Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Sai Srinivas
GEN_ERP_2025
Commits
2ccf19cc
Commit
2ccf19cc
authored
Jul 04, 2025
by
Sai Srinivas
Browse files
04-07-2025 By Sai Srinivas
Test cases and Order Module, Crm Module.
parent
4b790bef
Changes
94
Hide whitespace changes
Inline
Side-by-side
lib/screens/crm/crmDashboard.dart
View file @
2ccf19cc
import
'package:flutter/material.dart'
;
import
'package:flutter/material.dart'
;
import
'package:flutter/services.dart'
;
import
'package:flutter_svg/svg.dart'
;
import
'package:flutter_svg/svg.dart'
;
import
'package:generp/screens/crm/universalSearchScreen.dart'
;
import
'package:provider/provider.dart'
;
import
'package:provider/provider.dart'
;
import
'package:generp/screens/screensExports.dart'
;
import
'package:generp/screens/screensExports.dart'
;
...
@@ -15,12 +17,16 @@ class CrmdashboardScreen extends StatefulWidget {
...
@@ -15,12 +17,16 @@ class CrmdashboardScreen extends StatefulWidget {
}
}
class
_CrmdashboardScreenState
extends
State
<
CrmdashboardScreen
>
{
class
_CrmdashboardScreenState
extends
State
<
CrmdashboardScreen
>
{
FocusNode
focusNode
=
FocusNode
();
@override
@override
void
initState
()
{
void
initState
()
{
super
.
initState
();
super
.
initState
();
WidgetsBinding
.
instance
.
addPostFrameCallback
((
timeStamp
)
{
WidgetsBinding
.
instance
.
addPostFrameCallback
((
timeStamp
)
{
var
prov
=
Provider
.
of
<
Crmdashboardprovider
>(
context
,
listen:
false
);
var
prov
=
Provider
.
of
<
Crmdashboardprovider
>(
context
,
listen:
false
);
prov
.
accessPagesAPIFunction
(
context
);
prov
.
accessPagesAPIFunction
(
context
);
prov
.
crmDashboardAPIFunction
(
context
,
"executive"
,
""
,
""
,
""
);
prov
.
crmPendingTasksAPIFunction
(
context
);
});
});
}
}
...
@@ -29,119 +35,411 @@ class _CrmdashboardScreenState extends State<CrmdashboardScreen> {
...
@@ -29,119 +35,411 @@ class _CrmdashboardScreenState extends State<CrmdashboardScreen> {
return
Consumer
<
Crmdashboardprovider
>(
return
Consumer
<
Crmdashboardprovider
>(
builder:
(
context
,
provider
,
child
)
{
builder:
(
context
,
provider
,
child
)
{
final
gridPages
=
final
gridPages
=
provider
.
accessPages
provider
.
accessPages
.
where
((
page
)
=>
![
8
,
9
,
23
,
24
,
51
,
50
].
contains
(
page
.
id
))
.
where
((
page
)
=>
![
8
,
9
,
23
,
24
,
51
,
50
].
contains
(
page
.
id
))
.
toList
();
.
toList
();
return
WillPopScope
(
return
WillPopScope
(
onWillPop:
()
=>
onBackPressed
(
context
),
onWillPop:
()
=>
onBackPressed
(
context
),
child:
Scaffold
(
child:
Scaffold
(
resizeToAvoidBottomInset:
true
,
resizeToAvoidBottomInset:
true
,
backgroundColor:
AppColors
.
scaffold_bg_color
,
backgroundColor:
AppColors
.
scaffold_bg_color
,
appBar:
appbar
(
context
,
"CRM"
),
appBar:
AppBar
(
body:
SafeArea
(
automaticallyImplyLeading:
false
,
child:
ListView
.
builder
(
elevation:
2.0
,
padding:
EdgeInsets
.
symmetric
(
vertical:
10
,
horizontal:
10
),
title:
SizedBox
(
itemCount:
gridPages
.
length
,
child:
Row
(
itemBuilder:
(
context
,
index
)
{
mainAxisAlignment:
MainAxisAlignment
.
start
,
// final icons = ["comm_ic_1", "comm_ic_2"];
crossAxisAlignment:
CrossAxisAlignment
.
center
,
Widget
?
SvgIcon
;
children:
[
InkResponse
(
onTap:
()
=>
Navigator
.
pop
(
context
,
true
),
child:
SvgPicture
.
asset
(
"assets/svg/app_bar_back.svg"
,
height:
25
,
),
),
InkResponse
(
onTap:
()
=>
Navigator
.
pop
(
context
,
true
),
child:
Text
(
"CRM"
,
style:
TextStyle
(
fontSize:
16
,
height:
1.1
,
fontFamily:
"JakartaSemiBold"
,
color:
AppColors
.
semi_black
,
),
),
),
],
),
),
bottom:
PreferredSize
(
preferredSize:
Size
.
fromHeight
(
50
),
child:
Container
(
padding:
const
EdgeInsets
.
fromLTRB
(
5.0
,
0.0
,
10
,
0
),
margin:
const
EdgeInsets
.
fromLTRB
(
10.0
,
0.0
,
10
,
10
),
height:
50
,
alignment:
Alignment
.
center
,
decoration:
BoxDecoration
(
color:
AppColors
.
text_field_color
,
borderRadius:
BorderRadius
.
circular
(
14
),
border:
focusNode
.
hasFocus
?
Border
.
all
(
color:
AppColors
.
app_blue
):
null
),
child:
Row
(
children:
[
Expanded
(
child:
Container
(
padding:
const
EdgeInsets
.
fromLTRB
(
0.0
,
0.0
,
10
,
0
),
margin:
const
EdgeInsets
.
fromLTRB
(
10.0
,
0.0
,
10
,
10
),
child:
TextFormField
(
controller:
provider
.
searchController
,
keyboardType:
TextInputType
.
text
,
maxLines:
1
,
onChanged:
(
value
)
{},
focusNode:
focusNode
,
onTapUpOutside:
(
event
)
{
focusNode
.
requestFocus
();
},
if
(
gridPages
[
index
].
pageName
!.
contains
(
"Lead List"
))
textInputAction:
TextInputAction
.
done
,
{
onEditingComplete:
()
{
SvgIcon
=
SvgPicture
.
asset
(
"assets/svg/fin_lv1.svg"
);
Navigator
.
push
(
context
,
MaterialPageRoute
(
}
builder:
(
context
)
=>
Universalsearchscreen
(
else
if
(
gridPages
[
index
].
pageName
==
"Nearby Leads"
)
text:
provider
.
searchController
.
text
{
SvgIcon
=
SvgPicture
.
asset
(
"assets/svg/home_icons_5.svg"
,
height:
18
,
width:
18
,);
}
else
{
SvgIcon
=
SvgPicture
.
asset
(
"assets/svg/fin_ic.svg"
);
}
return
InkResponse
(
onTap:
()
{
print
(
gridPages
[
index
].
pageName
!);
if
(
gridPages
[
index
].
pageName
!.
contains
(
"Lead List"
))
{
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
context
)
=>
Leadlistbymode
(
mode:
gridPages
[
index
].
mode
,
pageTitleName:
gridPages
[
index
].
pageName
,
),
),
),
settings:
RouteSettings
(
name:
'SearchScreen'
),
);
));
}
else
if
(
gridPages
[
index
].
pageName
!.
contains
(
"Prospect List"
))
{
},
Navigator
.
push
(
enabled:
true
,
context
,
decoration:
InputDecoration
(
MaterialPageRoute
(
counterText:
""
,
builder:
hintText:
"Search"
,
(
context
)
=>
ProspectListByMode
(
hintStyle:
TextStyle
(
mode:
gridPages
[
index
].
mode
,
fontWeight:
FontWeight
.
w400
,
pageTitleName:
gridPages
[
index
].
pageName
,
color:
Color
(
0xFFB4BEC0
),
fontSize:
14
,
),
enabled:
true
,
enabledBorder:
InputBorder
.
none
,
focusedBorder:
InputBorder
.
none
,
),
),
),
),
);
),
}
else
if
(
gridPages
[
index
].
pageName
==
"Nearby Leads"
){
),
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
context
)
=>
NearbyOpenLeads
(),));
SvgPicture
.
asset
(
"assets/svg/search_ic.svg"
)
}
],
// switch (gridPages[index].pageName!) {
),
// case "Lead List":
),
// Navigator.push(
),
// context,
shape:
RoundedRectangleBorder
(
// MaterialPageRoute(builder: (context) => Leadlistbymode()),
borderRadius:
BorderRadius
.
vertical
(
// );
bottom:
Radius
.
circular
(
30
),
// Adjust the radius as needed
// break;
),
// case "Prospect List":
),
// // Navigator.push(
),
// // context,
body:
SafeArea
(
// // MaterialPageRoute(builder: (context) => Accountledger()),
child:
SingleChildScrollView
(
// // );
child:
Column
(
// break;
children:
[
//
Container
(
// default:
padding:
EdgeInsets
.
symmetric
(
// print("111");
horizontal:
10
,
// break;
vertical:
5
,
// }
),
},
margin:
EdgeInsets
.
symmetric
(
child:
Container
(
horizontal:
10
,
vertical:
10
,
),
decoration:
BoxDecoration
(
decoration:
BoxDecoration
(
color:
Colors
.
white
,
color:
Colors
.
white
,
borderRadius:
BorderRadius
.
circular
(
14
),
borderRadius:
BorderRadius
.
circular
(
16
),
),
height:
MediaQuery
.
of
(
context
)
.
size
.
height
*
0.28
,
child:
GridView
.
builder
(
padding:
EdgeInsets
.
symmetric
(
horizontal:
0
,
vertical:
5
,
),
itemCount:
provider
.
allLeads
.
length
,
shrinkWrap:
true
,
scrollDirection:
Axis
.
horizontal
,
physics:
AlwaysScrollableScrollPhysics
(),
gridDelegate:
SliverGridDelegateWithFixedCrossAxisCount
(
crossAxisCount:
2
,
crossAxisSpacing:
10
,
mainAxisSpacing:
10
,
childAspectRatio:
0.65
,
),
itemBuilder:
(
context
,
jndex
)
{
final
icons
=
[
"comm_ic_1"
,
"comm_ic_2"
];
final
leadTitles
=
[
'Hot Leads'
,
'Cold Leads'
,
'Warm Leads'
,
'Total Leads'
,
'Order Lost'
,
'No Requirement'
,
'Open Enquiries'
,
];
final
colors
=
[
0xFFE7FFE5
,
0xFFF3EDFF
,
0xFFFFFCD5
,
0xFFFFF6F0
,
0xFFE7FFE5
,
0xFFF3EDFF
,
0xFFFFFCD5
,
0xFFFFF6F0
,
];
final
textcolors
=
[
0xFF0D9C00
,
0xFF493272
,
0xFF605C00
,
0xFF91481B
,
0xFF0D9C00
,
0xFF493272
,
0xFF605C00
,
0xFF91481B
,
];
return
InkResponse
(
onTap:
()
async
{
if
(
provider
.
allLeads
[
jndex
].
filter
!.
pageName
!=
""
)
{
if
(
provider
.
allLeads
[
jndex
].
filter
!.
pageName
!
.
contains
(
"Lead List"
))
{
await
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
context
)
=>
Leadlistbymode
(
pageTitleName:
provider
.
allLeads
[
jndex
]
.
filter
!
.
pageName
!,
mode:
provider
.
allLeads
[
jndex
]
.
filter
!
.
mode
,
filter:
provider
.
allLeads
[
jndex
]
.
filter
!,
),
),
);
}
}
},
child:
Container
(
padding:
EdgeInsets
.
symmetric
(
horizontal:
13
),
decoration:
BoxDecoration
(
color:
Color
(
colors
[
jndex
]),
borderRadius:
BorderRadius
.
circular
(
12
),
),
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
mainAxisAlignment:
MainAxisAlignment
.
center
,
children:
[
Text
(
provider
.
allLeads
[
jndex
].
count
!,
style:
TextStyle
(
fontSize:
30
,
fontFamily:
"JakartaMedium"
,
color:
Color
(
textcolors
[
jndex
]),
),
),
Text
(
leadTitles
[
jndex
],
style:
TextStyle
(
color:
Color
(
0xFF818181
)),
),
],
),
),
);
},
),
),
margin:
EdgeInsets
.
symmetric
(
horizontal:
5
,
vertical:
5
),
),
ListView
.
builder
(
physics:
NeverScrollableScrollPhysics
(),
shrinkWrap:
true
,
padding:
EdgeInsets
.
symmetric
(
padding:
EdgeInsets
.
symmetric
(
vertical:
10
,
horizontal:
10
,
horizontal:
10
,
vertical:
15
,
),
),
child:
Row
(
itemCount:
gridPages
.
length
,
children:
[
itemBuilder:
(
context
,
index
)
{
Expanded
(
flex:
1
,
child:
SvgIcon
),
// final icons = ["comm_ic_1", "comm_ic_2"];
Widget
?
SvgIcon
;
if
(
gridPages
[
index
].
pageName
!.
contains
(
"Lead List"
))
{
SvgIcon
=
SvgPicture
.
asset
(
"assets/svg/fin_lv1.svg"
);
}
else
if
(
gridPages
[
index
].
pageName
==
"Nearby Leads"
)
{
SvgIcon
=
SvgPicture
.
asset
(
"assets/svg/home_icons_5.svg"
,
height:
18
,
width:
18
,
);
}
else
{
SvgIcon
=
SvgPicture
.
asset
(
"assets/svg/fin_ic.svg"
);
}
return
InkResponse
(
onTap:
()
{
print
(
gridPages
[
index
].
pageName
!);
if
(
gridPages
[
index
].
pageName
!.
contains
(
"Lead List"
,
))
{
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
context
)
=>
Leadlistbymode
(
mode:
gridPages
[
index
].
mode
,
pageTitleName:
gridPages
[
index
].
pageName
,
),
),
);
}
else
if
(
gridPages
[
index
].
pageName
!.
contains
(
"Prospect List"
,
))
{
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
context
)
=>
ProspectListByMode
(
mode:
gridPages
[
index
].
mode
,
pageTitleName:
gridPages
[
index
].
pageName
,
),
),
);
}
else
if
(
gridPages
[
index
].
pageName
==
"Nearby Leads"
)
{
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
context
)
=>
NearbyOpenLeads
(),
),
);
}
// switch (gridPages[index].pageName!) {
// case "Lead List":
// Navigator.push(
// context,
// MaterialPageRoute(builder: (context) => Leadlistbymode()),
// );
// break;
// case "Prospect List":
// // Navigator.push(
// // context,
// // MaterialPageRoute(builder: (context) => Accountledger()),
// // );
// break;
//
// default:
// print("111");
// break;
// }
},
child:
Container
(
decoration:
BoxDecoration
(
color:
Colors
.
white
,
borderRadius:
BorderRadius
.
circular
(
14
),
),
margin:
EdgeInsets
.
symmetric
(
horizontal:
5
,
vertical:
5
,
),
padding:
EdgeInsets
.
symmetric
(
horizontal:
10
,
vertical:
15
,
),
child:
Row
(
children:
[
Expanded
(
flex:
1
,
child:
SvgIcon
),
Expanded
(
Expanded
(
flex:
5
,
flex:
5
,
child:
Text
(
child:
Text
(
"
${gridPages[index].pageName}
"
,
"
${gridPages[index].pageName}
"
,
style:
TextStyle
(
fontSize:
14
),
style:
TextStyle
(
fontSize:
14
),
),
),
Expanded
(
flex:
1
,
child:
SvgPicture
.
asset
(
"assets/svg/arrow_right_new.svg"
,
),
),
],
),
),
),
),
Expanded
(
);
flex:
1
,
},
child:
SvgPicture
.
asset
(
),
"assets/svg/arrow_right_new.svg"
,
if
(
provider
.
pendingTasksLists
.
length
>
0
)
...[
Align
(
alignment:
Alignment
.
centerLeft
,
child:
Padding
(
padding:
EdgeInsets
.
symmetric
(
horizontal:
6
),
child:
Text
(
"Pending Tasks"
,
style:
TextStyle
(
fontSize:
16
,
color:
AppColors
.
grey_semi
,
),
),
),
),
]
,
)
,
),
),
),
ListView
.
builder
(
);
physics:
NeverScrollableScrollPhysics
(),
},
shrinkWrap:
true
,
padding:
EdgeInsets
.
symmetric
(
vertical:
10
,
horizontal:
10
,
),
itemCount:
provider
.
pendingTasksLists
.
length
,
itemBuilder:
(
context
,
index
)
{
return
Container
(
decoration:
BoxDecoration
(
color:
Colors
.
white
,
borderRadius:
BorderRadius
.
circular
(
14
),
),
margin:
EdgeInsets
.
symmetric
(
horizontal:
5
,
vertical:
5
,
),
padding:
EdgeInsets
.
symmetric
(
horizontal:
10
,
vertical:
15
,
),
child:
Row
(
children:
[
Text
(
provider
.
pendingTasksLists
[
index
].
aname
!),
],
),
);
},
),
],
],
),
),
),
),
),
floatingActionButtonLocation:
floatingActionButtonLocation:
FloatingActionButtonLocation
.
centerFloat
,
FloatingActionButtonLocation
.
centerFloat
,
floatingActionButton:
InkResponse
(
floatingActionButton:
InkResponse
(
onTap:
()
{
onTap:
()
{
_showPaymentOptionsSheet
(
context
);
_showPaymentOptionsSheet
(
context
);
...
@@ -187,9 +485,9 @@ class _CrmdashboardScreenState extends State<CrmdashboardScreen> {
...
@@ -187,9 +485,9 @@ class _CrmdashboardScreenState extends State<CrmdashboardScreen> {
child:
Consumer
<
Crmdashboardprovider
>(
child:
Consumer
<
Crmdashboardprovider
>(
builder:
(
context
,
provider
,
child
)
{
builder:
(
context
,
provider
,
child
)
{
final
accessiblePagesList
=
final
accessiblePagesList
=
provider
.
accessPages
provider
.
accessPages
.
where
((
page
)
=>
[
8
,
9
].
contains
(
page
.
id
))
.
where
((
page
)
=>
[
8
,
9
].
contains
(
page
.
id
))
.
toList
();
.
toList
();
return
Container
(
return
Container
(
margin:
EdgeInsets
.
only
(
margin:
EdgeInsets
.
only
(
bottom:
15
,
bottom:
15
,
...
@@ -197,7 +495,12 @@ class _CrmdashboardScreenState extends State<CrmdashboardScreen> {
...
@@ -197,7 +495,12 @@ class _CrmdashboardScreenState extends State<CrmdashboardScreen> {
right:
15
,
right:
15
,
top:
10
,
top:
10
,
),
),
padding:
EdgeInsets
.
only
(
bottom:
MediaQuery
.
of
(
context
).
viewInsets
.
bottom
,),
padding:
EdgeInsets
.
only
(
bottom:
MediaQuery
.
of
(
context
)
.
viewInsets
.
bottom
,
),
child:
SingleChildScrollView
(
child:
SingleChildScrollView
(
child:
Column
(
child:
Column
(
mainAxisSize:
MainAxisSize
.
min
,
mainAxisSize:
MainAxisSize
.
min
,
...
...
lib/screens/crm/editAccountDetails.dart
View file @
2ccf19cc
...
@@ -66,6 +66,7 @@ class _EditAccountDetailsState extends State<EditAccountDetails> {
...
@@ -66,6 +66,7 @@ class _EditAccountDetailsState extends State<EditAccountDetails> {
textControllerWidget
(
textControllerWidget
(
context
,
context
,
provider
.
editCompanyNameController
,
provider
.
editCompanyNameController
,
"Name"
,
"Enter Name"
,
"Enter Name"
,
provider
.
onChangedCompanyName
,
provider
.
onChangedCompanyName
,
TextInputType
.
text
,
TextInputType
.
text
,
...
...
lib/screens/crm/editProductsList.dart
View file @
2ccf19cc
...
@@ -550,11 +550,12 @@ class _EditProductsListState extends State<EditProductsList> {
...
@@ -550,11 +550,12 @@ class _EditProductsListState extends State<EditProductsList> {
child:
textControllerWidget
(
child:
textControllerWidget
(
context
,
context
,
editProvider
.
editProductPriceControllers
[
j
],
editProvider
.
editProductPriceControllers
[
j
],
"Product Price"
,
"Enter Product Price"
,
"Enter Product Price"
,
(
value
)
=>
editProvider
.
updateTotalAmount
(
j
),
(
value
)
=>
editProvider
.
updateTotalAmount
(
j
),
TextInputType
.
number
,
TextInputType
.
number
,
false
,
false
,
FilteringTextInputFormatter
.
digitsOnly
,
null
),
),
),
),
],
],
...
@@ -567,6 +568,7 @@ class _EditProductsListState extends State<EditProductsList> {
...
@@ -567,6 +568,7 @@ class _EditProductsListState extends State<EditProductsList> {
child:
textControllerWidget
(
child:
textControllerWidget
(
context
,
context
,
editProvider
.
editQuantityControllers
[
j
],
editProvider
.
editQuantityControllers
[
j
],
"Quantity"
,
"Enter Quantity"
,
"Enter Quantity"
,
(
value
)
=>
editProvider
.
updateTotalAmount
(
j
),
(
value
)
=>
editProvider
.
updateTotalAmount
(
j
),
TextInputType
.
number
,
TextInputType
.
number
,
...
@@ -576,6 +578,7 @@ class _EditProductsListState extends State<EditProductsList> {
...
@@ -576,6 +578,7 @@ class _EditProductsListState extends State<EditProductsList> {
),
),
],
],
),
),
errorWidget
(
context
,
"Note: Submit Quantity as Zero (0) to delete Product"
),
const
SizedBox
(
height:
10
),
const
SizedBox
(
height:
10
),
Row
(
Row
(
children:
[
children:
[
...
@@ -584,6 +587,7 @@ class _EditProductsListState extends State<EditProductsList> {
...
@@ -584,6 +587,7 @@ class _EditProductsListState extends State<EditProductsList> {
child:
textControllerWidget
(
child:
textControllerWidget
(
context
,
context
,
editProvider
.
editTotalAmountControllers
[
j
],
editProvider
.
editTotalAmountControllers
[
j
],
"Amount"
,
"Total Amount"
,
"Total Amount"
,
(
_
)
{},
(
_
)
{},
TextInputType
.
number
,
TextInputType
.
number
,
...
...
lib/screens/crm/generateQuotationScreen.dart
View file @
2ccf19cc
...
@@ -68,6 +68,7 @@ class _GeneratequotationscreenState extends State<Generatequotationscreen> {
...
@@ -68,6 +68,7 @@ class _GeneratequotationscreenState extends State<Generatequotationscreen> {
textControllerWidget
(
textControllerWidget
(
context
,
context
,
provider
.
mailIdController
,
provider
.
mailIdController
,
"Email Id"
,
"Enter Email Id"
,
"Enter Email Id"
,
provider
.
onChangemailId
,
provider
.
onChangemailId
,
TextInputType
.
emailAddress
,
TextInputType
.
emailAddress
,
...
@@ -79,6 +80,7 @@ class _GeneratequotationscreenState extends State<Generatequotationscreen> {
...
@@ -79,6 +80,7 @@ class _GeneratequotationscreenState extends State<Generatequotationscreen> {
textControllerWidget
(
textControllerWidget
(
context
,
context
,
provider
.
mobileController
,
provider
.
mobileController
,
"Mobile Number"
,
"Enter Mobile Number"
,
"Enter Mobile Number"
,
provider
.
onChangemobile
,
provider
.
onChangemobile
,
TextInputType
.
phone
,
TextInputType
.
phone
,
...
@@ -90,6 +92,7 @@ class _GeneratequotationscreenState extends State<Generatequotationscreen> {
...
@@ -90,6 +92,7 @@ class _GeneratequotationscreenState extends State<Generatequotationscreen> {
textControllerWidget
(
textControllerWidget
(
context
,
context
,
provider
.
subjectsController
,
provider
.
subjectsController
,
"Subject"
,
"Enter Subject"
,
"Enter Subject"
,
provider
.
onChangesubjects
,
provider
.
onChangesubjects
,
TextInputType
.
text
,
TextInputType
.
text
,
...
@@ -222,6 +225,7 @@ class _GeneratequotationscreenState extends State<Generatequotationscreen> {
...
@@ -222,6 +225,7 @@ class _GeneratequotationscreenState extends State<Generatequotationscreen> {
child:
textControllerWidget
(
child:
textControllerWidget
(
context
,
context
,
provider
.
editProductPriceControllers
[
j
],
provider
.
editProductPriceControllers
[
j
],
"Product Price"
,
"Enter Product Price"
,
"Enter Product Price"
,
(
value
)
=>
(
value
)
=>
provider
.
updateTotalAmount
(
j
),
provider
.
updateTotalAmount
(
j
),
...
@@ -240,6 +244,7 @@ class _GeneratequotationscreenState extends State<Generatequotationscreen> {
...
@@ -240,6 +244,7 @@ class _GeneratequotationscreenState extends State<Generatequotationscreen> {
child:
textControllerWidget
(
child:
textControllerWidget
(
context
,
context
,
provider
.
editQuantityControllers
[
j
],
provider
.
editQuantityControllers
[
j
],
"Quantity"
,
"Enter Quantity"
,
"Enter Quantity"
,
(
value
)
=>
(
value
)
=>
provider
.
updateTotalAmount
(
j
),
provider
.
updateTotalAmount
(
j
),
...
@@ -258,6 +263,7 @@ class _GeneratequotationscreenState extends State<Generatequotationscreen> {
...
@@ -258,6 +263,7 @@ class _GeneratequotationscreenState extends State<Generatequotationscreen> {
child:
textControllerWidget
(
child:
textControllerWidget
(
context
,
context
,
provider
.
editTotalAmountControllers
[
j
],
provider
.
editTotalAmountControllers
[
j
],
"Amount"
,
"Total Amount"
,
"Total Amount"
,
(
_
)
{},
(
_
)
{},
TextInputType
.
number
,
TextInputType
.
number
,
...
@@ -283,6 +289,7 @@ class _GeneratequotationscreenState extends State<Generatequotationscreen> {
...
@@ -283,6 +289,7 @@ class _GeneratequotationscreenState extends State<Generatequotationscreen> {
context
,
context
,
provider
.
taxesController
,
provider
.
taxesController
,
"Taxes"
,
"Taxes"
,
"Enter Taxes"
,
provider
.
onChangetaxes
,
provider
.
onChangetaxes
,
TextInputType
.
text
,
TextInputType
.
text
,
false
,
false
,
...
@@ -294,6 +301,7 @@ class _GeneratequotationscreenState extends State<Generatequotationscreen> {
...
@@ -294,6 +301,7 @@ class _GeneratequotationscreenState extends State<Generatequotationscreen> {
context
,
context
,
provider
.
SpecialNoteController
,
provider
.
SpecialNoteController
,
"Special Note"
,
"Special Note"
,
"Enter Special Note"
,
provider
.
onChangeSpecialNote
,
provider
.
onChangeSpecialNote
,
TextInputType
.
text
,
TextInputType
.
text
,
false
,
false
,
...
@@ -305,6 +313,7 @@ class _GeneratequotationscreenState extends State<Generatequotationscreen> {
...
@@ -305,6 +313,7 @@ class _GeneratequotationscreenState extends State<Generatequotationscreen> {
context
,
context
,
provider
.
forController
,
provider
.
forController
,
"FOR"
,
"FOR"
,
"Enter FOR"
,
provider
.
onChangefor
,
provider
.
onChangefor
,
TextInputType
.
text
,
TextInputType
.
text
,
false
,
false
,
...
@@ -316,6 +325,7 @@ class _GeneratequotationscreenState extends State<Generatequotationscreen> {
...
@@ -316,6 +325,7 @@ class _GeneratequotationscreenState extends State<Generatequotationscreen> {
context
,
context
,
provider
.
paymentTermsController
,
provider
.
paymentTermsController
,
"Payment Terms"
,
"Payment Terms"
,
"Enter Payment Terms"
,
provider
.
onChangepaymentTerms
,
provider
.
onChangepaymentTerms
,
TextInputType
.
text
,
TextInputType
.
text
,
false
,
false
,
...
...
lib/screens/crm/productDetails.dart
View file @
2ccf19cc
...
@@ -45,7 +45,7 @@ class _ProductdetailsState extends State<Productdetails> {
...
@@ -45,7 +45,7 @@ class _ProductdetailsState extends State<Productdetails> {
child:
Column
(
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
[
children:
[
TextWidget
(
context
,
"Product Details"
),
//
TextWidget(context,"Product Details"),
ListView
.
builder
(
ListView
.
builder
(
itemCount:
customerDetails
.
length
,
itemCount:
customerDetails
.
length
,
shrinkWrap:
true
,
shrinkWrap:
true
,
...
...
lib/screens/crm/prospectContactDetails.dart
View file @
2ccf19cc
...
@@ -262,6 +262,7 @@ class _ProspectContactDetailsState extends State<ProspectContactDetails> {
...
@@ -262,6 +262,7 @@ class _ProspectContactDetailsState extends State<ProspectContactDetails> {
textControllerWidget
(
textControllerWidget
(
context
,
context
,
provider
.
nameController
,
provider
.
nameController
,
"Name"
,
"Enter Name"
,
"Enter Name"
,
provider
.
onChangeName
,
provider
.
onChangeName
,
TextInputType
.
number
,
TextInputType
.
number
,
...
@@ -272,6 +273,7 @@ class _ProspectContactDetailsState extends State<ProspectContactDetails> {
...
@@ -272,6 +273,7 @@ class _ProspectContactDetailsState extends State<ProspectContactDetails> {
textControllerWidget
(
textControllerWidget
(
context
,
context
,
provider
.
designationController
,
provider
.
designationController
,
"Designation"
,
"Enter Designation"
,
"Enter Designation"
,
provider
.
onChangeDesignation
,
provider
.
onChangeDesignation
,
TextInputType
.
number
,
TextInputType
.
number
,
...
@@ -282,6 +284,7 @@ class _ProspectContactDetailsState extends State<ProspectContactDetails> {
...
@@ -282,6 +284,7 @@ class _ProspectContactDetailsState extends State<ProspectContactDetails> {
textControllerWidget
(
textControllerWidget
(
context
,
context
,
provider
.
mobileNumberController
,
provider
.
mobileNumberController
,
"Mobile Number"
,
"Enter Mobile Number"
,
"Enter Mobile Number"
,
provider
.
onChangeMobile
,
provider
.
onChangeMobile
,
TextInputType
.
number
,
TextInputType
.
number
,
...
@@ -292,6 +295,7 @@ class _ProspectContactDetailsState extends State<ProspectContactDetails> {
...
@@ -292,6 +295,7 @@ class _ProspectContactDetailsState extends State<ProspectContactDetails> {
textControllerWidget
(
textControllerWidget
(
context
,
context
,
provider
.
alternativeMobileController
,
provider
.
alternativeMobileController
,
"Alternative Mobile Number"
,
"Enter Alternative Mobile Number"
,
"Enter Alternative Mobile Number"
,
provider
.
onChangeAltMobile
,
provider
.
onChangeAltMobile
,
TextInputType
.
number
,
TextInputType
.
number
,
...
@@ -302,6 +306,7 @@ class _ProspectContactDetailsState extends State<ProspectContactDetails> {
...
@@ -302,6 +306,7 @@ class _ProspectContactDetailsState extends State<ProspectContactDetails> {
textControllerWidget
(
textControllerWidget
(
context
,
context
,
provider
.
telephoneController
,
provider
.
telephoneController
,
"Telephone Number"
,
"Enter Telephone Number"
,
"Enter Telephone Number"
,
provider
.
onChangeTelephone
,
provider
.
onChangeTelephone
,
TextInputType
.
number
,
TextInputType
.
number
,
...
@@ -312,7 +317,8 @@ class _ProspectContactDetailsState extends State<ProspectContactDetails> {
...
@@ -312,7 +317,8 @@ class _ProspectContactDetailsState extends State<ProspectContactDetails> {
textControllerWidget
(
textControllerWidget
(
context
,
context
,
provider
.
emailController
,
provider
.
emailController
,
"Enter EmailID"
,
"Email ID"
,
"Enter Email ID"
,
provider
.
onChangeEmailId
,
provider
.
onChangeEmailId
,
TextInputType
.
number
,
TextInputType
.
number
,
false
,
false
,
...
@@ -402,6 +408,7 @@ class _ProspectContactDetailsState extends State<ProspectContactDetails> {
...
@@ -402,6 +408,7 @@ class _ProspectContactDetailsState extends State<ProspectContactDetails> {
textControllerWidget
(
textControllerWidget
(
context
,
context
,
provider
.
editNameController
,
provider
.
editNameController
,
"Name"
,
"Enter Name"
,
"Enter Name"
,
provider
.
onChangeEditName
,
provider
.
onChangeEditName
,
TextInputType
.
number
,
TextInputType
.
number
,
...
@@ -412,6 +419,7 @@ class _ProspectContactDetailsState extends State<ProspectContactDetails> {
...
@@ -412,6 +419,7 @@ class _ProspectContactDetailsState extends State<ProspectContactDetails> {
textControllerWidget
(
textControllerWidget
(
context
,
context
,
provider
.
editDesignationController
,
provider
.
editDesignationController
,
"Designation"
,
"Enter Designation"
,
"Enter Designation"
,
provider
.
onChangeEditDesignation
,
provider
.
onChangeEditDesignation
,
TextInputType
.
number
,
TextInputType
.
number
,
...
@@ -422,6 +430,7 @@ class _ProspectContactDetailsState extends State<ProspectContactDetails> {
...
@@ -422,6 +430,7 @@ class _ProspectContactDetailsState extends State<ProspectContactDetails> {
textControllerWidget
(
textControllerWidget
(
context
,
context
,
provider
.
editMobileNumberController
,
provider
.
editMobileNumberController
,
"Mobile Number"
,
"Enter Mobile Number"
,
"Enter Mobile Number"
,
provider
.
onChangeEditMobile
,
provider
.
onChangeEditMobile
,
TextInputType
.
number
,
TextInputType
.
number
,
...
@@ -433,6 +442,7 @@ class _ProspectContactDetailsState extends State<ProspectContactDetails> {
...
@@ -433,6 +442,7 @@ class _ProspectContactDetailsState extends State<ProspectContactDetails> {
textControllerWidget
(
textControllerWidget
(
context
,
context
,
provider
.
editAlternativeMobileController
,
provider
.
editAlternativeMobileController
,
"Alternative Mobile Number"
,
"Enter Alternative Mobile Number"
,
"Enter Alternative Mobile Number"
,
provider
.
onChangeEditAltMobile
,
provider
.
onChangeEditAltMobile
,
TextInputType
.
number
,
TextInputType
.
number
,
...
@@ -443,6 +453,7 @@ class _ProspectContactDetailsState extends State<ProspectContactDetails> {
...
@@ -443,6 +453,7 @@ class _ProspectContactDetailsState extends State<ProspectContactDetails> {
textControllerWidget
(
textControllerWidget
(
context
,
context
,
provider
.
editTelephoneController
,
provider
.
editTelephoneController
,
"Telephone Number"
,
"Enter Telephone Number"
,
"Enter Telephone Number"
,
provider
.
onChangeEditTelephone
,
provider
.
onChangeEditTelephone
,
TextInputType
.
number
,
TextInputType
.
number
,
...
@@ -454,7 +465,8 @@ class _ProspectContactDetailsState extends State<ProspectContactDetails> {
...
@@ -454,7 +465,8 @@ class _ProspectContactDetailsState extends State<ProspectContactDetails> {
textControllerWidget
(
textControllerWidget
(
context
,
context
,
provider
.
editEmailController
,
provider
.
editEmailController
,
"Enter EmailID"
,
"Email ID"
,
"Enter Email ID"
,
provider
.
onChangeEditEmailId
,
provider
.
onChangeEditEmailId
,
TextInputType
.
number
,
TextInputType
.
number
,
false
,
false
,
...
...
lib/screens/crm/universalSearchScreen.dart
0 → 100644
View file @
2ccf19cc
import
'package:flutter/material.dart'
;
import
'package:flutter_svg/svg.dart'
;
import
'package:generp/screens/crm/ProspectDetailsByMode.dart'
;
import
'package:provider/provider.dart'
;
import
'../../Notifiers/crmProvider/crmDashboardProvider.dart'
;
import
'../../Utils/app_colors.dart'
;
import
'../../Utils/commonWidgets.dart'
;
class
Universalsearchscreen
extends
StatefulWidget
{
final
text
;
const
Universalsearchscreen
({
super
.
key
,
required
this
.
text
});
@override
State
<
Universalsearchscreen
>
createState
()
=>
_UniversalsearchscreenState
();
}
class
_UniversalsearchscreenState
extends
State
<
Universalsearchscreen
>
{
@override
void
initState
()
{
super
.
initState
();
WidgetsBinding
.
instance
.
addPostFrameCallback
((
timeStamp
)
{
var
prov
=
Provider
.
of
<
Crmdashboardprovider
>(
context
,
listen:
false
);
prov
.
crmUniversalSearchFunction
(
context
);
});
}
@override
Widget
build
(
BuildContext
context
)
{
return
Consumer
<
Crmdashboardprovider
>(
builder:
(
context
,
provider
,
child
)
{
return
WillPopScope
(
onWillPop:
()
=>
onBackPressed
(
context
),
child:
Scaffold
(
resizeToAvoidBottomInset:
true
,
backgroundColor:
AppColors
.
scaffold_bg_color
,
appBar:
appbar
(
context
,
"Search"
),
body:
SafeArea
(
child:
SingleChildScrollView
(
child:
Column
(
children:
[
if
(
provider
.
accountsList
.
length
>
0
)
...[
Align
(
alignment:
Alignment
.
centerLeft
,
child:
Padding
(
padding:
EdgeInsets
.
symmetric
(
horizontal:
6
),
child:
Text
(
"Accounts"
,
style:
TextStyle
(
fontSize:
16
,
color:
AppColors
.
grey_semi
,
),
),
),
),
ListView
.
builder
(
physics:
NeverScrollableScrollPhysics
(),
shrinkWrap:
true
,
padding:
EdgeInsets
.
symmetric
(
vertical:
10
,
horizontal:
10
,
),
itemCount:
provider
.
accountsList
.
length
,
itemBuilder:
(
context
,
index
)
{
return
InkResponse
(
onTap:
()
{
Navigator
.
pushAndRemoveUntil
(
context
,
MaterialPageRoute
(
builder:
(
context
)
=>
ProspectDetailsByMode
(
pageTitleName:
"Account Details"
,
mode:
"Executive"
,
leadId:
provider
.
accountsList
[
index
].
aid
,
),
settings:
RouteSettings
(
name:
'ProspectDetails'
),
),
(
Route
<
dynamic
>
route
)
=>
route
.
settings
.
name
==
'CrmdashboardScreen'
,
);
},
child:
Container
(
decoration:
BoxDecoration
(
color:
Colors
.
white
,
borderRadius:
BorderRadius
.
circular
(
14
),
),
margin:
EdgeInsets
.
only
(
bottom:
5
,
left:
5
,
right:
5
,
top:
5
,
),
padding:
EdgeInsets
.
only
(
bottom:
MediaQuery
.
of
(
context
).
viewInsets
.
bottom
,
),
child:
ListTile
(
title:
Text
(
provider
.
accountsList
[
index
].
aname
!,
style:
TextStyle
(
fontFamily:
"JakartaMedium"
,
fontSize:
14
,
),
),
trailing:
SvgPicture
.
asset
(
"assets/svg/arrow_right_new.svg"
,
),
),
),
);
},
),
],
if
(
provider
.
leadsList
.
length
>
0
)
...[
Align
(
alignment:
Alignment
.
centerLeft
,
child:
Padding
(
padding:
EdgeInsets
.
symmetric
(
horizontal:
6
),
child:
Text
(
"Leads"
,
style:
TextStyle
(
fontSize:
16
,
color:
AppColors
.
grey_semi
,
),
),
),
),
ListView
.
builder
(
physics:
NeverScrollableScrollPhysics
(),
shrinkWrap:
true
,
padding:
EdgeInsets
.
symmetric
(
vertical:
10
,
horizontal:
10
,
),
itemCount:
provider
.
leadsList
.
length
,
itemBuilder:
(
context
,
index
)
{
return
Container
(
decoration:
BoxDecoration
(
color:
Colors
.
white
,
borderRadius:
BorderRadius
.
circular
(
14
),
),
margin:
EdgeInsets
.
only
(
bottom:
5
,
left:
5
,
right:
5
,
top:
5
,
),
padding:
EdgeInsets
.
only
(
bottom:
MediaQuery
.
of
(
context
).
viewInsets
.
bottom
,
),
child:
ListTile
(
title:
Text
(
provider
.
leadsList
[
index
].
aname
!,
style:
TextStyle
(
fontFamily:
"JakartaMedium"
,
fontSize:
14
,
),
),
trailing:
SvgPicture
.
asset
(
"assets/svg/arrow_right_new.svg"
,
),
),
);
},
),
],
if
(
provider
.
enquiresList
.
length
>
0
)
...[
Align
(
alignment:
Alignment
.
centerLeft
,
child:
Padding
(
padding:
EdgeInsets
.
symmetric
(
horizontal:
6
),
child:
Text
(
"Enquiries"
,
style:
TextStyle
(
fontSize:
16
,
color:
AppColors
.
grey_semi
,
),
),
),
),
ListView
.
builder
(
physics:
NeverScrollableScrollPhysics
(),
shrinkWrap:
true
,
padding:
EdgeInsets
.
symmetric
(
vertical:
10
,
horizontal:
10
,
),
itemCount:
provider
.
enquiresList
.
length
,
itemBuilder:
(
context
,
index
)
{
return
Container
(
decoration:
BoxDecoration
(
color:
Colors
.
white
,
borderRadius:
BorderRadius
.
circular
(
14
),
),
margin:
EdgeInsets
.
only
(
bottom:
5
,
left:
5
,
right:
5
,
top:
5
,
),
padding:
EdgeInsets
.
only
(
bottom:
MediaQuery
.
of
(
context
).
viewInsets
.
bottom
,
),
child:
ListTile
(
title:
Text
(
provider
.
enquiresList
[
index
].
companyName
==
""
?
provider
.
enquiresList
[
index
].
name
!
:
provider
.
enquiresList
[
index
].
companyName
!,
style:
TextStyle
(
fontFamily:
"JakartaMedium"
,
fontSize:
14
,
),
),
trailing:
SvgPicture
.
asset
(
"assets/svg/arrow_right_new.svg"
,
),
),
);
},
),
],
],
),
),
),
),
);
},
);
}
}
lib/screens/finance/PaymentRequestionListDetails.dart
View file @
2ccf19cc
...
@@ -9,6 +9,7 @@ import 'package:generp/screens/notifierExports.dart';
...
@@ -9,6 +9,7 @@ import 'package:generp/screens/notifierExports.dart';
import
'package:generp/Utils/app_colors.dart'
;
import
'package:generp/Utils/app_colors.dart'
;
import
'package:generp/Utils/commonWidgets.dart'
;
import
'package:generp/Utils/commonWidgets.dart'
;
import
'package:generp/screens/commom/accountsListDetails.dart'
;
import
'package:generp/screens/commom/accountsListDetails.dart'
;
import
'package:intl/intl.dart'
;
import
'package:provider/provider.dart'
;
import
'package:provider/provider.dart'
;
import
'FileViewer.dart'
;
import
'FileViewer.dart'
;
...
@@ -57,7 +58,7 @@ class _PaymentrequestionlistdetailsState
...
@@ -57,7 +58,7 @@ class _PaymentrequestionlistdetailsState
// Final decision on whether to show buttons
// Final decision on whether to show buttons
bool
shouldShowButtons
=
false
;
bool
shouldShowButtons
=
false
;
final
numberFormat
=
NumberFormat
.
decimalPattern
();
@override
@override
void
initState
()
{
void
initState
()
{
// TODO: implement initState
// TODO: implement initState
...
@@ -633,6 +634,7 @@ class _PaymentrequestionlistdetailsState
...
@@ -633,6 +634,7 @@ class _PaymentrequestionlistdetailsState
textControllerWidget
(
textControllerWidget
(
context
,
context
,
approvedAmount
,
approvedAmount
,
"Approved Amount"
,
"Enter Approved Amount"
,
"Enter Approved Amount"
,
(
p0
)
{},
(
p0
)
{},
TextInputType
.
numberWithOptions
(),
TextInputType
.
numberWithOptions
(),
...
@@ -645,6 +647,7 @@ class _PaymentrequestionlistdetailsState
...
@@ -645,6 +647,7 @@ class _PaymentrequestionlistdetailsState
textControllerWidget
(
textControllerWidget
(
context
,
context
,
remarks
,
remarks
,
"Remarks"
,
"Enter Remarks"
,
"Enter Remarks"
,
(
p0
)
{},
(
p0
)
{},
TextInputType
.
text
,
TextInputType
.
text
,
...
@@ -870,6 +873,7 @@ class _PaymentrequestionlistdetailsState
...
@@ -870,6 +873,7 @@ class _PaymentrequestionlistdetailsState
textControllerWidget
(
textControllerWidget
(
context
,
context
,
remarks
,
remarks
,
"Remarks"
,
"Enter Remarks"
,
"Enter Remarks"
,
(
p0
)
{},
(
p0
)
{},
TextInputType
.
text
,
TextInputType
.
text
,
...
@@ -924,7 +928,7 @@ class _PaymentrequestionlistdetailsState
...
@@ -924,7 +928,7 @@ class _PaymentrequestionlistdetailsState
);
);
}
}
Future
<
void
>
_showAddPaymentSheet
(
BuildContext
context
,
paymentID
)
{
Future
<
void
>
_showAddPaymentSheet
1
(
BuildContext
context
,
paymentID
)
{
return
showModalBottomSheet
(
return
showModalBottomSheet
(
useSafeArea:
true
,
useSafeArea:
true
,
isDismissible:
true
,
isDismissible:
true
,
...
@@ -939,351 +943,711 @@ class _PaymentrequestionlistdetailsState
...
@@ -939,351 +943,711 @@ class _PaymentrequestionlistdetailsState
return
SafeArea
(
return
SafeArea
(
child:
Consumer
<
Requesitionlidtdetailsprovider
>(
child:
Consumer
<
Requesitionlidtdetailsprovider
>(
builder:
(
context
,
provider
,
child
)
{
builder:
(
context
,
provider
,
child
)
{
return
Container
(
return
Scaffold
(
margin:
EdgeInsets
.
only
(
body:
Container
(
bottom:
15
,
left:
15
,
margin:
EdgeInsets
.
only
(
right:
15
,
bottom:
15
,
top:
10
,
left:
15
,
),
right:
15
,
padding:
EdgeInsets
.
only
(
top:
10
,
bottom:
MediaQuery
.
of
(
context
).
viewInsets
.
bottom
,
),
),
padding:
EdgeInsets
.
only
(
bottom:
MediaQuery
.
of
(
context
).
viewInsets
.
bottom
,
),
child:
SingleChildScrollView
(
child:
Column
(
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
mainAxisSize:
MainAxisSize
.
min
,
children:
[
children:
[
Align
(
Row
(
alignment:
Alignment
.
topLeft
,
children:
[
child:
Text
(
Expanded
(
"Add Approval"
,
child:
SizedBox
(
style:
TextStyle
(
child:
Column
(
color:
AppColors
.
app_blue
,
crossAxisAlignment:
CrossAxisAlignment
.
start
,
fontSize:
16
,
mainAxisSize:
MainAxisSize
.
min
,
),
children:
[
),
Align
(
),
alignment:
Alignment
.
topLeft
,
child:
Text
(
"Add Approval"
,
style:
TextStyle
(
color:
AppColors
.
app_blue
,
fontSize:
16
,
),
),
),
textControllerReadonlyWidget
(
textControllerReadonlyWidget
(
context
,
context
,
provider
.
proposedPaymentAccount
,
provider
.
proposedPaymentAccount
,
"Enter Proposed Payment Account"
,
"Enter Proposed Payment Account"
,
(
p0
)
{},
(
p0
)
{},
),
),
TextWidget
(
context
,
"Payment Account"
),
DropdownButtonHideUnderline
(
TextWidget
(
context
,
"Payment Account"
),
child:
Row
(
DropdownButtonHideUnderline
(
children:
[
child:
Row
(
Expanded
(
children:
[
child:
DropdownButton2
<
PaymentAccounts
>(
Expanded
(
isExpanded:
true
,
child:
DropdownButton2
<
PaymentAccounts
>(
hint:
Text
(
isExpanded:
true
,
'Select Account'
,
hint:
Text
(
style:
TextStyle
(
fontSize:
14
),
'Select Account'
,
overflow:
TextOverflow
.
ellipsis
,
style:
TextStyle
(
fontSize:
14
),
),
overflow:
TextOverflow
.
ellipsis
,
items:
),
provider
.
paymentsAccounts
items:
.
map
(
provider
.
paymentsAccounts
(
paymenents
)
=>
DropdownMenuItem
<
.
map
(
PaymentAccounts
(
paymenents
)
=>
DropdownMenuItem
<
>(
PaymentAccounts
value:
paymenents
,
>(
child:
Text
(
value:
paymenents
,
paymenents
.
name
??
''
,
child:
Text
(
style:
const
TextStyle
(
paymenents
.
name
??
''
,
fontSize:
14
,
style:
const
TextStyle
(
fontSize:
14
,
),
overflow:
TextOverflow
.
ellipsis
,
),
),
)
.
toList
(),
value:
provider
.
selectedPaymentAccounts
,
onChanged:
(
PaymentAccounts
?
value
)
{
if
(
value
!=
null
)
{
if
(
provider
.
paymentsAccounts
.
isNotEmpty
)
{
provider
.
selectedPaymentAccounts
=
value
;
print
(
"Selected Complaint Type:
${value.name}
, ID:
${value.id}
"
,
);
provider
.
selectedID
=
value
.
id
!;
provider
.
selectedValue
=
value
.
name
!;
print
(
"hfjkshfg"
+
provider
.
selectedID
.
toString
(),
);
}
}
},
dropdownSearchData:
DropdownSearchData
(
searchInnerWidgetHeight:
50
,
searchController:
provider
.
paymentAccountSearchController
,
searchInnerWidget:
Padding
(
padding:
const
EdgeInsets
.
all
(
8
),
child:
TextFormField
(
controller:
provider
.
paymentAccountSearchController
,
decoration:
InputDecoration
(
isDense:
true
,
contentPadding:
const
EdgeInsets
.
symmetric
(
horizontal:
10
,
vertical:
8
,
),
hintText:
'Search account...'
,
border:
OutlineInputBorder
(
borderRadius:
BorderRadius
.
circular
(
8
),
),
),
),
),
),
overflow:
searchMatchFn:
(
item
,
searchValue
)
{
TextOverflow
.
ellipsis
,
return
item
.
value
?.
name
?.
toLowerCase
()
.
contains
(
searchValue
.
toLowerCase
(),
)
??
false
;
},
// Optional: clear search text when dropdown closes
),
),
onMenuStateChange:
(
isOpen
)
{
if
(!
isOpen
)
{
provider
.
paymentAccountSearchController
.
clear
();
}
},
buttonStyleData:
ddtheme
.
buttonStyleData
,
iconStyleData:
ddtheme
.
iconStyleData
,
menuItemStyleData:
ddtheme
.
menuItemStyleData
,
dropdownStyleData:
ddtheme
.
dropdownStyleData
,
),
),
)
.
toList
(),
value:
provider
.
selectedPaymentAccounts
,
onChanged:
(
PaymentAccounts
?
value
)
{
if
(
value
!=
null
)
{
if
(
provider
.
paymentsAccounts
.
isNotEmpty
)
{
provider
.
selectedPaymentAccounts
=
value
;
print
(
"Selected Complaint Type:
${value.name}
, ID:
${value.id}
"
,
);
provider
.
selectedID
=
value
.
id
!;
provider
.
selectedValue
=
value
.
name
!;
print
(
"hfjkshfg"
+
provider
.
selectedID
.
toString
(),
);
}
}
},
dropdownSearchData:
DropdownSearchData
(
searchInnerWidgetHeight:
50
,
searchController:
provider
.
paymentAccountSearchController
,
searchInnerWidget:
Padding
(
padding:
const
EdgeInsets
.
all
(
8
),
child:
TextFormField
(
controller:
provider
.
paymentAccountSearchController
,
decoration:
InputDecoration
(
isDense:
true
,
contentPadding:
const
EdgeInsets
.
symmetric
(
horizontal:
10
,
vertical:
8
,
),
),
hintText:
'Search account...'
,
],
border:
OutlineInputBorder
(
),
borderRadius:
),
BorderRadius
.
circular
(
8
),
textControllerReadonlyWidget
(
context
,
provider
.
approvedAmountReadonly
,
"Approved Amount"
,
(
p0
)
{},
),
textControllerWidget
(
context
,
provider
.
approvedAmount
,
"Payment Amount"
,
"Enter Payment Amount"
,
(
p0
)
{
if
(
numberFormat
.
parse
(
provider
.
approvedAmountReadonly
.
text
)<
numberFormat
.
parse
(
provider
.
approvedAmount
.
text
)){
provider
.
proposedAmountError
=
"Amount Should not be greater than Approved amount"
;
}
else
{
provider
.
proposedAmountError
=
""
;
}
},
TextInputType
.
numberWithOptions
(),
false
,
null
),
errorWidget
(
context
,
provider
.
proposedAmountError
),
textControllerWidget
(
context
,
paymentReferenceNumber
,
"Payment Reference Number"
,
"Enter Payment Reference Number"
,
(
p0
)
{},
TextInputType
.
text
,
false
,
null
,
focusNodes
[
3
],
focusNodes
[
4
],
TextInputAction
.
next
),
textControllerWidget
(
context
,
remarks
,
"Remarks"
,
"Enter Remarks"
,
(
p0
)
{},
TextInputType
.
text
,
false
,
null
,
focusNodes
[
4
],
null
,
TextInputAction
.
done
),
InkResponse
(
onTap:
()
{
_showAttachmentSheet
(
context
);
},
child:
Container
(
margin:
EdgeInsets
.
symmetric
(
vertical:
10
),
height:
45
,
width:
MediaQuery
.
of
(
context
).
size
.
width
,
decoration:
BoxDecoration
(
color:
Color
(
0xFFE6F6FF
),
borderRadius:
BorderRadius
.
circular
(
12
),
border:
Border
.
all
(
color:
AppColors
.
app_blue
,
width:
0.5
,
),
),
child:
Center
(
child:
Text
(
"Add Attachment"
,
style:
TextStyle
(
fontFamily:
"JakartaMedium"
,
color:
AppColors
.
app_blue
,
),
),
),
),
),
),
),
),
),
searchMatchFn:
(
item
,
searchValue
)
{
if
(
provider
.
imagePicked
==
1
&&
return
item
.
value
?.
name
provider
.
imagePath
!=
null
)
...[
?.
toLowerCase
()
Padding
(
.
contains
(
padding:
const
EdgeInsets
.
symmetric
(
searchValue
.
toLowerCase
(),
vertical:
4.0
,
)
??
),
false
;
child:
Row
(
},
mainAxisAlignment:
MainAxisAlignment
.
spaceBetween
,
children:
[
Text
(
"
${provider.imagePath}
"
,
style:
TextStyle
(
color:
AppColors
.
semi_black
,
fontSize:
11
,
fontWeight:
FontWeight
.
w600
,
),
),
InkResponse
(
onTap:
()
{
provider
.
imagePicked
=
0
;
provider
.
imagePath
=
null
;
provider
.
imageFilePath
=
null
;
},
child:
SvgPicture
.
asset
(
"assets/svg/ic_close.svg"
,
width:
15
,
height:
15
,
),
),
],
),
),
],
textControllerReadonlyWidget
(
context
,
provider
.
accountName
,
"Enter Account Name"
,
(
p0
)
{},
),
textControllerReadonlyWidget
(
context
,
provider
.
branch
,
"Enter Branch Name"
,
(
p0
)
{},
),
textControllerReadonlyWidget
(
context
,
provider
.
requestingPurpose
,
"Enter Requesting Purpose"
,
(
p0
)
{},
),
// Optional: clear search text when dropdown closes
textControllerReadonlyWidget
(
),
context
,
onMenuStateChange:
(
isOpen
)
{
provider
.
description
,
if
(!
isOpen
)
{
"Enter Description"
,
provider
.
paymentAccountSearchController
(
p0
)
{},
.
clear
();
),
}
},
textControllerReadonlyWidget
(
buttonStyleData:
ddtheme
.
buttonStyleData
,
context
,
iconStyleData:
ddtheme
.
iconStyleData
,
provider
.
amount
,
menuItemStyleData:
"Enter Amount"
,
ddtheme
.
menuItemStyleData
,
(
p0
)
{},
dropdownStyleData:
),
ddtheme
.
dropdownStyleData
,
textControllerReadonlyWidget
(
context
,
provider
.
paymentMode
,
"Enter Payment Mode"
,
(
p0
)
{},
),
textControllerReadonlyWidget
(
context
,
provider
.
bankHolderName
,
"Bank Account Holder Name"
,
(
p0
)
{},
),
textControllerReadonlyWidget
(
context
,
provider
.
bankAccountNumber
,
"Bank Account Number"
,
(
p0
)
{},
),
textControllerReadonlyWidget
(
context
,
provider
.
bankName
,
"Bank Name"
,
(
p0
)
{},
),
textControllerReadonlyWidget
(
context
,
provider
.
bankBranchName
,
"Bank Branch Name"
,
(
p0
)
{},
),
textControllerReadonlyWidget
(
context
,
provider
.
bankIfscCode
,
"Bank IFSC Code"
,
(
p0
)
{},
),
textControllerReadonlyWidget
(
context
,
provider
.
bankUpiID
,
"Bank UPI ID"
,
(
p0
)
{},
),
],
),
),
),
),
],
),
),
],
),
textControllerReadonlyWidget
(
context
,
provider
.
approvedAmount
,
"Approved Amount"
,
(
p0
)
{},
),
),
textControllerWidget
(
],
),
),
bottomNavigationBar:
Align
(
alignment:
Alignment
.
bottomCenter
,
child:
InkWell
(
onTap:
()
{
provider
.
paymentrequisitionProcessSubmitAPIFunction
(
context
,
context
,
paymentReferenceNumber
,
widget
.
mode
,
"Enter Payment Reference Number"
,
paymentReferenceNumber
.
text
,
(
p0
)
{},
provider
.
approvedAmount
.
text
,
TextInputType
.
text
,
paymentID
,
false
,
provider
.
selectedID
,
null
,
remarks
.
text
,
focusNodes
[
3
],
focusNodes
[
4
],
TextInputAction
.
next
provider
.
imagePath
,
);
},
child:
Container
(
alignment:
Alignment
.
bottomCenter
,
height:
45
,
margin:
EdgeInsets
.
only
(
left:
5.0
,
right:
5.0
,
top:
5.0
,
bottom:
5.0
,
),
),
decoration:
BoxDecoration
(
textControllerWidget
(
color:
AppColors
.
app_blue
,
//1487C9
context
,
borderRadius:
BorderRadius
.
circular
(
14.0
),
remarks
,
"Enter Remarks"
,
(
p0
)
{},
TextInputType
.
text
,
false
,
null
,
focusNodes
[
4
],
null
,
TextInputAction
.
done
),
),
child:
Center
(
child:
Text
(
"Submit"
,
InkResponse
(
///add payment
onTap:
()
{
textAlign:
TextAlign
.
center
,
_showAttachmentSheet
(
context
);
style:
TextStyle
(
color:
Colors
.
white
),
},
child:
Container
(
margin:
EdgeInsets
.
symmetric
(
vertical:
10
),
height:
45
,
width:
MediaQuery
.
of
(
context
).
size
.
width
,
decoration:
BoxDecoration
(
color:
Color
(
0xFFE6F6FF
),
borderRadius:
BorderRadius
.
circular
(
12
),
border:
Border
.
all
(
color:
AppColors
.
app_blue
,
width:
0.5
,
),
),
child:
Center
(
child:
Text
(
"Add Attachment"
,
style:
TextStyle
(
fontFamily:
"JakartaMedium"
,
color:
AppColors
.
app_blue
,
),
),
),
),
),
),
),
if
(
provider
.
imagePicked
==
1
&&
),
provider
.
imagePath
!=
null
)
...[
),
Padding
(
),
padding:
const
EdgeInsets
.
symmetric
(
);
vertical:
4.0
,
},
),
);
},
);
},
);
}
Future
<
void
>
_showAddPaymentSheet
(
BuildContext
context
,
paymentID
)
{
return
showModalBottomSheet
(
useSafeArea:
true
,
isDismissible:
true
,
isScrollControlled:
true
,
showDragHandle:
true
,
backgroundColor:
Colors
.
white
,
enableDrag:
true
,
context:
context
,
builder:
(
context
)
{
return
StatefulBuilder
(
builder:
(
context
,
setState
)
{
return
SafeArea
(
child:
Consumer
<
Requesitionlidtdetailsprovider
>(
builder:
(
context
,
provider
,
child
)
{
// Fallback UI if provider data is not ready
if
(
provider
.
paymentsAccounts
==
null
)
{
return
Center
(
child:
CircularProgressIndicator
());
}
return
Container
(
// Constrain the height to avoid overflow
constraints:
BoxConstraints
(
maxHeight:
MediaQuery
.
of
(
context
).
size
.
height
*
0.8
,
),
margin:
EdgeInsets
.
only
(
bottom:
15
,
left:
15
,
right:
15
,
top:
10
,
),
child:
Column
(
children:
[
// Scrollable content
Expanded
(
child:
SingleChildScrollView
(
child:
Padding
(
padding:
EdgeInsets
.
only
(
bottom:
MediaQuery
.
of
(
context
).
viewInsets
.
bottom
,
),
),
child:
Row
(
child:
Column
(
mainAxisAlignment:
mainAxisSize:
MainAxisSize
.
min
,
MainAxisAlignment
.
spaceBetween
,
children:
[
children:
[
Text
(
Row
(
"
${provider.imagePath}
"
,
children:
[
style:
TextStyle
(
Expanded
(
color:
AppColors
.
semi_black
,
child:
Column
(
fontSize:
11
,
crossAxisAlignment:
CrossAxisAlignment
.
start
,
fontWeight:
FontWeight
.
w600
,
mainAxisSize:
MainAxisSize
.
min
,
),
children:
[
),
Align
(
InkResponse
(
alignment:
Alignment
.
topLeft
,
onTap:
()
{
child:
Text
(
provider
.
imagePicked
=
0
;
"Add Approval"
,
provider
.
imagePath
=
null
;
style:
TextStyle
(
provider
.
imageFilePath
=
null
;
color:
AppColors
.
app_blue
,
},
fontSize:
16
,
child:
SvgPicture
.
asset
(
),
"assets/svg/ic_close.svg"
,
),
width:
15
,
),
height:
15
,
textControllerReadonlyWidget
(
),
context
,
provider
.
proposedPaymentAccount
,
"Enter Proposed Payment Account"
,
(
p0
)
{},
),
TextWidget
(
context
,
"Payment Account"
),
DropdownButtonHideUnderline
(
child:
Row
(
children:
[
Expanded
(
child:
DropdownButton2
<
PaymentAccounts
>(
isExpanded:
true
,
hint:
Text
(
'Select Account'
,
style:
TextStyle
(
fontSize:
14
),
overflow:
TextOverflow
.
ellipsis
,
),
items:
provider
.
paymentsAccounts
.
map
(
(
paymenents
)
=>
DropdownMenuItem
<
PaymentAccounts
>(
value:
paymenents
,
child:
Text
(
paymenents
.
name
??
''
,
style:
TextStyle
(
fontSize:
14
),
overflow:
TextOverflow
.
ellipsis
,
),
),
)
.
toList
(),
value:
provider
.
selectedPaymentAccounts
,
onChanged:
(
PaymentAccounts
?
value
)
{
if
(
value
!=
null
&&
provider
.
paymentsAccounts
.
isNotEmpty
)
{
setState
(()
{
provider
.
selectedPaymentAccounts
=
value
;
provider
.
selectedID
=
value
.
id
!;
provider
.
selectedValue
=
value
.
name
!;
print
(
"Selected Account:
${value.name}
, ID:
${value.id}
"
);
});
}
},
dropdownSearchData:
DropdownSearchData
(
searchInnerWidgetHeight:
50
,
searchController:
provider
.
paymentAccountSearchController
,
searchInnerWidget:
Padding
(
padding:
const
EdgeInsets
.
all
(
8
),
child:
TextFormField
(
controller:
provider
.
paymentAccountSearchController
,
decoration:
InputDecoration
(
isDense:
true
,
contentPadding:
EdgeInsets
.
symmetric
(
horizontal:
10
,
vertical:
8
,
),
hintText:
'Search account...'
,
border:
OutlineInputBorder
(
borderRadius:
BorderRadius
.
circular
(
8
),
),
),
),
),
searchMatchFn:
(
item
,
searchValue
)
{
return
item
.
value
?.
name
?.
toLowerCase
().
contains
(
searchValue
.
toLowerCase
())
??
false
;
},
),
onMenuStateChange:
(
isOpen
)
{
if
(!
isOpen
)
{
provider
.
paymentAccountSearchController
.
clear
();
}
},
buttonStyleData:
ddtheme
.
buttonStyleData
,
iconStyleData:
ddtheme
.
iconStyleData
,
menuItemStyleData:
ddtheme
.
menuItemStyleData
,
dropdownStyleData:
ddtheme
.
dropdownStyleData
,
),
),
],
),
),
textControllerReadonlyWidget
(
context
,
provider
.
approvedAmountReadonly
,
"Approved Amount"
,
(
p0
)
{},
),
textControllerWidget
(
context
,
provider
.
approvedAmount
,
"Payment Amount"
,
"Enter Payment Amount"
,
(
p0
)
{
if
(
numberFormat
.
parse
(
provider
.
approvedAmountReadonly
.
text
)
<
numberFormat
.
parse
(
provider
.
approvedAmount
.
text
))
{
provider
.
proposedAmountError
=
"Amount should not be greater than Approved amount"
;
}
else
{
provider
.
proposedAmountError
=
""
;
}
},
TextInputType
.
numberWithOptions
(),
false
,
null
,
),
errorWidget
(
context
,
provider
.
proposedAmountError
),
textControllerWidget
(
context
,
paymentReferenceNumber
,
"Enter Payment Reference Number"
,
"Payment Reference Number"
,
(
p0
)
{},
TextInputType
.
text
,
false
,
null
,
focusNodes
[
3
],
focusNodes
[
4
],
TextInputAction
.
next
,
),
textControllerWidget
(
context
,
remarks
,
"Remarks"
,
"Enter Remarks"
,
(
p0
)
{},
TextInputType
.
text
,
false
,
null
,
focusNodes
[
4
],
null
,
TextInputAction
.
done
,
),
InkResponse
(
onTap:
()
{
_showAttachmentSheet
(
context
);
},
child:
Container
(
margin:
EdgeInsets
.
symmetric
(
vertical:
10
),
height:
45
,
width:
MediaQuery
.
of
(
context
).
size
.
width
,
decoration:
BoxDecoration
(
color:
Color
(
0xFFE6F6FF
),
borderRadius:
BorderRadius
.
circular
(
12
),
border:
Border
.
all
(
color:
AppColors
.
app_blue
,
width:
0.5
,
),
),
child:
Center
(
child:
Text
(
"Add Attachment"
,
style:
TextStyle
(
fontFamily:
"JakartaMedium"
,
color:
AppColors
.
app_blue
,
),
),
),
),
),
if
(
provider
.
imagePicked
==
1
&&
provider
.
imagePath
!=
null
)
...[
Padding
(
padding:
const
EdgeInsets
.
symmetric
(
vertical:
4.0
),
child:
Row
(
mainAxisAlignment:
MainAxisAlignment
.
spaceBetween
,
children:
[
Text
(
"
${provider.imagePath}
"
,
style:
TextStyle
(
color:
AppColors
.
semi_black
,
fontSize:
11
,
fontWeight:
FontWeight
.
w600
,
),
),
InkResponse
(
onTap:
()
{
setState
(()
{
provider
.
imagePicked
=
0
;
provider
.
imagePath
=
null
;
provider
.
imageFilePath
=
null
;
});
},
child:
SvgPicture
.
asset
(
"assets/svg/ic_close.svg"
,
width:
15
,
height:
15
,
),
),
],
),
),
],
textControllerReadonlyWidget
(
context
,
provider
.
accountName
,
"Enter Account Name"
,
(
p0
)
{}),
textControllerReadonlyWidget
(
context
,
provider
.
branch
,
"Enter Branch Name"
,
(
p0
)
{}),
textControllerReadonlyWidget
(
context
,
provider
.
requestingPurpose
,
"Enter Requesting Purpose"
,
(
p0
)
{}),
textControllerReadonlyWidget
(
context
,
provider
.
description
,
"Enter Description"
,
(
p0
)
{}),
textControllerReadonlyWidget
(
context
,
provider
.
amount
,
"Enter Amount"
,
(
p0
)
{}),
textControllerReadonlyWidget
(
context
,
provider
.
paymentMode
,
"Enter Payment Mode"
,
(
p0
)
{}),
textControllerReadonlyWidget
(
context
,
provider
.
bankHolderName
,
"Bank Account Holder Name"
,
(
p0
)
{}),
textControllerReadonlyWidget
(
context
,
provider
.
bankAccountNumber
,
"Bank Account Number"
,
(
p0
)
{}),
textControllerReadonlyWidget
(
context
,
provider
.
bankName
,
"Bank Name"
,
(
p0
)
{}),
textControllerReadonlyWidget
(
context
,
provider
.
bankBranchName
,
"Bank Branch Name"
,
(
p0
)
{}),
textControllerReadonlyWidget
(
context
,
provider
.
bankIfscCode
,
"Bank IFSC Code"
,
(
p0
)
{}),
textControllerReadonlyWidget
(
context
,
provider
.
bankUpiID
,
"Bank UPI ID"
,
(
p0
)
{}),
],
),
),
],
),
),
],
],
),
),
),
),
],
textControllerReadonlyWidget
(
context
,
provider
.
accountName
,
"Enter Account Name"
,
(
p0
)
{},
),
textControllerReadonlyWidget
(
context
,
provider
.
branch
,
"Enter Branch Name"
,
(
p0
)
{},
),
textControllerReadonlyWidget
(
context
,
provider
.
requestingPurpose
,
"Enter Requesting Purpose"
,
(
p0
)
{},
),
textControllerReadonlyWidget
(
context
,
provider
.
description
,
"Enter Description"
,
(
p0
)
{},
),
textControllerReadonlyWidget
(
context
,
provider
.
amount
,
"Enter Amount"
,
(
p0
)
{},
),
textControllerReadonlyWidget
(
context
,
provider
.
paymentMode
,
"Enter Payment Mode"
,
(
p0
)
{},
),
textControllerReadonlyWidget
(
context
,
provider
.
bankHolderName
,
"Bank Account Holder Name"
,
(
p0
)
{},
),
textControllerReadonlyWidget
(
context
,
provider
.
bankAccountNumber
,
"Bank Account Number"
,
(
p0
)
{},
),
textControllerReadonlyWidget
(
context
,
provider
.
bankName
,
"Bank Name"
,
(
p0
)
{},
),
textControllerReadonlyWidget
(
context
,
provider
.
bankBranchName
,
"Bank Branch Name"
,
(
p0
)
{},
),
textControllerReadonlyWidget
(
context
,
provider
.
bankIfscCode
,
"Bank IFSC Code"
,
(
p0
)
{},
),
),
textControllerReadonlyWidget
(
),
context
,
// Sticky Submit Button
provider
.
bankUpiID
,
Padding
(
"Bank UPI ID"
,
padding:
EdgeInsets
.
only
(
(
p0
)
{},
left:
5.0
,
right:
5.0
,
top:
5.0
,
bottom:
5.0
,
),
),
child:
InkWell
(
InkWell
(
onTap:
()
{
onTap:
()
{
provider
provider
.
paymentrequisitionProcessSubmitAPIFunction
(
.
paymentrequisitionProcessSubmitAPIFunction
(
context
,
context
,
widget
.
mode
,
widget
.
mode
,
paymentReferenceNumber
.
text
,
paymentReferenceNumber
.
text
,
provider
.
approvedAmount
.
text
,
paymentID
,
paymentID
,
provider
.
selectedID
,
provider
.
selectedID
,
remarks
.
text
,
remarks
.
text
,
provider
.
imagePath
,
provider
.
imagePath
,
);
);
},
},
child:
Container
(
child:
Container
(
alignment:
Alignment
.
center
,
height:
45
,
height:
45
,
margin:
EdgeInsets
.
only
(
left:
5.0
,
right:
5.0
,
top:
5.0
,
bottom:
5.0
,
),
decoration:
BoxDecoration
(
decoration:
BoxDecoration
(
color:
AppColors
.
app_blue
,
//1487C9
color:
AppColors
.
app_blue
,
borderRadius:
BorderRadius
.
circular
(
14.0
),
borderRadius:
BorderRadius
.
circular
(
14.0
),
),
),
child:
Center
(
child:
Center
(
child:
Text
(
child:
Text
(
"Submit"
,
"Submit"
,
///add payment
textAlign:
TextAlign
.
center
,
textAlign:
TextAlign
.
center
,
style:
TextStyle
(
color:
Colors
.
white
),
style:
TextStyle
(
color:
Colors
.
white
),
),
),
),
),
),
),
),
),
]
,
)
,
)
,
]
,
),
),
);
);
},
},
...
@@ -1294,7 +1658,6 @@ class _PaymentrequestionlistdetailsState
...
@@ -1294,7 +1658,6 @@ class _PaymentrequestionlistdetailsState
},
},
);
);
}
}
Future
<
void
>
_showAttachmentSheet
(
BuildContext
context
)
{
Future
<
void
>
_showAttachmentSheet
(
BuildContext
context
)
{
return
showModalBottomSheet
(
return
showModalBottomSheet
(
useSafeArea:
true
,
useSafeArea:
true
,
...
...
lib/screens/finance/addPaymentReceiptList.dart
View file @
2ccf19cc
...
@@ -253,6 +253,7 @@ class _AddpaymentreceiptlistState extends State<Addpaymentreceiptlist> {
...
@@ -253,6 +253,7 @@ class _AddpaymentreceiptlistState extends State<Addpaymentreceiptlist> {
textControllerWidget
(
textControllerWidget
(
context
,
context
,
provider
.
amountController
,
provider
.
amountController
,
"Amount"
,
"Enter Amount"
,
"Enter Amount"
,
provider
.
updateAmount
,
TextInputType
.
numberWithOptions
(),
false
,
provider
.
updateAmount
,
TextInputType
.
numberWithOptions
(),
false
,
null
,
null
,
...
@@ -393,6 +394,7 @@ class _AddpaymentreceiptlistState extends State<Addpaymentreceiptlist> {
...
@@ -393,6 +394,7 @@ class _AddpaymentreceiptlistState extends State<Addpaymentreceiptlist> {
textControllerWidget
(
textControllerWidget
(
context
,
context
,
provider
.
bankNameController
,
provider
.
bankNameController
,
"Bank Name"
,
"Enter Bank Name"
,
"Enter Bank Name"
,
provider
.
updateBankName
,
TextInputType
.
text
,
false
,
null
,
provider
.
updateBankName
,
TextInputType
.
text
,
false
,
null
,
focusNodes
[
2
],
focusNodes
[
2
],
...
@@ -403,6 +405,7 @@ class _AddpaymentreceiptlistState extends State<Addpaymentreceiptlist> {
...
@@ -403,6 +405,7 @@ class _AddpaymentreceiptlistState extends State<Addpaymentreceiptlist> {
textControllerWidget
(
textControllerWidget
(
context
,
context
,
provider
.
bankBranchController
,
provider
.
bankBranchController
,
"Bank Branch"
,
"Enter Bank Branch"
,
"Enter Bank Branch"
,
provider
.
updateBankBranch
,
TextInputType
.
text
,
false
,
null
,
provider
.
updateBankBranch
,
TextInputType
.
text
,
false
,
null
,
focusNodes
[
3
],
focusNodes
[
3
],
...
@@ -413,6 +416,7 @@ class _AddpaymentreceiptlistState extends State<Addpaymentreceiptlist> {
...
@@ -413,6 +416,7 @@ class _AddpaymentreceiptlistState extends State<Addpaymentreceiptlist> {
textControllerWidget
(
textControllerWidget
(
context
,
context
,
provider
.
bankAccNumberController
,
provider
.
bankAccNumberController
,
"Account Number"
,
"Enter Account Number"
,
"Enter Account Number"
,
provider
.
updateNumber
,
TextInputType
.
number
,
false
,
FilteringTextInputFormatter
.
digitsOnly
,
provider
.
updateNumber
,
TextInputType
.
number
,
false
,
FilteringTextInputFormatter
.
digitsOnly
,
focusNodes
[
4
],
focusNodes
[
4
],
...
@@ -423,6 +427,7 @@ class _AddpaymentreceiptlistState extends State<Addpaymentreceiptlist> {
...
@@ -423,6 +427,7 @@ class _AddpaymentreceiptlistState extends State<Addpaymentreceiptlist> {
textControllerWidget
(
textControllerWidget
(
context
,
context
,
provider
.
bankIfscController
,
provider
.
bankIfscController
,
"Bank IFSC"
,
"Enter Bank IFSC"
,
"Enter Bank IFSC"
,
provider
.
updateIFSC
,
TextInputType
.
text
,
false
,
null
,
provider
.
updateIFSC
,
TextInputType
.
text
,
false
,
null
,
focusNodes
[
5
],
focusNodes
[
5
],
...
@@ -433,6 +438,7 @@ class _AddpaymentreceiptlistState extends State<Addpaymentreceiptlist> {
...
@@ -433,6 +438,7 @@ class _AddpaymentreceiptlistState extends State<Addpaymentreceiptlist> {
textControllerWidget
(
textControllerWidget
(
context
,
context
,
provider
.
bankAcHolderController
,
provider
.
bankAcHolderController
,
"Bank Account Holder Name"
,
"Enter Bank Account Holder Name"
,
"Enter Bank Account Holder Name"
,
provider
.
updateHolder
,
TextInputType
.
text
,
false
,
null
,
provider
.
updateHolder
,
TextInputType
.
text
,
false
,
null
,
focusNodes
[
6
],
focusNodes
[
6
],
...
@@ -445,6 +451,7 @@ class _AddpaymentreceiptlistState extends State<Addpaymentreceiptlist> {
...
@@ -445,6 +451,7 @@ class _AddpaymentreceiptlistState extends State<Addpaymentreceiptlist> {
textControllerWidget
(
textControllerWidget
(
context
,
context
,
provider
.
bankUpiController
,
provider
.
bankUpiController
,
"UPI ID"
,
"Enter UPI ID"
,
"Enter UPI ID"
,
provider
.
updateUPI
,
TextInputType
.
text
,
false
,
null
,
provider
.
updateUPI
,
TextInputType
.
text
,
false
,
null
,
focusNodes
[
7
],
focusNodes
[
7
],
...
@@ -456,6 +463,7 @@ class _AddpaymentreceiptlistState extends State<Addpaymentreceiptlist> {
...
@@ -456,6 +463,7 @@ class _AddpaymentreceiptlistState extends State<Addpaymentreceiptlist> {
textControllerWidget
(
textControllerWidget
(
context
,
context
,
provider
.
paymentReferenceController
,
provider
.
paymentReferenceController
,
"Payment Reference Number"
,
"Enter Payment Reference Number"
,
"Enter Payment Reference Number"
,
provider
.
updatereference
,
TextInputType
.
text
,
false
,
null
,
provider
.
updatereference
,
TextInputType
.
text
,
false
,
null
,
focusNodes
[
8
],
focusNodes
[
8
],
...
@@ -466,6 +474,7 @@ class _AddpaymentreceiptlistState extends State<Addpaymentreceiptlist> {
...
@@ -466,6 +474,7 @@ class _AddpaymentreceiptlistState extends State<Addpaymentreceiptlist> {
textControllerWidget
(
textControllerWidget
(
context
,
context
,
provider
.
descController
,
provider
.
descController
,
"Description"
,
"Enter Description"
,
"Enter Description"
,
provider
.
updateDescription
,
TextInputType
.
text
,
false
,
null
,
provider
.
updateDescription
,
TextInputType
.
text
,
false
,
null
,
focusNodes
[
9
],
focusNodes
[
9
],
...
...
lib/screens/finance/directPaymentRequesitionList.dart
View file @
2ccf19cc
...
@@ -265,6 +265,7 @@ class _DirectpaymentrequesitionlistState
...
@@ -265,6 +265,7 @@ class _DirectpaymentrequesitionlistState
textControllerWidget
(
textControllerWidget
(
context
,
context
,
provider
.
amountController
,
provider
.
amountController
,
"Amount"
,
"Enter Amount"
,
"Enter Amount"
,
provider
.
updateAmount
,
TextInputType
.
numberWithOptions
(),
provider
.
updateAmount
,
TextInputType
.
numberWithOptions
(),
false
,
null
,
false
,
null
,
...
@@ -405,6 +406,7 @@ class _DirectpaymentrequesitionlistState
...
@@ -405,6 +406,7 @@ class _DirectpaymentrequesitionlistState
textControllerWidget
(
textControllerWidget
(
context
,
context
,
provider
.
bankNameController
,
provider
.
bankNameController
,
"Bank Name"
,
"Enter Bank Name"
,
"Enter Bank Name"
,
provider
.
updateBankName
,
TextInputType
.
text
,
false
,
null
,
provider
.
updateBankName
,
TextInputType
.
text
,
false
,
null
,
focusNodes
[
2
],
focusNodes
[
2
],
...
@@ -415,6 +417,7 @@ class _DirectpaymentrequesitionlistState
...
@@ -415,6 +417,7 @@ class _DirectpaymentrequesitionlistState
textControllerWidget
(
textControllerWidget
(
context
,
context
,
provider
.
bankBranchController
,
provider
.
bankBranchController
,
"Bank Branch"
,
"Enter Bank Branch"
,
"Enter Bank Branch"
,
provider
.
updateBankBranch
,
TextInputType
.
text
,
false
,
null
,
provider
.
updateBankBranch
,
TextInputType
.
text
,
false
,
null
,
focusNodes
[
3
],
focusNodes
[
3
],
...
@@ -425,6 +428,7 @@ class _DirectpaymentrequesitionlistState
...
@@ -425,6 +428,7 @@ class _DirectpaymentrequesitionlistState
textControllerWidget
(
textControllerWidget
(
context
,
context
,
provider
.
bankAccNumberController
,
provider
.
bankAccNumberController
,
"Account Number"
,
"Enter Account Number"
,
"Enter Account Number"
,
provider
.
updateNumber
,
TextInputType
.
number
,
false
,
FilteringTextInputFormatter
.
digitsOnly
,
provider
.
updateNumber
,
TextInputType
.
number
,
false
,
FilteringTextInputFormatter
.
digitsOnly
,
focusNodes
[
4
],
focusNodes
[
4
],
...
@@ -435,6 +439,7 @@ class _DirectpaymentrequesitionlistState
...
@@ -435,6 +439,7 @@ class _DirectpaymentrequesitionlistState
textControllerWidget
(
textControllerWidget
(
context
,
context
,
provider
.
bankIfscController
,
provider
.
bankIfscController
,
"Bank IFSC"
,
"Enter Bank IFSC"
,
"Enter Bank IFSC"
,
provider
.
updateIFSC
,
TextInputType
.
text
,
false
,
null
,
provider
.
updateIFSC
,
TextInputType
.
text
,
false
,
null
,
focusNodes
[
5
],
focusNodes
[
5
],
...
@@ -445,6 +450,7 @@ class _DirectpaymentrequesitionlistState
...
@@ -445,6 +450,7 @@ class _DirectpaymentrequesitionlistState
textControllerWidget
(
textControllerWidget
(
context
,
context
,
provider
.
bankAcHolderController
,
provider
.
bankAcHolderController
,
"Bank Account Holder Name"
,
"Enter Bank Account Holder Name"
,
"Enter Bank Account Holder Name"
,
provider
.
updateHolder
,
TextInputType
.
text
,
false
,
null
,
provider
.
updateHolder
,
TextInputType
.
text
,
false
,
null
,
focusNodes
[
6
],
focusNodes
[
6
],
...
@@ -456,6 +462,7 @@ class _DirectpaymentrequesitionlistState
...
@@ -456,6 +462,7 @@ class _DirectpaymentrequesitionlistState
textControllerWidget
(
textControllerWidget
(
context
,
context
,
provider
.
bankUpiController
,
provider
.
bankUpiController
,
"UPI ID"
,
"Enter UPI ID"
,
"Enter UPI ID"
,
provider
.
updateUPI
,
TextInputType
.
text
,
false
,
null
,
provider
.
updateUPI
,
TextInputType
.
text
,
false
,
null
,
focusNodes
[
7
],
focusNodes
[
7
],
...
@@ -467,6 +474,7 @@ class _DirectpaymentrequesitionlistState
...
@@ -467,6 +474,7 @@ class _DirectpaymentrequesitionlistState
textControllerWidget
(
textControllerWidget
(
context
,
context
,
provider
.
paymentReferenceController
,
provider
.
paymentReferenceController
,
"Payment Reference Number"
,
"Enter Payment Reference Number"
,
"Enter Payment Reference Number"
,
provider
.
updateReference
,
TextInputType
.
text
,
false
,
null
,
provider
.
updateReference
,
TextInputType
.
text
,
false
,
null
,
focusNodes
[
8
],
focusNodes
[
8
],
...
@@ -477,6 +485,7 @@ class _DirectpaymentrequesitionlistState
...
@@ -477,6 +485,7 @@ class _DirectpaymentrequesitionlistState
textControllerWidget
(
textControllerWidget
(
context
,
context
,
provider
.
descController
,
provider
.
descController
,
"Description"
,
"Enter Description"
,
"Enter Description"
,
provider
.
updateDescription
,
TextInputType
.
text
,
false
,
null
,
provider
.
updateDescription
,
TextInputType
.
text
,
false
,
null
,
focusNodes
[
9
],
focusNodes
[
9
],
...
@@ -579,63 +588,63 @@ class _DirectpaymentrequesitionlistState
...
@@ -579,63 +588,63 @@ class _DirectpaymentrequesitionlistState
);
);
}
}
void
_showDialog
(
Widget
child
)
{
//
void _showDialog(Widget child) {
showCupertinoModalPopup
<
void
>(
//
showCupertinoModalPopup<void>(
context:
context
,
//
context: context,
builder:
//
builder:
(
BuildContext
context
)
=>
Container
(
//
(BuildContext context) => Container(
height:
216
,
//
height: 216,
padding:
const
EdgeInsets
.
only
(
top:
6.0
),
//
padding: const EdgeInsets.only(top: 6.0),
// The Bottom margin is provided to align the popup above the system
//
// The Bottom margin is provided to align the popup above the system
// navigation bar.
//
// navigation bar.
margin:
EdgeInsets
.
only
(
//
margin: EdgeInsets.only(
bottom:
MediaQuery
.
of
(
context
).
viewInsets
.
bottom
,
//
bottom: MediaQuery.of(context).viewInsets.bottom,
),
//
),
// Provide a background color for the popup.
//
// Provide a background color for the popup.
color:
CupertinoColors
.
systemBackground
.
resolveFrom
(
context
),
//
color: CupertinoColors.systemBackground.resolveFrom(context),
// Use a SafeArea widget to avoid system overlaps.
//
// Use a SafeArea widget to avoid system overlaps.
child:
SafeArea
(
//
child: SafeArea(
top:
false
,
//
top: false,
child:
Column
(
//
child: Column(
children:
[
//
children: [
Expanded
(
//
Expanded(
flex:
1
,
//
flex: 1,
child:
SizedBox
(
//
child: SizedBox(
height:
40
,
//
height: 40,
child:
Row
(
//
child: Row(
mainAxisAlignment:
MainAxisAlignment
.
spaceBetween
,
//
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children:
[
//
children: [
// Add a Cancel button (optional)
//
// Add a Cancel button (optional)
CupertinoButton
(
//
CupertinoButton(
child:
Text
(
//
child: Text(
'Cancel'
,
//
'Cancel',
style:
TextStyle
(
fontFamily:
"JakartaMedium"
),
//
style: TextStyle(fontFamily: "JakartaMedium"
,color: AppColors.app_blue
),
),
//
),
onPressed:
()
{
//
onPressed: () {
Navigator
.
pop
(
context
);
//
Navigator.pop(context);
},
//
},
),
//
),
// Add a Done button
//
// Add a Done button
CupertinoButton
(
//
CupertinoButton(
child:
Text
(
//
child: Text(
'Done'
,
//
'Done',
style:
TextStyle
(
fontFamily:
"JakartaMedium"
),
//
style: TextStyle(fontFamily: "JakartaMedium"
,color: AppColors.app_blue
),
),
//
),
onPressed:
()
{
//
onPressed: () {
Navigator
.
pop
(
context
);
// Dismiss the dialog
//
Navigator.pop(context); // Dismiss the dialog
},
//
},
),
//
),
],
//
],
),
//
),
),
//
),
),
//
),
Expanded
(
flex:
3
,
child:
child
),
//
Expanded(flex: 3, child: child),
],
//
],
),
//
),
),
//
),
),
//
),
);
//
);
}
//
}
...
...
lib/screens/finance/financeDashboard.dart
View file @
2ccf19cc
...
@@ -29,6 +29,8 @@ class _FinancedashboardState extends State<Financedashboard> {
...
@@ -29,6 +29,8 @@ class _FinancedashboardState extends State<Financedashboard> {
Widget
build
(
BuildContext
context
)
{
Widget
build
(
BuildContext
context
)
{
return
Consumer
<
Dashboardprovider
>(
return
Consumer
<
Dashboardprovider
>(
builder:
(
context
,
provider
,
child
)
{
builder:
(
context
,
provider
,
child
)
{
final
pages
=
provider
.
accessiblePagesList
;
return
WillPopScope
(
return
WillPopScope
(
onWillPop:
()
=>
onBackPressed
(
context
),
onWillPop:
()
=>
onBackPressed
(
context
),
child:
Scaffold
(
child:
Scaffold
(
...
@@ -41,12 +43,12 @@ class _FinancedashboardState extends State<Financedashboard> {
...
@@ -41,12 +43,12 @@ class _FinancedashboardState extends State<Financedashboard> {
child:
Column
(
child:
Column
(
children:
[
children:
[
ListView
.
builder
(
ListView
.
builder
(
itemCount:
p
rovider
.
accessiblePagesList
.
length
,
itemCount:
p
ages
.
length
,
shrinkWrap:
true
,
shrinkWrap:
true
,
physics:
NeverScrollableScrollPhysics
(),
physics:
NeverScrollableScrollPhysics
(),
itemBuilder:
(
context
,
index
)
{
itemBuilder:
(
context
,
index
)
{
Widget
?
SvgIcon
;
Widget
?
SvgIcon
;
switch
(
p
rovider
.
accessiblePagesList
[
index
].
mode
)
{
switch
(
p
ages
[
index
].
mode
)
{
case
"apr_lvl1"
:
case
"apr_lvl1"
:
SvgIcon
=
SvgPicture
.
asset
(
SvgIcon
=
SvgPicture
.
asset
(
"assets/svg/fin_lv1.svg"
,
"assets/svg/fin_lv1.svg"
,
...
@@ -57,16 +59,17 @@ class _FinancedashboardState extends State<Financedashboard> {
...
@@ -57,16 +59,17 @@ class _FinancedashboardState extends State<Financedashboard> {
"assets/svg/fin_lv2.svg"
,
"assets/svg/fin_lv2.svg"
,
);
);
break
;
break
;
final
icons
=
[
"comm_ic_1"
,
"comm_ic_2"
];
default
:
default
:
SvgIcon
=
SvgPicture
.
asset
(
"assets/svg/fin_ic.svg"
);
SvgIcon
=
SvgPicture
.
asset
(
"assets/svg/fin_ic.svg"
,
);
break
;
break
;
}
}
return
InkResponse
(
return
InkResponse
(
onTap:
()
async
{
onTap:
()
async
{
var
navigate
;
var
navigate
;
if
(
provider
.
accessiblePagesList
[
index
].
pageName
==
if
(
pages
[
index
].
pageName
==
"Payments List"
)
{
"Payments List"
)
{
navigate
=
Paymentlistpaymentrequisition
(
navigate
=
Paymentlistpaymentrequisition
(
pageTitleName:
pageTitleName:
provider
provider
...
@@ -79,13 +82,25 @@ class _FinancedashboardState extends State<Financedashboard> {
...
@@ -79,13 +82,25 @@ class _FinancedashboardState extends State<Financedashboard> {
"Payment Receipts List"
)
{
"Payment Receipts List"
)
{
navigate
=
Paymentreceiptlist
(
navigate
=
Paymentreceiptlist
(
pageTitleName:
pageTitleName:
provider
provider
.
accessiblePagesList
[
index
]
.
accessiblePagesList
[
index
]
.
pageName
!,
.
pageName
!,
);
);
}
else
if
(
provider
.
accessiblePagesList
[
index
]
.
pageName
==
"Account List"
)
{
navigate
=
Accountslist
();
// break;
}
else
if
(
provider
.
accessiblePagesList
[
index
]
.
pageName
==
"Account Ledger"
)
{
navigate
=
Accountledger
();
}
else
{
}
else
{
navigate
=
Allpaymentrequesitionlistsbymodes
(
navigate
=
Allpaymentrequesitionlistsbymodes
(
mode:
p
rovider
.
accessiblePagesList
[
index
].
mode
!,
mode:
p
ages
[
index
].
mode
!,
pageTitleName:
pageTitleName:
provider
provider
.
accessiblePagesList
[
index
]
.
accessiblePagesList
[
index
]
...
@@ -94,7 +109,9 @@ class _FinancedashboardState extends State<Financedashboard> {
...
@@ -94,7 +109,9 @@ class _FinancedashboardState extends State<Financedashboard> {
}
}
await
Navigator
.
push
(
await
Navigator
.
push
(
context
,
context
,
MaterialPageRoute
(
builder:
(
context
)
=>
navigate
),
MaterialPageRoute
(
builder:
(
context
)
=>
navigate
,
),
);
);
},
},
child:
Container
(
child:
Container
(
...
@@ -112,12 +129,30 @@ class _FinancedashboardState extends State<Financedashboard> {
...
@@ -112,12 +129,30 @@ class _FinancedashboardState extends State<Financedashboard> {
),
),
child:
Row
(
child:
Row
(
children:
[
children:
[
if
(
provider
.
accessiblePagesList
[
index
]
.
pageName
==
"Account List"
)...[
Expanded
(
flex:
1
,
child:
SvgPicture
.
asset
(
"assets/svg/comm_ic_1.svg"
,
width:
25
,
),
)
]
else
if
(
provider
.
accessiblePagesList
[
index
]
.
pageName
==
"Account Ledger"
)...[
Expanded
(
flex:
1
,
child:
SvgPicture
.
asset
(
"assets/svg/comm_ic_2.svg"
,
width:
25
,
),
)
]
else
...[
Expanded
(
flex:
1
,
child:
SvgIcon
),
Expanded
(
flex:
1
,
child:
SvgIcon
),
],
Expanded
(
Expanded
(
flex:
5
,
flex:
5
,
child:
Text
(
child:
Text
(
"
${pages[index].pageName}
"
),
"
${provider.accessiblePagesList[index].pageName}
"
,
),
),
),
Expanded
(
Expanded
(
flex:
1
,
flex:
1
,
...
@@ -152,7 +187,7 @@ class _FinancedashboardState extends State<Financedashboard> {
...
@@ -152,7 +187,7 @@ class _FinancedashboardState extends State<Financedashboard> {
borderRadius:
BorderRadius
.
circular
(
15
),
borderRadius:
BorderRadius
.
circular
(
15
),
),
),
child:
Text
(
child:
Text
(
"Add
Payment Request
"
,
"Add"
,
style:
TextStyle
(
style:
TextStyle
(
fontSize:
15
,
fontSize:
15
,
fontFamily:
"JakartaMedium"
,
fontFamily:
"JakartaMedium"
,
...
@@ -182,6 +217,7 @@ class _FinancedashboardState extends State<Financedashboard> {
...
@@ -182,6 +217,7 @@ class _FinancedashboardState extends State<Financedashboard> {
return
SafeArea
(
return
SafeArea
(
child:
Consumer
<
Dashboardprovider
>(
child:
Consumer
<
Dashboardprovider
>(
builder:
(
context
,
provider
,
child
)
{
builder:
(
context
,
provider
,
child
)
{
final
pages2
=
provider
.
accessiblePagesList2
;
return
Container
(
return
Container
(
margin:
EdgeInsets
.
only
(
margin:
EdgeInsets
.
only
(
bottom:
15
,
bottom:
15
,
...
@@ -189,34 +225,35 @@ class _FinancedashboardState extends State<Financedashboard> {
...
@@ -189,34 +225,35 @@ class _FinancedashboardState extends State<Financedashboard> {
right:
15
,
right:
15
,
top:
10
,
top:
10
,
),
),
padding:
EdgeInsets
.
only
(
bottom:
MediaQuery
.
of
(
context
).
viewInsets
.
bottom
,),
padding:
EdgeInsets
.
only
(
bottom:
MediaQuery
.
of
(
context
).
viewInsets
.
bottom
,
),
child:
SingleChildScrollView
(
child:
SingleChildScrollView
(
child:
Column
(
child:
Column
(
mainAxisSize:
MainAxisSize
.
min
,
mainAxisSize:
MainAxisSize
.
min
,
children:
[
children:
[
SizedBox
(
height:
15
),
SizedBox
(
height:
15
),
...
List
.
generate
(
p
rovider
.
accessiblePagesList
2
.
length
,
(
...
List
.
generate
(
p
ages
2
.
length
,
(
index
)
{
index
,
print
(
pages2
[
index
].
mode
);
)
{
// List<String> mode_lst = [
print
(
provider
.
accessiblePagesList2
[
index
].
mode
);
// "self",
List
<
String
>
mode_lst
=
[
// "other",
"self
"
,
// "process
",
"other
"
,
// "admin
",
"process
"
,
// "direct
",
"admin"
,
//
"admin"
"direct"
,
// ];
];
// final Headingnames = [
final
Headingnames
=
[
// "Add Self Payment Requisition",
"Add
Self
Payment Requisition"
,
//
"Add
Other
Payment Requisition",
"Add
Other
Payment Requisition"
,
//
"Add
Processed
Payment Requisition",
"Add
Processed
Payment Requisition"
,
//
"Add
Admin
Payment Requisition",
"Add
Admin
Payment
Requisition
"
,
//
"Add
Direct
Payment",
"Add
Direct Payme
nt"
,
//
"Add
Accou
nt"
];
//
];
return
ListTile
(
return
ListTile
(
onTap:
()
async
{
onTap:
()
async
{
var
res
;
var
res
;
if
(
provider
if
(
provider
.
accessiblePagesList2
[
index
]
.
accessiblePagesList2
[
index
]
...
@@ -236,21 +273,30 @@ class _FinancedashboardState extends State<Financedashboard> {
...
@@ -236,21 +273,30 @@ class _FinancedashboardState extends State<Financedashboard> {
),
),
),
),
);
);
}
else
if
(
provider
}
else
if
(
provider
.
accessiblePagesList2
[
index
]
.
accessiblePagesList2
[
index
]
.
pageName
==
.
pageName
==
"Add Payment Receipt"
)
{
"Add Payment Receipt"
)
{
res
=
await
Navigator
.
push
(
res
=
await
Navigator
.
push
(
context
,
context
,
MaterialPageRoute
(
MaterialPageRoute
(
builder:
builder:
(
(
context
)
=>
Addpaymentreceiptlist
(
context
,
pageTitleName:
)
=>
Addpaymentreceiptlist
(
provider
pageTitleName:
.
accessiblePagesList2
[
index
]
provider
.
pageName
!,
.
accessiblePagesList2
[
index
]
),
.
pageName
!,
),
);
}
else
if
(
provider
.
accessiblePagesList2
[
index
]
.
pageName
!.
contains
(
"Add Account"
))
{
res
=
await
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
context
)
=>
Addcommonpayment
(
from:
"Dashboard"
,
),
),
),
),
);
);
...
@@ -259,14 +305,12 @@ class _FinancedashboardState extends State<Financedashboard> {
...
@@ -259,14 +305,12 @@ class _FinancedashboardState extends State<Financedashboard> {
context
,
context
,
MaterialPageRoute
(
MaterialPageRoute
(
builder:
builder:
(
(
context
)
=>
context
,
Submitpaymentrequestionlistsbymode
(
)
=>
Submitpaymentrequestionlistsbymode
(
mode:
"
${pages2[index].mode}
"
,
mode:
pageTitleName:
"
${provider.accessiblePagesList2[index].mode}
"
,
"
${pages2[index].pageName}
"
,
pageTitleName:
),
"
${provider.accessiblePagesList2[index].pageName}
"
,
),
),
),
);
);
}
}
...
@@ -276,7 +320,7 @@ class _FinancedashboardState extends State<Financedashboard> {
...
@@ -276,7 +320,7 @@ class _FinancedashboardState extends State<Financedashboard> {
"assets/svg/fin_ic.svg"
,
"assets/svg/fin_ic.svg"
,
),
),
title:
Text
(
title:
Text
(
"
${p
rovider.accessiblePagesList
2[index].pageName}
"
,
"
${p
ages
2[index].pageName}
"
,
style:
TextStyle
(
style:
TextStyle
(
fontSize:
14
,
fontSize:
14
,
fontFamily:
"JakartaMedium"
,
fontFamily:
"JakartaMedium"
,
...
...
lib/screens/finance/paymentListPaymentRequisition.dart
View file @
2ccf19cc
...
@@ -168,30 +168,30 @@ late Commondaterangefilter cf;
...
@@ -168,30 +168,30 @@ late Commondaterangefilter cf;
),
),
),
),
),
),
Expanded
(
//
Expanded(
flex:
2
,
//
flex: 2,
child:
Container
(
//
child: Container(
padding:
EdgeInsets
.
symmetric
(
//
padding: EdgeInsets.symmetric(
horizontal:
5
,
//
horizontal: 5,
vertical:
10
,
//
vertical: 10,
),
//
),
decoration:
BoxDecoration
(
//
decoration: BoxDecoration(
borderRadius:
BorderRadius
.
circular
(
8
),
//
borderRadius: BorderRadius.circular(8),
color:
Color
(
0xFFE3FFE0
),
//
color: Color(0xFFE3FFE0),
),
//
),
child:
Center
(
//
child: Center(
child:
Text
(
//
child: Text(
requestLists
[
index
].
refType
!,
//
requestLists[index].refType!,
textAlign:
TextAlign
.
center
,
//
textAlign: TextAlign.center,
style:
TextStyle
(
//
style: TextStyle(
fontFamily:
"JakartaMedium"
,
//
fontFamily: "JakartaMedium",
fontSize:
14
,
//
fontSize: 14,
color:
Color
(
0xFF0D9C00
),
//
color: Color(0xFF0D9C00),
),
//
),
),
//
),
),
//
),
),
//
),
),
//
),
],
],
),
),
Divider
(
thickness:
0.5
,
color:
Color
(
0xFFD7D7D7
)),
Divider
(
thickness:
0.5
,
color:
Color
(
0xFFD7D7D7
)),
...
...
lib/screens/finance/submitPaymentRequestionListsByMode.dart
View file @
2ccf19cc
...
@@ -6,6 +6,8 @@ import 'package:generp/Notifiers/financeProvider/RequestionListProvider.dart';
...
@@ -6,6 +6,8 @@ import 'package:generp/Notifiers/financeProvider/RequestionListProvider.dart';
import
'package:generp/Utils/app_colors.dart'
;
import
'package:generp/Utils/app_colors.dart'
;
import
'package:generp/Utils/commonWidgets.dart'
;
import
'package:generp/Utils/commonWidgets.dart'
;
import
'package:generp/Utils/dropdownTheme.dart'
;
import
'package:generp/Utils/dropdownTheme.dart'
;
import
'package:generp/screens/commom/addCommonPayment.dart'
;
import
'package:get/utils.dart'
;
import
'package:provider/provider.dart'
;
import
'package:provider/provider.dart'
;
import
'../../Models/financeModels/addPaymentRequestionResponse.dart'
;
import
'../../Models/financeModels/addPaymentRequestionResponse.dart'
;
...
@@ -13,34 +15,68 @@ import '../../Models/financeModels/addPaymentRequestionResponse.dart';
...
@@ -13,34 +15,68 @@ import '../../Models/financeModels/addPaymentRequestionResponse.dart';
class
Submitpaymentrequestionlistsbymode
extends
StatefulWidget
{
class
Submitpaymentrequestionlistsbymode
extends
StatefulWidget
{
final
String
mode
;
final
String
mode
;
final
String
pageTitleName
;
final
String
pageTitleName
;
const
Submitpaymentrequestionlistsbymode
({
super
.
key
,
required
this
.
mode
,
required
this
.
pageTitleName
});
const
Submitpaymentrequestionlistsbymode
({
super
.
key
,
required
this
.
mode
,
required
this
.
pageTitleName
,
});
@override
@override
State
<
Submitpaymentrequestionlistsbymode
>
createState
()
=>
State
<
Submitpaymentrequestionlistsbymode
>
createState
()
=>
_SubmitpaymentrequestionlistsbymodeState
();
_SubmitpaymentrequestionlistsbymodeState
();
}
}
class
_SubmitpaymentrequestionlistsbymodeState
class
_SubmitpaymentrequestionlistsbymodeState
extends
State
<
Submitpaymentrequestionlistsbymode
>
{
extends
State
<
Submitpaymentrequestionlistsbymode
>
{
Dropdowntheme
ddtheme
=
Dropdowntheme
();
Dropdowntheme
ddtheme
=
Dropdowntheme
();
List
<
FocusNode
>
focusNodes
=
List
.
generate
(
11
,
(
index
)
=>
FocusNode
(),);
List
<
FocusNode
>
focusNodes
=
List
.
generate
(
11
,
(
index
)
=>
FocusNode
());
@override
@override
void
initState
()
{
void
initState
()
{
// TODO: implement initState
// TODO: implement initState
super
.
initState
();
super
.
initState
();
WidgetsBinding
.
instance
.
addPostFrameCallback
((
timeStamp
)
{
WidgetsBinding
.
instance
.
addPostFrameCallback
((
timeStamp
)
{
var
provider
=
Provider
.
of
<
Requestionlistprovider
>(
context
,
listen:
false
);
var
provider
=
Provider
.
of
<
Requestionlistprovider
>(
context
,
listen:
false
,
);
provider
.
addPaymentRequestionViewAPI
(
context
,
widget
.
mode
);
provider
.
addPaymentRequestionViewAPI
(
context
,
widget
.
mode
);
});
});
}
}
@override
@override
void
dispose
()
{
void
dispose
()
{
focusNodes
.
map
((
e
)=>
e
.
dispose
());
focusNodes
.
map
((
e
)
=>
e
.
dispose
());
super
.
dispose
();
super
.
dispose
();
}
}
autofill
(
res
){
print
(
"auto"
);
var
provider
=
Provider
.
of
<
Requestionlistprovider
>(
context
,
listen:
false
,
);
if
(
provider
.
accounts
!=
null
)
{
provider
.
selectedAccount
=
provider
.
accounts
.
firstWhereOrNull
((
element
)
=>
element
.
id
==
res
,);
print
(
"sdsd,al;,al
${provider.selectedAccount}
"
);
provider
.
accountId
=
provider
.
accounts
.
firstWhere
(
(
e
)
=>
e
.
id
==
res
,
)
.
id
!;
provider
.
accountValue
=
provider
.
accounts
.
firstWhere
(
(
e
)
=>
e
.
id
==
res
,
)
.
name
!;
}
}
Future
<
bool
>
_onBackPressed
(
BuildContext
context
)
async
{
Future
<
bool
>
_onBackPressed
(
BuildContext
context
)
async
{
Navigator
.
pop
(
context
,
true
);
Navigator
.
pop
(
context
,
true
);
return
true
;
return
true
;
...
@@ -61,7 +97,12 @@ class _SubmitpaymentrequestionlistsbymodeState
...
@@ -61,7 +97,12 @@ class _SubmitpaymentrequestionlistsbymodeState
child:
Scaffold
(
child:
Scaffold
(
resizeToAvoidBottomInset:
true
,
resizeToAvoidBottomInset:
true
,
backgroundColor:
AppColors
.
white
,
backgroundColor:
AppColors
.
white
,
appBar:
appbar2
(
context
,
"
${widget.pageTitleName}
"
,
provider
.
resetForm
,
SizedBox
(
width:
0
,)),
appBar:
appbar2
(
context
,
"
${widget.pageTitleName}
"
,
provider
.
resetForm
,
SizedBox
(
width:
0
),
),
body:
SafeArea
(
body:
SafeArea
(
child:
Container
(
child:
Container
(
padding:
EdgeInsets
.
symmetric
(
horizontal:
10
),
padding:
EdgeInsets
.
symmetric
(
horizontal:
10
),
...
@@ -78,6 +119,7 @@ class _SubmitpaymentrequestionlistsbymodeState
...
@@ -78,6 +119,7 @@ class _SubmitpaymentrequestionlistsbymodeState
child:
Row
(
child:
Row
(
children:
[
children:
[
Expanded
(
Expanded
(
flex:
5
,
child:
DropdownButton2
<
Accounts
>(
child:
DropdownButton2
<
Accounts
>(
isExpanded:
true
,
isExpanded:
true
,
hint:
Text
(
hint:
Text
(
...
@@ -115,40 +157,52 @@ class _SubmitpaymentrequestionlistsbymodeState
...
@@ -115,40 +157,52 @@ class _SubmitpaymentrequestionlistsbymodeState
provider
.
accountId
=
value
.
id
!;
provider
.
accountId
=
value
.
id
!;
print
(
print
(
"hfjkshfg"
+
"hfjkshfg"
+
provider
.
accountId
.
toString
(),
provider
.
accountId
.
toString
(),
);
);
provider
.
paymentRequestionBankDetailsAPIFunction
(
context
,
provider
.
accountId
);
provider
.
paymentRequestionBankDetailsAPIFunction
(
context
,
provider
.
accountId
,
);
}
}
}
}
},
},
dropdownSearchData:
DropdownSearchData
(
dropdownSearchData:
DropdownSearchData
(
searchInnerWidgetHeight:
50
,
searchInnerWidgetHeight:
50
,
searchController:
provider
.
accountSearchController
,
searchController:
provider
.
accountSearchController
,
searchInnerWidget:
Padding
(
searchInnerWidget:
Padding
(
padding:
const
EdgeInsets
.
all
(
8
),
padding:
const
EdgeInsets
.
all
(
8
),
child:
TextFormField
(
child:
TextFormField
(
controller:
provider
.
accountSearchController
,
controller:
provider
.
accountSearchController
,
decoration:
InputDecoration
(
decoration:
InputDecoration
(
isDense:
true
,
isDense:
true
,
contentPadding:
const
EdgeInsets
.
symmetric
(
contentPadding:
horizontal:
10
,
const
EdgeInsets
.
symmetric
(
vertical:
8
,
horizontal:
10
,
),
vertical:
8
,
),
hintText:
'Search account...'
,
hintText:
'Search account...'
,
border:
OutlineInputBorder
(
border:
OutlineInputBorder
(
borderRadius:
BorderRadius
.
circular
(
8
),
borderRadius:
BorderRadius
.
circular
(
8
,
),
),
),
),
),
),
),
),
),
searchMatchFn:
(
item
,
searchValue
)
{
searchMatchFn:
(
item
,
searchValue
)
{
return
item
.
value
?.
name
return
item
.
value
?.
name
?.
toLowerCase
()
?.
toLowerCase
()
.
contains
(
searchValue
.
toLowerCase
())
??
.
contains
(
searchValue
.
toLowerCase
(),
)
??
false
;
false
;
},
},
// Optional: clear search text when dropdown closes
// Optional: clear search text when dropdown closes
),
),
onMenuStateChange:
(
isOpen
)
{
onMenuStateChange:
(
isOpen
)
{
if
(!
isOpen
)
{
if
(!
isOpen
)
{
...
@@ -161,11 +215,57 @@ class _SubmitpaymentrequestionlistsbymodeState
...
@@ -161,11 +215,57 @@ class _SubmitpaymentrequestionlistsbymodeState
dropdownStyleData:
ddtheme
.
dropdownStyleData
,
dropdownStyleData:
ddtheme
.
dropdownStyleData
,
),
),
),
),
if
(
widget
.
mode
==
"other"
)
...[
SizedBox
(
width:
5
),
Expanded
(
flex:
1
,
child:
InkResponse
(
onTap:
()
async
{
var
res
=
await
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
context
)
=>
Addcommonpayment
(
from:
"Requesition"
,),
),
);
print
(
"return Response:
${res}
"
);
if
(
res
!=
true
)
{
provider
.
addPaymentRequestionViewAPI
(
context
,
widget
.
mode
,
);
if
(
res
!=
null
)
{
print
(
"true"
);
Future
.
delayed
(
Durations
.
long4
,
()
async
{
print
(
"Long411"
);
autofill
(
res
);
},
);
}
}
},
child:
Container
(
height:
45
,
padding:
EdgeInsets
.
all
(
8
),
decoration:
BoxDecoration
(
color:
AppColors
.
app_blue
,
borderRadius:
BorderRadius
.
circular
(
8
),
),
child:
SvgPicture
.
asset
(
"assets/svg/add_account.svg"
,
color:
Colors
.
white
,
),
),
),
),
],
],
],
),
),
),
),
errorWidget
(
context
,
provider
.
selectAccountError
),
errorWidget
(
context
,
provider
.
selectAccountError
),
if
([
"self"
,
"admin"
].
contains
(
widget
.
mode
))
...[
if
([
"self"
,
"admin"
].
contains
(
widget
.
mode
))
...[
TextWidget
(
context
,
"Select Requisition Type"
),
TextWidget
(
context
,
"Select Requisition Type"
),
DropdownButtonHideUnderline
(
DropdownButtonHideUnderline
(
...
@@ -195,15 +295,18 @@ class _SubmitpaymentrequestionlistsbymodeState
...
@@ -195,15 +295,18 @@ class _SubmitpaymentrequestionlistsbymodeState
)
)
.
toList
(),
.
toList
(),
value:
provider
.
selectReqPurpose
,
value:
provider
.
selectReqPurpose
,
onChanged:
(
String
?
value
)
{
onChanged:
(
String
?
value
)
{
if
(
value
!=
null
)
{
if
(
value
!=
null
)
{
provider
.
selectReqPurpose
=
value
;
provider
.
selectReqPurpose
=
value
;
print
(
"Selected Complaint Type:
${value}
,"
);
print
(
"Selected Complaint Type:
${value}
,"
,
);
print
(
print
(
"hfjkshfg"
+
"hfjkshfg"
+
provider
.
selectReqPurpose
.
toString
(),
provider
.
selectReqPurpose
.
toString
(),
);
);
}
}
},
},
...
@@ -220,38 +323,49 @@ class _SubmitpaymentrequestionlistsbymodeState
...
@@ -220,38 +323,49 @@ class _SubmitpaymentrequestionlistsbymodeState
textControllerWidget
(
textControllerWidget
(
context
,
context
,
provider
.
reqPurposeController
,
provider
.
reqPurposeController
,
"Request Purpose"
,
"Enter Request Purpose"
,
"Enter Request Purpose"
,
provider
.
updateReqPupose
,
TextInputType
.
text
,
false
,
null
,
provider
.
updateReqPupose
,
TextInputType
.
text
,
false
,
null
,
focusNodes
[
0
],
focusNodes
[
0
],
focusNodes
[
1
],
focusNodes
[
1
],
TextInputAction
.
next
TextInputAction
.
next
,
),
),
],
],
errorWidget
(
context
,
provider
.
reqPurposeError
),
errorWidget
(
context
,
provider
.
reqPurposeError
),
textControllerWidget
(
textControllerWidget
(
context
,
context
,
provider
.
descController
,
provider
.
descController
,
"Description"
,
"Enter Description"
,
"Enter Description"
,
provider
.
updateDescription
,
TextInputType
.
text
,
false
,
null
,
provider
.
updateDescription
,
focusNodes
[
1
],
TextInputType
.
text
,
focusNodes
[
2
],
false
,
TextInputAction
.
next
null
,
focusNodes
[
1
],
focusNodes
[
2
],
TextInputAction
.
next
,
),
),
errorWidget
(
context
,
provider
.
descriptionError
),
errorWidget
(
context
,
provider
.
descriptionError
),
textControllerWidget
(
textControllerWidget
(
context
,
context
,
provider
.
amountController
,
provider
.
amountController
,
"Amount"
,
"Enter Amount"
,
"Enter Amount"
,
provider
.
updateAmount
,
TextInputType
.
numberWithOptions
(),
false
,
provider
.
updateAmount
,
TextInputType
.
numberWithOptions
(),
false
,
null
,
focusNodes
[
2
],
null
,
null
,
focusNodes
[
2
],
TextInputAction
.
done
,
null
,
TextInputAction
.
done
),
),
errorWidget
(
context
,
provider
.
amountError
),
errorWidget
(
context
,
provider
.
amountError
),
TextWidget
(
context
,
"Select Payment Mode"
),
TextWidget
(
context
,
"Select Payment Mode"
),
DropdownButtonHideUnderline
(
DropdownButtonHideUnderline
(
child:
Row
(
child:
Row
(
...
@@ -275,7 +389,8 @@ class _SubmitpaymentrequestionlistsbymodeState
...
@@ -275,7 +389,8 @@ class _SubmitpaymentrequestionlistsbymodeState
style:
const
TextStyle
(
style:
const
TextStyle
(
fontSize:
14
,
fontSize:
14
,
),
),
overflow:
TextOverflow
.
ellipsis
,
overflow:
TextOverflow
.
ellipsis
,
),
),
),
),
)
)
...
@@ -307,7 +422,66 @@ class _SubmitpaymentrequestionlistsbymodeState
...
@@ -307,7 +422,66 @@ class _SubmitpaymentrequestionlistsbymodeState
),
),
),
),
errorWidget
(
context
,
provider
.
selectPaymentError
),
errorWidget
(
context
,
provider
.
selectPaymentError
),
if
(
widget
.
mode
==
"other"
)...[
TextWidget
(
context
,
"Select Approval Employee"
),
DropdownButtonHideUnderline
(
child:
Row
(
children:
[
Expanded
(
child:
DropdownButton2
<
Employees
>(
isExpanded:
true
,
hint:
Text
(
'Select Approval Employee'
,
style:
TextStyle
(
fontSize:
14
),
overflow:
TextOverflow
.
ellipsis
,
),
items:
provider
.
approvalEmployee
.
map
(
(
paymenents
)
=>
DropdownMenuItem
<
Employees
>(
value:
paymenents
,
child:
Text
(
paymenents
.
name
??
''
,
style:
const
TextStyle
(
fontSize:
14
,
),
overflow:
TextOverflow
.
ellipsis
,
),
),
)
.
toList
(),
value:
provider
.
selectedApprovalEmployee
,
onChanged:
(
Employees
?
value
)
{
if
(
value
!=
null
)
{
if
(
provider
.
approvalEmployee
.
isNotEmpty
)
{
provider
.
selectedApprovalEmployee
=
value
;
print
(
"Selected Complaint Type:
${value.name}
, ID:
${value.id}
"
,
);
provider
.
selectedApprovalEmployeeID
=
value
.
id
!;
provider
.
selectedApprovalEmployeeValue
=
value
.
name
!;
print
(
"hfjkshfg"
+
provider
.
paymentModeId
.
toString
(),
);
}
}
},
buttonStyleData:
ddtheme
.
buttonStyleData
,
iconStyleData:
ddtheme
.
iconStyleData
,
menuItemStyleData:
ddtheme
.
menuItemStyleData
,
dropdownStyleData:
ddtheme
.
dropdownStyleData
,
),
),
],
),
),
errorWidget
(
context
,
provider
.
selectPaymentError
),
],
InkResponse
(
InkResponse
(
onTap:
()
{
onTap:
()
{
_showAttachmentSheet
(
context
);
_showAttachmentSheet
(
context
);
...
@@ -335,30 +509,39 @@ class _SubmitpaymentrequestionlistsbymodeState
...
@@ -335,30 +509,39 @@ class _SubmitpaymentrequestionlistsbymodeState
),
),
),
),
),
),
if
(
provider
.
imagePicked
==
1
&&
provider
.
imagePath
!=
null
)...[
if
(
provider
.
imagePicked
==
1
&&
provider
.
imagePath
!=
null
)
...[
Padding
(
Padding
(
padding:
const
EdgeInsets
.
symmetric
(
vertical:
4.0
),
padding:
const
EdgeInsets
.
symmetric
(
vertical:
4.0
),
child:
Row
(
child:
Row
(
mainAxisAlignment:
MainAxisAlignment
.
spaceBetween
,
mainAxisAlignment:
MainAxisAlignment
.
spaceBetween
,
children:
[
children:
[
Text
(
"
${provider.imagePath}
"
,
style:
TextStyle
(
Text
(
"
${provider.imagePath}
"
,
style:
TextStyle
(
color:
AppColors
.
semi_black
,
color:
AppColors
.
semi_black
,
fontSize:
11
,
fontSize:
11
,
fontWeight:
FontWeight
.
w600
fontWeight:
FontWeight
.
w600
,
),),
),
),
InkResponse
(
InkResponse
(
onTap:
()
{
onTap:
()
{
provider
.
imagePicked
=
0
;
provider
.
imagePicked
=
0
;
provider
.
imagePath
=
null
;
provider
.
imagePath
=
null
;
provider
.
imageFilePath
=
null
;
provider
.
imageFilePath
=
null
;
},
},
child:
SvgPicture
.
asset
(
"assets/svg/ic_close.svg"
,
width:
15
,
height:
15
,))
child:
SvgPicture
.
asset
(
"assets/svg/ic_close.svg"
,
width:
15
,
height:
15
,
),
),
],
],
),
),
)
)
,
],
],
errorWidget
(
context
,
provider
.
FileError
),
errorWidget
(
context
,
provider
.
FileError
),
if
([
if
([
"Cheque"
,
"Cheque"
,
"RTGS"
,
"RTGS"
,
...
@@ -368,66 +551,97 @@ class _SubmitpaymentrequestionlistsbymodeState
...
@@ -368,66 +551,97 @@ class _SubmitpaymentrequestionlistsbymodeState
textControllerWidget
(
textControllerWidget
(
context
,
context
,
provider
.
bankNameController
,
provider
.
bankNameController
,
"Bank Name"
,
"Enter Bank Name"
,
"Enter Bank Name"
,
provider
.
updateBankName
,
TextInputType
.
text
,
false
,
null
,
provider
.
updateBankName
,
focusNodes
[
3
],
TextInputType
.
text
,
false
,
null
,
focusNodes
[
3
],
focusNodes
[
4
],
focusNodes
[
4
],
TextInputAction
.
next
TextInputAction
.
next
,
),
),
errorWidget
(
context
,
provider
.
bankNameError
),
errorWidget
(
context
,
provider
.
bankNameError
),
textControllerWidget
(
textControllerWidget
(
context
,
context
,
provider
.
bankBranchController
,
provider
.
bankBranchController
,
"Bank Branch"
,
"Enter Bank Branch"
,
"Enter Bank Branch"
,
provider
.
updateBankBranch
,
TextInputType
.
text
,
false
,
null
,
provider
.
updateBankBranch
,
focusNodes
[
4
],
TextInputType
.
text
,
focusNodes
[
5
],
false
,
TextInputAction
.
next
null
,
focusNodes
[
4
],
focusNodes
[
5
],
TextInputAction
.
next
,
),
),
errorWidget
(
context
,
provider
.
bankBranchError
),
errorWidget
(
context
,
provider
.
bankBranchError
),
textControllerWidget
(
textControllerWidget
(
context
,
context
,
provider
.
bankAccNumberController
,
provider
.
bankAccNumberController
,
"Account Number"
,
"Enter Account Number"
,
"Enter Account Number"
,
provider
.
updateNumber
,
TextInputType
.
number
,
false
,
FilteringTextInputFormatter
.
digitsOnly
,
provider
.
updateNumber
,
focusNodes
[
5
],
TextInputType
.
number
,
focusNodes
[
6
],
false
,
TextInputAction
.
next
FilteringTextInputFormatter
.
digitsOnly
,
focusNodes
[
5
],
focusNodes
[
6
],
TextInputAction
.
next
,
),
),
errorWidget
(
context
,
provider
.
bankNumberError
),
errorWidget
(
context
,
provider
.
bankNumberError
),
textControllerWidget
(
textControllerWidget
(
context
,
context
,
provider
.
bankIfscController
,
provider
.
bankIfscController
,
"Bank IFSC"
,
"Enter Bank IFSC"
,
"Enter Bank IFSC"
,
provider
.
updateIFSC
,
TextInputType
.
text
,
false
,
null
,
provider
.
updateIFSC
,
focusNodes
[
6
],
TextInputType
.
text
,
focusNodes
[
7
],
false
,
TextInputAction
.
next
null
,
focusNodes
[
6
],
focusNodes
[
7
],
TextInputAction
.
next
,
),
),
errorWidget
(
context
,
provider
.
bankIFSCError
),
errorWidget
(
context
,
provider
.
bankIFSCError
),
],
if
([
"Cheque"
,
"RTGS"
,
"IMPS"
,
"NEFT"
,
"UPI"
].
contains
(
provider
.
paymentModeValue
))
...[
textControllerWidget
(
textControllerWidget
(
context
,
context
,
provider
.
bankAcHolderController
,
provider
.
bankAcHolderController
,
"Bank Account Holder Name"
,
"Enter Bank Account Holder Name"
,
"Enter Bank Account Holder Name"
,
provider
.
updateHolder
,
TextInputType
.
text
,
false
,
null
,
provider
.
updateHolder
,
focusNodes
[
7
],
TextInputType
.
text
,
null
,
false
,
TextInputAction
.
done
null
,
focusNodes
[
7
],
null
,
TextInputAction
.
done
,
),
),
errorWidget
(
context
,
provider
.
bankHolderError
),
errorWidget
(
context
,
provider
.
bankHolderError
),
]
else
if
(
provider
.
paymentModeValue
==
"UPI"
)
...[
]
else
if
(
provider
.
paymentModeValue
==
"UPI"
)
...[
textControllerWidget
(
textControllerWidget
(
context
,
context
,
provider
.
bankUpiController
,
provider
.
bankUpiController
,
"UPI ID"
,
"Enter UPI ID"
,
"Enter UPI ID"
,
provider
.
updateUPI
,
TextInputType
.
text
,
false
,
null
,
provider
.
updateUPI
,
focusNodes
[
8
],
TextInputType
.
text
,
false
,
null
,
focusNodes
[
8
],
null
,
null
,
TextInputAction
.
done
TextInputAction
.
done
,
),
),
errorWidget
(
context
,
provider
.
UPIError
),
errorWidget
(
context
,
provider
.
UPIError
),
],
],
...
@@ -439,11 +653,16 @@ class _SubmitpaymentrequestionlistsbymodeState
...
@@ -439,11 +653,16 @@ class _SubmitpaymentrequestionlistsbymodeState
floatingActionButtonLocation:
floatingActionButtonLocation:
FloatingActionButtonLocation
.
centerFloat
,
FloatingActionButtonLocation
.
centerFloat
,
bottomNavigationBar:
InkResponse
(
bottomNavigationBar:
InkResponse
(
onTap:
provider
.
submitClicked
?
null
:
()
{
onTap:
provider
.
submitClicked
=
true
;
provider
.
submitClicked
?
null
:
()
{
provider
.
submitClicked
=
false
;
provider
.
addPaymentRequestionSubmitAPI
(
provider
.
addPaymentRequestionSubmitAPI
(
context
,
context
,
widget
.
mode
,
widget
.
mode
,
provider
.
selectedApprovalEmployeeID
);
);
},
},
child:
Container
(
child:
Container
(
...
@@ -452,17 +671,22 @@ class _SubmitpaymentrequestionlistsbymodeState
...
@@ -452,17 +671,22 @@ class _SubmitpaymentrequestionlistsbymodeState
margin:
EdgeInsets
.
symmetric
(
horizontal:
10
),
margin:
EdgeInsets
.
symmetric
(
horizontal:
10
),
padding:
EdgeInsets
.
symmetric
(
horizontal:
10
,
vertical:
5
),
padding:
EdgeInsets
.
symmetric
(
horizontal:
10
,
vertical:
5
),
decoration:
BoxDecoration
(
decoration:
BoxDecoration
(
color:
AppColors
.
app_blue
,
color:
AppColors
.
app_blue
,
borderRadius:
BorderRadius
.
circular
(
15
),
borderRadius:
BorderRadius
.
circular
(
15
),
),
),
child:
provider
.
submitClicked
?
CircularProgressIndicator
.
adaptive
(
valueColor:
AlwaysStoppedAnimation
(
AppColors
.
white
),):
Text
(
child:
"Submit"
,
provider
.
submitClicked
style:
TextStyle
(
?
CircularProgressIndicator
.
adaptive
(
fontSize:
15
,
valueColor:
AlwaysStoppedAnimation
(
AppColors
.
white
),
fontFamily:
"JakartaMedium"
,
)
color:
Colors
.
white
,
:
Text
(
),
"Submit"
,
),
style:
TextStyle
(
fontSize:
15
,
fontFamily:
"JakartaMedium"
,
color:
Colors
.
white
,
),
),
),
),
),
),
),
),
...
@@ -475,7 +699,6 @@ class _SubmitpaymentrequestionlistsbymodeState
...
@@ -475,7 +699,6 @@ class _SubmitpaymentrequestionlistsbymodeState
);
);
}
}
Future
<
void
>
_showAttachmentSheet
(
BuildContext
context
)
{
Future
<
void
>
_showAttachmentSheet
(
BuildContext
context
)
{
return
showModalBottomSheet
(
return
showModalBottomSheet
(
useSafeArea:
true
,
useSafeArea:
true
,
...
...
lib/screens/genTracker/ComplaintHistory.dart
View file @
2ccf19cc
...
@@ -7,7 +7,8 @@ import '../../Utils/app_colors.dart';
...
@@ -7,7 +7,8 @@ import '../../Utils/app_colors.dart';
import
'../../Utils/commonWidgets.dart'
;
import
'../../Utils/commonWidgets.dart'
;
class
Complainthistory
extends
StatefulWidget
{
class
Complainthistory
extends
StatefulWidget
{
const
Complainthistory
({
super
.
key
});
final
genHashID
;
const
Complainthistory
({
super
.
key
,
required
this
.
genHashID
});
@override
@override
State
<
Complainthistory
>
createState
()
=>
_ComplainthistoryState
();
State
<
Complainthistory
>
createState
()
=>
_ComplainthistoryState
();
...
@@ -24,7 +25,7 @@ class _ComplainthistoryState extends State<Complainthistory> {
...
@@ -24,7 +25,7 @@ class _ComplainthistoryState extends State<Complainthistory> {
listen:
false
,
listen:
false
,
);
);
var
homeProvider
=
Provider
.
of
<
HomescreenNotifier
>(
context
,
listen:
false
);
var
homeProvider
=
Provider
.
of
<
HomescreenNotifier
>(
context
,
listen:
false
);
details
.
LoadgeneratorComplaintHistoryApifunction
(
homeProvider
,
context
,
details
.
gen
ID
);
details
.
LoadgeneratorComplaintHistoryApifunction
(
homeProvider
,
context
,
widget
.
genHash
ID
);
});
});
}
}
...
@@ -54,9 +55,12 @@ class _ComplainthistoryState extends State<Complainthistory> {
...
@@ -54,9 +55,12 @@ class _ComplainthistoryState extends State<Complainthistory> {
return
Column
(
return
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
[
children:
[
Text
(
"
${ provider.complaintList[index].compRegdate}
"
,
style:
TextStyle
(
Padding
(
color:
Color
(
0xFF818181
)
padding:
const
EdgeInsets
.
only
(
left:
5.0
),
),),
child:
Text
(
"
${ provider.complaintList[index].compRegdate}
"
,
style:
TextStyle
(
color:
Color
(
0xFF818181
)
),),
),
Container
(
Container
(
margin:
EdgeInsets
.
symmetric
(
horizontal:
10
,
vertical:
5
),
margin:
EdgeInsets
.
symmetric
(
horizontal:
10
,
vertical:
5
),
decoration:
BoxDecoration
(
decoration:
BoxDecoration
(
...
@@ -83,7 +87,7 @@ class _ComplainthistoryState extends State<Complainthistory> {
...
@@ -83,7 +87,7 @@ class _ComplainthistoryState extends State<Complainthistory> {
];
];
return
Container
(
return
Container
(
padding:
EdgeInsets
.
symmetric
(
horizontal:
15
,
vertical:
15
),
padding:
EdgeInsets
.
symmetric
(
horizontal:
15
,
vertical:
6
),
child:
Row
(
child:
Row
(
children:
[
children:
[
Expanded
(
Expanded
(
...
...
lib/screens/genTracker/GenTrackerDashboard.dart
View file @
2ccf19cc
...
@@ -4,6 +4,7 @@ import 'package:generp/Utils/commonWidgets.dart';
...
@@ -4,6 +4,7 @@ import 'package:generp/Utils/commonWidgets.dart';
import
'package:generp/screens/genTracker/ScanEnterGeneratorIDScreen.dart'
;
import
'package:generp/screens/genTracker/ScanEnterGeneratorIDScreen.dart'
;
import
'../../Utils/app_colors.dart'
;
import
'../../Utils/app_colors.dart'
;
class
Gentrackerdashboard
extends
StatefulWidget
{
class
Gentrackerdashboard
extends
StatefulWidget
{
const
Gentrackerdashboard
({
super
.
key
});
const
Gentrackerdashboard
({
super
.
key
});
...
@@ -14,6 +15,18 @@ class Gentrackerdashboard extends StatefulWidget {
...
@@ -14,6 +15,18 @@ class Gentrackerdashboard extends StatefulWidget {
class
_GentrackerdashboardState
extends
State
<
Gentrackerdashboard
>
{
class
_GentrackerdashboardState
extends
State
<
Gentrackerdashboard
>
{
@override
@override
Widget
build
(
BuildContext
context
)
{
Widget
build
(
BuildContext
context
)
{
final
names
=
[
"Generator Details"
,
// "Register Complaint",
// "Tag Location",
"Tag Generator"
,
];
final
icons
=
[
"gent_gen_det"
,
// "gent_reg_comp",
// "gent_tag_loc",
"gent_tag_den"
,
];
return
WillPopScope
(
return
WillPopScope
(
onWillPop:
()
=>
onBackPressed
(
context
),
onWillPop:
()
=>
onBackPressed
(
context
),
child:
Scaffold
(
child:
Scaffold
(
...
@@ -21,68 +34,106 @@ class _GentrackerdashboardState extends State<Gentrackerdashboard> {
...
@@ -21,68 +34,106 @@ class _GentrackerdashboardState extends State<Gentrackerdashboard> {
backgroundColor:
AppColors
.
scaffold_bg_color
,
backgroundColor:
AppColors
.
scaffold_bg_color
,
appBar:
appbar
(
context
,
"Gen Tracker"
),
appBar:
appbar
(
context
,
"Gen Tracker"
),
body:
SafeArea
(
body:
SafeArea
(
child:
GridView
.
builder
(
child:
Column
(
padding:
EdgeInsets
.
symmetric
(
vertical:
10
,
horizontal:
10
),
children:
[
itemCount:
4
,
Expanded
(
gridDelegate:
SliverGridDelegateWithFixedCrossAxisCount
(
flex:
1
,
crossAxisCount:
2
,
child:
GridView
.
builder
(
crossAxisSpacing:
10
,
padding:
EdgeInsets
.
symmetric
(
vertical:
10
,
horizontal:
10
),
mainAxisSpacing:
10
,
itemCount:
names
.
length
,
),
gridDelegate:
SliverGridDelegateWithFixedCrossAxisCount
(
itemBuilder:
(
context
,
index
)
{
crossAxisCount:
2
,
final
names
=
[
crossAxisSpacing:
10
,
"Generator Details"
,
mainAxisSpacing:
10
,
"Register Complaint"
,
"Tag Location"
,
"Tag Generator"
,
];
final
icons
=
[
"gent_gen_det"
,
"gent_reg_comp"
,
"gent_tag_loc"
,
"gent_tag_den"
,
];
return
InkResponse
(
onTap:
()
{
switch
(
names
[
index
])
{
case
"Generator Details"
:
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
context
)
=>
Scanentergeneratoridscreen
(
from:
"Generator Details"
,)));
break
;
case
"Register Complaint"
:
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
context
)
=>
Scanentergeneratoridscreen
(
from:
"Register Complaint"
,)));
break
;
case
"Tag Location"
:
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
context
)=>
Scanentergeneratoridscreen
(
from:
"Tag Location"
,)));
break
;
case
"Tag Generator"
:
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
context
)=>
Scanentergeneratoridscreen
(
from:
"Tag Generator"
,)));
break
;
default
:
print
(
"111"
);
break
;
}
},
child:
Container
(
decoration:
BoxDecoration
(
color:
Colors
.
white
,
borderRadius:
BorderRadius
.
circular
(
30
),
),
),
child:
Column
(
physics:
NeverScrollableScrollPhysics
(),
crossAxisAlignment:
CrossAxisAlignment
.
center
,
itemBuilder:
(
context
,
index
)
{
mainAxisAlignment:
MainAxisAlignment
.
center
,
return
InkResponse
(
children:
[
onTap:
()
{
SvgPicture
.
asset
(
switch
(
names
[
index
])
{
"assets/svg/
${icons[index]}
.svg"
,
case
"Generator Details"
:
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
context
)
=>
Scanentergeneratoridscreen
(
from:
"Generator Details"
,
),
),
);
break
;
case
"Register Complaint"
:
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
context
)
=>
Scanentergeneratoridscreen
(
from:
"Register Complaint"
,
),
),
);
break
;
case
"Tag Location"
:
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
context
)
=>
Scanentergeneratoridscreen
(
from:
"Tag Location"
,
),
),
);
break
;
case
"Tag Generator"
:
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
context
)
=>
Scanentergeneratoridscreen
(
from:
"Tag Generator"
,
),
),
);
break
;
default
:
print
(
"111"
);
break
;
}
},
child:
Container
(
decoration:
BoxDecoration
(
color:
Colors
.
white
,
borderRadius:
BorderRadius
.
circular
(
30
),
),
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
center
,
mainAxisAlignment:
MainAxisAlignment
.
center
,
children:
[
SvgPicture
.
asset
(
"assets/svg/
${icons[index]}
.svg"
),
SizedBox
(
height:
10
),
Text
(
names
[
index
]),
],
),
),
),
SizedBox
(
height:
10
,),
);
Text
(
names
[
index
]),
},
],
),
),
SizedBox
(
height:
10
),
Expanded
(
flex:
3
,
child:
Padding
(
padding:
const
EdgeInsets
.
all
(
8.0
),
child:
Text
(
"Note: 'Tag Location' and 'Register Complaint' are moved to 'Generator Details'."
,
style:
TextStyle
(
color:
AppColors
.
grey_thick
,
fontSize:
14
),
),
),
),
),
);
),
},
SizedBox
(
height:
10
),
],
),
),
),
),
),
),
...
...
lib/screens/genTracker/GeneratorDetails.dart
View file @
2ccf19cc
...
@@ -10,6 +10,7 @@ import 'package:url_launcher/url_launcher.dart';
...
@@ -10,6 +10,7 @@ import 'package:url_launcher/url_launcher.dart';
import
'../../Notifiers/HomeScreenNotifier.dart'
;
import
'../../Notifiers/HomeScreenNotifier.dart'
;
import
'../../Utils/app_colors.dart'
;
import
'../../Utils/app_colors.dart'
;
import
'../../Utils/commonWidgets.dart'
;
import
'../../Utils/commonWidgets.dart'
;
import
'ScanEnterGeneratorIDScreen.dart'
;
class
Generatordetails
extends
StatefulWidget
{
class
Generatordetails
extends
StatefulWidget
{
final
activityName
;
final
activityName
;
...
@@ -48,55 +49,34 @@ class _GeneratordetailsState extends State<Generatordetails> {
...
@@ -48,55 +49,34 @@ class _GeneratordetailsState extends State<Generatordetails> {
""
,
""
,
widget
.
generatorId
,
widget
.
generatorId
,
);
);
}
else
{
details
.
LoadgeneratorDetailsApifunction
(
homeProvider
,
context
,
""
,
widget
.
generatorId
,
);
}
}
// else {
// details.LoadgeneratorDetailsApifunction(
// homeProvider,
// context,
// "",
// widget.generatorId,
// "3"
// );
// }
});
});
}
}
@override
@override
Widget
build
(
BuildContext
context
)
{
Widget
build
(
BuildContext
context
)
{
return
Consumer
<
Generatordetailsprovider
>(
return
Consumer2
<
Generatordetailsprovider
,
HomescreenNotifier
>(
builder:
(
context
,
provider
,
child
)
{
builder:
(
context
,
provider
,
Homeprovider
,
child
)
{
var
sendwidget
=
Container
(
var
sendwidget
=
SizedBox
(
width:
0
);
padding:
EdgeInsets
.
only
(
right:
10.0
),
child:
InkWell
(
onTap:
()
async
{
if
(
widget
.
genLocation
!=
null
)
{
var
loc
=
widget
.
genLocation
?.
split
(
","
).
toString
();
var
uri
=
Uri
.
parse
(
"google.navigation:q=
${loc![0]}
,
${loc![1]}
&mode=d"
,
);
if
(
Platform
.
isIOS
)
{
uri
=
Uri
.
parse
(
"maps://?q=
${loc![0]}
,
${loc![1]}
&z=10&daddr=
${loc![0]}
,
${loc![1]}
&dirflg=d"
,
);
}
if
(
await
canLaunch
(
uri
.
toString
()))
{
await
launch
(
uri
.
toString
());
}
else
{
throw
'Could not launch
${uri.toString()}
'
;
}
// val intent = Intent(Intent.ACTION_VIEW, Uri.parse(uri))
}
},
child:
SvgPicture
.
asset
(
"assets/svg/directions_ic.svg"
),
),
);
return
WillPopScope
(
return
WillPopScope
(
onWillPop:
()
=>
onBackPressed
(
context
),
onWillPop:
()
=>
onBackPressed
(
context
),
child:
Scaffold
(
child:
Scaffold
(
resizeToAvoidBottomInset:
true
,
resizeToAvoidBottomInset:
true
,
appBar:
appBar:
appbar2
(
widget
.
activityName
==
"NearByGenerators"
context
,
?
appbar2
(
context
,
"Generator Details"
,
provider
.
resetForm
,
sendwidget
)
"Generator Details"
,
:
appbar
(
context
,
"Generator Details"
),
provider
.
resetForm
,
sendwidget
,
),
backgroundColor:
AppColors
.
scaffold_bg_color
,
backgroundColor:
AppColors
.
scaffold_bg_color
,
body:
SafeArea
(
body:
SafeArea
(
child:
Container
(
child:
Container
(
...
@@ -105,15 +85,23 @@ class _GeneratordetailsState extends State<Generatordetails> {
...
@@ -105,15 +85,23 @@ class _GeneratordetailsState extends State<Generatordetails> {
crossAxisAlignment:
CrossAxisAlignment
.
start
,
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
[
children:
[
Container
(
Container
(
padding:
EdgeInsets
.
symmetric
(
horizontal:
10
,
vertical:
5
),
padding:
EdgeInsets
.
symmetric
(
horizontal:
10
,
vertical:
5
,
),
child:
Text
(
child:
Text
(
"Customer Details"
,
"Customer Details"
,
style:
TextStyle
(
color:
Color
(
0xFF818181
),
style:
TextStyle
(
fontFamily:
"JakartaMedium"
),
color:
Color
(
0xFF818181
),
fontFamily:
"JakartaMedium"
,
),
),
),
),
),
Container
(
Container
(
margin:
EdgeInsets
.
symmetric
(
horizontal:
10
,
vertical:
5
),
margin:
EdgeInsets
.
symmetric
(
horizontal:
10
,
vertical:
5
,
),
padding:
EdgeInsets
.
symmetric
(
padding:
EdgeInsets
.
symmetric
(
horizontal:
15
,
horizontal:
15
,
vertical:
10
,
vertical:
10
,
...
@@ -130,73 +118,55 @@ class _GeneratordetailsState extends State<Generatordetails> {
...
@@ -130,73 +118,55 @@ class _GeneratordetailsState extends State<Generatordetails> {
horizontal:
0
,
horizontal:
0
,
),
),
child:
Row
(
child:
Row
(
mainAxisAlignment:
MainAxisAlignment
.
spaceBetween
,
children:
[
children:
[
SvgPicture
.
asset
(
SvgPicture
.
asset
(
"assets/svg/se_block_head.svg"
,
"assets/svg/se_block_head.svg"
,
),
),
SizedBox
(
width:
5
),
SizedBox
(
width:
10
),
Column
(
Expanded
(
crossAxisAlignment:
child:
Column
(
CrossAxisAlignment
.
start
,
crossAxisAlignment:
children:
[
CrossAxisAlignment
.
start
,
SizedBox
(
children:
[
width:
Text
(
MediaQuery
.
of
(
"
${provider.aname}
"
,
context
,
).
size
.
width
*
0.75
,
child:
Text
(
"
${provider.cname}
"
,
maxLines:
2
,
maxLines:
2
,
overflow:
overflow:
TextOverflow
.
ellipsis
,
TextOverflow
.
ellipsis
,
style:
TextStyle
(
style:
TextStyle
(
fontFamily:
"JakartaMedium"
,
fontFamily:
"JakartaMedium"
,
fontSize:
14
fontSize:
14
,
),
),
),
),
),
Text
(
SizedBox
(
"
${provider.cname}
"
,
// height:45,
width:
MediaQuery
.
of
(
context
,
).
size
.
width
*
0.75
,
child:
Text
(
"
${provider.aname}
"
,
maxLines:
2
,
maxLines:
2
,
overflow:
overflow:
TextOverflow
.
ellipsis
,
TextOverflow
.
ellipsis
,
style:
TextStyle
(
style:
TextStyle
(
fontSize:
14
,
fontSize:
14
,
color:
Color
(
color:
Color
(
0xFF818181
),
0xFF818181
,
),
),
),
),
),
)
,
]
,
]
,
)
,
),
),
],
],
),
),
),
),
Column
(
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
List
.
generate
(
3
,
(
j
)
{
children:
List
.
generate
(
4
,
(
j
)
{
final
textheads
=
[
final
textheads
=
[
"Mobile Number"
,
"Mobile Number"
,
"Contact Person Number"
,
"Contact Person Number"
,
"Mail ID"
,
"Mail ID"
,
"Location"
,
];
];
final
textSubheads
=
[
final
textSubheads
=
[
"
${provider.mob1}
"
,
provider
.
mob1
??
"-"
,
"
${provider.mob2}
"
,
provider
.
mob2
??
"-"
,
"
${provider.mail}
"
,
provider
.
mail
??
"-"
,
"View"
,
];
];
return
Container
(
return
Container
(
padding:
EdgeInsets
.
symmetric
(
padding:
EdgeInsets
.
symmetric
(
...
@@ -204,44 +174,133 @@ class _GeneratordetailsState extends State<Generatordetails> {
...
@@ -204,44 +174,133 @@ class _GeneratordetailsState extends State<Generatordetails> {
horizontal:
0
,
horizontal:
0
,
),
),
child:
Row
(
child:
Row
(
children:
[
children:
[
Expanded
(
Expanded
(
flex:
1
,
flex:
1
,
child:
SizedBox
(
child:
SizedBox
(
child:
Text
(
child:
Text
(
textheads
[
j
].
toString
(),
textheads
[
j
].
toString
(),
maxLines:
2
,
maxLines:
2
,
overflow:
overflow:
TextOverflow
.
ellipsis
,
TextOverflow
.
ellipsis
,
style:
TextStyle
(
style:
TextStyle
(
fontFamily:
"JakartaMedium"
,
fontFamily:
"JakartaMedium"
,
fontSize:
14
fontSize:
14
,
),
),
),
),
),
),
),
),
SizedBox
(
width:
5
,),
SizedBox
(
width:
5
),
Expanded
(
if
(
textSubheads
[
j
]
==
"View"
)
...[
flex:
2
,
Expanded
(
child:
SizedBox
(
flex:
2
,
child:
Container
(
child:
Text
(
padding:
EdgeInsets
.
only
(
textSubheads
[
j
],
right:
10.0
,
maxLines:
2
,
),
overflow:
child:
InkWell
(
TextOverflow
.
ellipsis
,
onTap:
()
async
{
style:
TextStyle
(
if
(
widget
.
genLocation
!=
fontSize:
14
,
null
)
{
color:
Color
(
provider
.
genLocationLatLngs
=
0xFF818181
,
widget
.
genLocation
?.
split
(
","
)
.
toString
();
}
else
{
provider
.
genLocationLatLngs
=
provider
.
genLocation
?.
split
(
","
)
.
toString
();
}
var
uri
=
Uri
.
parse
(
"google.navigation:q=
${provider.genLocationLatLngs![0]}
,
${provider.genLocationLatLngs![1]}
&mode=d"
,
);
if
(
Platform
.
isIOS
)
{
uri
=
Uri
.
parse
(
"maps://?q=
${provider.genLocationLatLngs![0]}
,
${provider.genLocationLatLngs![1]}
&z=10&daddr=
${provider.genLocationLatLngs![0]}
,
${provider.genLocationLatLngs![1]}
&dirflg=d"
,
);
}
if
(
await
canLaunch
(
uri
.
toString
(),
))
{
await
launch
(
uri
.
toString
());
}
else
{
throw
'Could not launch
${uri.toString()}
'
;
}
},
child:
Text
(
textSubheads
[
j
],
maxLines:
2
,
overflow:
TextOverflow
.
ellipsis
,
style:
TextStyle
(
fontSize:
14
,
color:
AppColors
.
app_blue
,
decoration:
TextDecoration
.
underline
,
decorationColor:
AppColors
.
app_blue
,
),
),
),
),
),
),
),
),
),
),
]
else
...[
Expanded
(
flex:
2
,
child:
InkResponse
(
onTap:
textheads
[
j
]
!=
"Mobile Number"
?
null
:
()
async
{
final
Uri
phoneUri
=
Uri
(
scheme:
'tel'
,
path:
provider
.
mob1
==
""
?
provider
.
mob2
:
provider
.
mob1
,
);
if
(
await
canLaunchUrl
(
phoneUri
,
))
{
await
launchUrl
(
phoneUri
,
);
}
else
{
throw
'Could not launch
$phoneUri
'
;
}
},
child:
SizedBox
(
child:
Text
(
textSubheads
[
j
]
==
""
?
"-"
:
textSubheads
[
j
],
maxLines:
2
,
overflow:
TextOverflow
.
ellipsis
,
style:
TextStyle
(
fontSize:
14
,
color:
textheads
[
j
]
==
"Mobile Number"
?
AppColors
.
app_blue
:
Color
(
0xFF818181
),
decorationColor:
textheads
[
j
]
==
"Mobile Number"
?
AppColors
.
app_blue
:
null
,
decoration:
textheads
[
j
]
==
"Mobile Number"
?
TextDecoration
.
underline
:
null
,
),
),
),
),
),
],
],
],
),
),
);
);
...
@@ -250,17 +309,25 @@ class _GeneratordetailsState extends State<Generatordetails> {
...
@@ -250,17 +309,25 @@ class _GeneratordetailsState extends State<Generatordetails> {
],
],
),
),
),
),
Container
(
Container
(
padding:
EdgeInsets
.
symmetric
(
horizontal:
10
,
vertical:
5
),
padding:
EdgeInsets
.
symmetric
(
horizontal:
10
,
vertical:
5
,
),
child:
Text
(
child:
Text
(
"Generator Details"
,
"Generator Details"
,
style:
TextStyle
(
color:
Color
(
0xFF818181
),
style:
TextStyle
(
fontFamily:
"JakartaMedium"
),
color:
Color
(
0xFF818181
),
fontFamily:
"JakartaMedium"
,
),
),
),
),
),
Container
(
Container
(
margin:
EdgeInsets
.
symmetric
(
horizontal:
10
,
vertical:
5
),
margin:
EdgeInsets
.
symmetric
(
horizontal:
10
,
vertical:
5
,
),
padding:
EdgeInsets
.
symmetric
(
padding:
EdgeInsets
.
symmetric
(
horizontal:
15
,
horizontal:
15
,
vertical:
10
,
vertical:
10
,
...
@@ -273,19 +340,19 @@ class _GeneratordetailsState extends State<Generatordetails> {
...
@@ -273,19 +340,19 @@ class _GeneratordetailsState extends State<Generatordetails> {
crossAxisAlignment:
CrossAxisAlignment
.
start
,
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
List
.
generate
(
6
,
(
j
)
{
children:
List
.
generate
(
6
,
(
j
)
{
final
textheads
=
[
final
textheads
=
[
"Gen ID"
,
"Engine Number"
,
"Address"
,
"Product Name"
,
"Product Name"
,
"Gen Hash ID"
,
"Engine Number"
,
"Engine Model"
,
"Engine Model"
,
"Address"
,
"Date Of Supply"
,
"Date Of Supply"
,
];
];
final
textSubheads
=
[
final
textSubheads
=
[
"
${provider.genID}
"
,
"
${provider.engineNo}
"
,
"
${provider.address}
"
,
"
${provider.spname}
"
,
"
${provider.spname}
"
,
"
${provider.genHashID}
"
,
"
${provider.engineNo}
"
,
"
${provider.emodel}
"
,
"
${provider.emodel}
"
,
"
${provider.address}
"
,
"
${provider.dateOfEngineSale}
"
,
"
${provider.dateOfEngineSale}
"
,
];
];
return
Container
(
return
Container
(
...
@@ -294,30 +361,31 @@ class _GeneratordetailsState extends State<Generatordetails> {
...
@@ -294,30 +361,31 @@ class _GeneratordetailsState extends State<Generatordetails> {
horizontal:
0
,
horizontal:
0
,
),
),
child:
Row
(
child:
Row
(
crossAxisAlignment:
crossAxisAlignment:
CrossAxisAlignment
.
start
,
CrossAxisAlignment
.
start
,
children:
[
children:
[
Expanded
(
Expanded
(
flex:
1
,
flex:
1
,
child:
Text
(
textheads
[
j
].
toString
(),
style:
TextStyle
(
child:
Text
(
textheads
[
j
].
toString
(),
style:
TextStyle
(
fontSize:
14
,
fontSize:
14
,
fontFamily:
"JakartaMedium"
fontFamily:
"JakartaMedium"
,
),),),
),
SizedBox
(
width:
5
,),
),
),
SizedBox
(
width:
5
),
Expanded
(
Expanded
(
flex:
2
,
flex:
2
,
child:
SizedBox
(
child:
SizedBox
(
child:
Text
(
child:
Text
(
textSubheads
[
j
],
textSubheads
[
j
]
==
""
?
"-"
:
textSubheads
[
j
],
maxLines:
2
,
maxLines:
2
,
overflow:
overflow:
TextOverflow
.
ellipsis
,
TextOverflow
.
ellipsis
,
style:
TextStyle
(
style:
TextStyle
(
fontSize:
14
,
fontSize:
14
,
color:
Color
(
color:
Color
(
0xFF818181
),
0xFF818181
,
),
),
),
),
),
),
),
...
@@ -328,7 +396,127 @@ class _GeneratordetailsState extends State<Generatordetails> {
...
@@ -328,7 +396,127 @@ class _GeneratordetailsState extends State<Generatordetails> {
}),
}),
),
),
),
),
InkWell
(
onTap:
()
{
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
context
)
=>
TagLocationScreen
(
genHashID:
provider
.
genHashID
,
),
),
);
},
child:
Container
(
alignment:
Alignment
.
bottomCenter
,
height:
45
,
decoration:
BoxDecoration
(
color:
Colors
.
white
,
borderRadius:
BorderRadius
.
circular
(
14
),
),
// width: Med1iaQuery.of(context).size.width,
margin:
EdgeInsets
.
symmetric
(
horizontal:
10
,
vertical:
5
,
),
padding:
EdgeInsets
.
symmetric
(
horizontal:
10
,
vertical:
10
,
),
// decoration: BoxDecoration(
// color: AppColors.app_blue,
// borderRadius: BorderRadius.circular(15.0),
// ),
child:
Center
(
child:
Row
(
mainAxisAlignment:
MainAxisAlignment
.
start
,
children:
[
SvgPicture
.
asset
(
"assets/svg/gent_tag_loc.svg"
,
width:
20
,
),
SizedBox
(
width:
10
),
Text
(
"Tag Location"
,
textAlign:
TextAlign
.
center
,
style:
TextStyle
(
fontFamily:
"JakartaMedium"
,
fontSize:
15
,
decoration:
TextDecoration
.
underline
,
decorationColor:
AppColors
.
app_blue
,
color:
AppColors
.
app_blue
,
),
),
],
),
),
),
),
InkWell
(
onTap:
()
{
provider
.
LoadgeneratorDetailsApifunction
(
Homeprovider
,
context
,
"Register Complaint"
,
provider
.
genHashID
,
"2"
,
);
// Navigator.push(
// context,
// MaterialPageRoute(
// builder:
// (context) => Scanentergeneratoridscreen(
// from: "Register Complaint",
// ),
// ),
// );
},
child:
Container
(
alignment:
Alignment
.
bottomCenter
,
height:
45
,
decoration:
BoxDecoration
(
color:
Colors
.
white
,
borderRadius:
BorderRadius
.
circular
(
14
),
),
// width: Med1iaQuery.of(context).size.width,
margin:
EdgeInsets
.
symmetric
(
horizontal:
10
,
vertical:
5
,
),
padding:
EdgeInsets
.
symmetric
(
horizontal:
10
,
vertical:
10
,
),
// decoration: BoxDecoration(
// color: AppColors.app_blue,
// borderRadius: BorderRadius.circular(15.0),
// ),
child:
Center
(
child:
Row
(
mainAxisAlignment:
MainAxisAlignment
.
start
,
children:
[
SvgPicture
.
asset
(
"assets/svg/gent_reg_comp.svg"
,
width:
20
,
),
SizedBox
(
width:
10
),
Text
(
"Register Complaint"
,
textAlign:
TextAlign
.
center
,
style:
TextStyle
(
fontFamily:
"JakartaMedium"
,
fontSize:
15
,
decoration:
TextDecoration
.
underline
,
decorationColor:
AppColors
.
app_blue
,
color:
AppColors
.
app_blue
,
),
),
],
),
),
),
),
SizedBox
(
height:
75
),
SizedBox
(
height:
75
),
],
],
),
),
...
@@ -341,7 +529,11 @@ class _GeneratordetailsState extends State<Generatordetails> {
...
@@ -341,7 +529,11 @@ class _GeneratordetailsState extends State<Generatordetails> {
onTap:
()
{
onTap:
()
{
Navigator
.
push
(
Navigator
.
push
(
context
,
context
,
MaterialPageRoute
(
builder:
(
context
)
=>
Complainthistory
()),
MaterialPageRoute
(
builder:
(
context
)
=>
Complainthistory
(
genHashID:
provider
.
genHashID
),
),
);
);
},
},
child:
Container
(
child:
Container
(
...
@@ -358,9 +550,10 @@ class _GeneratordetailsState extends State<Generatordetails> {
...
@@ -358,9 +550,10 @@ class _GeneratordetailsState extends State<Generatordetails> {
"Complaint History"
,
"Complaint History"
,
textAlign:
TextAlign
.
center
,
textAlign:
TextAlign
.
center
,
style:
TextStyle
(
style:
TextStyle
(
fontFamily:
"JakartaMedium"
,
fontFamily:
"JakartaMedium"
,
fontSize:
15
,
fontSize:
15
,
color:
Colors
.
white
),
color:
Colors
.
white
,
),
),
),
),
),
),
),
...
@@ -374,3 +567,225 @@ class _GeneratordetailsState extends State<Generatordetails> {
...
@@ -374,3 +567,225 @@ class _GeneratordetailsState extends State<Generatordetails> {
);
);
}
}
}
}
class
TagLocationScreen
extends
StatefulWidget
{
final
genHashID
;
const
TagLocationScreen
({
super
.
key
,
required
this
.
genHashID
});
@override
State
<
TagLocationScreen
>
createState
()
=>
_TagLocationScreenState
();
}
class
_TagLocationScreenState
extends
State
<
TagLocationScreen
>
{
@override
void
initState
()
{
// TODO: implement initState
super
.
initState
();
WidgetsBinding
.
instance
.
addPostFrameCallback
((
_
)
{});
}
@override
Widget
build
(
BuildContext
context
)
{
return
Consumer2
<
Generatordetailsprovider
,
HomescreenNotifier
>(
builder:
(
context
,
provider
,
Homeprovider
,
child
)
{
var
sendwidget
=
SizedBox
(
width:
0
);
return
WillPopScope
(
onWillPop:
()
=>
onBackPressed
(
context
),
child:
Scaffold
(
resizeToAvoidBottomInset:
true
,
appBar:
appbar2
(
context
,
"Tag Location"
,
provider
.
resetForm
,
sendwidget
,
),
backgroundColor:
AppColors
.
white
,
body:
SafeArea
(
child:
Padding
(
padding:
EdgeInsets
.
symmetric
(
horizontal:
10
,
vertical:
10
),
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
[
textControllerReadonlyWidget
(
context
,
TextEditingController
(
text:
widget
.
genHashID
),
"Gen ID"
,
(
p0
)
{},
),
SizedBox
(
height:
10
,),
InkResponse
(
onTap:
()
{
_showAttachmentSheet
(
context
);
},
child:
Container
(
margin:
EdgeInsets
.
symmetric
(
vertical:
10
),
height:
45
,
width:
MediaQuery
.
of
(
context
).
size
.
width
,
decoration:
BoxDecoration
(
color:
Color
(
0xFFE6F6FF
),
borderRadius:
BorderRadius
.
circular
(
12
),
border:
Border
.
all
(
color:
AppColors
.
app_blue
,
width:
0.5
,
),
),
child:
Center
(
child:
Text
(
"Add Proof"
,
style:
TextStyle
(
color:
AppColors
.
app_blue
),
),
),
),
),
if
(
provider
.
imagePicked
==
1
&&
provider
.
imagePath
!=
null
)
...[
Padding
(
padding:
const
EdgeInsets
.
symmetric
(
vertical:
4.0
),
child:
Row
(
mainAxisAlignment:
MainAxisAlignment
.
spaceBetween
,
children:
[
Expanded
(
flex:
4
,
child:
Text
(
"
${provider.imagePath}
"
,
overflow:
TextOverflow
.
visible
,
style:
TextStyle
(
color:
AppColors
.
semi_black
,
fontSize:
11
,
fontWeight:
FontWeight
.
w600
,
),
),
),
SizedBox
(
width:
10
,),
Expanded
(
flex:
1
,
child:
InkResponse
(
onTap:
()
{
provider
.
imagePicked
=
0
;
provider
.
imagePath
=
null
;
provider
.
imageFilePath
=
null
;
},
child:
SvgPicture
.
asset
(
"assets/svg/ic_close.svg"
,
width:
15
,
height:
15
,
),
),
),
],
),
),
],
errorWidget
(
context
,
provider
.
imageError
)
],
),
),
),
bottomNavigationBar:
InkWell
(
onTap:
()
{
provider
.
TagLocationAPIFunction
(
Homeprovider
,
context
,
provider
.
genHashID
,
);
},
child:
Container
(
alignment:
Alignment
.
bottomCenter
,
height:
45
,
width:
MediaQuery
.
of
(
context
).
size
.
width
,
margin:
EdgeInsets
.
symmetric
(
horizontal:
10
,
vertical:
10
),
decoration:
BoxDecoration
(
color:
AppColors
.
app_blue
,
borderRadius:
BorderRadius
.
circular
(
15.0
),
),
child:
Center
(
child:
Text
(
"Tag Location"
,
textAlign:
TextAlign
.
center
,
style:
TextStyle
(
fontFamily:
"JakartaMedium"
,
fontSize:
15
,
color:
Colors
.
white
,
),
),
),
),
),
),
);
},
);
}
Future
<
void
>
_showAttachmentSheet
(
BuildContext
context
)
{
return
showModalBottomSheet
(
useSafeArea:
true
,
isDismissible:
true
,
isScrollControlled:
true
,
showDragHandle:
true
,
backgroundColor:
Colors
.
white
,
enableDrag:
true
,
context:
context
,
builder:
(
context
)
{
return
StatefulBuilder
(
builder:
(
context
,
setState
)
{
return
SafeArea
(
child:
Consumer
<
Generatordetailsprovider
>(
builder:
(
context
,
provider
,
child
)
{
return
Padding
(
padding:
EdgeInsets
.
only
(
bottom:
MediaQuery
.
of
(
context
,
).
viewInsets
.
bottom
,
// This handles keyboard
),
child:
Container
(
margin:
EdgeInsets
.
only
(
bottom:
15
,
left:
15
,
right:
15
,
top:
10
,
),
child:
SingleChildScrollView
(
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
mainAxisSize:
MainAxisSize
.
min
,
children:
[
Align
(
alignment:
Alignment
.
center
,
child:
Text
(
"Select Source"
,
style:
TextStyle
(
color:
AppColors
.
app_blue
,
fontSize:
16
,
),
),
),
SizedBox
(
height:
15
),
InkWell
(
onTap:
()
{
Navigator
.
of
(
context
).
pop
(
false
);
provider
.
imgFromCamera
();
},
child:
Container
(
height:
35
,
child:
Text
(
"Capture photo from camera"
),
),
),
],
),
),
),
);
},
),
);
},
);
},
);
}
}
lib/screens/genTracker/ScanEnterGeneratorIDScreen.dart
View file @
2ccf19cc
import
'package:flutter/material.dart'
;
import
'package:flutter/material.dart'
;
import
'package:generp/Notifiers/GeneratorDetailsProvider.dart'
;
import
'package:generp/Notifiers/GeneratorDetailsProvider.dart'
;
import
'package:generp/Utils/commonServices.dart'
;
import
'package:generp/services/api_calling.dart'
;
import
'package:provider/provider.dart'
;
import
'package:provider/provider.dart'
;
import
'package:qr_code_scanner/qr_code_scanner.dart'
;
import
'package:qr_code_scanner/qr_code_scanner.dart'
;
...
@@ -40,6 +42,15 @@ class _ScanentergeneratoridscreenState extends State<Scanentergeneratoridscreen>
...
@@ -40,6 +42,15 @@ class _ScanentergeneratoridscreenState extends State<Scanentergeneratoridscreen>
});
});
}
}
@override
void
dispose
()
{
// TODO: implement dispose
super
.
dispose
();
genIDcontroller
.
clear
();
genIDcontroller
.
dispose
();
}
@override
@override
...
@@ -99,10 +110,12 @@ class _ScanentergeneratoridscreenState extends State<Scanentergeneratoridscreen>
...
@@ -99,10 +110,12 @@ class _ScanentergeneratoridscreenState extends State<Scanentergeneratoridscreen>
),
),
InkResponse
(
InkResponse
(
onTap:
()
async
{
onTap:
()
async
{
provider
.
qrViewController
!.
pauseCamera
();
provider
.
submitLoading
=
false
;
_showgenIdBottomSheet
(
context
);
_showgenIdBottomSheet
(
context
);
},
},
child:
Text
(
child:
Text
(
"Tap to Enter Gen
erator
ID"
,
"Tap to Enter Gen ID"
,
textAlign:
TextAlign
.
center
,
textAlign:
TextAlign
.
center
,
style:
TextStyle
(
fontSize:
18
,
style:
TextStyle
(
fontSize:
18
,
fontFamily:
"JakartaMedium"
,
fontFamily:
"JakartaMedium"
,
...
@@ -158,7 +171,7 @@ class _ScanentergeneratoridscreenState extends State<Scanentergeneratoridscreen>
...
@@ -158,7 +171,7 @@ class _ScanentergeneratoridscreenState extends State<Scanentergeneratoridscreen>
padding:
EdgeInsets
.
symmetric
(
horizontal:
10
,
vertical:
5
),
padding:
EdgeInsets
.
symmetric
(
horizontal:
10
,
vertical:
5
),
alignment:
Alignment
.
topLeft
,
alignment:
Alignment
.
topLeft
,
child:
Text
(
child:
Text
(
"Gen
erator
ID"
,
"Gen ID"
,
style:
TextStyle
(
style:
TextStyle
(
color:
AppColors
.
semi_black
,
color:
AppColors
.
semi_black
,
fontFamily:
"JakartaMedium"
,
fontFamily:
"JakartaMedium"
,
...
@@ -210,36 +223,50 @@ class _ScanentergeneratoridscreenState extends State<Scanentergeneratoridscreen>
...
@@ -210,36 +223,50 @@ class _ScanentergeneratoridscreenState extends State<Scanentergeneratoridscreen>
//contentPadding: EdgeInsets.fromLTRB(5.0, 10.0, 5.0, 10.0),
//contentPadding: EdgeInsets.fromLTRB(5.0, 10.0, 5.0, 10.0),
enabledBorder:
InputBorder
.
none
,
enabledBorder:
InputBorder
.
none
,
focusedBorder:
InputBorder
.
none
,
focusedBorder:
InputBorder
.
none
,
hintText:
'Enter Gen
erator
ID'
,
hintText:
'Enter Gen ID'
,
),
),
),
),
),
),
),
),
SizedBox
(
height:
15
,),
SizedBox
(
height:
15
,),
InkWell
(
InkWell
(
onTap:
()
{
onTap:
provider
.
submitLoading
?
null
:
()
async
{
switch
(
widget
.
from
){
switch
(
widget
.
from
){
case
"Generator Details"
:
case
"Generator Details"
:
provider
.
submitLoading
=
true
;
provider
.
LoadgeneratorDetailsApifunction
(
provider
.
LoadgeneratorDetailsApifunction
(
homeProvider
,
homeProvider
,
context
,
context
,
widget
.
from
,
widget
.
from
,
genIDcontroller
.
text
,
genIDcontroller
.
text
,
"1"
,
);
);
genIDcontroller
.
clear
();
break
;
break
;
case
"Register Complaint"
:
// case "Register Complaint":
provider
.
LoadgeneratorDetailsApifunction
(
// provider.LoadgeneratorDetailsApifunction(
homeProvider
,
// homeProvider,
context
,
// context,
widget
.
from
,
// widget.from,
genIDcontroller
.
text
,
// genIDcontroller.text,
);
// "2"
break
;
// );
case
"Tag Location"
:
// break;
provider
.
TagLocationAPIFunction
(
homeProvider
,
context
,
genIDcontroller
.
text
);
// case "Tag Location":
break
;
// provider.TagLocationAPIFunction(homeProvider, context, genIDcontroller.text);
// break;
case
"Tag Generator"
:
case
"Tag Generator"
:
provider
.
showTagGeneratorBottomSheet
(
context
,
genIDcontroller
.
text
);
provider
.
submitLoading
=
false
;
final
data
=
await
ApiCalling
.
LoadGeneratorDetailsAPI
(
homeProvider
.
empId
,
homeProvider
.
session
,
genIDcontroller
.
text
);
if
(
data
!=
null
){
if
(
data
.
error
==
0
){
provider
.
showTagGeneratorBottomSheet
(
context
,
genIDcontroller
.
text
);
}
else
{
toast
(
context
,
"Enter Correct ID!!"
);
}
}
break
;
break
;
default
:
default
:
...
@@ -261,8 +288,11 @@ class _ScanentergeneratoridscreenState extends State<Scanentergeneratoridscreen>
...
@@ -261,8 +288,11 @@ class _ScanentergeneratoridscreenState extends State<Scanentergeneratoridscreen>
borderRadius:
BorderRadius
.
circular
(
15.0
),
borderRadius:
BorderRadius
.
circular
(
15.0
),
),
),
child:
Center
(
child:
Center
(
child:
Text
(
child:
provider
.
submitLoading
?
CircularProgressIndicator
.
adaptive
(
"Submit"
,
valueColor:
AlwaysStoppedAnimation
(
AppColors
.
white
),
padding:
EdgeInsets
.
all
(
10
),
):
Text
(
"Search"
,
textAlign:
TextAlign
.
center
,
textAlign:
TextAlign
.
center
,
style:
TextStyle
(
color:
Colors
.
white
,
style:
TextStyle
(
color:
Colors
.
white
,
fontFamily:
"JakartaMedium"
,
fontFamily:
"JakartaMedium"
,
...
@@ -283,7 +313,13 @@ class _ScanentergeneratoridscreenState extends State<Scanentergeneratoridscreen>
...
@@ -283,7 +313,13 @@ class _ScanentergeneratoridscreenState extends State<Scanentergeneratoridscreen>
},
},
);
);
},
},
);
).
whenComplete
(()
{
var
provider
=
Provider
.
of
<
Generatordetailsprovider
>(
context
,
listen:
false
,
);
provider
.
qrViewController
!.
resumeCamera
();
},);
}
}
...
...
lib/screens/inventory/GeneratorPartDetailsScreen.dart
View file @
2ccf19cc
import
'package:flutter/material.dart'
;
import
'package:flutter/material.dart'
;
import
'package:generp/screens/finance/FileViewer.dart'
;
import
'package:generp/screens/notifierExports.dart'
;
import
'package:generp/screens/notifierExports.dart'
;
import
'package:generp/Utils/app_colors.dart'
;
import
'package:generp/Utils/app_colors.dart'
;
import
'package:generp/Utils/commonServices.dart'
;
import
'package:generp/Utils/commonServices.dart'
;
...
@@ -49,427 +50,491 @@ class _GeneratorPartDetailsScreenState
...
@@ -49,427 +50,491 @@ class _GeneratorPartDetailsScreenState
@override
@override
Widget
build
(
BuildContext
context
)
{
Widget
build
(
BuildContext
context
)
{
return
Consumer
<
InventoryProvider
>(
return
Consumer
2
<
InventoryProvider
,
HomescreenNotifier
>(
builder:
(
context
,
provider
,
child
)
{
builder:
(
context
,
provider
,
homeProvider
,
child
)
{
return
WillPopScope
(
return
WillPopScope
(
onWillPop:
()
=>
onBackPressed
(
context
),
onWillPop:
()
=>
onBackPressed
(
context
),
child:
Scaffold
(
child:
RefreshIndicator
.
adaptive
(
resizeToAvoidBottomInset:
true
,
onRefresh:
()
async
{
backgroundColor:
AppColors
.
scaffold_bg_color
,
initialiseFunction
(
context
,
homeProvider
);
appBar:
appbar
(
context
,
"Gen Inventory"
),
},
body:
SafeArea
(
child:
Scaffold
(
child:
Container
(
resizeToAvoidBottomInset:
true
,
child:
SingleChildScrollView
(
backgroundColor:
AppColors
.
scaffold_bg_color
,
child:
Column
(
appBar:
appbar
(
context
,
"Gen Inventory"
),
children:
[
body:
SafeArea
(
Container
(
child:
Container
(
margin:
EdgeInsets
.
only
(
top:
15
,
bottom:
15
),
child:
SingleChildScrollView
(
decoration:
BoxDecoration
(
child:
Column
(
color:
Colors
.
white
,
children:
[
borderRadius:
BorderRadius
.
circular
(
16
),
Container
(
),
margin:
EdgeInsets
.
only
(
top:
15
,
bottom:
15
),
child:
Column
(
decoration:
BoxDecoration
(
children:
[
color:
Colors
.
white
,
Container
(
borderRadius:
BorderRadius
.
circular
(
16
),
padding:
EdgeInsets
.
only
(
),
left:
10
,
child:
Column
(
right:
10
,
children:
[
top:
15
,
Container
(
),
padding:
EdgeInsets
.
only
(
child:
Row
(
left:
10
,
children:
[
right:
10
,
Expanded
(
top:
15
,
child:
Text
(
),
"
${provider.partData.prodName}
"
,
child:
Row
(
style:
TextStyle
(
children:
[
color:
AppColors
.
app_blue
,
Expanded
(
fontFamily:
"JakartaMedium"
,
child:
Text
(
"
${provider.partData.prodName}
"
,
style:
TextStyle
(
color:
AppColors
.
app_blue
,
fontFamily:
"JakartaMedium"
,
),
),
),
),
),
),
],
],
),
),
),
Container
(
padding:
EdgeInsets
.
symmetric
(
horizontal:
10
,
vertical:
15
,
),
margin:
EdgeInsets
.
symmetric
(
horizontal:
10
,
vertical:
15
,
),
decoration:
BoxDecoration
(
color:
Color
(
0xFFE6F6FF
),
borderRadius:
BorderRadius
.
circular
(
16
),
),
),
child:
Row
(
Container
(
mainAxisAlignment:
MainAxisAlignment
.
center
,
padding:
EdgeInsets
.
symmetric
(
children:
[
horizontal:
10
,
Expanded
(
vertical:
15
,
child:
SizedBox
(
),
child:
Column
(
margin:
EdgeInsets
.
symmetric
(
crossAxisAlignment:
horizontal:
10
,
CrossAxisAlignment
.
center
,
vertical:
15
,
children:
[
),
RichText
(
decoration:
BoxDecoration
(
text:
TextSpan
(
color:
Color
(
0xFFE6F6FF
),
children:
[
borderRadius:
BorderRadius
.
circular
(
16
),
TextSpan
(
),
text:
child:
Row
(
"
${provider.partData.remainingQuantity}
"
,
mainAxisAlignment:
MainAxisAlignment
.
center
,
style:
TextStyle
(
children:
[
color:
AppColors
.
app_blue
,
Expanded
(
fontSize:
30
,
child:
SizedBox
(
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
center
,
children:
[
RichText
(
text:
TextSpan
(
children:
[
TextSpan
(
text:
"
${provider.partData.remainingQuantity}
"
,
style:
TextStyle
(
color:
AppColors
.
app_blue
,
fontSize:
30
,
),
),
),
)
,
]
,
]
,
)
,
),
),
),
Text
(
Text
(
"Remaining Quantity"
,
"Remaining Quantity"
,
style:
TextStyle
(
style:
TextStyle
(
color:
Color
(
0xFF818181
),
color:
Color
(
0xFF818181
),
),
),
),
)
,
]
,
]
,
)
,
),
),
),
),
),
],
],
),
),
),
Container
(
padding:
EdgeInsets
.
symmetric
(
horizontal:
15
,
vertical:
15
,
),
),
child:
Row
(
Container
(
mainAxisAlignment:
MainAxisAlignment
.
center
,
padding:
EdgeInsets
.
symmetric
(
children:
[
horizontal:
15
,
Expanded
(
vertical:
15
,
child:
InkResponse
(
),
onTap:
()
{
child:
Row
(
_showStockIssueBottomSheet
(
mainAxisAlignment:
MainAxisAlignment
.
center
,
context
,
children:
[
"Issue"
,
Expanded
(
);
child:
InkResponse
(
},
onTap:
()
{
child:
Container
(
_showStockIssueBottomSheet
(
height:
45
,
context
,
decoration:
BoxDecoration
(
"Issue"
,
color:
Color
(
0xFFFFEFEF
),
);
border:
Border
.
all
(
},
color:
Color
(
0xFFED3424
),
child:
Container
(
width:
0.5
,
height:
45
,
),
decoration:
BoxDecoration
(
borderRadius:
BorderRadius
.
circular
(
12
),
color:
Color
(
0xFFFFEFEF
),
),
border:
Border
.
all
(
child:
Center
(
child:
Text
(
"- Issue"
,
style:
TextStyle
(
color:
Color
(
0xFFED3424
),
color:
Color
(
0xFFED3424
),
width:
0.5
,
),
borderRadius:
BorderRadius
.
circular
(
12
,
),
),
child:
Center
(
child:
Text
(
"- Issue"
,
style:
TextStyle
(
color:
Color
(
0xFFED3424
),
),
),
),
),
),
),
),
),
),
),
),
),
SizedBox
(
width:
10
),
SizedBox
(
width:
10
),
Expanded
(
Expanded
(
child:
InkResponse
(
child:
InkResponse
(
onTap:
()
{
onTap:
()
{
_showStockIssueBottomSheet
(
_showStockIssueBottomSheet
(
context
,
context
,
"Recieve"
,
"Recieve"
,
);
);
},
},
child:
Container
(
child:
Container
(
height:
45
,
height:
45
,
decoration:
BoxDecoration
(
decoration:
BoxDecoration
(
color:
Color
(
0xFFE7FFE5
),
color:
Color
(
0xFFE7FFE5
),
border:
Border
.
all
(
border:
Border
.
all
(
color:
Color
(
0xFF0D9C00
),
width:
0.5
,
),
borderRadius:
BorderRadius
.
circular
(
12
),
),
child:
Center
(
child:
Text
(
"+ Recieve"
,
style:
TextStyle
(
color:
Color
(
0xFF0D9C00
),
color:
Color
(
0xFF0D9C00
),
width:
0.5
,
),
borderRadius:
BorderRadius
.
circular
(
12
,
),
),
child:
Center
(
child:
Text
(
"+ Recieve"
,
style:
TextStyle
(
color:
Color
(
0xFF0D9C00
),
),
),
),
),
),
),
),
),
),
),
),
)
,
]
,
]
,
)
,
),
),
),
],
],
),
),
Container
(
alignment:
Alignment
.
topLeft
,
padding:
EdgeInsets
.
symmetric
(
horizontal:
10
),
child:
Text
(
"Product Details"
,
style:
TextStyle
(
color:
Color
(
0xFF818181
),
fontFamily:
"JakartaMedium"
,
),
),
),
),
),
Container
(
Container
(
padding:
EdgeInsets
.
symmetric
(
alignment:
Alignment
.
topLeft
,
horizontal:
10
,
padding:
EdgeInsets
.
symmetric
(
horizontal:
10
),
vertical:
10
,
child:
Text
(
),
"Product Details"
,
margin:
EdgeInsets
.
symmetric
(
style:
TextStyle
(
horizontal:
10
,
color:
Color
(
0xFF818181
),
vertical:
10
,
fontFamily:
"JakartaMedium"
,
),
),
decoration:
BoxDecoration
(
color:
Colors
.
white
,
borderRadius:
BorderRadius
.
circular
(
16
),
),
child:
Column
(
children:
List
.
generate
(
3
,
(
index
)
{
final
headings
=
[
"Product Name"
,
"Product ID"
,
"Project"
,
];
final
values
=
[
provider
.
partData
.
prodName
,
provider
.
partData
.
id
,
provider
.
partData
.
project
,
];
return
Container
(
padding:
EdgeInsets
.
symmetric
(
horizontal:
10
,
vertical:
10
,
),
child:
Row
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
mainAxisAlignment:
MainAxisAlignment
.
start
,
children:
[
Expanded
(
flex:
1
,
child:
Text
(
"
${headings[index]}
"
,
style:
TextStyle
(
fontFamily:
"JakartaMedium"
,
),
),
),
Expanded
(
flex:
2
,
child:
Text
(
"
${values[index]}
"
,
style:
TextStyle
(
color:
Color
(
0xFF818181
)),
),
),
],
),
);
}),
),
),
Container
(
alignment:
Alignment
.
topLeft
,
padding:
EdgeInsets
.
symmetric
(
horizontal:
10
),
child:
Text
(
"Vendor Details"
,
style:
TextStyle
(
fontFamily:
"JakartaMedium"
,
color:
Color
(
0xFF818181
),
),
),
),
),
),
Container
(
Container
(
padding:
EdgeInsets
.
symmetric
(
padding:
EdgeInsets
.
symmetric
(
horizontal:
10
,
horizontal:
10
,
vertical:
10
,
vertical:
10
,
),
),
margin:
EdgeInsets
.
symmetric
(
margin:
EdgeInsets
.
symmetric
(
horizontal:
10
,
horizontal:
10
,
vertical:
10
,
vertical:
10
,
),
),
decoration:
BoxDecoration
(
decoration:
BoxDecoration
(
color:
Colors
.
white
,
color:
Colors
.
white
,
borderRadius:
BorderRadius
.
circular
(
16
),
borderRadius:
BorderRadius
.
circular
(
16
),
),
),
child:
Column
(
child:
Column
(
children:
List
.
generate
(
2
,
(
index
)
{
children:
List
.
generate
(
2
,
(
index
)
{
final
headings
=
[
final
headings
=
[
"Vendor 1"
,
"Vendor 2"
];
"Product Name"
,
// "Product ID",
final
values
=
[
"Project"
,
provider
.
partData
.
vendor1
,
];
provider
.
partData
.
vendor2
,
];
final
values
=
[
return
Container
(
provider
.
partData
.
prodName
,
padding:
EdgeInsets
.
symmetric
(
// provider.partData.id,
horizontal:
10
,
provider
.
partData
.
project
,
vertical:
10
,
];
),
return
Container
(
child:
Row
(
padding:
EdgeInsets
.
symmetric
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
horizontal:
10
,
mainAxisAlignment:
MainAxisAlignment
.
start
,
vertical:
10
,
children:
[
),
Expanded
(
child:
Row
(
flex:
1
,
crossAxisAlignment:
CrossAxisAlignment
.
start
,
child:
Text
(
mainAxisAlignment:
MainAxisAlignment
.
start
,
"
${headings[index]}
"
,
children:
[
style:
TextStyle
(
Expanded
(
fontFamily:
"JakartaMedium"
,
flex:
1
,
child:
Text
(
"
${headings[index]}
"
,
style:
TextStyle
(
fontFamily:
"JakartaMedium"
,
),
),
),
),
),
),
Expanded
(
Expanded
(
flex:
2
,
flex:
2
,
child:
Text
(
child:
Text
(
"
${values[index]}
"
,
"
${values[index]}
"
,
style:
TextStyle
(
style:
TextStyle
(
color:
Color
(
0xFF818181
)),
color:
Color
(
0xFF818181
),
),
),
),
),
),
],
],
),
),
);
);
}),
}),
),
),
Container
(
alignment:
Alignment
.
topLeft
,
padding:
EdgeInsets
.
symmetric
(
horizontal:
10
),
child:
Text
(
"Other Details"
,
style:
TextStyle
(
fontFamily:
"JakartaMedium"
,
color:
Color
(
0xFF818181
),
),
),
),
),
),
Container
(
Container
(
padding:
EdgeInsets
.
symmetric
(
alignment:
Alignment
.
topLeft
,
horizontal:
10
,
padding:
EdgeInsets
.
symmetric
(
horizontal:
10
),
vertical:
10
,
child:
Text
(
),
"Vendor Details"
,
margin:
EdgeInsets
.
symmetric
(
style:
TextStyle
(
horizontal:
10
,
fontFamily:
"JakartaMedium"
,
vertical:
10
,
color:
Color
(
0xFF818181
),
),
),
decoration:
BoxDecoration
(
),
color:
Colors
.
white
,
borderRadius:
BorderRadius
.
circular
(
16
),
),
),
child:
Column
(
Container
(
children:
List
.
generate
(
3
,
(
index
)
{
padding:
EdgeInsets
.
symmetric
(
final
headings
=
[
"Sub Group"
,
"Units"
,
"MSL"
];
horizontal:
10
,
vertical:
10
,
final
values
=
[
),
provider
.
partData
.
subGroup
,
margin:
EdgeInsets
.
symmetric
(
provider
.
partData
.
units
,
horizontal:
10
,
provider
.
partData
.
msl
,
vertical:
10
,
];
),
return
Container
(
decoration:
BoxDecoration
(
padding:
EdgeInsets
.
symmetric
(
color:
Colors
.
white
,
horizontal:
10
,
borderRadius:
BorderRadius
.
circular
(
16
),
vertical:
10
,
),
),
child:
Column
(
child:
Row
(
children:
List
.
generate
(
2
,
(
index
)
{
crossAxisAlignment:
CrossAxisAlignment
.
start
,
final
headings
=
[
"Vendor 1"
,
"Vendor 2"
];
mainAxisAlignment:
MainAxisAlignment
.
start
,
children:
[
final
values
=
[
Expanded
(
provider
.
partData
.
vendor1
,
flex:
1
,
provider
.
partData
.
vendor2
,
child:
Text
(
];
"
${headings[index]}
"
,
return
Container
(
style:
TextStyle
(
padding:
EdgeInsets
.
symmetric
(
fontFamily:
"JakartaMedium"
,
horizontal:
10
,
vertical:
10
,
),
child:
Row
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
mainAxisAlignment:
MainAxisAlignment
.
start
,
children:
[
Expanded
(
flex:
1
,
child:
Text
(
"
${headings[index]}
"
,
style:
TextStyle
(
fontFamily:
"JakartaMedium"
,
),
),
),
),
),
),
Expanded
(
Expanded
(
flex:
2
,
flex:
2
,
child:
Text
(
child:
Text
(
"
${values[index]}
"
,
"
${values[index]}
"
,
style:
TextStyle
(
style:
TextStyle
(
color:
Color
(
0xFF818181
)),
color:
Color
(
0xFF818181
),
),
),
),
),
),
],
],
),
),
);
);
}),
}),
),
),
Container
(
alignment:
Alignment
.
topLeft
,
padding:
EdgeInsets
.
symmetric
(
horizontal:
10
),
child:
Text
(
"Description"
,
style:
TextStyle
(
fontFamily:
"JakartaMedium"
,
color:
Color
(
0xFF818181
),
),
),
),
),
),
Container
(
Container
(
padding:
EdgeInsets
.
symmetric
(
alignment:
Alignment
.
topLeft
,
horizontal:
10
,
padding:
EdgeInsets
.
symmetric
(
horizontal:
10
),
vertical:
10
,
child:
Text
(
),
"Other Details"
,
margin:
EdgeInsets
.
symmetric
(
style:
TextStyle
(
horizontal:
10
,
fontFamily:
"JakartaMedium"
,
vertical:
10
,
color:
Color
(
0xFF818181
),
),
),
decoration:
BoxDecoration
(
),
color:
Colors
.
white
,
borderRadius:
BorderRadius
.
circular
(
16
),
),
),
child:
Container
(
Container
(
padding:
EdgeInsets
.
symmetric
(
padding:
EdgeInsets
.
symmetric
(
horizontal:
10
,
horizontal:
10
,
vertical:
10
,
vertical:
10
,
),
),
child:
Row
(
margin:
EdgeInsets
.
symmetric
(
children:
[
horizontal:
10
,
Expanded
(
vertical:
10
,
child:
SizedBox
(
),
child:
Column
(
decoration:
BoxDecoration
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
color:
Colors
.
white
,
mainAxisAlignment:
MainAxisAlignment
.
start
,
borderRadius:
BorderRadius
.
circular
(
16
),
children:
[
),
Text
(
child:
Column
(
"Description"
,
children:
List
.
generate
(
5
,
(
index
)
{
final
headings
=
[
"Sub Group"
,
"Units"
,
"MSL"
,
"Description"
,
"Image"
,
];
final
values
=
[
provider
.
partData
.
subGroup
,
provider
.
partData
.
units
,
provider
.
partData
.
msl
,
provider
.
partData
.
prodDesc
,
"View"
,
];
if
(
index
==
4
&&
provider
.
partData
.
imageDirFilePath
==
""
){
return
SizedBox
.
shrink
();
}
return
Container
(
padding:
EdgeInsets
.
symmetric
(
horizontal:
10
,
vertical:
10
,
),
child:
Row
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
mainAxisAlignment:
MainAxisAlignment
.
start
,
children:
[
Expanded
(
flex:
1
,
child:
Text
(
"
${headings[index]}
"
,
style:
TextStyle
(
style:
TextStyle
(
fontFamily:
"JakartaMedium"
,
fontFamily:
"JakartaMedium"
,
),
),
),
),
Text
(
),
"
${provider.partData.prodDesc}
"
,
if
(
values
[
index
]
==
"View"
)
...[
style:
TextStyle
(
Expanded
(
color:
Color
(
0xFF818181
),
flex:
2
,
child:
InkResponse
(
onTap:
()
{
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
context
)
=>
Fileviewer
(
fileName:
provider
.
partData
.
imageViewFileName
!,
fileUrl:
provider
.
partData
.
imageDirFilePath
!,
),
),
);
},
child:
Text
(
"
${values[index]}
"
,
style:
TextStyle
(
color:
AppColors
.
app_blue
,
decoration:
TextDecoration
.
underline
,
decorationColor:
AppColors
.
app_blue
,
),
),
),
),
]
else
...[
Expanded
(
flex:
2
,
child:
Text
(
"
${values[index]}
"
,
style:
TextStyle
(
color:
Color
(
0xFF818181
),
),
),
),
),
),
],
],
)
,
]
,
),
),
)
,
)
;
]
,
})
,
),
),
),
),
),
SizedBox
(
height:
150
),
// Container(
],
// alignment: Alignment.topLeft,
// padding: EdgeInsets.symmetric(horizontal: 10),
// child: Text(
// "Description",
// style: TextStyle(
// fontFamily: "JakartaMedium",
// color: Color(0xFF818181),
// ),
// ),
// ),
// Container(
// padding: EdgeInsets.symmetric(
// horizontal: 10,
// vertical: 10,
// ),
// margin: EdgeInsets.symmetric(
// horizontal: 10,
// vertical: 10,
// ),
// decoration: BoxDecoration(
// color: Colors.white,
// borderRadius: BorderRadius.circular(16),
// ),
// child: Container(
// padding: EdgeInsets.symmetric(
// horizontal: 10,
// vertical: 10,
// ),
// child: Row(
// children: [
// Expanded(
// child: SizedBox(
// child: Column(
// crossAxisAlignment: CrossAxisAlignment.start,
// mainAxisAlignment: MainAxisAlignment.start,
// children: [
// Text(
// "Description",
// style: TextStyle(
// fontFamily: "JakartaMedium",
// ),
// ),
// Text(
//
// style: TextStyle(
// color: Color(0xFF818181),
// ),
// ),
// ],
// ),
// ),
// ),
// ],
// ),
// ),
// ),
SizedBox
(
height:
150
),
],
),
),
),
),
),
),
),
...
@@ -560,7 +625,10 @@ class _GeneratorPartDetailsScreenState
...
@@ -560,7 +625,10 @@ class _GeneratorPartDetailsScreenState
),
),
child:
TextField
(
child:
TextField
(
controller:
quantitycontroller
,
controller:
quantitycontroller
,
keyboardType:
TextInputType
.
numberWithOptions
(
decimal:
true
,
signed:
true
),
keyboardType:
TextInputType
.
numberWithOptions
(
decimal:
true
,
signed:
true
,
),
focusNode:
quantityFocusNode
,
focusNode:
quantityFocusNode
,
style:
TextStyle
(
fontSize:
14
),
style:
TextStyle
(
fontSize:
14
),
...
@@ -653,52 +721,26 @@ class _GeneratorPartDetailsScreenState
...
@@ -653,52 +721,26 @@ class _GeneratorPartDetailsScreenState
),
),
),
),
InkWell
(
InkWell
(
onTap:
onTap:
()
{
provider
.
isButtonEnabled
print
(
provider
.
isButtonEnabled
);
?
()
{
if
(
type
==
"Recieve"
)
{
print
(
provider
.
isButtonEnabled
);
provider
.
issuetype
=
"Recieved"
;
if
(
type
==
"Recieve"
)
{
}
else
{
provider
.
issuetype
=
"Recieved"
;
provider
.
issuetype
=
"Issued"
;
}
else
{
}
provider
.
issuetype
=
"Issued"
;
}
provider
.
StockRecieveIssueAPI
(
homeProvider
,
context
,
quantitycontroller
.
text
,
descriptioncontroller
.
text
,
provider
.
partID
,
provider
.
issuetype
,
);
quantitycontroller
.
clear
();
descriptioncontroller
.
clear
();
},
provider
.
StockRecieveIssueAPI
(
homeProvider
,
context
,
quantitycontroller
.
text
,
descriptioncontroller
.
text
,
provider
.
partID
,
provider
.
issuetype
,
);
quantitycontroller
.
clear
();
descriptioncontroller
.
clear
();
}
:
()
{
if
(
quantitycontroller
.
text
.
isEmpty
)
{
toast
(
context
,
"Please Enter Quantity."
,
);
}
else
if
(
descriptioncontroller
.
text
.
isEmpty
)
{
toast
(
context
,
"Please Enter Description."
,
);
}
else
if
(
quantitycontroller
.
text
.
isEmpty
&&
descriptioncontroller
.
text
.
isEmpty
)
{
toast
(
context
,
"Quantity and Description are mandatory."
,
);
}
},
child:
Container
(
child:
Container
(
alignment:
Alignment
.
center
,
alignment:
Alignment
.
center
,
height:
45
,
height:
45
,
...
...
lib/screens/order/addOrder.dart
View file @
2ccf19cc
...
@@ -324,6 +324,7 @@ class _AddorderScreenState extends State<AddorderScreen> {
...
@@ -324,6 +324,7 @@ class _AddorderScreenState extends State<AddorderScreen> {
context
,
context
,
provider
.
billingNameController
,
provider
.
billingNameController
,
"Billing Name"
,
"Billing Name"
,
"Enter Billing Name"
,
provider
.
onChangedBillingName
,
provider
.
onChangedBillingName
,
TextInputType
.
text
,
TextInputType
.
text
,
false
,
false
,
...
@@ -369,7 +370,7 @@ class _AddorderScreenState extends State<AddorderScreen> {
...
@@ -369,7 +370,7 @@ class _AddorderScreenState extends State<AddorderScreen> {
value
!.
name
!;
value
!.
name
!;
if
(
provider
.
billingDistricts
.
isNotEmpty
)
{
if
(
provider
.
billingDistricts
.
isNotEmpty
)
{
provider
.
billingDistricts
.
clear
();
provider
.
billingDistricts
.
clear
();
provider
.
selectedBillingDistricts
=
null
;
//
provider.selectedBillingDistricts
=
null;
provider
.
selectedBillingDistrictId
=
null
;
provider
.
selectedBillingDistrictId
=
null
;
provider
.
selectedBillingDistrictValue
=
""
;
provider
.
selectedBillingDistrictValue
=
""
;
}
}
...
@@ -463,7 +464,7 @@ class _AddorderScreenState extends State<AddorderScreen> {
...
@@ -463,7 +464,7 @@ class _AddorderScreenState extends State<AddorderScreen> {
value
!.
district
!;
value
!.
district
!;
if
(
provider
.
billingSubLocations
.
isNotEmpty
)
{
if
(
provider
.
billingSubLocations
.
isNotEmpty
)
{
provider
.
billingSubLocations
.
clear
();
provider
.
billingSubLocations
.
clear
();
provider
.
selectedBillingSubLocations
=
null
;
//
provider.selectedBillingSubLocations = null;
provider
.
selectedBillingSubLocID
=
null
;
provider
.
selectedBillingSubLocID
=
null
;
provider
.
selectedBillingSubLocValue
=
""
;
provider
.
selectedBillingSubLocValue
=
""
;
}
}
...
@@ -608,6 +609,7 @@ class _AddorderScreenState extends State<AddorderScreen> {
...
@@ -608,6 +609,7 @@ class _AddorderScreenState extends State<AddorderScreen> {
context
,
context
,
provider
.
billingAddressController
,
provider
.
billingAddressController
,
"Billing Address"
,
"Billing Address"
,
"Enter Billing Address"
,
provider
.
onChangedBillingAddress
,
provider
.
onChangedBillingAddress
,
TextInputType
.
text
,
TextInputType
.
text
,
false
,
false
,
...
@@ -622,6 +624,7 @@ class _AddorderScreenState extends State<AddorderScreen> {
...
@@ -622,6 +624,7 @@ class _AddorderScreenState extends State<AddorderScreen> {
context
,
context
,
provider
.
billingPincodeController
,
provider
.
billingPincodeController
,
"Billing Pin code"
,
"Billing Pin code"
,
"Enter Billing Pin code"
,
provider
.
onChangedBillingPincode
,
provider
.
onChangedBillingPincode
,
TextInputType
.
number
,
TextInputType
.
number
,
false
,
false
,
...
@@ -668,7 +671,7 @@ class _AddorderScreenState extends State<AddorderScreen> {
...
@@ -668,7 +671,7 @@ class _AddorderScreenState extends State<AddorderScreen> {
value
!.
name
!;
value
!.
name
!;
if
(
provider
.
dispatchDistricts
.
isNotEmpty
)
{
if
(
provider
.
dispatchDistricts
.
isNotEmpty
)
{
provider
.
dispatchDistricts
.
clear
();
provider
.
dispatchDistricts
.
clear
();
provider
.
selectedDispatchDistricts
=
null
;
//
provider.selectedDispatchDistricts = null;
provider
.
selectedDispatchDistrictId
=
null
;
provider
.
selectedDispatchDistrictId
=
null
;
provider
.
selectedDispatchDistrictValue
=
""
;
provider
.
selectedDispatchDistrictValue
=
""
;
}
}
...
@@ -765,8 +768,7 @@ class _AddorderScreenState extends State<AddorderScreen> {
...
@@ -765,8 +768,7 @@ class _AddorderScreenState extends State<AddorderScreen> {
.
dispatchSubLocations
.
dispatchSubLocations
.
isNotEmpty
)
{
.
isNotEmpty
)
{
provider
.
dispatchSubLocations
.
clear
();
provider
.
dispatchSubLocations
.
clear
();
provider
.
selectedDispatchSubLocations
=
// provider.selectedDispatchSubLocations=null;
null
;
provider
.
selectedDispatchSubLocID
=
null
;
provider
.
selectedDispatchSubLocID
=
null
;
provider
.
selectedDispatchSubLocValue
=
""
;
provider
.
selectedDispatchSubLocValue
=
""
;
}
}
...
@@ -912,6 +914,7 @@ class _AddorderScreenState extends State<AddorderScreen> {
...
@@ -912,6 +914,7 @@ class _AddorderScreenState extends State<AddorderScreen> {
context
,
context
,
provider
.
dispatchAddressController
,
provider
.
dispatchAddressController
,
"Dispatch Address"
,
"Dispatch Address"
,
"Enter Dispatch Address"
,
provider
.
onChangedDispatchAddress
,
provider
.
onChangedDispatchAddress
,
TextInputType
.
text
,
TextInputType
.
text
,
false
,
false
,
...
@@ -926,6 +929,7 @@ class _AddorderScreenState extends State<AddorderScreen> {
...
@@ -926,6 +929,7 @@ class _AddorderScreenState extends State<AddorderScreen> {
context
,
context
,
provider
.
dispatchPincodeController
,
provider
.
dispatchPincodeController
,
"Dispatch Pin code"
,
"Dispatch Pin code"
,
"Enter Dispatch Pin code"
,
provider
.
onChangedDispatchPincode
,
provider
.
onChangedDispatchPincode
,
TextInputType
.
number
,
TextInputType
.
number
,
false
,
false
,
...
@@ -941,6 +945,7 @@ class _AddorderScreenState extends State<AddorderScreen> {
...
@@ -941,6 +945,7 @@ class _AddorderScreenState extends State<AddorderScreen> {
context
,
context
,
provider
.
gstController
,
provider
.
gstController
,
"GST Number"
,
"GST Number"
,
"Enter GST Number"
,
provider
.
onChangedGst
,
provider
.
onChangedGst
,
TextInputType
.
text
,
TextInputType
.
text
,
false
,
false
,
...
@@ -1308,8 +1313,8 @@ class _AddorderScreenState extends State<AddorderScreen> {
...
@@ -1308,8 +1313,8 @@ class _AddorderScreenState extends State<AddorderScreen> {
provider
.
selectedTpcAgentID
provider
.
selectedTpcAgentID
.
toString
(),
.
toString
(),
);
);
provider
.
dropDownSearchController
.
text
=
provider
.
dropDown
Tpc
SearchController
.
text
=
provider
.
accountLis
t
[
index
].
text
!;
provider
.
tpcAgen
t
[
index
].
text
!;
}
}
// provider.ordersAddPaymentSelectOrderAPIFunction(context, provider.selectedAccountID);
// provider.ordersAddPaymentSelectOrderAPIFunction(context, provider.selectedAccountID);
// provider.tpcAgent = [];
// provider.tpcAgent = [];
...
@@ -1335,6 +1340,7 @@ class _AddorderScreenState extends State<AddorderScreen> {
...
@@ -1335,6 +1340,7 @@ class _AddorderScreenState extends State<AddorderScreen> {
context
,
context
,
provider
.
tpcAmountController
,
provider
.
tpcAmountController
,
"TPC Amount"
,
"TPC Amount"
,
"Enter TPC Amount"
,
provider
.
onChangeTpcAmount
,
provider
.
onChangeTpcAmount
,
TextInputType
.
number
,
TextInputType
.
number
,
false
,
false
,
...
@@ -1614,10 +1620,7 @@ class OrderForm extends StatelessWidget {
...
@@ -1614,10 +1620,7 @@ class OrderForm extends StatelessWidget {
),
),
)
)
.
toList
(),
.
toList
(),
value:
value:
provider
.
selectedSaleProductID
[
index
]!=
null
provider
.
saleProducts
.
contains
(
provider
.
selectedSaleProducts
,
)
?
provider
.
saleProducts
.
firstWhere
(
?
provider
.
saleProducts
.
firstWhere
(
(
product
)
=>
(
product
)
=>
product
.
id
==
product
.
id
==
...
@@ -1625,6 +1628,7 @@ class OrderForm extends StatelessWidget {
...
@@ -1625,6 +1628,7 @@ class OrderForm extends StatelessWidget {
.
selectedSaleProductID
[
index
],
.
selectedSaleProductID
[
index
],
)
)
:
null
,
:
null
,
onChanged:
(
SaleProducts
?
value
)
{
onChanged:
(
SaleProducts
?
value
)
{
if
(
value
!=
null
)
{
if
(
value
!=
null
)
{
if
(
provider
if
(
provider
...
@@ -1664,6 +1668,7 @@ class OrderForm extends StatelessWidget {
...
@@ -1664,6 +1668,7 @@ class OrderForm extends StatelessWidget {
context
,
context
,
provider
.
PriceControllers
[
index
],
provider
.
PriceControllers
[
index
],
"Price"
,
"Price"
,
"Enter Price"
,
(
p0
)
{},
(
p0
)
{},
TextInputType
.
number
,
TextInputType
.
number
,
false
,
false
,
...
@@ -1698,6 +1703,7 @@ class OrderForm extends StatelessWidget {
...
@@ -1698,6 +1703,7 @@ class OrderForm extends StatelessWidget {
context
,
context
,
provider
.
QuantityControllers
[
index
],
provider
.
QuantityControllers
[
index
],
"Quantity"
,
"Quantity"
,
"Enter Quantity"
,
(
p0
)
{
(
p0
)
{
provider
.
updateRowCalculations
(
index
);
provider
.
updateRowCalculations
(
index
);
},
},
...
@@ -1737,6 +1743,7 @@ class OrderForm extends StatelessWidget {
...
@@ -1737,6 +1743,7 @@ class OrderForm extends StatelessWidget {
context
,
context
,
provider
.
CGSTControllers
[
index
],
provider
.
CGSTControllers
[
index
],
"CGST %"
,
"CGST %"
,
"Enter CGST %"
,
(
p0
)
{
(
p0
)
{
provider
.
updateRowCalculations
(
index
);
provider
.
updateRowCalculations
(
index
);
},
},
...
@@ -1772,6 +1779,7 @@ class OrderForm extends StatelessWidget {
...
@@ -1772,6 +1779,7 @@ class OrderForm extends StatelessWidget {
context
,
context
,
provider
.
SGSTControllers
[
index
],
provider
.
SGSTControllers
[
index
],
"SGST %"
,
"SGST %"
,
"Enter SGST %"
,
(
p0
)
{
(
p0
)
{
provider
.
updateRowCalculations
(
index
);
provider
.
updateRowCalculations
(
index
);
},
},
...
@@ -1807,6 +1815,7 @@ class OrderForm extends StatelessWidget {
...
@@ -1807,6 +1815,7 @@ class OrderForm extends StatelessWidget {
context
,
context
,
provider
.
IGSTControllers
[
index
],
provider
.
IGSTControllers
[
index
],
"IGST %"
,
"IGST %"
,
"Enter IGST %"
,
(
p0
)
{
(
p0
)
{
provider
.
updateRowCalculations
(
index
);
provider
.
updateRowCalculations
(
index
);
},
},
...
@@ -1842,6 +1851,7 @@ class OrderForm extends StatelessWidget {
...
@@ -1842,6 +1851,7 @@ class OrderForm extends StatelessWidget {
context
,
context
,
provider
.
TaxableValueControllers
[
index
],
provider
.
TaxableValueControllers
[
index
],
"Total Price"
,
"Total Price"
,
"Enter Total Price"
,
(
p0
)
{
(
p0
)
{
provider
.
updateRowCalculations
(
index
);
provider
.
updateRowCalculations
(
index
);
},
},
...
@@ -1885,6 +1895,7 @@ class OrderForm extends StatelessWidget {
...
@@ -1885,6 +1895,7 @@ class OrderForm extends StatelessWidget {
context
,
context
,
provider
.
basicAmountReadOnlyController
,
provider
.
basicAmountReadOnlyController
,
"Basic Amount"
,
"Basic Amount"
,
"Enter Basic Amount"
,
(
p0
)
{},
(
p0
)
{},
TextInputType
.
text
,
TextInputType
.
text
,
true
,
true
,
...
@@ -1897,6 +1908,7 @@ class OrderForm extends StatelessWidget {
...
@@ -1897,6 +1908,7 @@ class OrderForm extends StatelessWidget {
context
,
context
,
provider
.
cgstReadOnlyController
,
provider
.
cgstReadOnlyController
,
"CGST Amount"
,
"CGST Amount"
,
"Enter CGST Amount"
,
(
p0
)
{},
(
p0
)
{},
TextInputType
.
text
,
TextInputType
.
text
,
true
,
true
,
...
@@ -1909,6 +1921,7 @@ class OrderForm extends StatelessWidget {
...
@@ -1909,6 +1921,7 @@ class OrderForm extends StatelessWidget {
context
,
context
,
provider
.
sgstReadOnlyController
,
provider
.
sgstReadOnlyController
,
"SGST Amount"
,
"SGST Amount"
,
"Enter SGST Amount"
,
(
p0
)
{},
(
p0
)
{},
TextInputType
.
text
,
TextInputType
.
text
,
true
,
true
,
...
@@ -1921,6 +1934,7 @@ class OrderForm extends StatelessWidget {
...
@@ -1921,6 +1934,7 @@ class OrderForm extends StatelessWidget {
context
,
context
,
provider
.
igstReadOnlyController
,
provider
.
igstReadOnlyController
,
"IGST Amount"
,
"IGST Amount"
,
"Enter IGST Amount"
,
(
p0
)
{},
(
p0
)
{},
TextInputType
.
text
,
TextInputType
.
text
,
true
,
true
,
...
@@ -1933,6 +1947,7 @@ class OrderForm extends StatelessWidget {
...
@@ -1933,6 +1947,7 @@ class OrderForm extends StatelessWidget {
context
,
context
,
provider
.
totalReadOnlyAmountController
,
provider
.
totalReadOnlyAmountController
,
"Total Amount"
,
"Total Amount"
,
"Enter Total Amount"
,
(
p0
)
{},
(
p0
)
{},
TextInputType
.
text
,
TextInputType
.
text
,
true
,
true
,
...
@@ -1945,6 +1960,7 @@ class OrderForm extends StatelessWidget {
...
@@ -1945,6 +1960,7 @@ class OrderForm extends StatelessWidget {
context
,
context
,
provider
.
noteController
,
provider
.
noteController
,
"Note"
,
"Note"
,
"Enter Note"
,
(
p0
)
{},
(
p0
)
{},
TextInputType
.
text
,
TextInputType
.
text
,
false
,
false
,
...
...
lib/screens/order/addPayment.dart
View file @
2ccf19cc
...
@@ -218,6 +218,7 @@ class _AddpaymentScreenState extends State<AddpaymentScreen> {
...
@@ -218,6 +218,7 @@ class _AddpaymentScreenState extends State<AddpaymentScreen> {
context
,
context
,
provider
.
amountController
,
provider
.
amountController
,
"Amount"
,
"Amount"
,
"Enter Amount"
,
provider
.
onChangeAmount
,
provider
.
onChangeAmount
,
TextInputType
.
number
,
TextInputType
.
number
,
false
,
false
,
...
@@ -393,6 +394,7 @@ class _AddpaymentScreenState extends State<AddpaymentScreen> {
...
@@ -393,6 +394,7 @@ class _AddpaymentScreenState extends State<AddpaymentScreen> {
context
,
context
,
provider
provider
.
orderAmountControllers
[
index
],
.
orderAmountControllers
[
index
],
"Order Amount"
,
"Enter Order Amount"
,
"Enter Order Amount"
,
(
p0
)
{
(
p0
)
{
provider
.
updateAdjustedAmount
();
provider
.
updateAdjustedAmount
();
...
@@ -427,6 +429,7 @@ class _AddpaymentScreenState extends State<AddpaymentScreen> {
...
@@ -427,6 +429,7 @@ class _AddpaymentScreenState extends State<AddpaymentScreen> {
context
,
context
,
provider
.
orderAdjustedAmountController
,
provider
.
orderAdjustedAmountController
,
"Order Adjusted Amount"
,
"Order Adjusted Amount"
,
"Enter Order Adjusted Amount"
,
provider
.
onChangeorderAdjustedAmount
,
provider
.
onChangeorderAdjustedAmount
,
TextInputType
.
number
,
TextInputType
.
number
,
false
,
false
,
...
@@ -597,7 +600,8 @@ class _AddpaymentScreenState extends State<AddpaymentScreen> {
...
@@ -597,7 +600,8 @@ class _AddpaymentScreenState extends State<AddpaymentScreen> {
textControllerWidget
(
textControllerWidget
(
context
,
context
,
provider
.
paymentRefController
,
provider
.
paymentRefController
,
"Payment Reference No. / Cheque No. / UTR No. tf"
,
"Payment Reference No"
,
"Enter Payment Reference No. / Cheque No. / UTR No."
,
provider
.
onChangepaymentRef
,
provider
.
onChangepaymentRef
,
TextInputType
.
text
,
TextInputType
.
text
,
false
,
false
,
...
@@ -626,7 +630,7 @@ class _AddpaymentScreenState extends State<AddpaymentScreen> {
...
@@ -626,7 +630,7 @@ class _AddpaymentScreenState extends State<AddpaymentScreen> {
),
),
child:
Center
(
child:
Center
(
child:
Text
(
child:
Text
(
"Payment
Attachment
"
,
"Payment
Reference
"
,
style:
TextStyle
(
style:
TextStyle
(
fontFamily:
"JakartaMedium"
,
fontFamily:
"JakartaMedium"
,
color:
AppColors
.
app_blue
,
color:
AppColors
.
app_blue
,
...
@@ -672,9 +676,9 @@ class _AddpaymentScreenState extends State<AddpaymentScreen> {
...
@@ -672,9 +676,9 @@ class _AddpaymentScreenState extends State<AddpaymentScreen> {
),
),
floatingActionButtonLocation:
floatingActionButtonLocation:
FloatingActionButtonLocation
.
centerFloat
,
FloatingActionButtonLocation
.
centerFloat
,
bottomNavigationBar:
provider
.
submitClicked
?
null
:
bottomNavigationBar:
InkResponse
(
InkResponse
(
onTap:
()
{
onTap:
provider
.
submitClicked
?
null
:
()
{
provider
.
submitClicked
=
true
;
provider
.
submitClicked
=
true
;
provider
.
selectedOrders
=
provider
.
getFormData
();
provider
.
selectedOrders
=
provider
.
getFormData
();
provider
.
ordersAddPaymentAPISubmitFunction
(
provider
.
ordersAddPaymentAPISubmitFunction
(
...
...
Prev
1
2
3
4
5
Next
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment