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
528df0d2
Commit
528df0d2
authored
May 14, 2025
by
Sai Srinivas
Browse files
14-05-2025 By Sai Srinivas
All UI Adjustments and Font Sizes
parent
fd946558
Changes
74
Hide whitespace changes
Inline
Side-by-side
lib/screens/serviceEngineer/MonthlyCollection.dart
View file @
528df0d2
import
'package:flutter/material.dart'
;
import
'package:flutter_svg/svg.dart'
;
import
'package:generp/Notifiers/PaymentCollectionProvider.dart'
;
import
'package:generp/Utils/commonWidgets.dart'
;
import
'package:generp/screens/WebERPScreen.dart'
;
import
'package:provider/provider.dart'
;
...
...
@@ -32,200 +33,202 @@ class _MonthlycollectionState extends State<Monthlycollection> {
Widget
build
(
BuildContext
context
)
{
return
Consumer
<
Paymentcollectionprovider
>(
builder:
(
context
,
provider
,
child
)
{
return
Scaffold
(
backgroundColor:
AppColors
.
scaffold_bg_color
,
appBar:
AppBar
(
automaticallyImplyLeading:
false
,
elevation:
2.0
,
title:
SizedBox
(
child:
Row
(
mainAxisAlignment:
MainAxisAlignment
.
start
,
crossAxisAlignment:
CrossAxisAlignment
.
center
,
children:
[
InkResponse
(
onTap:
()
=>
Navigator
.
pop
(
context
,
true
),
child:
SvgPicture
.
asset
(
"assets/svg/app_bar_back.svg"
,
height:
25
,
),
),
Text
(
"Payment Collection"
,
style:
TextStyle
(
fontSize:
16
,
height:
1.1
,
color:
AppColors
.
semi_black
,
),
),
Spacer
(),
InkResponse
(
onTap:
()
{
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
context
)
=>
Accountsuggestions
(),
),
);
},
child:
SvgPicture
.
asset
(
"assets/svg/scanner.svg"
),
),
],
),
),
shape:
RoundedRectangleBorder
(
borderRadius:
BorderRadius
.
vertical
(
bottom:
Radius
.
circular
(
30
),
// Adjust the radius as needed
),
),
var
sendWidget
=
InkResponse
(
onTap:
()
async
{
var
res
=
await
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
context
)
=>
Accountsuggestions
()),
);
if
(
res
==
true
){
provider
.
PaymentCollectionAPI
(
context
);
}
},
child:
SvgPicture
.
asset
(
"assets/svg/add_account.svg"
,
width:
20
,
color:
Color
(
0xFF2D2D2D
),
height:
20
,
),
body:
Container
(
child:
ListView
.
builder
(
scrollDirection:
Axis
.
vertical
,
shrinkWrap:
true
,
itemCount:
provider
.
paymenCollectionList
.
length
,
padding:
EdgeInsets
.
symmetric
(
horizontal:
10
,
vertical:
10
),
);
return
WillPopScope
(
onWillPop:
()
=>
onBackPressed
(
context
),
child:
Scaffold
(
resizeToAvoidBottomInset:
true
,
backgroundColor:
AppColors
.
scaffold_bg_color
,
appBar:
appbar2
(
context
,
"Payment Collection"
,
sendWidget
),
body:
provider
.
paymenCollectionList
.
isNotEmpty
?
Container
(
child:
ListView
.
builder
(
scrollDirection:
Axis
.
vertical
,
shrinkWrap:
true
,
physics:
AlwaysScrollableScrollPhysics
(),
itemCount:
provider
.
paymenCollectionList
.
length
,
padding:
EdgeInsets
.
symmetric
(
horizontal:
10
,
vertical:
10
),
itemBuilder:
(
context
,
index
)
{
itemBuilder:
(
context
,
index
)
{
return
Container
(
padding:
EdgeInsets
.
symmetric
(
horizontal:
10
,
vertical:
10
),
margin:
EdgeInsets
.
symmetric
(
vertical:
5
),
decoration:
BoxDecoration
(
color:
Colors
.
white
,
borderRadius:
BorderRadius
.
circular
(
20
),
),
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
[
Row
(
crossAxisAlignment:
CrossAxisAlignment
.
center
,
mainAxisAlignment:
MainAxisAlignment
.
center
,
children:
[
Expanded
(
flex:
1
,
child:
SvgPicture
.
asset
(
"assets/svg/se_block_head.svg"
,
return
Container
(
padding:
EdgeInsets
.
symmetric
(
horizontal:
10
,
vertical:
10
),
margin:
EdgeInsets
.
symmetric
(
vertical:
5
),
decoration:
BoxDecoration
(
color:
Colors
.
white
,
borderRadius:
BorderRadius
.
circular
(
20
),
),
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
[
Row
(
crossAxisAlignment:
CrossAxisAlignment
.
center
,
mainAxisAlignment:
MainAxisAlignment
.
center
,
children:
[
Expanded
(
flex:
1
,
child:
Container
(
padding:
EdgeInsets
.
symmetric
(
horizontal:
10
,
vertical:
10
,
),
decoration:
BoxDecoration
(
color:
Color
(
0xFFE6F6FF
),
borderRadius:
BorderRadius
.
circular
(
8
),
),
child:
SvgPicture
.
asset
(
width:
30
,
height:
30
,
"assets/svg/se_block_head.svg"
,
),
),
),
),
SizedBox
(
width:
5
),
SizedBox
(
width:
10
),
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
[
Text
(
"
${provider.paymenCollectionList[index].accountName}
"
,
Expanded
(
flex:
4
,
child:
SizedBox
(
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
[
Text
(
"
${provider.paymenCollectionList[index].accountName}
"
,
style:
TextStyle
(
fontFamily:
"JakartaMedium"
),
),
Text
(
"₹
${provider.paymenCollectionList[index].amount}
"
,
style:
TextStyle
(
color:
AppColors
.
app_blue
),
),
// Text("Gen Pvt. Ltd"),
],
),
),
),
Container
(
height:
35
,
padding:
EdgeInsets
.
symmetric
(
horizontal:
10
),
decoration:
BoxDecoration
(
color:
Color
(
0xFFE3FFE0
),
borderRadius:
BorderRadius
.
circular
(
8
),
),
child:
Center
(
child:
Text
(
"
${provider.paymenCollectionList[index].approvalStatus}
"
,
style:
TextStyle
(
fontSize:
13
,
color:
Color
(
0xFF0D9C00
)),
),
),
// Text("Gen Pvt. Ltd"),
],
),
Spacer
(),
Expanded
(
flex:
2
,
child:
Text
(
"₹
${provider.paymenCollectionList[index].amount}
"
,
style:
TextStyle
(
color:
AppColors
.
app_blue
),
),
// Expanded(
// flex: 1,
// child: InkResponse(
// onTap: () {
// _showOptionsSheet(context);
// },
// child: Icon(Icons.more_vert),
// ),
// ),
],
),
Padding
(
padding:
const
EdgeInsets
.
all
(
8.0
),
child:
Divider
(
thickness:
0.5
,
color:
Color
(
0xFFD7D7D7
),
),
// Expanded(
// flex: 1,
// child: InkResponse(
// onTap: () {
// _showOptionsSheet(context);
// },
// child: Icon(Icons.more_vert),
// ),
// ),
],
),
SizedBox
(
height:
10
),
...
List
.
generate
(
2
,
(
j
)
{
final
textheads
=
[
"ID"
,
"Generator Type"
];
final
textSubheads
=
[
provider
.
paymenCollectionList
[
index
].
paymentRefNo
,
provider
.
paymenCollectionList
[
index
].
paymentMode
,
];
return
Container
(
padding:
EdgeInsets
.
symmetric
(
vertical:
3
),
child:
Column
(
children:
[
Row
(
mainAxisAlignment:
MainAxisAlignment
.
spaceBetween
,
children:
[
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
[
Text
(
textheads
[
j
].
toString
()),
Text
(
textSubheads
[
j
].
toString
()),
],
),
if
(
j
==
1
)
Container
(
height:
30
,
padding:
EdgeInsets
.
symmetric
(
horizontal:
10
,
),
decoration:
BoxDecoration
(
color:
Color
(
0xFFE3FFE0
),
borderRadius:
BorderRadius
.
circular
(
8
),
),
child:
Center
(
child:
Text
(
"
${provider.paymenCollectionList[index].approvalStatus}
"
,
style:
TextStyle
(
color:
Color
(
0xFF0D9C00
),
),
),
SizedBox
(
height:
5
),
...
List
.
generate
(
2
,
(
j
)
{
final
textheads
=
[
"ID"
,
"Generator Type"
];
final
textSubheads
=
[
provider
.
paymenCollectionList
[
index
].
paymentRefNo
,
provider
.
paymenCollectionList
[
index
].
paymentMode
,
];
return
Container
(
padding:
EdgeInsets
.
symmetric
(
vertical:
3
),
child:
Column
(
children:
[
Row
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
[
Expanded
(
flex:
1
,
child:
Text
(
textheads
[
j
].
toString
(),
style:
TextStyle
(
fontFamily:
"JakartaMedium"
),),
),
SizedBox
(
width:
5
),
Expanded
(
flex:
2
,
child:
Text
(
textSubheads
[
j
].
toString
(),
style:
TextStyle
(
color:
Color
(
0xFF818181
),
),
),
),
],
),
if
(
j
==
0
)
Divider
(
thickness:
0.5
,
color:
Color
(
0xFFD7D7D7
),
],
),
],
),
);
}),
SizedBox
(
height:
10
),
InkResponse
(
onTap:
()
{
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
context
)
=>
WebErpScreen
(
erp_url:
provider
.
paymenCollectionList
[
index
]
.
paymentProofFilePath
??
""
,
),
],
),
);
},
child:
SizedBox
(
child:
Row
(
mainAxisAlignment:
MainAxisAlignment
.
start
,
crossAxisAlignment:
CrossAxisAlignment
.
center
,
children:
[
Text
(
"View Attachment"
,
style:
TextStyle
(
color:
AppColors
.
app_blue
),
}),
SizedBox
(
height:
10
),
InkResponse
(
onTap:
()
{
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
context
)
=>
WebErpScreen
(
erp_url:
provider
.
paymenCollectionList
[
index
]
.
paymentProofFilePath
??
""
,
),
),
SizedBox
(
width:
5
),
SvgPicture
.
asset
(
"assets/svg/next_button.svg"
),
],
);
},
child:
SizedBox
(
child:
Row
(
mainAxisAlignment:
MainAxisAlignment
.
start
,
crossAxisAlignment:
CrossAxisAlignment
.
center
,
children:
[
Text
(
"View Attachment"
,
style:
TextStyle
(
color:
AppColors
.
app_blue
,
fontFamily:
"JakartaMedium"
),
),
SizedBox
(
width:
5
),
SvgPicture
.
asset
(
"assets/svg/next_button.svg"
),
],
),
),
),
)
,
]
,
)
,
);
}
,
),
]
,
)
,
)
;
},
)
,
):
Emptywidget
(
context
),
),
);
},
...
...
lib/screens/serviceEngineer/NearbyGenerators.dart
View file @
528df0d2
...
...
@@ -101,7 +101,8 @@ class _NearbygeneratorsState extends State<Nearbygenerators> {
max:
100
,
divisions:
100
,
label:
provider
.
currentValue
.
toStringAsFixed
(
2
),
inactiveColor:
Colors
.
grey
,
inactiveColor:
Color
(
0xFFD7D7D7
),
activeColor:
AppColors
.
cyan_blue
,
onChanged:
(
value
)
{
provider
.
currentValue
=
value
;
provider
.
debounce
(()
{
...
...
@@ -109,41 +110,49 @@ class _NearbygeneratorsState extends State<Nearbygenerators> {
},
Duration
(
milliseconds:
500
));
},
),
Text
(
'Status'
,
Align
(
alignment:
Alignment
.
centerLeft
,
child:
Text
(
'Status'
,
style:
TextStyle
(
color:
Colors
.
black
,
fontWeight:
FontWeight
.
w500
,
style:
TextStyle
(
fontSize:
18.0
,
fontWeight:
FontWeight
.
w500
,
),
),
),
Container
(
width:
200
,
// Set the desired width here
child:
DropdownButton
<
String
>(
value:
provider
.
selectedItem
,
items:
<
String
>[
'Active'
,
'Inactive'
,
'Suspense'
,
].
map
<
DropdownMenuItem
<
String
>>((
String
value
,)
{
return
DropdownMenuItem
<
String
>(
value:
value
,
child:
Text
(
value
),
);
}).
toList
(),
onChanged:
(
String
?
newValue
)
{
setState
(()
{
provider
.
selectedItem
=
newValue
!;
});
},
icon:
Icon
(
Icons
.
keyboard_arrow_down
,
),
iconSize:
12
,
iconEnabledColor:
Colors
.
black
,
// Remove the default dropdown icon
child:
Row
(
children:
[
Expanded
(
child:
DropdownButton
<
String
>(
value:
provider
.
selectedItem
,
items:
<
String
>[
'Active'
,
'Inactive'
,
'Suspense'
,
].
map
<
DropdownMenuItem
<
String
>>((
String
value
,)
{
return
DropdownMenuItem
<
String
>(
value:
value
,
child:
Text
(
value
),
);
}).
toList
(),
onChanged:
(
String
?
newValue
)
{
setState
(()
{
provider
.
selectedItem
=
newValue
!;
});
},
icon:
Icon
(
Icons
.
keyboard_arrow_down
,
),
iconSize:
12
,
iconEnabledColor:
Colors
.
black
,
// Remove the default dropdown icon
),
),
],
),
),
SizedBox
(
height:
30.0
),
...
...
@@ -199,46 +208,50 @@ class _NearbygeneratorsState extends State<Nearbygenerators> {
child:
Icon
(
Icons
.
filter_alt_outlined
),
));
return
Scaffold
(
appBar:
appbar2
(
context
,
"Nearby Generators"
,
sendWidget
),
backgroundColor:
AppColors
.
scaffold_bg_color
,
body:
Container
(
child:
SingleChildScrollView
(
child:
Column
(
children:
[
ClipRRect
(
// Apply border radius using ClipRRect
borderRadius:
BorderRadius
.
only
(
topLeft:
Radius
.
circular
(
30.0
),
topRight:
Radius
.
circular
(
30.0
),
),
// padding: EdgeInsets.fromLTRB(10, 20, 10, 20),
child:
Container
(
height:
MediaQuery
.
of
(
context
).
size
.
height
,
child:
Stack
(
children:
[
GoogleMap
(
myLocationEnabled:
true
,
zoomGesturesEnabled:
true
,
return
WillPopScope
(
onWillPop:
()
=>
onBackPressed
(
context
),
child:
Scaffold
(
resizeToAvoidBottomInset:
true
,
appBar:
appbar2
(
context
,
"Nearby Generators"
,
sendWidget
),
backgroundColor:
AppColors
.
scaffold_bg_color
,
body:
Container
(
child:
SingleChildScrollView
(
child:
Column
(
children:
[
ClipRRect
(
// Apply border radius using ClipRRect
borderRadius:
BorderRadius
.
only
(
topLeft:
Radius
.
circular
(
30.0
),
topRight:
Radius
.
circular
(
30.0
),
),
// padding: EdgeInsets.fromLTRB(10, 20, 10, 20),
child:
Container
(
height:
MediaQuery
.
of
(
context
).
size
.
height
,
child:
Stack
(
children:
[
GoogleMap
(
myLocationEnabled:
true
,
zoomGesturesEnabled:
true
,
initialCameraPosition:
CameraPosition
(
target:
provider
.
startLocation
,
zoom:
14.0
,
initialCameraPosition:
CameraPosition
(
target:
provider
.
startLocation
,
zoom:
14.0
,
),
markers:
provider
.
markers
.
toSet
(),
mapType:
MapType
.
normal
,
onMapCreated:
(
controller
)
{
setState
(()
{
provider
.
mapController
=
controller
;
});
},
onCameraMove:
(
position
)
{
provider
.
onCameraMove
(
context
,
position
);
},
),
markers:
provider
.
markers
.
toSet
(),
mapType:
MapType
.
normal
,
onMapCreated:
(
controller
)
{
setState
(()
{
provider
.
mapController
=
controller
;
});
},
onCameraMove:
(
position
)
{
provider
.
onCameraMove
(
context
,
position
);
},
),
]),
]),
),
),
)
,
]
,
]
,
)
,
),
),
),
...
...
lib/screens/serviceEngineer/PCWallet.dart
View file @
528df0d2
...
...
@@ -30,258 +30,293 @@ class _PcwalletState extends State<Pcwallet> {
return
Consumer
<
Pcwalletprovider
>(
builder:
(
context
,
provider
,
child
)
{
final
groupedData
=
provider
.
groupByDate
(
provider
.
historyList
);
return
Scaffold
(
appBar:
AppBar
(
automaticallyImplyLeading:
false
,
elevation:
2.0
,
title:
SizedBox
(
child:
Row
(
mainAxisAlignment:
MainAxisAlignment
.
start
,
crossAxisAlignment:
CrossAxisAlignment
.
center
,
children:
[
InkResponse
(
onTap:
()
=>
Navigator
.
pop
(
context
,
true
),
child:
SvgPicture
.
asset
(
"assets/svg/app_bar_back.svg"
,
height:
25
,
return
WillPopScope
(
onWillPop:
()
=>
onBackPressed
(
context
),
child:
Scaffold
(
resizeToAvoidBottomInset:
true
,
appBar:
AppBar
(
automaticallyImplyLeading:
false
,
elevation:
2.0
,
title:
SizedBox
(
child:
Row
(
mainAxisAlignment:
MainAxisAlignment
.
start
,
crossAxisAlignment:
CrossAxisAlignment
.
center
,
children:
[
InkResponse
(
onTap:
()
=>
Navigator
.
pop
(
context
,
true
),
child:
SvgPicture
.
asset
(
"assets/svg/app_bar_back.svg"
,
height:
25
,
),
),
),
Text
(
"P.C. Wallet"
,
style:
TextStyle
(
fontSize:
16
,
height:
1.1
,
color:
AppColors
.
semi_black
,
),
),
Spacer
(),
Container
(
padding:
EdgeInsets
.
symmetric
(
horizontal:
10
),
height:
40
,
decoration:
BoxDecoration
(
color:
Color
(
0xFFF2FAFF
),
borderRadius:
BorderRadius
.
circular
(
16
),
),
child:
Row
(
mainAxisAlignment:
MainAxisAlignment
.
center
,
children:
[
SvgPicture
.
asset
(
'assets/svg/pc_wallet.svg'
,
height:
30
,
),
SizedBox
(
width:
5
),
Text
(
"
${provider.totlDetails.balanceAmount}
"
,
style:
TextStyle
(
fontSize:
14
),
InkResponse
(
onTap:
()
=>
Navigator
.
pop
(
context
,
true
),
child:
Text
(
"P.C. Wallet"
,
style:
TextStyle
(
fontSize:
16
,
height:
1.1
,
fontFamily:
"JakartaSemiBold"
,
color:
AppColors
.
semi_black
,
),
],
),
),
Spacer
(),
Container
(
padding:
EdgeInsets
.
symmetric
(
horizontal:
10
),
height:
40
,
decoration:
BoxDecoration
(
color:
Color
(
0xFFF2FAFF
),
borderRadius:
BorderRadius
.
circular
(
16
),
),
child:
Row
(
mainAxisAlignment:
MainAxisAlignment
.
center
,
children:
[
SvgPicture
.
asset
(
'assets/svg/pc_wallet.svg'
,
height:
30
,
),
SizedBox
(
width:
5
),
Text
(
"
${provider.totlDetails.balanceAmount??"0.00"}
"
,
style:
TextStyle
(
fontSize:
14
),
),
],
),
),
)
,
]
,
]
,
)
,
),
),
shape:
RoundedRectangleBorder
(
borderRadius:
BorderRadius
.
vertical
(
bottom:
Radius
.
circular
(
30
),
// Adjust the radius as needed
shape:
RoundedRectangleBorder
(
borderRadius:
BorderRadius
.
vertical
(
bottom:
Radius
.
circular
(
30
),
// Adjust the radius as needed
),
),
),
)
,
backgroundColor:
AppColors
.
scaffold_bg_color
,
body:
Container
(
child:
SingleChildScrollView
(
child
:
Column
(
children:
[
Container
(
padding:
EdgeInsets
.
symmetric
(
horizontal:
10
,
vertical:
15
),
decoration:
BoxDecoration
(
color:
Colors
.
white
,
borderRadius:
BorderRadius
.
circular
(
16
),
),
child
:
Row
(
children:
[
Expanded
(
child:
Container
(
padding:
EdgeInsets
.
symmetric
(
horizont
al:
15
,
vertical:
15
,
),
decoration:
BoxDecoration
(
color:
Color
(
0xFFE7FFE5
),
borderRadius:
BorderRadius
.
circular
(
16
),
),
child:
Column
(
crossAxisAlignm
en
t
:
CrossAxisAlignment
.
start
,
children:
[
Row
(
crossAxisAlignm
en
t
:
CrossAxisAlignment
.
center
,
children:
[
Text
(
"₹"
,
style:
TextStyle
(
height:
1
,
color:
Color
(
0xFF0D9C00
),
backgroundColor:
AppColors
.
scaffold_bg_color
,
body:
Container
(
child:
SingleChildScrollView
(
child:
Column
(
child
ren:
[
Container
(
padding:
EdgeInsets
.
symmetric
(
horizontal:
10
,
vertical:
15
),
decoration:
BoxDecoration
(
color:
Colors
.
white
,
borderRadius:
BorderRadius
.
circular
(
16
)
,
),
child:
Row
(
child
ren:
[
Expanded
(
child:
Container
(
padding:
EdgeInsets
.
symmetric
(
horizontal:
15
,
vertic
al:
15
,
)
,
decoration:
BoxDecoration
(
color:
Color
(
0xFFE7FFE5
),
borderRadius:
BorderRadius
.
circular
(
16
),
),
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
childr
en:
[
Row
(
crossAxisAlignment:
CrossAxisAlignment
.
center
,
childr
en:
[
Text
(
"₹"
,
style:
TextStyle
(
height:
1
,
color:
Color
(
0xFF0D9C00
)
,
),
),
),
Text
(
"
${provider.totlDetails.creditAmount}
"
,
style:
TextStyle
(
fontSize:
30
,
height:
1
,
color:
Color
(
0xFF0D9C00
),
Text
(
"
${provider.totlDetails.creditAmount??"0.00"}
"
,
style:
TextStyle
(
fontSize:
30
,
height:
1
,
color:
Color
(
0xFF0D9C00
)
,
),
),
),
],
),
Text
(
"Credited"
),
],
],
),
Text
(
"Credited"
,
style:
TextStyle
(
fontFamily:
"JakartaMedium"
),),
],
),
),
),
),
SizedBox
(
width:
10
),
Expanded
(
child:
Container
(
padding:
EdgeInsets
.
symmetric
(
horizont
al:
15
,
vertical:
15
,
),
decoration:
BoxDecoration
(
color:
Color
(
0xFFFFEFEF
),
borderRadius:
BorderRadius
.
circular
(
16
),
),
child:
Column
(
crossAxisAlignm
en
t
:
CrossAxisAlignment
.
start
,
children:
[
Row
(
crossAxisAlignm
en
t
:
CrossAxisAlignment
.
center
,
children:
[
Text
(
"₹"
,
style:
TextStyle
(
height:
1
,
color:
Color
(
0xFFED3424
),
SizedBox
(
width:
10
),
Expanded
(
child:
Container
(
padding:
EdgeInsets
.
symmetric
(
horizontal:
15
,
vertic
al:
15
,
)
,
decoration:
BoxDecoration
(
color:
Color
(
0xFFFFEFEF
),
borderRadius:
BorderRadius
.
circular
(
16
),
),
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
childr
en:
[
Row
(
crossAxisAlignment:
CrossAxisAlignment
.
center
,
childr
en:
[
Text
(
"₹"
,
style:
TextStyle
(
height:
1
,
color:
Color
(
0xFFED3424
)
,
),
),
),
Text
(
"
${provider.totlDetails.debitAmount}
"
,
style:
TextStyle
(
fontSize:
30
,
height:
1
,
color:
Color
(
0xFFED3424
),
Text
(
"
${provider.totlDetails.debitAmount??0.00}
"
,
style:
TextStyle
(
fontSize:
30
,
height:
1
,
color:
Color
(
0xFFED3424
)
,
),
),
),
],
),
Text
(
"Debited"
),
],
],
),
Text
(
"Debited"
,
style:
TextStyle
(
fontFamily:
"JakartaMedium"
)),
],
),
),
),
)
,
]
,
]
,
)
,
),
),
ListView
.
builder
(
physics:
NeverScrollableScrollPhysics
(),
shrinkWrap:
true
,
itemCount:
groupedData
.
keys
.
length
,
itemBuilder:
(
context
,
index
)
{
String
date
=
groupedData
.
keys
.
elementAt
(
index
);
List
<
HistoryList
>
items
=
groupedData
[
date
]!;
ListView
.
builder
(
physics:
NeverScrollableScrollPhysics
(),
shrinkWrap:
true
,
itemCount:
groupedData
.
keys
.
length
,
itemBuilder:
(
context
,
index
)
{
String
date
=
groupedData
.
keys
.
elementAt
(
index
);
List
<
HistoryList
>
items
=
groupedData
[
date
]!;
return
Container
(
padding:
EdgeInsets
.
symmetric
(
vertical:
5
),
margin:
EdgeInsets
.
symmetric
(
horizontal:
10
),
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
[
Container
(
padding:
EdgeInsets
.
only
(
bottom:
5
),
child:
Text
(
date
,
style:
TextStyle
(
fontSize:
14
,
color:
Color
(
0xFF818181
),
return
Container
(
padding:
EdgeInsets
.
symmetric
(
vertical:
5
),
margin:
EdgeInsets
.
symmetric
(
horizontal:
10
),
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
[
Container
(
padding:
EdgeInsets
.
only
(
bottom:
5
),
child:
Text
(
date
,
style:
TextStyle
(
fontSize:
14
,
fontFamily:
"JakartaMedium"
,
color:
Color
(
0xFF818181
),
),
),
),
),
...
items
.
map
((
item
)
{
String
part1
=
item
.
description
!.
split
(
' ('
).
first
;
...
items
.
map
((
item
)
{
String
part1
=
item
.
description
!.
split
(
' ('
).
first
;
RegExp
regExp
=
RegExp
(
r'\(([^)]+)\)'
);
String
?
part2
=
regExp
.
firstMatch
(
item
.
description
!)
?.
group
(
1
);
RegExp
regExp
=
RegExp
(
r'\(([^)]+)\)'
);
String
?
part2
=
regExp
.
firstMatch
(
item
.
description
!)
?.
group
(
1
);
return
Container
(
padding:
EdgeInsets
.
symmetric
(
horizontal:
10
,
vertical:
10
,
),
decoration:
BoxDecoration
(
color:
Colors
.
white
,
borderRadius:
BorderRadius
.
circular
(
16
),
),
child:
Row
(
mainAxisAlignment:
MainAxisAlignment
.
spaceBetween
,
children:
[
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
[
Text
(
part1
),
Text
(
"
${part2}
"
,
style:
TextStyle
(
color:
Color
(
0xFF818181
),
),
),
],
),
RichText
(
text:
TextSpan
(
children:
[
TextSpan
(
text:
item
.
transactionType
==
"Credit"
?
"+"
:
"-"
,
style:
TextStyle
(
color:
item
.
transactionType
==
"Credit"
?
Color
(
0xFF0D9C00
)
:
Color
(
0xFFED3424
),
fontSize:
16
,
fontFamily:
"Lexend"
,
return
Container
(
padding:
EdgeInsets
.
symmetric
(
horizontal:
10
,
vertical:
10
,
),
decoration:
BoxDecoration
(
color:
Colors
.
white
,
borderRadius:
BorderRadius
.
circular
(
16
),
),
child:
Row
(
mainAxisAlignment:
MainAxisAlignment
.
start
,
children:
[
Expanded
(
flex:
1
,
child:
SizedBox
(
child:
item
.
transactionType
==
"Credit"
?
Image
.
asset
(
"assets/images/trans_credit.png"
,
height:
45
,
width:
45
,
fit:
BoxFit
.
contain
,
)
:
Image
.
asset
(
"assets/images/trans_debit.png"
,
height:
45
,
width:
45
,
fit:
BoxFit
.
contain
,
),
),
),
SizedBox
(
width:
10
,),
Expanded
(
flex:
5
,
child:
SizedBox
(
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
[
Text
(
part1
,
style:
TextStyle
(
fontFamily:
"JakartaMedium"
),),
Text
(
"
${part2}
"
,
style:
TextStyle
(
color:
Color
(
0xFF818181
),
),
),
],
),
TextSpan
(
text:
"₹
${item.amount!}
"
,
style:
TextStyle
(
color:
item
.
transactionType
==
"Credit"
?
Color
(
0xFF0D9C00
)
:
Color
(
0xFFED3424
),
fontSize:
16
,
fontFamily:
"Lexend"
,
),
),
Spacer
(),
Expanded
(
flex:
2
,
child:
SizedBox
(
child:
RichText
(
text:
TextSpan
(
children:
[
TextSpan
(
text:
item
.
transactionType
==
"Credit"
?
"+"
:
"-"
,
style:
TextStyle
(
color:
Color
(
0xFF2D2D2D
),
fontSize:
14
,
fontFamily:
"JakartaRegular"
,
),
),
TextSpan
(
text:
"₹
${item.amount!}
"
,
style:
TextStyle
(
color:
Color
(
0xFF2D2D2D
),
fontSize:
14
,
fontFamily:
"JakartaMedium"
,
),
),
],
),
),
]
,
)
,
),
)
,
]
,
)
,
);
}).
toList
()
,
]
,
)
,
);
}
,
)
,
]
,
]
,
)
,
)
;
}).
toList
(),
]
,
)
,
)
;
},
)
,
]
,
)
,
),
),
),
...
...
lib/screens/serviceEngineer/PaymentDetails.dart
View file @
528df0d2
...
...
@@ -58,389 +58,419 @@ class _PaymentdetailsState extends State<Paymentdetails> {
// Debug prints to inspect contactsDropDown and selectContact
debugPrint
(
"contactsDropDown:
${provider.contactsDropDown}
"
);
debugPrint
(
"selectContact:
${provider.selectContact}
"
);
return
Scaffold
(
appBar:
appbar
(
context
,
"Payment Details"
),
backgroundColor:
AppColors
.
scaffold_bg_color
,
body:
Container
(
padding:
EdgeInsets
.
symmetric
(
horizontal:
10
,
vertical:
10
),
margin:
EdgeInsets
.
symmetric
(
horizontal:
10
,
vertical:
10
),
decoration:
BoxDecoration
(
color:
Colors
.
white
,
borderRadius:
BorderRadius
.
circular
(
20
)
),
child:
SingleChildScrollView
(
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
[
Container
(
padding:
EdgeInsets
.
symmetric
(
vertical:
5
),
child:
Text
(
"
${widget.name}
"
,
style:
TextStyle
(
color:
AppColors
.
app_blue
),)),
SizedBox
(
height:
10
,),
Text
(
"Phone Number"
),
DropdownButtonHideUnderline
(
child:
Row
(
children:
[
Expanded
(
child:
DropdownButton2
<
Contacts
>(
isExpanded:
true
,
hint:
const
Row
(
children:
[
Expanded
(
child:
Text
(
'Select Phone Number'
,
style:
TextStyle
(
fontSize:
14
,
),
overflow:
TextOverflow
.
ellipsis
,
),
),
],
),
items:
[
...
provider
.
contactsDropDown
.
map
((
contacts
)
{
return
DropdownMenuItem
<
Contacts
>(
value:
contacts
,
// You can use the entire object, but we need to ensure it's unique
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
[
Text
(
contacts
.
name
??
""
,
maxLines:
1
,
style:
const
TextStyle
(
fontSize:
12
,
),
overflow:
TextOverflow
.
ellipsis
,
),
Text
(
contacts
.
mob1
??
""
,
style:
const
TextStyle
(
fontSize:
12
,
),
overflow:
TextOverflow
.
ellipsis
,
return
WillPopScope
(
onWillPop:
()
=>
onBackPressed
(
context
),
child:
Scaffold
(
resizeToAvoidBottomInset:
true
,
appBar:
appbar
(
context
,
"Payment Details"
),
backgroundColor:
AppColors
.
scaffold_bg_color
,
body:
Container
(
padding:
EdgeInsets
.
symmetric
(
horizontal:
10
,
vertical:
10
),
margin:
EdgeInsets
.
symmetric
(
horizontal:
10
,
vertical:
10
),
decoration:
BoxDecoration
(
color:
Colors
.
white
,
borderRadius:
BorderRadius
.
circular
(
20
)
),
child:
SingleChildScrollView
(
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
[
Container
(
padding:
EdgeInsets
.
symmetric
(
vertical:
5
),
child:
Text
(
"
${widget.name}
"
,
style:
TextStyle
(
fontFamily:
"JakartaMedium"
,
color:
AppColors
.
app_blue
),)),
SizedBox
(
height:
10
,),
Padding
(
padding:
const
EdgeInsets
.
only
(
bottom:
5.0
),
child:
Text
(
"Phone Number"
),
),
DropdownButtonHideUnderline
(
child:
Row
(
children:
[
Expanded
(
child:
DropdownButton2
<
Contacts
>(
isExpanded:
true
,
hint:
const
Row
(
children:
[
Expanded
(
child:
Text
(
'Select Phone Number'
,
style:
TextStyle
(
fontSize:
14
,
),
],
overflow:
TextOverflow
.
ellipsis
,
),
),
);
}).
toList
(),
DropdownMenuItem
<
Contacts
>(
value:
null
,
// No value associated with the button
enabled:
false
,
// To disable selecting this item
child:
InkWell
(
onTap:
()
{
_addContactSheet
(
context
);
},
child:
Container
(
padding:
const
EdgeInsets
.
symmetric
(
vertical:
12
,
horizontal:
14
),
child:
Row
(
mainAxisAlignment:
MainAxisAlignment
],
),
items:
[
...
provider
.
contactsDropDown
.
map
((
contacts
)
{
return
DropdownMenuItem
<
Contacts
>(
value:
contacts
,
// You can use the entire object, but we need to ensure it's unique
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
const
[
children:
[
Text
(
'Add Contact'
,
style:
TextStyle
(
fontSize:
14
,
color:
Colors
.
blue
),
contacts
.
name
??
""
,
maxLines:
1
,
style:
const
TextStyle
(
fontSize:
12
,
),
overflow:
TextOverflow
.
ellipsis
,
),
Text
(
contacts
.
mob1
??
""
,
style:
const
TextStyle
(
fontSize:
12
,
),
overflow:
TextOverflow
.
ellipsis
,
),
],
),
);
}).
toList
(),
DropdownMenuItem
<
Contacts
>(
value:
null
,
// No value associated with the button
enabled:
false
,
// To disable selecting this item
child:
InkWell
(
onTap:
()
{
_addContactSheet
(
context
);
},
child:
Container
(
decoration:
BoxDecoration
(
border:
Border
.
all
(
color:
AppColors
.
app_blue
,
width:
0.5
),
borderRadius:
BorderRadius
.
circular
(
12
)
),
padding:
const
EdgeInsets
.
symmetric
(
vertical:
12
,
horizontal:
14
),
child:
Row
(
mainAxisAlignment:
MainAxisAlignment
.
center
,
children:
const
[
Text
(
'Add Contact'
,
style:
TextStyle
(
fontSize:
14
,
color:
Colors
.
blue
),
),
],
),
),
),
),
)
,
]
,
value:
provider
.
selectContact
,
// The selected value is now the entire 'Contacts' object
onChanged:
(
Contacts
?
value
)
{
if
(
value
!=
null
)
{
if
(
provider
.
contactsDropDown
.
isNotEmpty
)
{
provider
.
select
C
ontact
=
value
;
// Set the selected contact
provider
.
contact
=
value
.
name
??
""
;
// Update the contact name
provider
.
contactID
=
value
.
mob1
??
""
;
// Update the contact ID
debugPrint
(
"Selected Contact:
${value
.name}
, Phone:
${value.mob1}
"
);
]
,
value:
provider
.
selectContact
,
// The selected value is now the entire 'Contacts' object
onChanged:
(
Contacts
?
value
)
{
if
(
value
!=
null
)
{
if
(
provider
.
contactsDropDown
.
isNotEmpty
)
{
provider
.
selectContact
=
value
;
// Set the
select
ed c
ontact
provider
.
contact
=
value
.
name
??
""
;
// Update the contact
name
provider
.
contactID
=
value
.
mob1
??
""
;
// Update the
contact
ID
debugPrint
(
"Selected Contact:
${value
.name}
, Phone:
${value.mob1}
"
);
}
}
}
},
buttonStyleData:
ButtonStyleData
(
height:
5
0
,
width:
160
,
padding:
const
EdgeInsets
.
only
(
left:
14
,
right:
14
),
decoration:
BoxDecoration
(
borderRadius:
BorderRadius
.
circular
(
14
)
,
color:
AppColors
.
text_field_color
,
}
,
buttonStyleData:
ButtonStyleData
(
height:
50
,
width:
16
0
,
padding:
const
EdgeInsets
.
only
(
left:
14
,
right:
14
),
decoration:
BoxDecoration
(
borderRadius:
BorderRadius
.
circular
(
14
),
color:
AppColors
.
text_field_color
,
)
,
),
),
iconStyleData:
const
IconStyleData
(
icon:
Icon
(
Icons
.
keyboard_arrow_down_sharp
,
iconStyleData:
const
IconStyleData
(
icon:
Icon
(
Icons
.
keyboard_arrow_down_sharp
,
),
iconSize:
12
,
iconEnabledColor:
Color
(
0xFF2D2D2D
),
iconDisabledColor:
Colors
.
grey
,
),
iconSize:
12
,
iconEnabledColor:
Color
(
0xFF2D2D2D
),
iconDisabledColor:
Colors
.
grey
,
),
dropdownStyleData:
DropdownStyleData
(
maxHeight:
200
,
width:
280
,
decoration:
BoxDecoration
(
borderRadius:
BorderRadius
.
circular
(
14
),
color:
AppColors
.
text_field_color
,
dropdownStyleData:
DropdownStyleData
(
maxHeight:
200
,
width:
280
,
decoration:
BoxDecoration
(
borderRadius:
BorderRadius
.
circular
(
14
),
color:
AppColors
.
text_field_color
,
),
scrollbarTheme:
ScrollbarThemeData
(
radius:
const
Radius
.
circular
(
15
),
thickness:
MaterialStateProperty
.
all
<
double
>(
6
),
thumbVisibility:
MaterialStateProperty
.
all
<
bool
>(
true
),
),
),
scrollbarTheme:
ScrollbarThemeData
(
radius:
const
Radius
.
circular
(
15
),
thickness:
MaterialStateProperty
.
all
<
double
>(
6
),
thumbVisibility:
MaterialStateProperty
.
all
<
bool
>(
true
),
menuItemStyleData:
const
MenuItemStyleData
(
height:
60
,
padding:
EdgeInsets
.
only
(
left:
14
,
right:
14
),
),
),
menuItemStyleData:
const
MenuItemStyleData
(
height:
60
,
padding:
EdgeInsets
.
only
(
left:
14
,
right:
14
),
),
),
)
,
]
,
]
,
)
,
),
),
SizedBox
(
height:
10
,),
Text
(
"Complaint Type"
),
DropdownButtonHideUnderline
(
child:
Row
(
children:
[
Expanded
(
child:
DropdownButton2
<
PaymentModeList
>(
isExpanded:
true
,
hint:
const
Row
(
children:
[
Expanded
(
child:
Text
(
'Select Complaint Type'
,
style:
TextStyle
(
fontSize:
14
,
SizedBox
(
height:
10
,),
Padding
(
padding:
const
EdgeInsets
.
only
(
bottom:
5.0
),
child:
Text
(
"Complaint Type"
),
),
DropdownButtonHideUnderline
(
child:
Row
(
children:
[
Expanded
(
child:
DropdownButton2
<
PaymentModeList
>(
isExpanded:
true
,
hint:
const
Row
(
children:
[
Expanded
(
child:
Text
(
'Select Complaint Type'
,
style:
TextStyle
(
fontSize:
14
,
),
overflow:
TextOverflow
.
ellipsis
,
),
overflow:
TextOverflow
.
ellipsis
,
),
),
],
),
items:
provider
.
paymentModeDropDown
.
map
((
paymentMode
)
=>
DropdownMenuItem
<
PaymentModeList
>(
value:
paymentMode
,
child:
Text
(
paymentMode
.
name
??
''
,
style:
const
TextStyle
(
fontSize:
14
,
],
),
items:
provider
.
paymentModeDropDown
.
map
((
paymentMode
)
=>
DropdownMenuItem
<
PaymentModeList
>(
value:
paymentMode
,
child:
Text
(
paymentMode
.
name
??
''
,
style:
const
TextStyle
(
fontSize:
14
,
),
overflow:
TextOverflow
.
ellipsis
,
),
overflow:
TextOverflow
.
ellipsis
,
),
))
.
toList
(),
value:
provider
.
selectPaymentMode
,
onChanged:
(
PaymentModeList
?
value
)
{
if
(
value
!=
null
)
{
if
(
provider
.
paymentModeDropDown
.
isNotEmpty
)
{
provider
.
selectPaymentMode
=
value
;
print
(
"Selected Complaint Type:
${value
.name}
, ID:
${value.id}
"
);
provider
.
PaymentMode
=
value
?.
name
;
provider
.
paymentModeID
=
value
?.
id
;
print
(
"hfjkshfg"
+
provider
.
paymentModeID
.
toString
());
))
.
toList
(),
value:
provider
.
selectPaymentMode
,
onChanged:
(
PaymentModeList
?
value
)
{
if
(
value
!=
null
)
{
if
(
provider
.
paymentModeDropDown
.
isNotEmpty
)
{
provider
.
selectPaymentMode
=
value
;
print
(
"Selected Complaint Type:
${value
.name}
, ID:
${value.id}
"
);
provider
.
PaymentMode
=
value
?.
name
;
provider
.
paymentModeID
=
value
?.
id
;
print
(
"hfjkshfg"
+
provider
.
paymentModeID
.
toString
());
}
}
}
},
buttonStyleData:
ButtonStyleData
(
height:
50
,
width:
MediaQuery
.
of
(
context
)
.
size
.
width
,
padding:
const
EdgeInsets
.
only
(
left:
14
,
right:
14
),
decoration:
BoxDecoration
(
borderRadius:
BorderRadius
.
circular
(
14
)
,
color:
AppColors
.
text_field_color
,
}
,
buttonStyleData:
ButtonStyleData
(
height:
50
,
width:
MediaQuery
.
of
(
context
)
.
size
.
width
,
padding:
const
EdgeInsets
.
only
(
left:
14
,
right:
14
),
decoration:
BoxDecoration
(
borderRadius:
BorderRadius
.
circular
(
14
),
color:
AppColors
.
text_field_color
,
)
,
),
),
iconStyleData:
const
IconStyleData
(
icon:
Icon
(
Icons
.
keyboard_arrow_down
,
iconStyleData:
const
IconStyleData
(
icon:
Icon
(
Icons
.
keyboard_arrow_down
,
),
iconSize:
12
,
iconEnabledColor:
Color
(
0xFF2D2D2D
),
iconDisabledColor:
Colors
.
grey
,
),
iconSize:
12
,
iconEnabledColor:
Color
(
0xFF2D2D2D
),
iconDisabledColor:
Colors
.
grey
,
),
dropdownStyleData:
DropdownStyleData
(
maxHeight:
200
,
width:
340
,
decoration:
BoxDecoration
(
borderRadius:
BorderRadius
.
circular
(
14
),
color:
AppColors
.
text_field_color
,
dropdownStyleData:
DropdownStyleData
(
maxHeight:
200
,
width:
340
,
decoration:
BoxDecoration
(
borderRadius:
BorderRadius
.
circular
(
14
),
color:
AppColors
.
text_field_color
,
),
scrollbarTheme:
ScrollbarThemeData
(
radius:
const
Radius
.
circular
(
15
),
thickness:
MaterialStateProperty
.
all
<
double
>(
6
),
thumbVisibility:
MaterialStateProperty
.
all
<
bool
>(
true
),
),
),
scrollbarTheme:
ScrollbarThemeData
(
radius:
const
Radius
.
circular
(
15
),
thickness:
MaterialStateProperty
.
all
<
double
>(
6
),
thumbVisibility:
MaterialStateProperty
.
all
<
bool
>(
true
),
menuItemStyleData:
const
MenuItemStyleData
(
height:
40
,
padding:
EdgeInsets
.
only
(
left:
14
,
right:
14
),
),
),
menuItemStyleData:
const
MenuItemStyleData
(
height:
40
,
padding:
EdgeInsets
.
only
(
left:
14
,
right:
14
),
),
),
)
,
]
,
]
,
)
,
),
),
SizedBox
(
height:
10
,),
Text
(
"Amount"
),
Container
(
height:
50
,
alignment:
Alignment
.
center
,
decoration:
BoxDecoration
(
color:
AppColors
.
text_field_color
,
borderRadius:
BorderRadius
.
circular
(
14
),
SizedBox
(
height:
10
,),
Padding
(
padding:
const
EdgeInsets
.
only
(
bottom:
5.0
),
child:
Text
(
"Amount"
),
),
child:
Padding
(
padding:
const
EdgeInsets
.
fromLTRB
(
10.0
,
0.0
,
10
,
0
),
child:
TextFormField
(
controller:
Amountcontroller
,
keyboardType:
TextInputType
.
text
,
decoration:
InputDecoration
(
hintText:
"Enter Amount"
,
hintStyle:
TextStyle
(
fontWeight:
FontWeight
.
w400
,
color:
Color
(
0xFFB4BEC0
),
fontSize:
14
Container
(
height:
50
,
alignment:
Alignment
.
center
,
decoration:
BoxDecoration
(
color:
AppColors
.
text_field_color
,
borderRadius:
BorderRadius
.
circular
(
14
),
),
child:
Padding
(
padding:
const
EdgeInsets
.
fromLTRB
(
10.0
,
0.0
,
10
,
0
),
child:
TextFormField
(
controller:
Amountcontroller
,
keyboardType:
TextInputType
.
text
,
decoration:
InputDecoration
(
hintText:
"Enter Amount"
,
hintStyle:
TextStyle
(
fontWeight:
FontWeight
.
w400
,
color:
Color
(
0xFFB4BEC0
),
fontSize:
14
),
enabledBorder:
InputBorder
.
none
,
focusedBorder:
InputBorder
.
none
,
),
enabledBorder:
InputBorder
.
none
,
focusedBorder:
InputBorder
.
none
,
),
),
),
),
SizedBox
(
height:
10
,),
Text
(
"Reference Number"
),
Container
(
height:
50
,
alignment:
Alignment
.
center
,
decoration:
BoxDecoration
(
color:
AppColors
.
text_field_color
,
borderRadius:
BorderRadius
.
circular
(
14
),
SizedBox
(
height:
10
,),
Padding
(
padding:
const
EdgeInsets
.
only
(
bottom:
5.0
),
child:
Text
(
"Reference Number"
),
),
child:
Padding
(
padding:
const
EdgeInsets
.
fromLTRB
(
10.0
,
0.0
,
10
,
0
),
child:
TextFormField
(
controller:
Referencecontroller
,
keyboardType:
TextInputType
.
text
,
decoration:
InputDecoration
(
hintText:
"Enter Reference Number"
,
hintStyle:
TextStyle
(
fontWeight:
FontWeight
.
w400
,
color:
Color
(
0xFFB4BEC0
),
fontSize:
14
Container
(
height:
50
,
alignment:
Alignment
.
center
,
decoration:
BoxDecoration
(
color:
AppColors
.
text_field_color
,
borderRadius:
BorderRadius
.
circular
(
14
),
),
child:
Padding
(
padding:
const
EdgeInsets
.
fromLTRB
(
10.0
,
0.0
,
10
,
0
),
child:
TextFormField
(
controller:
Referencecontroller
,
keyboardType:
TextInputType
.
text
,
decoration:
InputDecoration
(
hintText:
"Enter Reference Number"
,
hintStyle:
TextStyle
(
fontWeight:
FontWeight
.
w400
,
color:
Color
(
0xFFB4BEC0
),
fontSize:
14
),
enabledBorder:
InputBorder
.
none
,
focusedBorder:
InputBorder
.
none
,
),
enabledBorder:
InputBorder
.
none
,
focusedBorder:
InputBorder
.
none
,
),
),
),
),
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
(
"Scan Document"
,
style:
TextStyle
(
color:
AppColors
.
app_blue
),),
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
(
"Scan Document"
,
style:
TextStyle
(
fontFamily:
"JakartaMedium"
,
color:
AppColors
.
app_blue
),),
),
),
),
)
,
]
,
]
,
)
,
),
),
),
floatingActionButtonLocation:
FloatingActionButtonLocation
.
centerFloat
,
floatingActionButton:
InkWell
(
onTap:
()
{
provider
.
CheckValidations
(
context
,
Referencecontroller
.
text
,
Amountcontroller
.
text
);
if
(
provider
.
CollectionId
!=
0
)
{
_showOTPSheetSheet
(
context
);
}
},
child:
Container
(
alignment:
Alignment
.
center
,
height:
45
,
margin:
EdgeInsets
.
only
(
left:
5.0
,
right:
5.0
,
top:
5.0
,
bottom:
5.0
,
),
decoration:
BoxDecoration
(
color:
AppColors
.
app_blue
,
//1487C9
borderRadius:
BorderRadius
.
circular
(
30.0
),
),
child:
Center
(
child:
Text
(
"Send OTP"
,
textAlign:
TextAlign
.
center
,
style:
TextStyle
(
color:
Colors
.
white
),
floatingActionButtonLocation:
FloatingActionButtonLocation
.
centerFloat
,
floatingActionButton:
InkWell
(
onTap:
()
{
provider
.
CheckValidations
(
context
,
Referencecontroller
.
text
,
Amountcontroller
.
text
);
if
(
provider
.
CollectionId
!=
0
)
{
_showOTPSheetSheet
(
context
);
}
},
child:
Container
(
alignment:
Alignment
.
center
,
height:
45
,
margin:
EdgeInsets
.
only
(
left:
5.0
,
right:
5.0
,
top:
5.0
,
bottom:
5.0
,
),
decoration:
BoxDecoration
(
color:
AppColors
.
app_blue
,
//1487C9
borderRadius:
BorderRadius
.
circular
(
15.0
),
),
child:
Center
(
child:
Text
(
"Send OTP"
,
textAlign:
TextAlign
.
center
,
style:
TextStyle
(
fontSize:
15
,
fontFamily:
"JakartaMedium"
,
color:
Colors
.
white
),
),
),
),
),
...
...
lib/screens/serviceEngineer/PendingComplaints.dart
View file @
528df0d2
...
...
@@ -4,6 +4,7 @@ import 'package:generp/Notifiers/PendingComplaintsProvider.dart';
import
'package:generp/Utils/commonWidgets.dart'
;
import
'package:generp/screens/serviceEngineer/PaymentDetails.dart'
;
import
'package:generp/screens/serviceEngineer/VisitDetails.dart'
;
import
'package:generp/screens/serviceEngineer/scanComplaintDetails.dart'
;
import
'package:provider/provider.dart'
;
import
'package:url_launcher/url_launcher.dart'
;
import
'../../Utils/app_colors.dart'
;
...
...
@@ -36,176 +37,206 @@ class _PendingcomplaintsState extends State<Pendingcomplaints> {
Widget
build
(
BuildContext
context
)
{
return
Consumer
<
Pendingcomplaintsprovider
>(
builder:
(
context
,
provider
,
child
)
{
return
Scaffold
(
backgroundColor:
AppColors
.
scaffold_bg_color
,
appBar:
AppBar
(
automaticallyImplyLeading:
false
,
elevation:
2.0
,
title:
SizedBox
(
child:
Row
(
mainAxisAlignment:
MainAxisAlignment
.
start
,
crossAxisAlignment:
CrossAxisAlignment
.
center
,
children:
[
InkResponse
(
onTap:
()
=>
Navigator
.
pop
(
context
,
true
),
child:
SvgPicture
.
asset
(
"assets/svg/app_bar_back.svg"
,
height:
25
,
return
WillPopScope
(
onWillPop:
()
=>
onBackPressed
(
context
),
child:
Scaffold
(
resizeToAvoidBottomInset:
true
,
backgroundColor:
AppColors
.
scaffold_bg_color
,
appBar:
appbar2
(
context
,
"Pending Complaints"
,
InkResponse
(
onTap:
()
{
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
context
)
=>
Scancomplaintdetails
(),
),
),
Text
(
"Pending Complaints"
,
style:
TextStyle
(
fontSize:
16
,
height:
1.1
,
color:
AppColors
.
semi_black
,
),
),
Spacer
(),
SvgPicture
.
asset
(
"assets/svg/scanner.svg"
),
],
),
),
shape:
RoundedRectangleBorder
(
borderRadius:
BorderRadius
.
vertical
(
bottom:
Radius
.
circular
(
30
),
// Adjust the radius as needed
);
},
child:
SvgPicture
.
asset
(
"assets/svg/scanner.svg"
),
),
),
),
body:
Container
(
child:
ListView
.
builder
(
scrollDirection:
Axis
.
vertical
,
shrinkWrap:
true
,
itemCount:
provider
.
technician_complaint_list
.
length
,
padding:
EdgeInsets
.
symmetric
(
horizontal:
10
,
vertical:
10
),
body:
provider
.
technician_complaint_list
.
isNotEmpty
?
Container
(
child:
ListView
.
builder
(
scrollDirection:
Axis
.
vertical
,
shrinkWrap:
true
,
itemCount:
provider
.
technician_complaint_list
.
length
,
padding:
EdgeInsets
.
symmetric
(
horizontal:
10
,
vertical:
10
,
),
itemBuilder:
(
context
,
index
)
{
return
Container
(
padding:
EdgeInsets
.
symmetric
(
horizontal:
10
,
vertical:
10
),
margin:
EdgeInsets
.
symmetric
(
vertical:
5
),
decoration:
BoxDecoration
(
color:
Colors
.
white
,
borderRadius:
BorderRadius
.
circular
(
20
),
),
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
[
Row
(
crossAxisAlignment:
CrossAxisAlignment
.
center
,
mainAxisAlignment:
MainAxisAlignment
.
center
,
children:
[
Expanded
(
flex:
1
,
child:
SvgPicture
.
asset
(
"assets/svg/se_block_head.svg"
,
itemBuilder:
(
context
,
index
)
{
return
Container
(
padding:
EdgeInsets
.
symmetric
(
horizontal:
10
,
vertical:
10
,
),
margin:
EdgeInsets
.
symmetric
(
vertical:
5
),
decoration:
BoxDecoration
(
color:
Colors
.
white
,
borderRadius:
BorderRadius
.
circular
(
20
),
),
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
[
Row
(
crossAxisAlignment:
CrossAxisAlignment
.
center
,
mainAxisAlignment:
MainAxisAlignment
.
center
,
children:
[
Expanded
(
flex:
1
,
child:
SvgPicture
.
asset
(
"assets/svg/se_block_head.svg"
,
),
),
),
SizedBox
(
width:
5
),
SizedBox
(
width:
5
),
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
[
Text
(
"
${provider.technician_complaint_list[index].contactName}
"
,
),
Text
(
"
${provider.technician_complaint_list[index].companyName}
"
,
style:
TextStyle
(
color:
Color
(
0xFF818181
)),
),
],
),
Spacer
(),
Expanded
(
flex:
1
,
child:
InkResponse
(
onTap:
()
{
launch
(
'tel://
${provider.technician_complaint_list[index].mobileNo}
'
,
);
},
child:
SvgPicture
.
asset
(
"assets/svg/se_call_customer.svg"
,
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
[
Text
(
"
${provider.technician_complaint_list[index].contactName}
"
,
style:
TextStyle
(
fontFamily:
"JakartaMedium"
,
),
),
Text
(
"
${provider.technician_complaint_list[index].companyName}
"
,
style:
TextStyle
(
color:
Color
(
0xFF818181
),
fontSize:
14
,
),
),
],
),
Spacer
(),
Expanded
(
flex:
1
,
child:
InkResponse
(
onTap:
()
{
launch
(
'tel://
${provider.technician_complaint_list[index].mobileNo}
'
,
);
},
child:
SvgPicture
.
asset
(
"assets/svg/se_call_customer.svg"
,
color:
Color
(
0xFF0D9C00
),
height:
20
,
width:
20
,
),
),
),
),
Expanded
(
flex:
1
,
child:
InkResponse
(
onTap:
()
{
_showOptionsSheet
(
context
,
provider
.
technician_complaint_list
[
index
]
.
companyName
,
Expanded
(
flex:
1
,
child:
InkResponse
(
onTap:
()
{
_showOptionsSheet
(
context
,
provider
.
technician_complaint_list
[
index
]
.
companyName
,
provider
.
technician_complaint_list
[
index
]
.
genId
,
provider
.
technician_complaint_list
[
index
]
.
complaintId
,
);
},
child:
Icon
(
Icons
.
more_vert
),
provider
.
technician_complaint_list
[
index
]
.
genId
,
provider
.
technician_complaint_list
[
index
]
.
complaintId
,
);
},
child:
Icon
(
Icons
.
more_vert
),
),
),
),
],
),
Divider
(
thickness:
0.5
,
color:
Color
(
0xFFD7D7D7
)),
...
List
.
generate
(
3
,
(
j
)
{
final
textheads
=
[
"ID"
,
"Generator Type"
,
"Address"
];
final
textSubheads
=
[
provider
.
technician_complaint_list
[
index
].
genId
,
provider
.
technician_complaint_list
[
index
].
productName
,
provider
.
technician_complaint_list
[
index
].
address
,
];
return
Container
(
padding:
EdgeInsets
.
symmetric
(
vertical:
3
),
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
],
),
Divider
(
thickness:
0.5
,
color:
Color
(
0xFFD7D7D7
)),
...
List
.
generate
(
3
,
(
j
)
{
final
textheads
=
[
"ID"
,
"Generator Type"
,
"Address"
,
];
final
textSubheads
=
[
provider
.
technician_complaint_list
[
index
]
.
genId
,
provider
.
technician_complaint_list
[
index
]
.
productName
,
provider
.
technician_complaint_list
[
index
]
.
address
,
];
return
Container
(
padding:
EdgeInsets
.
symmetric
(
vertical:
3
),
child:
Row
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
[
Expanded
(
flex:
1
,
child:
Text
(
textheads
[
j
].
toString
(),
style:
TextStyle
(
fontFamily:
"JakartaMedium"
,
),
),
),
Expanded
(
flex:
2
,
child:
Text
(
textSubheads
[
j
].
toString
(),
style:
TextStyle
(
color:
Color
(
0xFF818181
),
),
),
),
],
),
);
}),
InkResponse
(
onTap:
()
{
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
context
)
=>
Visitdetails
(
complaintID:
provider
.
technician_complaint_list
[
index
]
.
complaintId
,
),
),
);
},
child:
Row
(
mainAxisAlignment:
MainAxisAlignment
.
start
,
crossAxisAlignment:
CrossAxisAlignment
.
center
,
children:
[
Text
(
textheads
[
j
].
toString
()),
Text
(
textSubheads
[
j
].
toString
(),
style:
TextStyle
(
color:
Color
(
0xFF818181
)),
"View Details"
,
style:
TextStyle
(
color:
AppColors
.
app_blue
,
fontFamily:
"JakartaMedium"
),
),
SizedBox
(
width:
5
),
SvgPicture
.
asset
(
"assets/svg/next_button.svg"
,
),
],
),
);
}),
InkResponse
(
onTap:
()
{
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
context
)
=>
Visitdetails
(
complaintID:
provider
.
technician_complaint_list
[
index
]
.
complaintId
,
),
),
);
},
child:
Row
(
mainAxisAlignment:
MainAxisAlignment
.
start
,
crossAxisAlignment:
CrossAxisAlignment
.
center
,
children:
[
Text
(
"View Details"
,
style:
TextStyle
(
color:
AppColors
.
app_blue
),
),
SizedBox
(
width:
5
),
SvgPicture
.
asset
(
"assets/svg/next_button.svg"
),
],
),
)
,
]
,
)
,
);
}
,
),
]
,
)
,
)
;
},
)
,
):
Emptywidget
(
context
),
),
);
},
...
...
@@ -310,10 +341,11 @@ class _PendingcomplaintsState extends State<Pendingcomplaints> {
leading:
SvgPicture
.
asset
(
"assets/svg/
${assetnames[index]}
.svg"
,
),
title:
Text
(
Headingnames
[
index
]),
trailing:
Icon
(
Icons
.
arrow_forward_ios_sharp
,
size:
16
,
title:
Text
(
Headingnames
[
index
],
style:
TextStyle
(
fontFamily:
"JakartaMedium"
),),
trailing:
SvgPicture
.
asset
(
"assets/svg/arrow_right_new.svg"
,
),
);
}),
...
...
lib/screens/serviceEngineer/TodayMontlyVisists.dart
View file @
528df0d2
import
'package:flutter/material.dart'
;
import
'package:flutter_svg/svg.dart'
;
import
'package:generp/Utils/commonWidgets.dart'
;
import
'package:generp/screens/serviceEngineer/PaymentDetails.dart'
;
import
'package:generp/screens/serviceEngineer/VisitDetails.dart'
;
import
'package:provider/provider.dart'
;
...
...
@@ -45,179 +46,235 @@ class _TodaymontlyvisistsState extends State<Todaymontlyvisists> {
Widget
build
(
BuildContext
context
)
{
return
Consumer
<
Todaymontlyvisitsprovider
>(
builder:
(
context
,
provider
,
child
)
{
return
Scaffold
(
backgroundColor:
AppColors
.
scaffold_bg_color
,
appBar:
AppBar
(
automaticallyImplyLeading:
false
,
elevation:
2.0
,
title:
SizedBox
(
child:
Row
(
mainAxisAlignment:
MainAxisAlignment
.
start
,
crossAxisAlignment:
CrossAxisAlignment
.
center
,
children:
[
InkResponse
(
onTap:
()
=>
Navigator
.
pop
(
context
,
true
),
child:
SvgPicture
.
asset
(
"assets/svg/app_bar_back.svg"
,
height:
25
,
),
),
Text
(
provider
.
title
,
style:
TextStyle
(
fontSize:
16
,
height:
1.1
,
color:
AppColors
.
semi_black
,
),
),
Spacer
(),
SvgPicture
.
asset
(
"assets/svg/scanner.svg"
),
],
),
),
shape:
RoundedRectangleBorder
(
borderRadius:
BorderRadius
.
vertical
(
bottom:
Radius
.
circular
(
30
),
// Adjust the radius as needed
),
),
),
body:
Container
(
child:
ListView
.
builder
(
scrollDirection:
Axis
.
vertical
,
shrinkWrap:
true
,
itemCount:
provider
.
visitsList
.
length
,
padding:
EdgeInsets
.
symmetric
(
horizontal:
10
,
vertical:
10
),
return
WillPopScope
(
onWillPop:
()
=>
onBackPressed
(
context
),
child:
Scaffold
(
resizeToAvoidBottomInset:
true
,
backgroundColor:
AppColors
.
scaffold_bg_color
,
appBar:
appbar
(
context
,
provider
.
title
),
body:
provider
.
visitsList
.
isNotEmpty
?
Container
(
child:
ListView
.
builder
(
scrollDirection:
Axis
.
vertical
,
shrinkWrap:
true
,
itemCount:
provider
.
visitsList
.
length
,
padding:
EdgeInsets
.
symmetric
(
horizontal:
10
,
vertical:
10
,
),
itemBuilder:
(
context
,
index
)
{
return
Container
(
padding:
EdgeInsets
.
symmetric
(
horizontal:
10
,
vertical:
10
),
margin:
EdgeInsets
.
symmetric
(
vertical:
5
),
decoration:
BoxDecoration
(
color:
Colors
.
white
,
borderRadius:
BorderRadius
.
circular
(
20
),
),
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
[
Row
(
crossAxisAlignment:
CrossAxisAlignment
.
center
,
mainAxisAlignment:
MainAxisAlignment
.
center
,
children:
[
Expanded
(
flex:
1
,
child:
SvgPicture
.
asset
(
"assets/svg/se_block_head.svg"
,
itemBuilder:
(
context
,
index
)
{
return
Container
(
padding:
EdgeInsets
.
symmetric
(
horizontal:
10
,
vertical:
10
,
),
),
SizedBox
(
width:
5
),
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
[
Text
(
"
${provider.visitsList[index]
.companyName}
"
,
),
Text
(
"Gen Pvt. Ltd"
),
],
),
Spacer
(),
Expanded
(
flex:
1
,
child:
InkResponse
(
onTap:
()
{
launch
(
'tel://
${provider
.visitsList[index]
.mobileNo}
'
,
);
},
child:
SvgPicture
.
asset
(
"assets/svg/se_call_customer.svg"
,
),
margin:
EdgeInsets
.
symmetric
(
vertical:
5
),
decoration:
BoxDecoration
(
color:
Colors
.
white
,
borderRadius:
BorderRadius
.
circular
(
20
),
),
),
// Expanded(
// flex: 1,
// child: InkResponse(
// onTap: () {
// _showOptionsSheet(context);
// },
// child: Icon(Icons.more_vert),
// ),
// ),
],
),
Divider
(
thickness:
0.5
,
color:
Color
(
0xFFD7D7D7
)),
...
List
.
generate
(
3
,
(
j
)
{
final
textheads
=
[
"ID"
,
"Generator Type"
,
"Address"
];
final
textSubheads
=
[
provider
.
visitsList
[
index
].
genId
,
provider
.
visitsList
[
index
].
productName
,
provider
.
visitsList
[
index
].
address
,
];
return
Container
(
padding:
EdgeInsets
.
symmetric
(
vertical:
3
),
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
[
Text
(
textheads
[
j
].
toString
()),
Text
(
textSubheads
[
j
].
toString
()),
],
),
);
}),
SizedBox
(
child:
Row
(
mainAxisAlignment:
MainAxisAlignment
.
spaceBetween
,
children:
[
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
[
Row
(
crossAxisAlignment:
CrossAxisAlignment
.
center
,
mainAxisAlignment:
MainAxisAlignment
.
center
,
children:
[
Expanded
(
flex:
1
,
child:
Container
(
padding:
EdgeInsets
.
symmetric
(
horizontal:
10
,
vertical:
10
,
),
decoration:
BoxDecoration
(
color:
Color
(
0xFFE6F6FF
),
borderRadius:
BorderRadius
.
circular
(
8
,
),
),
child:
SvgPicture
.
asset
(
width:
30
,
height:
30
,
"assets/svg/se_block_head.svg"
,
),
),
),
SizedBox
(
width:
5
),
InkResponse
(
onTap:
()
{
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
context
)
=>
Paymentdetails
(
accountName:
"Generator"
,
name:
provider
.
visitsList
[
index
].
companyName
,
genId:
provider
.
visitsList
[
index
].
genId
,
referenceID:
provider
.
visitsList
[
index
].
complaintId
),));
},
child:
SvgPicture
.
asset
(
"assets/svg/se_payment_details.svg"
,
),
),
Spacer
(),
InkResponse
(
onTap:
()
{
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
context
)
=>
Visitdetails
(
complaintID:
provider
.
visitsList
[
index
].
complaintId
),));
},
child:
Row
(
mainAxisAlignment:
MainAxisAlignment
.
start
,
crossAxisAlignment:
CrossAxisAlignment
.
center
,
children:
[
Text
(
"View Details"
,
style:
TextStyle
(
color:
AppColors
.
app_blue
),),
SizedBox
(
width:
5
),
SvgPicture
.
asset
(
"assets/svg/next_button.svg"
,
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
[
Text
(
"
${provider.visitsList[index].contactName ?? "-"}
"
,
style:
TextStyle
(
fontFamily:
"JakartaMedium"
,
),
),
Text
(
"
${provider.visitsList[index].companyName}
"
,
style:
TextStyle
(
color:
Color
(
0xFF818181
),
),
),
],
),
Spacer
(),
Expanded
(
flex:
1
,
child:
InkResponse
(
onTap:
()
{
launch
(
'tel://
${provider.visitsList[index].mobileNo}
'
,
);
},
child:
SvgPicture
.
asset
(
"assets/svg/se_call_customer.svg"
,
color:
Color
(
0xFF0D9C00
),
height:
20
,
width:
20
,
),
),
),
// Expanded(
// flex: 1,
// child: InkResponse(
// onTap: () {
// _showOptionsSheet(context);
// },
// child: Icon(Icons.more_vert),
// ),
// ),
],
),
Padding
(
padding:
const
EdgeInsets
.
all
(
8.0
),
child:
Divider
(
thickness:
0.5
,
color:
Color
(
0xFFD7D7D7
),
),
],
),
),
...
List
.
generate
(
3
,
(
j
)
{
final
textheads
=
[
"ID"
,
"Generator Type"
,
"Address"
,
];
final
textSubheads
=
[
provider
.
visitsList
[
index
].
genId
,
provider
.
visitsList
[
index
].
productName
,
provider
.
visitsList
[
index
].
address
,
];
return
Container
(
padding:
EdgeInsets
.
symmetric
(
vertical:
3
),
child:
Row
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
[
Expanded
(
flex:
1
,
child:
Text
(
textheads
[
j
].
toString
(),
style:
TextStyle
(
fontFamily:
"JakartaMedium"
,
),
),
),
Expanded
(
flex:
2
,
child:
Text
(
textSubheads
[
j
].
toString
(),
style:
TextStyle
(
color:
Color
(
0xFF818181
),
),
),
),
],
),
);
}),
SizedBox
(
child:
Row
(
mainAxisAlignment:
MainAxisAlignment
.
spaceBetween
,
children:
[
InkResponse
(
onTap:
()
{
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
context
)
=>
Paymentdetails
(
accountName:
"Generator"
,
name:
provider
.
visitsList
[
index
]
.
companyName
,
genId:
provider
.
visitsList
[
index
]
.
genId
,
referenceID:
provider
.
visitsList
[
index
]
.
complaintId
,
),
),
);
},
child:
SvgPicture
.
asset
(
"assets/svg/se_payment_details.svg"
,
),
),
Spacer
(),
InkResponse
(
onTap:
()
{
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
context
)
=>
Visitdetails
(
complaintID:
provider
.
visitsList
[
index
]
.
complaintId
,
),
),
);
},
child:
Row
(
mainAxisAlignment:
MainAxisAlignment
.
start
,
crossAxisAlignment:
CrossAxisAlignment
.
center
,
children:
[
Text
(
"View Details"
,
style:
TextStyle
(
fontFamily:
"JakartaMedium"
,
color:
AppColors
.
app_blue
,
),
),
SizedBox
(
width:
5
),
SvgPicture
.
asset
(
"assets/svg/next_button.svg"
,
),
],
),
),
],
),
),
],
),
],
)
,
);
}
,
),
],
),
);
},
),
)
:
Emptywidget
(
context
),
),
);
},
...
...
@@ -262,8 +319,10 @@ class _TodaymontlyvisistsState extends State<Todaymontlyvisists> {
),
title:
Text
(
"Payment Details"
),
trailing:
Icon
(
Icons
.
arrow_forward_ios_sharp
,
size:
16
,),
)
Icons
.
arrow_forward_ios_sharp
,
size:
16
,
),
),
],
),
),
...
...
lib/screens/serviceEngineer/UpdateComplaints.dart
View file @
528df0d2
...
...
@@ -26,369 +26,388 @@ class _UpdatecomplaintsState extends State<Updatecomplaints> {
Widget
build
(
BuildContext
context
)
{
return
Consumer
<
Pendingcomplaintsprovider
>(
builder:
(
context
,
provider
,
child
)
{
return
Scaffold
(
appBar:
appbar
(
context
,
"Update Complaint"
),
backgroundColor:
AppColors
.
scaffold_bg_color
,
body:
Container
(
padding:
EdgeInsets
.
symmetric
(
horizontal:
10
,
vertical:
10
),
decoration:
BoxDecoration
(
color:
Colors
.
white
,
borderRadius:
BorderRadius
.
circular
(
20
)
),
child:
SingleChildScrollView
(
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
mainAxisSize:
MainAxisSize
.
min
,
children:
[
SizedBox
(
height:
15
),
return
WillPopScope
(
onWillPop:
()
=>
onBackPressed
(
context
),
child:
Scaffold
(
resizeToAvoidBottomInset:
true
,
appBar:
appbar
(
context
,
"Update Complaint"
),
backgroundColor:
AppColors
.
scaffold_bg_color
,
body:
Container
(
padding:
EdgeInsets
.
symmetric
(
horizontal:
10
,
vertical:
10
),
decoration:
BoxDecoration
(
color:
Colors
.
white
,
borderRadius:
BorderRadius
.
circular
(
20
)
),
child:
SingleChildScrollView
(
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
mainAxisSize:
MainAxisSize
.
min
,
children:
[
SizedBox
(
height:
15
),
Text
(
"Complaint Status"
,
style:
TextStyle
(
fontWeight:
FontWeight
.
w400
,
color:
Colors
.
grey
,
Padding
(
padding:
const
EdgeInsets
.
only
(
bottom:
5.0
),
child:
Text
(
"Complaint Status"
,
style:
TextStyle
(
fontFamily:
"JakartaMedium"
,
color:
AppColors
.
semi_black
,
),
),
),
),
Row
(
children:
[
Expanded
(
child:
DropdownButtonHideUnderline
(
child:
DropdownButton2
<
String
>(
isExpanded:
true
,
hint:
const
Row
(
children:
[
Expanded
(
child:
Text
(
'Select Complaint Status'
,
style:
TextStyle
(
fontSize:
14
,
DropdownButtonHideUnderline
(
child:
Row
(
children:
[
Expanded
(
child:
DropdownButton2
<
String
>(
isExpanded:
true
,
hint:
const
Row
(
children:
[
Expanded
(
child:
Text
(
'Select Complaint Status'
,
style:
TextStyle
(
fontSize:
14
,
),
overflow:
TextOverflow
.
ellipsis
,
),
overflow:
TextOverflow
.
ellipsis
,
),
),
],
),
items:
CompletedStatus
.
map
(
(
complaintStatus
)
=>
DropdownMenuItem
<
String
>(
value:
complaintStatus
[
'name'
],
child:
Text
(
complaintStatus
[
'name'
]
??
''
,
style:
const
TextStyle
(
fontSize:
14
,
],
),
items:
CompletedStatus
.
map
(
(
complaintStatus
)
=>
DropdownMenuItem
<
String
>(
value:
complaintStatus
[
'name'
],
child:
Text
(
complaintStatus
[
'name'
]
??
''
,
style:
const
TextStyle
(
fontSize:
14
,
),
overflow:
TextOverflow
.
ellipsis
,
),
overflow:
TextOverflow
.
ellipsis
,
),
)).
toList
(),
value:
provider
.
statusID
,
onChanged:
(
value
)
{
if
(
value
!=
null
)
{
provider
.
statusID
=
value
;
print
(
"statusId:
${provider.statusID}
"
);
}
},
buttonStyleData:
ButtonStyleData
(
height:
50
,
width:
MediaQuery
.
of
(
context
).
size
.
width
,
padding:
const
EdgeInsets
.
only
(
left:
14
,
right:
14
),
decoration:
BoxDecoration
(
borderRadius:
BorderRadius
.
circular
(
14
),
color:
AppColors
.
text_field_color
,
)).
toList
(),
value:
provider
.
statusID
,
onChanged:
(
value
)
{
if
(
value
!=
null
)
{
provider
.
statusID
=
value
;
print
(
"statusId:
${provider.statusID}
"
);
}
},
buttonStyleData:
ButtonStyleData
(
height:
50
,
width:
160
,
padding:
const
EdgeInsets
.
only
(
left:
14
,
right:
14
),
decoration:
BoxDecoration
(
borderRadius:
BorderRadius
.
circular
(
14
),
color:
AppColors
.
text_field_color
,
),
),
),
iconStyleData:
const
IconStyleData
(
icon:
Icon
(
Icons
.
keyboard_arrow_down_sharp
,
iconStyleData:
const
IconStyleData
(
icon:
Icon
(
Icons
.
keyboard_arrow_down_sharp
,
),
iconSize:
14
,
iconEnabledColor:
Color
(
0xFF2D2D2D
),
iconDisabledColor:
Colors
.
grey
,
),
iconSize:
14
,
iconEnabledColor:
Color
(
0xFF2D2D2D
),
iconDisabledColor:
Colors
.
grey
,
),
dropdownStyleData:
DropdownStyleData
(
maxHeight:
200
,
width:
310
,
decoration:
BoxDecoration
(
borderRadius:
BorderRadius
.
circular
(
14
),
color:
AppColors
.
text_field_color
,
dropdownStyleData:
DropdownStyleData
(
maxHeight:
200
,
width:
350
,
decoration:
BoxDecoration
(
borderRadius:
BorderRadius
.
circular
(
14
),
color:
AppColors
.
text_field_color
,
),
scrollbarTheme:
ScrollbarThemeData
(
radius:
const
Radius
.
circular
(
15
),
thickness:
MaterialStateProperty
.
all
<
double
>(
6
),
thumbVisibility:
MaterialStateProperty
.
all
<
bool
>(
true
),
),
),
scrollbarTheme:
ScrollbarThemeData
(
radius:
const
Radius
.
circular
(
15
),
thickness:
MaterialStateProperty
.
all
<
double
>(
6
),
thumbVisibility:
MaterialStateProperty
.
all
<
bool
>(
true
),
menuItemStyleData:
const
MenuItemStyleData
(
height:
40
,
padding:
EdgeInsets
.
only
(
left:
14
,
right:
14
),
),
),
menuItemStyleData:
const
MenuItemStyleData
(
height:
40
,
padding:
EdgeInsets
.
only
(
left:
14
,
right:
14
),
),
),
],
),
),
SizedBox
(
height:
5
,),
Padding
(
padding:
const
EdgeInsets
.
only
(
bottom:
5.0
),
child:
Text
(
"FSR Number"
,
style:
TextStyle
(
fontFamily:
"JakartaMedium"
,
color:
AppColors
.
semi_black
,
),
),
],
),
Text
(
"FSR Number"
,
style:
TextStyle
(
fontWeight:
FontWeight
.
w400
,
color:
Colors
.
grey
,
),
),
Container
(
height:
50
,
Container
(
height:
50
,
alignment:
Alignment
.
center
,
decoration:
BoxDecoration
(
color:
AppColors
.
text_field_color
,
borderRadius:
BorderRadius
.
circular
(
14
),
),
child:
Padding
(
padding:
const
EdgeInsets
.
fromLTRB
(
10.0
,
0.0
,
10
,
0
),
child:
TextFormField
(
controller:
fsrNumberController
,
keyboardType:
TextInputType
.
text
,
decoration:
InputDecoration
(
alignment:
Alignment
.
center
,
decoration:
BoxDecoration
(
color:
AppColors
.
text_field_color
,
borderRadius:
BorderRadius
.
circular
(
14
),
),
child:
Padding
(
padding:
const
EdgeInsets
.
fromLTRB
(
10.0
,
0.0
,
10
,
0
),
child:
TextFormField
(
controller:
fsrNumberController
,
keyboardType:
TextInputType
.
text
,
decoration:
InputDecoration
(
hintText:
"Enter FSR Number"
,
hintStyle:
TextStyle
(
fontWeight:
FontWeight
.
w400
,
color:
Color
(
0xFFB4BEC0
),
fontSize:
14
hintText:
"Enter FSR Number"
,
hintStyle:
TextStyle
(
fontWeight:
FontWeight
.
w400
,
color:
Color
(
0xFFB4BEC0
),
fontSize:
14
),
enabledBorder:
InputBorder
.
none
,
focusedBorder:
InputBorder
.
none
,
),
enabledBorder:
InputBorder
.
none
,
focusedBorder:
InputBorder
.
none
,
),
),
),
),
Row
(
children:
[
Expanded
(
child:
Padding
(
padding:
const
EdgeInsets
.
symmetric
(
horizontal:
20.0
),
child:
Text
(
"Select Time"
,
style:
TextStyle
(
fontWeight:
FontWeight
.
w400
,
color:
Colors
.
grey
,
SizedBox
(
height:
5
,),
Row
(
children:
[
Expanded
(
child:
Padding
(
padding:
const
EdgeInsets
.
symmetric
(
horizontal:
5.0
,
vertical:
3
),
child:
Text
(
"Select Time"
,
style:
TextStyle
(
fontFamily:
"JakartaMedium"
,
color:
AppColors
.
semi_black
,
),
),
),
),
),
Expanded
(
child:
Padding
(
padding:
const
EdgeInsets
.
symmetric
(
horizontal:
20.0
),
child:
Text
(
"Running Hours"
,
style:
TextStyle
(
fontWeight:
FontWeight
.
w400
,
color:
Colors
.
grey
,
Expanded
(
child:
Padding
(
padding:
const
EdgeInsets
.
symmetric
(
horizontal:
20.0
),
child:
Text
(
"Running Hours"
,
style:
TextStyle
(
fontWeight:
FontWeight
.
w400
,
color:
AppColors
.
semi_black
,
)
,
),
),
),
),
],
),
Row
(
children:
[
Expanded
(
child:
Container
(
],
),
Row
(
children:
[
Expanded
(
child:
Container
(
decoration:
BoxDecoration
(
color:
AppColors
.
text_field_color
,
borderRadius:
BorderRadius
.
circular
(
14
),
),
child:
InkWell
(
onTap:
()
{
provider
.
selectTime
(
context
);
},
child:
Container
(
alignment:
Alignment
.
center
,
height:
45
,
margin:
EdgeInsets
.
only
(
left:
15.0
,
right:
15.0
),
decoration:
BoxDecoration
(
borderRadius:
BorderRadius
.
circular
(
15.0
),
),
child:
Row
(
children:
[
Text
(
provider
.
selectedTime
.
hour
.
toString
()
+
":"
+
provider
.
selectedTime
.
minute
.
toString
()
??
"Enter in Time"
,
textAlign:
TextAlign
.
center
,
style:
TextStyle
(
fontWeight:
FontWeight
.
w400
),
),
]),
),
)),
),
SizedBox
(
width:
10
,),
Expanded
(
child:
Container
(
height:
50
,
alignment:
Alignment
.
center
,
decoration:
BoxDecoration
(
color:
AppColors
.
text_field_color
,
borderRadius:
BorderRadius
.
circular
(
14
),
),
child:
InkWell
(
onTap:
()
{
provider
.
selectTime
(
context
);
},
child:
Container
(
alignment:
Alignment
.
center
,
height:
45
,
margin:
EdgeInsets
.
only
(
left:
15.0
,
right:
15.0
),
decoration:
BoxDecoration
(
borderRadius:
BorderRadius
.
circular
(
15.0
),
),
child:
Row
(
children:
[
child:
Padding
(
padding:
const
EdgeInsets
.
fromLTRB
(
10.0
,
0.0
,
10
,
0
),
child:
TextFormField
(
controller:
runningHoursController
,
keyboardType:
TextInputType
.
text
,
decoration:
InputDecoration
(
Text
(
provider
.
selectedTime
.
hour
.
toString
()
+
":"
+
provider
.
selectedTime
.
minute
.
toString
()
??
"Enter in Time"
,
textAlign:
TextAlign
.
center
,
style:
TextStyle
(
fontWeight:
FontWeight
.
w400
),
hintText:
"Enter FSR Number"
,
hintStyle:
TextStyle
(
fontWeight:
FontWeight
.
w400
,
color:
Color
(
0xFFB4BEC0
),
fontSize:
14
),
]),
),
)),
),
SizedBox
(
width:
10
,),
Expanded
(
child:
Container
(
height:
50
,
alignment:
Alignment
.
center
,
decoration:
BoxDecoration
(
color:
AppColors
.
text_field_color
,
borderRadius:
BorderRadius
.
circular
(
14
),
),
child:
Padding
(
padding:
const
EdgeInsets
.
fromLTRB
(
10.0
,
0.0
,
10
,
0
),
child:
TextFormField
(
controller:
runningHoursController
,
keyboardType:
TextInputType
.
text
,
decoration:
InputDecoration
(
hintText:
"Enter FSR Number"
,
hintStyle:
TextStyle
(
fontWeight:
FontWeight
.
w400
,
color:
Color
(
0xFFB4BEC0
),
fontSize:
14
enabledBorder:
InputBorder
.
none
,
focusedBorder:
InputBorder
.
none
,
),
enabledBorder:
InputBorder
.
none
,
focusedBorder:
InputBorder
.
none
,
),
),
),
),
),
)
,
]
,
),
InkResponse
(
onTap:
()
{
_showAttachmentSheet
(
context
);
},
child:
Container
(
margin:
EdgeInsets
.
symmetric
(
vertical:
10
)
,
height:
45
,
width:
MediaQuery
.
of
(
context
)
.
size
.
width
,
decoration:
BoxDecoration
(
color:
Color
(
0xFFE6F6FF
),
border
Radius
:
Border
Radius
.
circular
(
12
),
border:
Border
.
all
(
color:
AppColors
.
app_blue
,
width:
0.5
)
),
child:
Center
(
child:
Text
(
"Scan Document"
,
style:
TextStyle
(
color:
AppColors
.
app_blue
),
),
]
,
)
,
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
(
"Scan Document"
,
style:
TextStyle
(
color:
AppColors
.
app_blue
),),
),
),
),
),
Text
(
"Feedback"
,
style:
TextStyle
(
fontWeight:
FontWeight
.
w400
,
color:
Colors
.
grey
,
Padding
(
padding:
const
EdgeInsets
.
only
(
bottom:
5.0
),
child:
Text
(
"Feedback"
,
style:
TextStyle
(
fontFamily:
"JakartaMedium"
,
color:
AppColors
.
semi_black
,
),
),
),
),
Container
(
height:
150
,
Container
(
height:
150
,
alignment:
Alignment
.
center
,
decoration:
BoxDecoration
(
color:
AppColors
.
text_field_color
,
borderRadius:
BorderRadius
.
circular
(
14
),
),
child:
Padding
(
padding:
const
EdgeInsets
.
fromLTRB
(
10.0
,
0.0
,
10
,
0
),
child:
TextFormField
(
controller:
feedbackController
,
maxLines:
60
,
keyboardType:
TextInputType
.
text
,
decoration:
InputDecoration
(
alignment:
Alignment
.
center
,
decoration:
BoxDecoration
(
color:
AppColors
.
text_field_color
,
borderRadius:
BorderRadius
.
circular
(
14
),
),
child:
Padding
(
padding:
const
EdgeInsets
.
fromLTRB
(
10.0
,
0.0
,
10
,
0
),
child:
TextFormField
(
controller:
feedbackController
,
maxLines:
60
,
keyboardType:
TextInputType
.
text
,
decoration:
InputDecoration
(
hintText:
"Enter Feedback"
,
hintStyle:
TextStyle
(
fontWeight:
FontWeight
.
w400
,
color:
Color
(
0xFFB4BEC0
),
fontSize:
14
hintText:
"Enter Feedback"
,
hintStyle:
TextStyle
(
fontWeight:
FontWeight
.
w400
,
color:
Color
(
0xFFB4BEC0
),
fontSize:
14
),
enabledBorder:
InputBorder
.
none
,
focusedBorder:
InputBorder
.
none
,
),
enabledBorder:
InputBorder
.
none
,
focusedBorder:
InputBorder
.
none
,
),
),
),
),
),
],
],
),
),
),
),
floatingActionButtonLocation:
FloatingActionButtonLocation
.
centerFloat
,
floatingActionButton:
InkWell
(
onTap:
()
{
provider
.
UpdateComplaintAPIFunction
(
context
,
widget
.
ComplaintID
,
feedbackController
.
text
,
fsrNumberController
.
text
,
runningHoursController
.
text
,
provider
.
statusID
);
},
child:
Container
(
alignment:
Alignment
.
center
,
height:
45
,
margin:
EdgeInsets
.
only
(
left:
5.0
,
right:
5.0
,
top:
5.0
,
bottom:
5.0
,
),
decoration:
BoxDecoration
(
color:
AppColors
.
app_blue
,
//1487C9
borderRadius:
BorderRadius
.
circular
(
30.0
),
),
child:
Center
(
child:
Text
(
"Submit"
,
textAlign:
TextAlign
.
center
,
style:
TextStyle
(
color:
Colors
.
white
),
floatingActionButtonLocation:
FloatingActionButtonLocation
.
centerFloat
,
floatingActionButton:
InkWell
(
onTap:
()
{
provider
.
UpdateComplaintAPIFunction
(
context
,
widget
.
ComplaintID
,
feedbackController
.
text
,
fsrNumberController
.
text
,
runningHoursController
.
text
,
provider
.
statusID
);
},
child:
Container
(
alignment:
Alignment
.
center
,
height:
45
,
margin:
EdgeInsets
.
only
(
left:
5.0
,
right:
5.0
,
top:
5.0
,
bottom:
5.0
,
),
decoration:
BoxDecoration
(
color:
AppColors
.
app_blue
,
//1487C9
borderRadius:
BorderRadius
.
circular
(
15.0
),
),
child:
Center
(
child:
Text
(
"Submit"
,
textAlign:
TextAlign
.
center
,
style:
TextStyle
(
fontSize:
15
,
fontFamily:
"JakartaMedium"
,
color:
Colors
.
white
),
),
),
),
),
...
...
lib/screens/serviceEngineer/VisitDetails.dart
View file @
528df0d2
...
...
@@ -37,299 +37,303 @@ class _VisitdetailsState extends State<Visitdetails> {
var
customerDetails
=
provider
.
customerDetails
;
var
generatorDetails
=
provider
.
generatorDetails
;
var
complaintDetails
=
provider
.
complaintDetailsNew
;
return
Scaffold
(
appBar:
appbar
(
context
,
"Visit Details"
),
backgroundColor:
AppColors
.
scaffold_bg_color
,
body:
Container
(
child:
SingleChildScrollView
(
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
[
Text
(
"Customer Details"
),
Container
(
margin:
EdgeInsets
.
symmetric
(
horizontal:
10
,
vertical:
5
),
padding:
EdgeInsets
.
symmetric
(
horizontal:
15
,
vertical:
10
),
decoration:
BoxDecoration
(
color:
Colors
.
white
,
borderRadius:
BorderRadius
.
circular
(
20
),
),
child:
Column
(
children:
[
Row
(
children:
[
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
List
.
generate
(
4
,
(
j
)
{
final
textheads
=
[
"
${customerDetails.cname}
"
,
"Mobile Number"
,
"Contact Person Number"
,
"Mail ID"
,
];
final
textSubheads
=
[
"
${customerDetails.aname}
"
,
"
${customerDetails.mob1}
"
,
"
${customerDetails.mob2}
"
,
"
${customerDetails.mail}
"
,
];
return
Container
(
padding:
EdgeInsets
.
symmetric
(
vertical:
3
),
child:
Container
(
padding:
EdgeInsets
.
symmetric
(
vertical:
3
,
horizontal:
0
,
return
WillPopScope
(
onWillPop:
()
=>
onBackPressed
(
context
),
child:
Scaffold
(
resizeToAvoidBottomInset:
true
,
appBar:
appbar
(
context
,
"Visit Details"
),
backgroundColor:
AppColors
.
scaffold_bg_color
,
body:
Container
(
child:
SingleChildScrollView
(
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
[
Text
(
"Customer Details"
),
Container
(
margin:
EdgeInsets
.
symmetric
(
horizontal:
10
,
vertical:
5
),
padding:
EdgeInsets
.
symmetric
(
horizontal:
15
,
vertical:
10
),
decoration:
BoxDecoration
(
color:
Colors
.
white
,
borderRadius:
BorderRadius
.
circular
(
20
),
),
child:
Column
(
children:
[
Row
(
children:
[
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
List
.
generate
(
4
,
(
j
)
{
final
textheads
=
[
"
${customerDetails.cname}
"
,
"Mobile Number"
,
"Contact Person Number"
,
"Mail ID"
,
];
final
textSubheads
=
[
"
${customerDetails.aname}
"
,
"
${customerDetails.mob1}
"
,
"
${customerDetails.mob2}
"
,
"
${customerDetails.mail}
"
,
];
return
Container
(
padding:
EdgeInsets
.
symmetric
(
vertical:
3
),
child:
Container
(
padding:
EdgeInsets
.
symmetric
(
vertical:
3
,
horizontal:
0
,
),
child:
Column
(
children:
[
Row
(
mainAxisAlignment:
MainAxisAlignment
.
spaceBetween
,
children:
[
if
(
j
==
0
)
...[
SvgPicture
.
asset
(
"assets/svg/se_block_head.svg"
,
),
SizedBox
(
width:
5
),
],
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
[
Text
(
textheads
[
j
].
toString
()),
SizedBox
(
// height:45,
width:
MediaQuery
.
of
(
context
,
).
size
.
width
*
0.75
,
child:
Text
(
textSubheads
[
j
],
maxLines:
2
,
overflow:
TextOverflow
.
ellipsis
,
style:
TextStyle
(
color:
Color
(
0xFF818181
),
),
),
),
],
),
],
),
],
),
),
);
}),
),
],
),
],
),
),
Text
(
"Generator Details"
),
Container
(
margin:
EdgeInsets
.
symmetric
(
horizontal:
10
,
vertical:
5
),
padding:
EdgeInsets
.
symmetric
(
horizontal:
15
,
vertical:
10
),
decoration:
BoxDecoration
(
color:
Colors
.
white
,
borderRadius:
BorderRadius
.
circular
(
20
),
),
child:
Column
(
children:
[
Row
(
children:
[
SvgPicture
.
asset
(
"assetName"
),
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
List
.
generate
(
6
,
(
j
)
{
final
textheads
=
[
"Gen ID"
,
"Engine Number"
,
"Address"
,
"Product Name"
,
"Engine Model"
,
"Date Of Supply"
,
];
final
textSubheads
=
[
"
${generatorDetails.genHashId}
"
,
"
${generatorDetails.engineNo}
"
,
"
${generatorDetails.address}
"
,
"
${generatorDetails.spname}
"
,
"
${generatorDetails.engineModel}
"
,
"
${complaintDetails.dateOfSupply}
"
,
];
return
Container
(
padding:
EdgeInsets
.
symmetric
(
vertical:
3
),
child:
Column
(
children:
[
Row
(
mainAxisAlignment:
MainAxisAlignment
.
spaceBetween
,
children:
[
if
(
j
==
0
)
...[
SvgPicture
.
asset
(
"assets/svg/se_block_head.svg"
,
Container
(
padding:
EdgeInsets
.
symmetric
(
vertical:
3
,
horizontal:
0
,
),
SizedBox
(
width:
5
),
],
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
[
Text
(
textheads
[
j
].
toString
()),
SizedBox
(
// height:45,
width:
MediaQuery
.
of
(
context
,
).
size
.
width
*
0.75
,
child:
Text
(
textSubheads
[
j
],
maxLines:
2
,
overflow:
TextOverflow
.
ellipsis
,
style:
TextStyle
(
color:
Color
(
0xFF818181
),
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
[
Text
(
textheads
[
j
].
toString
()),
SizedBox
(
// height:45,
width:
MediaQuery
.
of
(
context
,
).
size
.
width
*
0.8
,
child:
Text
(
textSubheads
[
j
],
maxLines:
2
,
overflow:
TextOverflow
.
ellipsis
,
style:
TextStyle
(
color:
Color
(
0xFF818181
),
),
),
),
)
,
]
,
]
,
)
,
),
],
),
],
),
)
,
);
}
),
)
,
]
,
)
,
]
,
)
;
}),
),
]
,
)
,
]
,
)
,
),
),
Text
(
"Generator Details"
),
Container
(
margin:
EdgeInsets
.
symmetric
(
horizontal:
10
,
vertical:
5
),
padding:
EdgeInsets
.
symmetric
(
horizontal:
15
,
vertical:
10
),
decoration:
BoxDecoration
(
color:
Colors
.
white
,
borderRadius:
BorderRadius
.
circular
(
20
),
),
child:
Column
(
children:
[
Row
(
children:
[
SvgPicture
.
asset
(
"assetName"
),
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
List
.
generate
(
6
,
(
j
)
{
final
textheads
=
[
"Gen ID"
,
"Engine Number"
,
"Address"
,
"Product Name"
,
"Engine Model"
,
"Date Of Supply"
,
];
final
textSubheads
=
[
"
${generatorDetails.genHashId}
"
,
"
${generatorDetails.engineNo}
"
,
"
${generatorDetails.address}
"
,
"
${generatorDetails.spname}
"
,
"
${generatorDetails.engineModel}
"
,
"
${complaintDetails.dateOfSupply}
"
,
];
return
Container
(
padding:
EdgeInsets
.
symmetric
(
vertical:
3
),
child:
Column
(
children:
[
Row
(
mainAxisAlignment:
MainAxisAlignment
.
spaceBetween
,
children:
[
Container
(
padding:
EdgeInsets
.
symmetric
(
vertical:
3
,
horizontal:
0
,
),
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
[
Text
(
textheads
[
j
].
toString
()),
SizedBox
(
// height:45,
width:
MediaQuery
.
of
(
context
,
).
size
.
width
*
0.8
,
child:
Text
(
textSubheads
[
j
],
maxLines:
2
,
overflow:
TextOverflow
.
ellipsis
,
style:
TextStyle
(
color:
Color
(
0xFF818181
),
),
),
),
],
),
),
],
),
],
),
);
}),
),
],
),
],
),
),
Text
(
"Complaint Details"
),
Container
(
margin:
EdgeInsets
.
symmetric
(
horizontal:
10
,
vertical:
5
),
padding:
EdgeInsets
.
symmetric
(
horizontal:
15
,
vertical:
10
),
decoration:
BoxDecoration
(
color:
Colors
.
white
,
borderRadius:
BorderRadius
.
circular
(
20
),
),
child:
Column
(
children:
[
Row
(
children:
[
SvgPicture
.
asset
(
"assetName"
),
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
List
.
generate
(
4
,
(
j
)
{
final
textheads
=
[
"Complaint ID"
,
"Complaint Description"
,
"Opened Date"
,
"Complaint Type"
,
];
final
textSubheads
=
[
"
${complaintDetails.complaintId}
"
,
"
${complaintDetails.complaintDesc}
"
,
"
${complaintDetails.openedDate}
"
,
"
${complaintDetails.complaintType}
"
,
];
return
Container
(
padding:
EdgeInsets
.
symmetric
(
vertical:
3
),
child:
Column
(
children:
[
Row
(
mainAxisAlignment:
MainAxisAlignment
.
spaceBetween
,
children:
[
Container
(
padding:
EdgeInsets
.
symmetric
(
vertical:
3
,
horizontal:
0
,
),
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
[
Text
(
textheads
[
j
].
toString
()),
SizedBox
(
// height:45,
width:
MediaQuery
.
of
(
context
,
).
size
.
width
*
0.8
,
child:
Text
(
textSubheads
[
j
],
maxLines:
2
,
overflow:
TextOverflow
.
ellipsis
,
style:
TextStyle
(
color:
Color
(
0xFF818181
),
Text
(
"Complaint Details"
),
Container
(
margin:
EdgeInsets
.
symmetric
(
horizontal:
10
,
vertical:
5
),
padding:
EdgeInsets
.
symmetric
(
horizontal:
15
,
vertical:
10
),
decoration:
BoxDecoration
(
color:
Colors
.
white
,
borderRadius:
BorderRadius
.
circular
(
20
),
),
child:
Column
(
children:
[
Row
(
children:
[
SvgPicture
.
asset
(
"assetName"
),
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
List
.
generate
(
4
,
(
j
)
{
final
textheads
=
[
"Complaint ID"
,
"Complaint Description"
,
"Opened Date"
,
"Complaint Type"
,
];
final
textSubheads
=
[
"
${complaintDetails.complaintId}
"
,
"
${complaintDetails.complaintDesc}
"
,
"
${complaintDetails.openedDate}
"
,
"
${complaintDetails.complaintType}
"
,
];
return
Container
(
padding:
EdgeInsets
.
symmetric
(
vertical:
3
),
child:
Column
(
children:
[
Row
(
mainAxisAlignment:
MainAxisAlignment
.
spaceBetween
,
children:
[
Container
(
padding:
EdgeInsets
.
symmetric
(
vertical:
3
,
horizontal:
0
,
),
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
[
Text
(
textheads
[
j
].
toString
()),
SizedBox
(
// height:45,
width:
MediaQuery
.
of
(
context
,
).
size
.
width
*
0.8
,
child:
Text
(
textSubheads
[
j
],
maxLines:
2
,
overflow:
TextOverflow
.
ellipsis
,
style:
TextStyle
(
color:
Color
(
0xFF818181
),
),
),
),
)
,
]
,
]
,
)
,
),
)
,
]
,
)
,
]
,
)
,
);
}
),
)
,
]
,
)
,
]
,
]
,
)
,
]
,
)
,
)
;
}),
),
]
,
)
,
]
,
)
,
),
),
SizedBox
(
height:
75
),
],
SizedBox
(
height:
75
),
],
),
),
),
),
floatingActionButton:
Align
(
alignment:
Alignment
.
bottomCenter
,
child:
InkWell
(
onTap:
()
{
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
context
)
=>
Followupdetails
(
complaintID:
widget
.
complaintID
),
floatingActionButton:
Align
(
alignment:
Alignment
.
bottomCenter
,
child:
InkWell
(
onTap:
()
{
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
context
)
=>
Followupdetails
(
complaintID:
widget
.
complaintID
),
),
);
},
child:
Container
(
alignment:
Alignment
.
bottomCenter
,
height:
45
,
width:
MediaQuery
.
of
(
context
).
size
.
width
,
margin:
EdgeInsets
.
symmetric
(
horizontal:
10
),
decoration:
BoxDecoration
(
color:
AppColors
.
app_blue
,
borderRadius:
BorderRadius
.
circular
(
30.0
),
),
);
},
child:
Container
(
alignment:
Alignment
.
bottomCenter
,
height:
45
,
width:
MediaQuery
.
of
(
context
).
size
.
width
,
margin:
EdgeInsets
.
symmetric
(
horizontal:
10
),
decoration:
BoxDecoration
(
color:
AppColors
.
app_blue
,
borderRadius:
BorderRadius
.
circular
(
30.0
),
),
child:
Center
(
child:
Text
(
"Followup Details"
,
textAlign:
TextAlign
.
center
,
style:
TextStyle
(
color:
Colors
.
white
),
child:
Center
(
child:
Text
(
"Followup Details"
,
textAlign:
TextAlign
.
center
,
style:
TextStyle
(
color:
Colors
.
white
),
),
),
),
),
),
floatingActionButtonLocation:
FloatingActionButtonLocation
.
centerFloat
,
),
floatingActionButtonLocation:
FloatingActionButtonLocation
.
centerFloat
,
);
},
);
...
...
lib/screens/serviceEngineer/scanComplaintDetails.dart
0 → 100644
View file @
528df0d2
import
'package:flutter/material.dart'
;
import
'package:generp/Notifiers/HomeScreenNotifier.dart'
;
import
'package:generp/Notifiers/InventoryProvider.dart'
;
import
'package:generp/Utils/commonWidgets.dart'
;
import
'package:provider/provider.dart'
;
import
'package:qr_code_scanner/qr_code_scanner.dart'
;
import
'../../Utils/app_colors.dart'
;
class
Scancomplaintdetails
extends
StatefulWidget
{
const
Scancomplaintdetails
({
super
.
key
});
@override
State
<
Scancomplaintdetails
>
createState
()
=>
_ScancomplaintdetailsState
();
}
class
_ScancomplaintdetailsState
extends
State
<
Scancomplaintdetails
>
{
FocusNode
partIDfocusNode
=
FocusNode
();
TextEditingController
partIDcontroller
=
TextEditingController
();
@override
void
initState
()
{
// TODO: implement initState
super
.
initState
();
WidgetsBinding
.
instance
.
addPostFrameCallback
((
_
)
{
var
inventoryProvider
=
Provider
.
of
<
InventoryProvider
>(
context
,
listen:
false
,
);
inventoryProvider
.
checkPermission1
();
inventoryProvider
.
requestCameraPermission
();
});
}
@override
Widget
build
(
BuildContext
context
)
{
return
Consumer
<
InventoryProvider
>(
builder:
(
context
,
provider
,
child
)
{
return
WillPopScope
(
onWillPop:
()
=>
onBackPressed
(
context
),
child:
Scaffold
(
resizeToAvoidBottomInset:
true
,
backgroundColor:
AppColors
.
scaffold_bg_color
,
appBar:
appbar
(
context
,
"Pending Complaints"
),
body:
Container
(
decoration:
BoxDecoration
(
color:
Colors
.
black
),
child:
Column
(
children:
[
Spacer
(),
Container
(
height:
250
,
child:
QRView
(
key:
provider
.
scannerKey
,
onQRViewCreated:
(
p0
)
{
provider
.
onQRViewCreated
(
p0
,
"pendingComplaints"
,
context
);
},
formatsAllowed:
[
BarcodeFormat
.
qrcode
],
cameraFacing:
CameraFacing
.
back
,
overlay:
QrScannerOverlayShape
(
borderColor:
AppColors
.
app_blue
,
borderRadius:
20
,
borderLength:
60
,
borderWidth:
10
,
cutOutSize:
250.0
,
),
),
),
SizedBox
(
height:
25
),
Text
(
"Scan QR"
,
textAlign:
TextAlign
.
center
,
style:
TextStyle
(
fontSize:
18
,
color:
Colors
.
white
),
),
Text
(
"to open Complaints"
,
textAlign:
TextAlign
.
center
,
style:
TextStyle
(
fontSize:
14
,
color:
Colors
.
white
),
),
Spacer
(),
Text
(
"or"
,
textAlign:
TextAlign
.
center
,
style:
TextStyle
(
fontSize:
18
,
color:
Colors
.
white
),
),
InkResponse
(
onTap:
()
async
{
_showPartIdBottomSheet
(
context
);
},
child:
Text
(
"Tap To Enter Generator ID"
,
textAlign:
TextAlign
.
center
,
style:
TextStyle
(
fontSize:
14
,
color:
Colors
.
white
),
),
),
SizedBox
(
height:
50
),
],
),
),
),
);
},
);
}
Future
<
void
>
_showPartIdBottomSheet
(
BuildContext
context
)
{
return
showModalBottomSheet
(
useSafeArea:
true
,
isDismissible:
true
,
isScrollControlled:
true
,
showDragHandle:
true
,
useRootNavigator:
true
,
enableDrag:
true
,
context:
context
,
builder:
(
context
)
{
return
StatefulBuilder
(
builder:
(
context
,
setState
)
{
return
SafeArea
(
child:
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:
30
,
),
child:
Consumer2
<
InventoryProvider
,
HomescreenNotifier
>(
builder:
(
context
,
provider
,
homeProvider
,
child
)
{
return
SingleChildScrollView
(
child:
Column
(
mainAxisSize:
MainAxisSize
.
min
,
children:
[
Container
(
padding:
EdgeInsets
.
symmetric
(
horizontal:
10
),
alignment:
Alignment
.
topLeft
,
child:
Text
(
"Generator ID"
,
style:
TextStyle
(
color:
Color
(
0xFF818181
),
fontSize:
14
,
),
),
),
SizedBox
(
height:
5
,),
Container
(
height:
48
,
alignment:
Alignment
.
center
,
decoration:
BoxDecoration
(
color:
AppColors
.
text_field_color
,
borderRadius:
BorderRadius
.
circular
(
20
),
border:
partIDfocusNode
.
hasFocus
?
Border
.
all
(
color:
AppColors
.
app_blue
,
width:
0.5
,
)
:
null
,
),
// alignment: Alignment.center,
margin:
EdgeInsets
.
only
(
left:
5.0
,
right:
5.0
),
child:
Padding
(
padding:
const
EdgeInsets
.
fromLTRB
(
10.0
,
0.0
,
15
,
0
,
),
child:
TextField
(
controller:
partIDcontroller
,
keyboardType:
TextInputType
.
emailAddress
,
focusNode:
partIDfocusNode
,
textCapitalization:
TextCapitalization
.
characters
,
style:
TextStyle
(
fontSize:
14
),
onChanged:
(
value
)
{},
onTapOutside:
(
event
)
{
// Handle onTapOutside
FocusScope
.
of
(
context
).
unfocus
();
},
decoration:
InputDecoration
(
isDense:
true
,
hintStyle:
TextStyle
(
fontWeight:
FontWeight
.
w400
,
fontSize:
14
,
),
//contentPadding: EdgeInsets.fromLTRB(5.0, 10.0, 5.0, 10.0),
enabledBorder:
InputBorder
.
none
,
focusedBorder:
InputBorder
.
none
,
hintText:
'Enter Generator ID'
,
),
),
),
),
SizedBox
(
height:
15
,),
InkWell
(
onTap:
()
{
provider
.
LoadgeneratorComplaintHistoryApifunction
(
homeProvider
,
context
,
"pendingComplaints"
,
partIDcontroller
.
text
,
);
},
child:
Container
(
alignment:
Alignment
.
center
,
height:
45
,
margin:
EdgeInsets
.
only
(
left:
5.0
,
right:
5.0
,
top:
5.0
,
bottom:
5.0
,
),
decoration:
BoxDecoration
(
color:
AppColors
.
app_blue
,
//1487C9
borderRadius:
BorderRadius
.
circular
(
15.0
),
),
child:
Center
(
child:
Text
(
"Submit"
,
textAlign:
TextAlign
.
center
,
style:
TextStyle
(
color:
Colors
.
white
),
),
),
),
),
],
),
);
},
),
),
),
);
},
);
},
);
}
}
lib/screens/serviceEngineer/serviceEngineerDashboard.dart
View file @
528df0d2
...
...
@@ -35,262 +35,286 @@ class _ServiceengineerdashboardState extends State<Serviceengineerdashboard> {
Widget
build
(
BuildContext
context
)
{
return
Consumer
<
Serviceengineerdashboardprovider
>(
builder:
(
context
,
provider
,
child
)
{
return
Scaffold
(
backgroundColor:
AppColors
.
scaffold_bg_color
,
appBar:
AppBar
(
automaticallyImplyLeading:
false
,
elevation:
2.0
,
title:
SizedBox
(
child:
Row
(
mainAxisAlignment:
MainAxisAlignment
.
start
,
crossAxisAlignment:
CrossAxisAlignment
.
center
,
children:
[
InkResponse
(
onTap:
()
=>
Navigator
.
pop
(
context
,
true
),
child:
SvgPicture
.
asset
(
"assets/svg/app_bar_back.svg"
,
height:
25
,
),
),
Text
(
"Service Engineer"
,
style:
TextStyle
(
fontSize:
16
,
height:
1.1
,
color:
AppColors
.
semi_black
,
),
),
Spacer
(),
Container
(
height:
25
,
width:
45
,
decoration:
BoxDecoration
(
color:
Color
(
0xFFFFF6E2
),
borderRadius:
BorderRadius
.
circular
(
20
),
return
WillPopScope
(
onWillPop:
()
=>
onBackPressed
(
context
),
child:
Scaffold
(
resizeToAvoidBottomInset:
true
,
backgroundColor:
AppColors
.
scaffold_bg_color
,
appBar:
AppBar
(
automaticallyImplyLeading:
false
,
elevation:
2.0
,
title:
SizedBox
(
child:
Row
(
mainAxisAlignment:
MainAxisAlignment
.
start
,
crossAxisAlignment:
CrossAxisAlignment
.
center
,
children:
[
InkResponse
(
onTap:
()
=>
Navigator
.
pop
(
context
,
true
),
child:
SvgPicture
.
asset
(
"assets/svg/app_bar_back.svg"
,
height:
25
,
),
),
child:
Row
(
mainAxisAlignment:
MainAxisAlignment
.
center
,
children:
[
SvgPicture
.
asset
(
'assets/svg/engineer_rating.svg'
,
height:
15
,
),
SizedBox
(
width:
5
),
Text
(
provider
.
avgRating
.
toString
(),
style:
TextStyle
(
fontSize:
14
),
InkResponse
(
onTap:
()
=>
Navigator
.
pop
(
context
,
true
),
child:
Text
(
"Service Engineer"
,
style:
TextStyle
(
fontSize:
16
,
height:
1.1
,
fontFamily:
"JakartaSemiBold"
,
color:
AppColors
.
semi_black
,
),
]
,
)
,
),
),
],
Spacer
(),
Container
(
height:
25
,
width:
45
,
decoration:
BoxDecoration
(
color:
Color
(
0xFFFFF6E2
),
borderRadius:
BorderRadius
.
circular
(
20
),
),
child:
Row
(
mainAxisAlignment:
MainAxisAlignment
.
center
,
children:
[
SvgPicture
.
asset
(
'assets/svg/engineer_rating.svg'
,
height:
15
,
),
SizedBox
(
width:
5
),
Text
(
provider
.
avgRating
.
toString
(),
style:
TextStyle
(
fontSize:
14
),
),
],
),
),
],
),
),
),
shape:
RoundedRectangleBorder
(
borderRadius:
BorderRadius
.
vertical
(
bottom:
Radius
.
circular
(
30
),
// Adjust the radius as needed
shape:
RoundedRectangleBorder
(
borderRadius:
BorderRadius
.
vertical
(
bottom:
Radius
.
circular
(
30
),
// Adjust the radius as needed
),
),
),
),
body:
Container
(
child:
SingleChildScrollView
(
child
:
Column
(
children:
[
Container
(
margin:
EdgeInsets
.
only
(
top:
0
,
bottom:
15
),
decoration:
BoxDecoration
(
color:
Colors
.
white
,
borderRadius:
BorderRadius
.
vertical
(
bottom:
Radius
.
circular
(
16
),
body:
Container
(
child:
SingleChildScrollView
(
child:
Column
(
child
ren:
[
Container
(
margin:
EdgeInsets
.
only
(
top:
0
,
bottom:
15
),
decoration:
BoxDecoration
(
color:
Colors
.
white
,
borderRadius:
BorderRadius
.
vertical
(
bottom:
Radius
.
circular
(
16
),
),
),
),
child:
Column
(
children:
[
InkResponse
(
onTap:
()
{
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
context
)
=>
Pendingcomplaints
(),
child:
Column
(
children:
[
InkResponse
(
onTap:
()
{
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
context
)
=>
Pendingcomplaints
(),
),
);
},
child:
Container
(
padding:
EdgeInsets
.
symmetric
(
horizontal:
10
,
vertical:
15
,
),
);
},
child:
Container
(
padding:
EdgeInsets
.
symmetric
(
horizontal:
10
,
vertical:
15
,
),
margin:
EdgeInsets
.
symmetric
(
horizontal:
10
,
vertical:
15
,
),
decoration:
BoxDecoration
(
color:
Color
(
0xFFFFEFEF
),
borderRadius:
BorderRadius
.
circular
(
16
),
),
child:
Row
(
mainAxisAlignment:
MainAxisAlignment
.
center
,
children:
[
Expanded
(
child:
SizedBox
(
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
center
,
children:
[
Text
(
"
${provider.pendingComplaints}
"
,
style:
TextStyle
(
fontSize:
30
,
color:
Color
(
0xFFED3424
),
margin:
EdgeInsets
.
symmetric
(
horizontal:
10
,
vertical:
15
,
),
decoration:
BoxDecoration
(
color:
Color
(
0xFFFFEFEF
),
borderRadius:
BorderRadius
.
circular
(
16
),
),
child:
Row
(
mainAxisAlignment:
MainAxisAlignment
.
center
,
children:
[
Expanded
(
child:
SizedBox
(
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
center
,
children:
[
Text
(
"
${provider.pendingComplaints}
"
,
style:
TextStyle
(
fontSize:
30
,
color:
Color
(
0xFFED3424
),
),
),
),
Text
(
"Pending Complaints"
)
,
]
,
Text
(
"Pending Complaints"
),
]
,
)
,
),
),
)
,
]
,
]
,
)
,
),
),
),
],
),
),
Container
(
padding:
EdgeInsets
.
only
(
left:
15
),
alignment:
Alignment
.
topLeft
,
child:
Text
(
"Collections & Visits"
,
style:
TextStyle
(
color:
Color
(
0xFF818181
),
fontSize:
14
),
),
),
Container
(
margin:
EdgeInsets
.
symmetric
(
horizontal:
10
,
vertical:
15
),
decoration:
BoxDecoration
(
color:
Colors
.
white
,
borderRadius:
BorderRadius
.
circular
(
16
),
],
),
),
child:
GridView
.
builder
(
padding:
EdgeInsets
.
symmetric
(
vertical:
15
,
horizontal:
10
,
Container
(
padding:
EdgeInsets
.
only
(
left:
15
),
alignment:
Alignment
.
topLeft
,
child:
Text
(
"Collections & Visits"
,
style:
TextStyle
(
color:
Color
(
0xFF818181
),
fontFamily:
"JakartaMedium"
,
fontSize:
14
),
),
itemCount:
4
,
shrinkWrap:
true
,
physics:
NeverScrollableScrollPhysics
(),
gridDelegate:
SliverGridDelegateWithFixedCrossAxisCount
(
crossAxisCount:
2
,
crossAxisSpacing:
10
,
mainAxisSpacing:
10
,
childAspectRatio:
22
/
10
,
),
Container
(
margin:
EdgeInsets
.
symmetric
(
horizontal:
10
,
vertical:
15
),
decoration:
BoxDecoration
(
color:
Colors
.
white
,
borderRadius:
BorderRadius
.
circular
(
16
),
),
itemBuilder:
(
context
,
index
)
{
final
numbers
=
[
provider
.
monthlyPaymentCollectionAmount
,
provider
.
paymentCollectionWalletBalanceAmount
,
provider
.
thisMonthsVisits
,
provider
.
todayVisits
,
];
final
names
=
[
"Month Collection"
,
"P.C. Wallet"
,
"Month Visits"
,
"Today Visits"
,
];
final
List
<
int
>
colorCodes
=
[
0xFFEEFCFF
,
0xFFE7FFE5
,
0xFFF3EDFF
,
0xFFFFF6F0
,
];
final
List
<
int
>
textColorCodes
=
[
0xFF1487C9
,
0xFF0D9C00
,
0xFF493272
,
0xFF91481B
,
];
return
InkResponse
(
onTap:
()
{
var
route
;
switch
(
index
)
{
case
0
:
route
=
Monthlycollection
();
break
;
case
1
:
route
=
Pcwallet
();
break
;
case
2
:
route
=
Todaymontlyvisists
(
visitType:
"Month"
);
break
;
case
3
:
route
=
Todaymontlyvisists
(
visitType:
"Today"
);
break
;
}
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
context
)
=>
route
),
);
},
child:
Container
(
padding:
EdgeInsets
.
only
(
left:
15
,
top:
5
,
bottom:
5
,
),
decoration:
BoxDecoration
(
color:
Color
(
colorCodes
[
index
]),
borderRadius:
BorderRadius
.
circular
(
20
),
),
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
mainAxisAlignment:
MainAxisAlignment
.
center
,
children:
[
Text
(
numbers
[
index
].
toString
(),
style:
TextStyle
(
fontSize:
30
,
color:
Color
(
textColorCodes
[
index
]),
child:
GridView
.
builder
(
padding:
EdgeInsets
.
symmetric
(
vertical:
15
,
horizontal:
10
,
),
itemCount:
4
,
shrinkWrap:
true
,
physics:
NeverScrollableScrollPhysics
(),
gridDelegate:
SliverGridDelegateWithFixedCrossAxisCount
(
crossAxisCount:
2
,
crossAxisSpacing:
10
,
mainAxisSpacing:
10
,
childAspectRatio:
22
/
10
,
),
itemBuilder:
(
context
,
index
)
{
final
numbers
=
[
provider
.
monthlyPaymentCollectionAmount
,
provider
.
paymentCollectionWalletBalanceAmount
,
provider
.
thisMonthsVisits
,
provider
.
todayVisits
,
];
final
names
=
[
"Month Collection"
,
"P.C. Wallet"
,
"Month Visits"
,
"Today Visits"
,
];
final
List
<
int
>
colorCodes
=
[
0xFFE7FFE5
,
0xFFFFFCD5
,
0xFFF3EDFF
,
0xFFFFF6F0
,
];
final
List
<
int
>
textColorCodes
=
[
0xFF0D9C00
,
0xFF605C00
,
0xFF493272
,
0xFF91481B
,
];
return
InkResponse
(
onTap:
()
{
var
route
;
switch
(
index
)
{
case
0
:
route
=
Monthlycollection
();
break
;
case
1
:
route
=
Pcwallet
();
break
;
case
2
:
route
=
Todaymontlyvisists
(
visitType:
"Month"
);
break
;
case
3
:
route
=
Todaymontlyvisists
(
visitType:
"Today"
);
break
;
}
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
context
)
=>
route
),
);
},
child:
Container
(
padding:
EdgeInsets
.
only
(
left:
15
,
top:
5
,
bottom:
5
,
),
decoration:
BoxDecoration
(
color:
Color
(
colorCodes
[
index
]),
borderRadius:
BorderRadius
.
circular
(
12
),
),
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
mainAxisAlignment:
MainAxisAlignment
.
center
,
children:
[
Row
(
children:
[
Text
(
"₹"
,
style:
TextStyle
(
fontSize:
14
,
color:
Color
(
textColorCodes
[
index
]),
),),
Padding
(
padding:
EdgeInsets
.
only
(
top:
5
),
child:
Text
(
"
${numbers[index].toString()}
"
,
style:
TextStyle
(
fontSize:
27
,
color:
Color
(
textColorCodes
[
index
]),
),
),
),
],
),
),
Text
(
names
[
index
]),
],
Text
(
names
[
index
],
style:
TextStyle
(
color:
Color
(
0xFF818181
)
),),
],
),
),
),
);
},
),
),
InkResponse
(
onTap:
()
{
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
context
)
=>
Nearbygenerators
(),));
},
child:
Container
(
height:
60
,
margin:
EdgeInsets
.
symmetric
(
horizontal:
10
,
vertical:
0
),
decoration:
BoxDecoration
(
color:
Colors
.
white
,
borderRadius:
BorderRadius
.
circular
(
20
),
);
},
),
),
InkResponse
(
onTap:
()
{
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
context
)
=>
Nearbygenerators
(),));
},
child:
Container
(
height:
60
,
margin:
EdgeInsets
.
symmetric
(
horizontal:
10
,
vertical:
0
),
decoration:
BoxDecoration
(
color:
Colors
.
white
,
borderRadius:
BorderRadius
.
circular
(
20
),
),
child:
Row
(
children:
[
Expanded
(
flex:
1
,
child:
SvgPicture
.
asset
(
"assets/svg/find_generator.svg"
,
child:
Row
(
children:
[
Expanded
(
flex:
1
,
child:
SvgPicture
.
asset
(
"assets/svg/find_generator.svg"
,
),
),
),
Expanded
(
flex:
4
,
child:
Text
(
"Find Nearby Generators"
),
)
,
]
,
Expanded
(
flex:
4
,
child:
Text
(
"Find Nearby Generators"
)
,
),
]
,
)
,
),
),
)
,
]
,
]
,
)
,
),
),
),
...
...
lib/screens/splash.dart
View file @
528df0d2
...
...
@@ -25,13 +25,17 @@ class _SplashState extends State<Splash> {
// TODO: implement initState
super
.
initState
();
splashImage
=
Image
.
asset
(
"assets/images/ic_splash.jpg"
);
requestPermissions
();
final
spalshProvider
=
Provider
.
of
<
SplashVersionNotifier
>(
context
,
listen:
false
,
);
spalshProvider
.
initPackageInfo
();
spalshProvider
.
handleVersionCheck
(
context
);
WidgetsBinding
.
instance
.
addPostFrameCallback
((
_
)
{
requestPermissions
();
final
spalshProvider
=
Provider
.
of
<
SplashVersionNotifier
>(
context
,
listen:
false
,
);
spalshProvider
.
initPackageInfo
();
spalshProvider
.
handleVersionCheck
(
context
);
},);
}
void
requestPermissions
()
async
{
...
...
@@ -139,6 +143,7 @@ class _SplashState extends State<Splash> {
@override
Widget
build
(
BuildContext
context
)
{
return
Scaffold
(
resizeToAvoidBottomInset:
true
,
body:
Consumer
<
SplashVersionNotifier
>(
builder:
(
context
,
value
,
child
)
{
return
Container
(
...
...
lib/services/api_calling.dart
View file @
528df0d2
...
...
@@ -104,7 +104,7 @@ class ApiCalling {
try
{
final
response
=
await
post
({},
getAppVersionUrl
,
{});
if
(
response
!=
null
)
{
//
print("${response.body}");
print
(
"
${response.body}
"
);
return
VersionsResponse
.
fromJson
(
jsonDecode
(
response
.
body
));
}
else
{
return
null
;
...
...
@@ -432,7 +432,7 @@ class ApiCalling {
};
final
res
=
await
post
(
data
,
genTrackerGeneratorDetailsUrl
,
{});
if
(
res
!=
null
)
{
//
debugPrint(res.body);
debugPrint
(
res
.
body
);
return
loadGeneratorDetailsResponse
.
fromJson
(
jsonDecode
(
res
.
body
));
}
else
{
debugPrint
(
"Null Response"
);
...
...
pubspec.lock
View file @
528df0d2
...
...
@@ -29,18 +29,10 @@ packages:
dependency: transitive
description:
name: async
sha256:
"758e6d74e
971c
3
e5
aceb4110bfd6698efc7f501675bcfe0c775459a8140750eb"
sha256:
d2872f9c1
97
3
1c
2
e5
f10444b14686eb7cc85c76274bd6c16e1816bff9a3bab63
url: "https://pub.dev"
source: hosted
version: "2.13.0"
background_location:
dependency: "direct main"
description:
name: background_location
sha256: fbb83ceb8cefcc6793f0a362f12773c28fc290a5e2c76cb593ee592ec7b6cb32
url: "https://pub.dev"
source: hosted
version: "0.13.0"
version: "2.12.0"
boolean_selector:
dependency: transitive
description:
...
...
@@ -237,10 +229,10 @@ packages:
dependency: transitive
description:
name: fake_async
sha256: "
5368f224a74523e8d2e7399ea1638b37aecfca824a3cc4dfdf77bf1fa905ac44
"
sha256: "
6a95e56b2449df2273fd8c45a662d6947ce1ebb7aafe80e550a3f68297f3cacc
"
url: "https://pub.dev"
source: hosted
version: "1.3.
3
"
version: "1.3.
2
"
ffi:
dependency: transitive
description:
...
...
@@ -860,26 +852,26 @@ packages:
dependency: transitive
description:
name: leak_tracker
sha256:
"8dcda04c3fc16c14f48a7bb586d4be1f0d1572731b6d81d51772ef47c02081e0"
sha256:
c35baad643ba394b40aac41080300150a4f08fd0fd6a10378f8f7c6bc161acec
url: "https://pub.dev"
source: hosted
version: "1
1
.0.
1
"
version: "1
0
.0.
8
"
leak_tracker_flutter_testing:
dependency: transitive
description:
name: leak_tracker_flutter_testing
sha256:
"1dbc140bb5a23c75ea9c4811222756104fbcd1a27173f0c34ca01e16bea473c1"
sha256:
f8b613e7e6a13ec79cfdc0e97638fddb3ab848452eff057653abd3edba760573
url: "https://pub.dev"
source: hosted
version: "3.0.
10
"
version: "3.0.
9
"
leak_tracker_testing:
dependency: transitive
description:
name: leak_tracker_testing
sha256: "
8d5a2d49f4a66b49744b23b018848400d23e54caf9463f4eb20df3eb8acb2eb1
"
sha256: "
6ba465d5d76e67ddf503e1161d1f4a6bc42306f9d66ca1e8f079a47290fb06d3
"
url: "https://pub.dev"
source: hosted
version: "3.0.
2
"
version: "3.0.
1
"
lints:
dependency: transitive
description:
...
...
@@ -1481,10 +1473,10 @@ packages:
dependency: transitive
description:
name: vm_service
sha256:
ddfa8d30d89985b96407efce8acbdd124701f96741f2d981ca860662f1c0dc02
sha256:
"0968250880a6c5fe7edc067ed0a13d4bae1577fe2771dcf3010d52c4a9d3ca14"
url: "https://pub.dev"
source: hosted
version: "1
5.0.0
"
version: "1
4.3.1
"
web:
dependency: transitive
description:
...
...
pubspec.yaml
View file @
528df0d2
...
...
@@ -71,7 +71,6 @@ dependencies:
cached_network_image
:
^3.4.1
geocoding
:
^3.0.0
webview_flutter_wkwebview
:
^3.20.0
background_location
:
^0.13.0
dev_dependencies
:
flutter_test
:
...
...
@@ -149,5 +148,29 @@ flutter:
fonts
:
-
asset
:
fonts/Lexend-Light.ttf
-
family
:
JakartaLight
fonts
:
-
asset
:
fonts/PlusJakartaSans-Light.ttf
-
family
:
JakartaRegular
fonts
:
-
asset
:
fonts/PlusJakartaSans-Regular.ttf
-
family
:
JakartaSemiBold
fonts
:
-
asset
:
fonts/PlusJakartaSans-SemiBold.ttf
-
family
:
JakartaMedium
fonts
:
-
asset
:
fonts/PlusJakartaSans-Medium.ttf
-
family
:
JakartaBold
fonts
:
-
asset
:
fonts/PlusJakartaSans-Bold.ttf
-
family
:
JakartaExtraBold
fonts
:
-
asset
:
fonts/PlusJakartaSans-ExtraBold.ttf
# For details regarding fonts from package dependencies,
# see https://flutter.dev/to/font-from-package
Prev
1
2
3
4
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