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_services
Commits
12dd3213
Commit
12dd3213
authored
Nov 15, 2025
by
Sai Srinivas
Browse files
SafeArea changes
parent
6f73c3f4
Changes
4
Hide whitespace changes
Inline
Side-by-side
lib/Screens/HelpAndComplaintScreens/ComplaintDetailsScreen.dart
View file @
12dd3213
...
...
@@ -362,15 +362,16 @@ class _ComplaintDetailsScreenState extends State<ComplaintDetailsScreen> {
);
}
return
SafeArea
(
bottom:
Platform
.
isIOS
?
false
:
true
,
maintainBottomViewPadding:
true
,
top:
false
,
bottom:
Platform
.
isIOS
?
false
:
true
,
child:
RefreshIndicator
.
adaptive
(
color:
AppColors
.
amountText
,
onRefresh:
()
async
{
await
Future
.
delayed
(
const
Duration
(
milliseconds:
600
));
},
child:
Scaffold
(
resizeToAvoidBottomInset:
true
,
backgroundColor:
AppColors
.
backgroundRegular
,
body:
CustomScrollView
(
slivers:
[
...
...
@@ -1133,227 +1134,229 @@ class _ComplaintDetailsScreenState extends State<ComplaintDetailsScreen> {
builder:
(
context
)
{
return
StatefulBuilder
(
builder:
(
context
,
setState
)
{
return
Padding
(
padding:
EdgeInsets
.
only
(
bottom:
MediaQuery
.
of
(
context
).
viewInsets
.
bottom
,
top:
16
,
left:
16
,
right:
16
,
),
child:
Column
(
mainAxisSize:
MainAxisSize
.
min
,
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
[
// Handle Bar
Center
(
child:
Container
(
width:
40
,
height:
4
,
decoration:
BoxDecoration
(
color:
Colors
.
grey
[
300
],
borderRadius:
BorderRadius
.
circular
(
4
),
return
SafeArea
(
child:
Padding
(
padding:
EdgeInsets
.
only
(
bottom:
MediaQuery
.
of
(
context
).
viewInsets
.
bottom
,
top:
16
,
left:
16
,
right:
16
,
),
child:
Column
(
mainAxisSize:
MainAxisSize
.
min
,
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
[
// Handle Bar
Center
(
child:
Container
(
width:
40
,
height:
4
,
decoration:
BoxDecoration
(
color:
Colors
.
grey
[
300
],
borderRadius:
BorderRadius
.
circular
(
4
),
),
),
),
),
const
SizedBox
(
height:
16
),
const
SizedBox
(
height:
16
),
// Title
const
Text
(
"Balance Amount Bill"
,
style:
TextStyle
(
fontSize:
14
,
fontWeight:
FontWeight
.
w500
,
fontFamily:
"Poppins"
,
// Title
const
Text
(
"Balance Amount Bill"
,
style:
TextStyle
(
fontSize:
14
,
fontWeight:
FontWeight
.
w500
,
fontFamily:
"Poppins"
,
),
),
),
const
SizedBox
(
height:
6
),
const
SizedBox
(
height:
6
),
Divider
(),
const
SizedBox
(
height:
10
),
Divider
(),
const
SizedBox
(
height:
10
),
// Pay Total Option
GestureDetector
(
onTap:
()
{
setState
(()
=>
isPartPayment
=
false
);
},
child:
Row
(
children:
[
Radio
<
bool
>(
value:
false
,
groupValue:
isPartPayment
,
onChanged:
(
v
)
=>
setState
(()
=>
isPartPayment
=
v
!),
activeColor:
const
Color
(
0xFF008CDE
),
),
// Radio<bool>(
// value: false,
// groupValue: isPartPayment,
// onChanged: (v) => setState(() => isPartPayment = v!),
// ),
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
[
const
Text
(
"Pay Total"
,
style:
TextStyle
(
fontSize:
14
,
fontFamily:
"Poppins"
,
fontWeight:
FontWeight
.
w400
,
// Pay Total Option
GestureDetector
(
onTap:
()
{
setState
(()
=>
isPartPayment
=
false
);
},
child:
Row
(
children:
[
Radio
<
bool
>(
value:
false
,
groupValue:
isPartPayment
,
onChanged:
(
v
)
=>
setState
(()
=>
isPartPayment
=
v
!),
activeColor:
const
Color
(
0xFF008CDE
),
),
// Radio<bool>(
// value: false,
// groupValue: isPartPayment,
// onChanged: (v) => setState(() => isPartPayment = v!),
// ),
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
[
const
Text
(
"Pay Total"
,
style:
TextStyle
(
fontSize:
14
,
fontFamily:
"Poppins"
,
fontWeight:
FontWeight
.
w400
,
),
),
),
Text
(
"Avoid late payment fees."
,
style:
TextStyle
(
color:
Color
(
0xff5FBB54
)
,
font
Size:
12
,
fontFamily:
"Poppins"
,
Text
(
"Avoid late payment fees."
,
style:
TextStyle
(
color:
Color
(
0xff5FBB54
),
fontSize:
12
,
font
Family:
"Poppins"
,
)
,
),
],
),
const
Spacer
(),
Text
(
"₹
${totalAmount.toStringAsFixed(0)}
"
,
style:
const
TextStyle
(
fontSize:
14
,
fontFamily:
"Poppins"
,
fontWeight:
FontWeight
.
w400
,
),
],
),
const
Spacer
(),
Text
(
"₹
${totalAmount.toStringAsFixed(0)}
"
,
style:
const
TextStyle
(
fontSize:
14
,
fontFamily:
"Poppins"
,
fontWeight:
FontWeight
.
w400
,
),
)
,
]
,
]
,
)
,
),
),
const
SizedBox
(
height:
10
),
const
SizedBox
(
height:
10
),
// Part Payment Option
GestureDetector
(
onTap:
()
{
setState
(()
=>
isPartPayment
=
true
);
},
child:
Row
(
children:
[
Radio
<
bool
>(
value:
true
,
groupValue:
isPartPayment
,
onChanged:
(
v
)
=>
setState
(()
=>
isPartPayment
=
v
!),
activeColor:
const
Color
(
0xFF008CDE
),
),
const
Text
(
"Part Payment"
,
style:
TextStyle
(
fontSize:
14
,
fontFamily:
"Poppins"
,
fontWeight:
FontWeight
.
w400
,
// Part Payment Option
GestureDetector
(
onTap:
()
{
setState
(()
=>
isPartPayment
=
true
);
},
child:
Row
(
children:
[
Radio
<
bool
>(
value:
true
,
groupValue:
isPartPayment
,
onChanged:
(
v
)
=>
setState
(()
=>
isPartPayment
=
v
!),
activeColor:
const
Color
(
0xFF008CDE
),
),
),
const
SizedBox
(
width:
24
),
Expanded
(
child:
Container
(
height:
50
,
alignment:
Alignment
.
center
,
padding:
const
EdgeInsets
.
symmetric
(
horizontal:
10
),
decoration:
BoxDecoration
(
color:
Colors
.
grey
.
shade100
,
borderRadius:
BorderRadius
.
circular
(
12
),
const
Text
(
"Part Payment"
,
style:
TextStyle
(
fontSize:
14
,
fontFamily:
"Poppins"
,
fontWeight:
FontWeight
.
w400
,
),
child:
TextFormField
(
controller:
amountController
,
enabled:
isPartPayment
,
style:
const
TextStyle
(
fontSize:
14
,
fontFamily:
"Poppins"
,
color:
Colors
.
black87
,
),
const
SizedBox
(
width:
24
),
Expanded
(
child:
Container
(
height:
50
,
alignment:
Alignment
.
center
,
padding:
const
EdgeInsets
.
symmetric
(
horizontal:
10
),
decoration:
BoxDecoration
(
color:
Colors
.
grey
.
shade100
,
borderRadius:
BorderRadius
.
circular
(
12
),
),
keyboardType:
TextInputType
.
number
,
decoration:
const
InputDecoration
(
hintText:
"Enter amou
nt
"
,
hintStyle:
TextStyle
(
child:
TextFormField
(
controller:
amountController
,
enabled:
isPartPayme
nt
,
style:
const
TextStyle
(
fontSize:
14
,
fontFamily:
"Poppins"
,
color:
Colors
.
grey
,
color:
Colors
.
black87
,
),
keyboardType:
TextInputType
.
number
,
decoration:
const
InputDecoration
(
hintText:
"Enter amount"
,
hintStyle:
TextStyle
(
fontSize:
14
,
fontFamily:
"Poppins"
,
color:
Colors
.
grey
,
),
border:
InputBorder
.
none
,
),
border:
InputBorder
.
none
,
),
),
),
)
,
]
,
]
,
)
,
),
),
const
SizedBox
(
height:
6
),
const
SizedBox
(
height:
6
),
Divider
(),
const
SizedBox
(
height:
6
),
Divider
(),
const
SizedBox
(
height:
6
),
// Continue Button
SizedBox
(
width:
double
.
infinity
,
child:
ElevatedButton
(
onPressed:
()
{
double
enteredAmount
=
isPartPayment
?
double
.
tryParse
(
amountController
.
text
)
??
0
:
totalAmount
;
// Continue Button
SizedBox
(
width:
double
.
infinity
,
child:
ElevatedButton
(
onPressed:
()
{
double
enteredAmount
=
isPartPayment
?
double
.
tryParse
(
amountController
.
text
)
??
0
:
totalAmount
;
if
(
enteredAmount
<=
0
)
{
ScaffoldMessenger
.
of
(
context
).
showSnackBar
(
const
SnackBar
(
content:
Text
(
"Please enter a valid amount"
),
),
);
return
;
}
if
(
enteredAmount
<=
0
)
{
ScaffoldMessenger
.
of
(
context
).
showSnackBar
(
const
SnackBar
(
content:
Text
(
"Please enter a valid amount"
),
),
);
return
;
}
if
(
isPartPayment
&&
enteredAmount
>
totalAmount
)
{
ScaffoldMessenger
.
of
(
context
).
showSnackBar
(
const
SnackBar
(
content:
Text
(
"Entered amount cannot exceed total amount"
,
if
(
isPartPayment
&&
enteredAmount
>
totalAmount
)
{
ScaffoldMessenger
.
of
(
context
).
showSnackBar
(
const
SnackBar
(
content:
Text
(
"Entered amount cannot exceed total amount"
,
),
),
),
);
return
;
}
);
return
;
}
Navigator
.
pop
(
context
);
Navigator
.
pop
(
context
);
// Pass selected amount to your payAmountFunction
payAmountFunction
(
enteredAmount
.
toStringAsFixed
(
2
));
},
style:
ElevatedButton
.
styleFrom
(
backgroundColor:
const
Color
(
0xFF008CDE
),
foregroundColor:
Colors
.
white
,
shape:
RoundedRectangleBorder
(
borderRadius:
BorderRadius
.
circular
(
30
),
// Pass selected amount to your payAmountFunction
payAmountFunction
(
enteredAmount
.
toStringAsFixed
(
2
));
},
style:
ElevatedButton
.
styleFrom
(
backgroundColor:
const
Color
(
0xFF008CDE
),
foregroundColor:
Colors
.
white
,
shape:
RoundedRectangleBorder
(
borderRadius:
BorderRadius
.
circular
(
30
),
),
padding:
const
EdgeInsets
.
symmetric
(
vertical:
16
),
),
padding:
const
EdgeInsets
.
symmetric
(
vertical:
16
),
),
child:
Padding
(
padding:
const
EdgeInsets
.
symmetric
(
horizontal:
22
),
child:
Row
(
mainAxisAlignment:
MainAxisAlignment
.
spaceBetween
,
children:
[
const
Text
(
"Continue Payment"
,
style:
TextStyle
(
fontFamily:
"Poppins"
,
child:
Padding
(
padding:
const
EdgeInsets
.
symmetric
(
horizontal:
22
),
child:
Row
(
mainAxisAlignment:
MainAxisAlignment
.
spaceBetween
,
children:
[
const
Text
(
"Continue Payment"
,
style:
TextStyle
(
fontFamily:
"Poppins"
,
color:
Colors
.
white
,
fontSize:
16
,
),
),
SvgPicture
.
asset
(
"assets/svg/continue_ic.svg"
,
color:
Colors
.
white
,
fontSize:
16
,
height:
25
,
width:
25
,
),
),
SvgPicture
.
asset
(
"assets/svg/continue_ic.svg"
,
color:
Colors
.
white
,
height:
25
,
width:
25
,
),
],
],
),
),
),
),
),
const
SizedBox
(
height:
16
)
,
]
,
const
SizedBox
(
height:
16
),
]
,
)
,
),
);
},
...
...
lib/Screens/HelpAndComplaintScreens/ComplaintListScreen.dart
View file @
12dd3213
import
'dart:io'
;
import
'package:flutter/material.dart'
;
import
'package:flutter_svg/svg.dart'
;
import
'package:gen_service/Notifiers/HelpAndComplaintProvider.dart'
;
...
...
@@ -198,217 +200,223 @@ class _ComplaintListScreenState extends State<ComplaintListScreen> {
sessionId:
widget
.
sessionId
,
);
},
child:
Scaffold
(
backgroundColor:
AppColors
.
backgroundRegular
,
body:
CustomScrollView
(
physics:
const
ClampingScrollPhysics
(),
slivers:
<
Widget
>[
SliverAppBar
(
automaticallyImplyLeading:
false
,
stretch:
_stretch
,
backgroundColor:
const
Color
(
0xFF4076FF
),
onStretchTrigger:
()
async
{
await
provider
.
fetchComplaintsList
(
accId:
widget
.
accId
,
sessionId:
widget
.
sessionId
,
);
},
stretchTriggerOffset:
300.0
,
// expandedHeight: 60.0,
flexibleSpace:
FlexibleSpaceBar
(
stretchModes:
const
[
StretchMode
.
zoomBackground
,
StretchMode
.
blurBackground
,
],
background:
Container
(
decoration:
const
BoxDecoration
(
gradient:
AppColors
.
commonAppBarGradient
),
child:
Padding
(
padding:
const
EdgeInsets
.
symmetric
(
horizontal:
16
,
vertical:
16
,
),
child:
Row
(
crossAxisAlignment:
CrossAxisAlignment
.
end
,
children:
[
InkResponse
(
onTap:
()
=>
Navigator
.
pop
(
context
,
true
),
child:
SvgPicture
.
asset
(
color:
Colors
.
white
,
"assets/svg/continue_left_ic.svg"
,
height:
30
,
child:
SafeArea
(
top:
false
,
bottom:
Platform
.
isIOS
?
false
:
true
,
maintainBottomViewPadding:
true
,
child:
Scaffold
(
resizeToAvoidBottomInset:
true
,
backgroundColor:
AppColors
.
backgroundRegular
,
body:
CustomScrollView
(
physics:
const
ClampingScrollPhysics
(),
slivers:
<
Widget
>[
SliverAppBar
(
automaticallyImplyLeading:
false
,
stretch:
_stretch
,
backgroundColor:
const
Color
(
0xFF4076FF
),
onStretchTrigger:
()
async
{
await
provider
.
fetchComplaintsList
(
accId:
widget
.
accId
,
sessionId:
widget
.
sessionId
,
);
},
stretchTriggerOffset:
300.0
,
// expandedHeight: 60.0,
flexibleSpace:
FlexibleSpaceBar
(
stretchModes:
const
[
StretchMode
.
zoomBackground
,
StretchMode
.
blurBackground
,
],
background:
Container
(
decoration:
const
BoxDecoration
(
gradient:
AppColors
.
commonAppBarGradient
),
child:
Padding
(
padding:
const
EdgeInsets
.
symmetric
(
horizontal:
16
,
vertical:
16
,
),
child:
Row
(
crossAxisAlignment:
CrossAxisAlignment
.
end
,
children:
[
InkResponse
(
onTap:
()
=>
Navigator
.
pop
(
context
,
true
),
child:
SvgPicture
.
asset
(
color:
Colors
.
white
,
"assets/svg/continue_left_ic.svg"
,
height:
30
,
),
),
),
const
SizedBox
(
width:
10
),
const
Text
(
"Help?"
,
style:
TextStyle
(
font
Size:
16
,
font
Family:
"Poppins"
,
fontWeight:
FontWeight
.
w400
,
color:
Colors
.
white
,
const
SizedBox
(
width:
10
),
const
Text
(
"Help?"
,
style:
TextStyle
(
fontSize:
16
,
font
Family:
"Poppins"
,
font
Weight:
FontWeight
.
w400
,
color:
Colors
.
white
,
)
,
),
)
,
]
,
]
,
)
,
),
),
),
),
),
/// Main body container
SliverToBoxAdapter
(
child:
Container
(
padding:
const
EdgeInsets
.
only
(
top:
1
),
color:
AppColors
.
backgroundBottom
,
/// Main body container
SliverToBoxAdapter
(
child:
Container
(
padding:
const
EdgeInsets
.
symmetric
(
horizontal:
16
,
vertical:
20
,
),
decoration:
const
BoxDecoration
(
color:
AppColors
.
backgroundRegular
,
borderRadius:
BorderRadius
.
only
(
topLeft:
Radius
.
circular
(
30
),
topRight:
Radius
.
circular
(
30
),
padding:
const
EdgeInsets
.
only
(
top:
1
),
color:
AppColors
.
backgroundBottom
,
child:
Container
(
padding:
const
EdgeInsets
.
symmetric
(
horizontal:
16
,
vertical:
20
,
),
),
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
[
/// Top Tile
InkResponse
(
onTap:
()
{
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
context
)
=>
SelectOrderHelpScreen
(
accId:
widget
.
accId
,
sessionId:
widget
.
sessionId
,
),
decoration:
const
BoxDecoration
(
color:
AppColors
.
backgroundRegular
,
borderRadius:
BorderRadius
.
only
(
topLeft:
Radius
.
circular
(
30
),
topRight:
Radius
.
circular
(
30
),
),
),
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
[
/// Top Tile
InkResponse
(
onTap:
()
{
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
context
)
=>
SelectOrderHelpScreen
(
accId:
widget
.
accId
,
sessionId:
widget
.
sessionId
,
),
),
).
then
((
_
)
async
{
await
provider
.
fetchComplaintsList
(
accId:
widget
.
accId
,
sessionId:
widget
.
sessionId
,
);
});
},
child:
Container
(
padding:
const
EdgeInsets
.
symmetric
(
vertical:
16
,
horizontal:
14
,
),
).
then
((
_
)
async
{
await
provider
.
fetchComplaintsList
(
accId:
widget
.
accId
,
sessionId:
widget
.
sessionId
,
);
});
},
child:
Container
(
padding:
const
EdgeInsets
.
symmetric
(
vertical:
16
,
horizontal:
14
,
),
decoration:
BoxDecoration
(
color:
Colors
.
white
,
borderRadius:
BorderRadius
.
circular
(
14
),
),
child:
Row
(
children:
[
SizedBox
(
height:
42
,
width:
42
,
child:
SvgPicture
.
asset
(
"assets/svg/help_ic.svg"
,
fit:
BoxFit
.
contain
,
decoration:
BoxDecoration
(
color:
Colors
.
white
,
borderRadius:
BorderRadius
.
circular
(
14
),
),
child:
Row
(
children:
[
SizedBox
(
height:
42
,
width:
42
,
child:
SvgPicture
.
asset
(
"assets/svg/help_ic.svg"
,
fit:
BoxFit
.
contain
,
),
),
),
const
SizedBox
(
width:
12
),
Expanded
(
child:
Column
(
crossAxisAlignm
en
t
:
CrossAxisAlignment
.
start
,
children:
const
[
Text
(
"Get help for an order"
,
style:
TextStyle
(
font
Family:
"Poppins"
,
font
Size:
14
,
fontWeight:
FontWeight
.
w400
,
color:
Colors
.
black
,
const
SizedBox
(
width:
12
),
Expanded
(
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
childr
en:
const
[
Text
(
"Get help for an order"
,
style:
TextStyle
(
fontFamily:
"Poppins"
,
font
Size:
14
,
font
Weight:
FontWeight
.
w400
,
color:
Colors
.
black
,
)
,
),
),
SizedBox
(
height:
4
),
Text
(
"Select a Generator"
,
style:
TextStyle
(
font
Family:
"Poppins"
,
font
Size:
12
,
fontWeight:
FontWeight
.
w400
,
color:
Colors
.
grey
,
SizedBox
(
height:
4
),
Text
(
"Select a Generator"
,
style:
TextStyle
(
fontFamily:
"Poppins"
,
font
Size:
12
,
font
Weight:
FontWeight
.
w400
,
color:
Colors
.
grey
,
)
,
),
)
,
]
,
]
,
)
,
),
),
SvgPicture
.
asset
(
"assets/svg/continue_ic.svg"
,
color:
Colors
.
black
,
height:
32
,
)
,
]
,
SvgPicture
.
asset
(
"assets/svg/continue_ic.svg"
,
color:
Colors
.
black
,
height:
32
,
)
,
]
,
)
,
),
),
),
const
SizedBox
(
height:
25
),
const
SizedBox
(
height:
25
),
/// Raised Complaints
if
(
openComplaints
.
isNotEmpty
)
const
Text
(
"Raised Complaints"
,
style:
TextStyle
(
fontSize:
14
,
fontWeight:
FontWeight
.
w500
,
color:
Colors
.
black87
,
/// Raised Complaints
if
(
openComplaints
.
isNotEmpty
)
const
Text
(
"Raised Complaints"
,
style:
TextStyle
(
fontSize:
14
,
fontWeight:
FontWeight
.
w500
,
color:
Colors
.
black87
,
),
),
),
const
SizedBox
(
height:
8
),
...
openComplaints
.
map
(
(
c
)
=>
ComplaintCard
(
accId:
widget
.
accId
,
sessionId:
widget
.
sessionId
,
title:
c
.
complaintName
??
"-"
,
id:
c
.
id
??
"-"
,
product:
c
.
productName
??
""
,
status:
c
.
openStatus
??
"Open"
,
date:
c
.
registredDate
??
""
,
engModel:
c
.
modelName
??
"-"
,
const
SizedBox
(
height:
8
),
...
openComplaints
.
map
(
(
c
)
=>
ComplaintCard
(
accId:
widget
.
accId
,
sessionId:
widget
.
sessionId
,
title:
c
.
complaintName
??
"-"
,
id:
c
.
id
??
"-"
,
product:
c
.
productName
??
""
,
status:
c
.
openStatus
??
"Open"
,
date:
c
.
registredDate
??
""
,
engModel:
c
.
modelName
??
"-"
,
),
),
),
const
SizedBox
(
height:
25
),
const
SizedBox
(
height:
25
),
/// Resolved Complaints
if
(
closedComplaints
.
isNotEmpty
)
const
Text
(
"Resolved Complaints"
,
style:
TextStyle
(
fontSize:
14
,
fontWeight:
FontWeight
.
w500
,
color:
Colors
.
black87
,
/// Resolved Complaints
if
(
closedComplaints
.
isNotEmpty
)
const
Text
(
"Resolved Complaints"
,
style:
TextStyle
(
fontSize:
14
,
fontWeight:
FontWeight
.
w500
,
color:
Colors
.
black87
,
),
),
),
const
SizedBox
(
height:
8
),
...
closedComplaints
.
map
(
(
c
)
=>
ComplaintCard
(
accId:
widget
.
accId
,
sessionId:
widget
.
sessionId
,
title:
c
.
complaintName
??
"-"
,
id:
c
.
id
??
""
,
product:
c
.
productName
??
""
,
status:
c
.
openStatus
??
"Closed"
,
date:
c
.
registredDate
??
""
,
engModel:
c
.
modelName
??
""
,
const
SizedBox
(
height:
8
),
...
closedComplaints
.
map
(
(
c
)
=>
ComplaintCard
(
accId:
widget
.
accId
,
sessionId:
widget
.
sessionId
,
title:
c
.
complaintName
??
"-"
,
id:
c
.
id
??
""
,
product:
c
.
productName
??
""
,
status:
c
.
openStatus
??
"Closed"
,
date:
c
.
registredDate
??
""
,
engModel:
c
.
modelName
??
""
,
),
),
)
,
]
,
]
,
)
,
),
),
),
)
,
]
,
]
,
)
,
),
),
);
...
...
lib/Screens/HelpAndComplaintScreens/SelectOrderHelpScreen.dart
View file @
12dd3213
import
'dart:io'
;
import
'package:flutter/material.dart'
;
import
'package:flutter_svg/flutter_svg.dart'
;
import
'package:gen_service/Notifiers/HelpAndComplaintProvider.dart'
;
...
...
@@ -191,148 +193,154 @@ class _SelectOrderHelpScreenState extends State<SelectOrderHelpScreen> {
sessionId:
widget
.
sessionId
,
);
},
child:
Scaffold
(
backgroundColor:
AppColors
.
backgroundRegular
,
body:
CustomScrollView
(
physics:
const
ClampingScrollPhysics
(),
slivers:
<
Widget
>[
/// App bar section
SliverAppBar
(
leading:
Container
(),
stretch:
_stretch
,
backgroundColor:
const
Color
(
0xFF4076FF
),
onStretchTrigger:
()
async
{
await
provider
.
fetchGeneratorList
(
accId:
widget
.
accId
,
sessionId:
widget
.
sessionId
,
);
},
stretchTriggerOffset:
300.0
,
flexibleSpace:
FlexibleSpaceBar
(
stretchModes:
const
[
StretchMode
.
zoomBackground
,
StretchMode
.
blurBackground
,
],
background:
Container
(
decoration:
const
BoxDecoration
(
gradient:
AppColors
.
commonAppBarGradient
),
child:
Padding
(
padding:
const
EdgeInsets
.
symmetric
(
horizontal:
16
,
vertical:
16
,
),
child:
Row
(
crossAxisAlignment:
CrossAxisAlignment
.
end
,
children:
[
InkResponse
(
onTap:
()
=>
Navigator
.
pop
(
context
,
true
),
child:
SvgPicture
.
asset
(
"assets/svg/continue_left_ic.svg"
,
height:
30
,
color:
Colors
.
white
,
child:
SafeArea
(
top:
false
,
bottom:
Platform
.
isIOS
?
false
:
true
,
maintainBottomViewPadding:
true
,
child:
Scaffold
(
resizeToAvoidBottomInset:
true
,
backgroundColor:
AppColors
.
backgroundRegular
,
body:
CustomScrollView
(
physics:
const
ClampingScrollPhysics
(),
slivers:
<
Widget
>[
/// App bar section
SliverAppBar
(
leading:
Container
(),
stretch:
_stretch
,
backgroundColor:
const
Color
(
0xFF4076FF
),
onStretchTrigger:
()
async
{
await
provider
.
fetchGeneratorList
(
accId:
widget
.
accId
,
sessionId:
widget
.
sessionId
,
);
},
stretchTriggerOffset:
300.0
,
flexibleSpace:
FlexibleSpaceBar
(
stretchModes:
const
[
StretchMode
.
zoomBackground
,
StretchMode
.
blurBackground
,
],
background:
Container
(
decoration:
const
BoxDecoration
(
gradient:
AppColors
.
commonAppBarGradient
),
child:
Padding
(
padding:
const
EdgeInsets
.
symmetric
(
horizontal:
16
,
vertical:
16
,
),
child:
Row
(
crossAxisAlignment:
CrossAxisAlignment
.
end
,
children:
[
InkResponse
(
onTap:
()
=>
Navigator
.
pop
(
context
,
true
),
child:
SvgPicture
.
asset
(
"assets/svg/continue_left_ic.svg"
,
height:
30
,
color:
Colors
.
white
,
),
),
),
const
SizedBox
(
width:
10
),
const
Text
(
"Help?"
,
style:
TextStyle
(
font
Size:
16
,
font
Family:
"Poppins"
,
fontWeight:
FontWeight
.
w400
,
color:
Colors
.
white
,
const
SizedBox
(
width:
10
),
const
Text
(
"Help?"
,
style:
TextStyle
(
fontSize:
16
,
font
Family:
"Poppins"
,
font
Weight:
FontWeight
.
w400
,
color:
Colors
.
white
,
)
,
),
)
,
]
,
]
,
)
,
),
),
),
),
),
/// Main content
SliverToBoxAdapter
(
child:
Container
(
color:
AppColors
.
backgroundBottom
,
/// Main content
SliverToBoxAdapter
(
child:
Container
(
padding:
const
EdgeInsets
.
symmetric
(
horizontal:
16
,
vertical:
20
,
),
decoration:
const
BoxDecoration
(
color:
AppColors
.
backgroundRegular
,
borderRadius:
BorderRadius
.
only
(
topLeft:
Radius
.
circular
(
30
),
topRight:
Radius
.
circular
(
30
),
color:
AppColors
.
backgroundBottom
,
child:
Container
(
padding:
const
EdgeInsets
.
symmetric
(
horizontal:
16
,
vertical:
20
,
),
),
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
[
Padding
(
padding:
const
EdgeInsets
.
all
(
10.0
),
child:
const
Text
(
"Select the Generator you are
\n
having issues with"
,
style:
TextStyle
(
fontSize:
16
,
fontFamily:
"PoppinsMedium"
,
fontWeight:
FontWeight
.
w500
,
color:
Colors
.
black87
,
decoration:
const
BoxDecoration
(
color:
AppColors
.
backgroundRegular
,
borderRadius:
BorderRadius
.
only
(
topLeft:
Radius
.
circular
(
30
),
topRight:
Radius
.
circular
(
30
),
),
),
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
[
Padding
(
padding:
const
EdgeInsets
.
all
(
10.0
),
child:
const
Text
(
"Select the Generator you are
\n
having issues with"
,
style:
TextStyle
(
fontSize:
16
,
fontFamily:
"PoppinsMedium"
,
fontWeight:
FontWeight
.
w500
,
color:
Colors
.
black87
,
),
),
),
),
const
SizedBox
(
height:
16
),
const
SizedBox
(
height:
16
),
/// Generator List from Provider
...
genList
.
map
((
order
)
{
return
Column
(
children:
[
InkResponse
(
onTap:
()
{
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
context
)
=>
AddComplaintScreen
(
accId:
widget
.
accId
,
sessionId:
widget
.
sessionId
,
product:
order
.
prodName
.
toString
(),
hashId:
order
.
hashId
.
toString
(),
modolNo:
order
.
engine
.
toString
(),
),
),
).
then
((
_
)
async
{
await
provider
.
fetchGeneratorList
(
accId:
widget
.
accId
,
sessionId:
widget
.
sessionId
,
);
});
},
child:
_buildOrderItem
(
assetId:
"#
${order.hashId ?? ''}
| Engine :
${order.engine ?? ''}
"
,
description:
order
.
prodName
??
''
,
amc:
order
.
amc
??
''
,
warranty:
order
.
warranty
??
''
,
pImage:
order
.
productImage
??
''
,
date:
order
.
schedule
?.
isNotEmpty
==
true
?
order
.
schedule
!.
first
:
null
,
serviceText:
order
.
schedule
?.
isNotEmpty
==
true
?
'Upcoming Service Scheduled'
:
null
,
/// Generator List from Provider
...
genList
.
map
((
order
)
{
return
Column
(
children:
[
InkResponse
(
onTap:
()
{
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
context
)
=>
AddComplaintScreen
(
accId:
widget
.
accId
,
sessionId:
widget
.
sessionId
,
product:
order
.
prodName
.
toString
(),
hashId:
order
.
hashId
.
toString
(),
modolNo:
order
.
engine
.
toString
(),
),
),
).
then
((
_
)
async
{
await
provider
.
fetchGeneratorList
(
accId:
widget
.
accId
,
sessionId:
widget
.
sessionId
,
);
});
},
child:
_buildOrderItem
(
assetId:
"#
${order.hashId ?? ''}
| Engine :
${order.engine ?? ''}
"
,
description:
order
.
prodName
??
''
,
amc:
order
.
amc
??
''
,
warranty:
order
.
warranty
??
''
,
pImage:
order
.
productImage
??
''
,
date:
order
.
schedule
?.
isNotEmpty
==
true
?
order
.
schedule
!.
first
:
null
,
serviceText:
order
.
schedule
?.
isNotEmpty
==
true
?
'Upcoming Service Scheduled'
:
null
,
),
),
),
const
SizedBox
(
height:
12
)
,
],
);
}).
toList
()
,
]
,
const
SizedBox
(
height:
12
),
]
,
);
}).
toList
(),
]
,
)
,
),
),
),
)
,
]
,
]
,
)
,
),
),
);
...
...
lib/Screens/HelpAndComplaintScreens/jobcardListScreen.dart
View file @
12dd3213
...
...
@@ -724,227 +724,229 @@ class _JobcardlistscreenState extends State<Jobcardlistscreen> {
builder:
(
context
)
{
return
StatefulBuilder
(
builder:
(
context
,
setState
)
{
return
Padding
(
padding:
EdgeInsets
.
only
(
bottom:
MediaQuery
.
of
(
context
).
viewInsets
.
bottom
,
top:
16
,
left:
16
,
right:
16
,
),
child:
Column
(
mainAxisSize:
MainAxisSize
.
min
,
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
[
// Handle Bar
Center
(
child:
Container
(
width:
40
,
height:
4
,
decoration:
BoxDecoration
(
color:
Colors
.
grey
[
300
],
borderRadius:
BorderRadius
.
circular
(
4
),
return
SafeArea
(
child:
Padding
(
padding:
EdgeInsets
.
only
(
bottom:
MediaQuery
.
of
(
context
).
viewInsets
.
bottom
,
top:
16
,
left:
16
,
right:
16
,
),
child:
Column
(
mainAxisSize:
MainAxisSize
.
min
,
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
[
// Handle Bar
Center
(
child:
Container
(
width:
40
,
height:
4
,
decoration:
BoxDecoration
(
color:
Colors
.
grey
[
300
],
borderRadius:
BorderRadius
.
circular
(
4
),
),
),
),
),
const
SizedBox
(
height:
16
),
// Title
const
Text
(
"Balance Amount Bill"
,
style:
TextStyle
(
font
Size:
14
,
font
Weight:
FontWeight
.
w500
,
fontFamily:
"Poppins"
,
const
SizedBox
(
height:
16
),
// Title
const
Text
(
"Balance Amount Bill"
,
style:
TextStyle
(
fontSize:
14
,
font
Weight:
FontWeight
.
w500
,
font
Family:
"Poppins"
,
)
,
),
),
const
SizedBox
(
height:
6
),
Divider
(
),
const
SizedBox
(
height:
10
),
// Pay Total Option
GestureDetector
(
onTap:
()
{
setState
(()
=>
isPartPayment
=
false
);
},
child
:
Row
(
children:
[
Radio
<
bool
>(
value:
false
,
groupValue:
isPartPayment
,
onChanged:
(
v
)
=>
setState
(()
=>
isPartPayment
=
v
!
),
activeColor:
const
Color
(
0xFF008CDE
),
),
//
Radio<bool>(
//
value: false
,
//
groupValue:
isPartPayment,
//
onChanged: (v) => setState(() => isPartPayment = v!
),
// ),
Column
(
crossAxisAlignm
en
t
:
CrossAxisAlignment
.
start
,
children:
[
const
Text
(
"Pay Total"
,
style:
TextStyle
(
font
Size:
14
,
font
Family:
"Poppins"
,
fontWeight:
FontWeight
.
w400
,
const
SizedBox
(
height:
6
),
Divider
(),
const
SizedBox
(
height:
10
),
// Pay Total Option
GestureDetector
(
onTap:
()
{
setState
(()
=>
isPartPayment
=
false
);
},
child:
Row
(
child
ren:
[
Radio
<
bool
>(
value:
false
,
groupValue:
isPartPayment
,
onChanged:
(
v
)
=>
setState
(()
=>
isPartPayment
=
v
!)
,
activeColor:
const
Color
(
0xFF008CDE
),
),
// Radio<bool>(
//
value: false,
//
groupValue: isPartPayment
,
//
onChanged: (v) => setState(() =>
isPartPayment
= v!)
,
// ),
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
childr
en:
[
const
Text
(
"Pay Total"
,
style:
TextStyle
(
fontSize:
14
,
font
Family:
"Poppins"
,
font
Weight:
FontWeight
.
w400
,
)
,
),
),
Text
(
"Avoid late payment fees."
,
style:
TextStyle
(
color:
Color
(
0xff5FBB54
)
,
font
Size:
12
,
fontFamily:
"Poppins"
,
Text
(
"Avoid late payment fees."
,
style:
TextStyle
(
color:
Color
(
0xff5FBB54
),
fontSize:
12
,
font
Family:
"Poppins"
,
)
,
),
],
),
const
Spacer
(),
Text
(
"₹
${totalAmount.toStringAsFixed(0)}
"
,
style:
const
TextStyle
(
fontSize:
14
,
fontFamily:
"Poppins"
,
fontWeight:
FontWeight
.
w400
,
),
],
),
const
Spacer
(),
Text
(
"₹
${totalAmount.toStringAsFixed(0)}
"
,
style:
const
TextStyle
(
fontSize:
14
,
fontFamily:
"Poppins"
,
fontWeight:
FontWeight
.
w400
,
),
)
,
]
,
]
,
)
,
),
),
const
SizedBox
(
height:
10
),
// Part Payment Option
GestureDetector
(
onTap:
()
{
setState
(()
=>
isPartPayment
=
true
);
},
child:
Row
(
children:
[
Radio
<
bool
>(
value:
true
,
groupValue:
isPartPayment
,
onChanged:
(
v
)
=>
setState
(()
=>
isPartPayment
=
v
!),
activeColor:
const
Color
(
0xFF008CDE
),
),
const
Text
(
"Part Payment"
,
style:
TextStyle
(
fontSize:
14
,
fontFamily:
"Poppins"
,
fontWeight:
FontWeight
.
w400
,
const
SizedBox
(
height:
10
),
// Part Payment Option
GestureDetector
(
onTap:
()
{
setState
(()
=>
isPartPayment
=
true
);
},
child:
Row
(
children:
[
Radio
<
bool
>(
value:
true
,
groupValue:
isPartPayment
,
onChanged:
(
v
)
=>
setState
(()
=>
isPartPayment
=
v
!),
activeColor:
const
Color
(
0xFF008CDE
),
),
),
const
SizedBox
(
width:
24
),
Expanded
(
child:
Container
(
height:
50
,
alignment:
Alignment
.
center
,
padding:
const
EdgeInsets
.
symmetric
(
horizontal:
10
),
decoration:
BoxDecoration
(
color:
Colors
.
grey
.
shade100
,
borderRadius:
BorderRadius
.
circular
(
12
),
const
Text
(
"Part Payment"
,
style:
TextStyle
(
fontSize:
14
,
fontFamily:
"Poppins"
,
fontWeight:
FontWeight
.
w400
,
),
child:
TextFormField
(
controller:
amountController
,
enabled:
isPartPayment
,
style:
const
TextStyle
(
fontSize:
14
,
fontFamily:
"Poppins"
,
color:
Colors
.
black87
,
),
const
SizedBox
(
width:
24
),
Expanded
(
child:
Container
(
height:
50
,
alignment:
Alignment
.
center
,
padding:
const
EdgeInsets
.
symmetric
(
horizontal:
10
),
decoration:
BoxDecoration
(
color:
Colors
.
grey
.
shade100
,
borderRadius:
BorderRadius
.
circular
(
12
),
),
keyboardType:
TextInputType
.
number
,
decoration:
const
InputDecoration
(
hintText:
"Enter amou
nt
"
,
hintStyle:
TextStyle
(
child:
TextFormField
(
controller:
amountController
,
enabled:
isPartPayme
nt
,
style:
const
TextStyle
(
fontSize:
14
,
fontFamily:
"Poppins"
,
color:
Colors
.
grey
,
color:
Colors
.
black87
,
),
keyboardType:
TextInputType
.
number
,
decoration:
const
InputDecoration
(
hintText:
"Enter amount"
,
hintStyle:
TextStyle
(
fontSize:
14
,
fontFamily:
"Poppins"
,
color:
Colors
.
grey
,
),
border:
InputBorder
.
none
,
),
border:
InputBorder
.
none
,
),
),
),
)
,
]
,
]
,
)
,
),
),
const
SizedBox
(
height:
6
),
Divider
(),
const
SizedBox
(
height:
6
),
// Continue Button
SizedBox
(
width:
double
.
infinity
,
child:
ElevatedButton
(
onPressed:
()
{
double
enteredAmount
=
isPartPayment
?
double
.
tryParse
(
amountController
.
text
)
??
0
:
totalAmount
;
if
(
enteredAmount
<=
0
)
{
ScaffoldMessenger
.
of
(
context
).
showSnackBar
(
const
SnackBar
(
content:
Text
(
"Please enter a valid amount"
),
),
);
return
;
}
if
(
isPartPayment
&&
enteredAmount
>
totalAmount
)
{
ScaffoldMessenger
.
of
(
context
).
showSnackBar
(
const
SnackBar
(
content:
Text
(
"Entered amount cannot exceed total amount"
,
const
SizedBox
(
height:
6
),
Divider
(),
const
SizedBox
(
height:
6
),
// Continue Button
SizedBox
(
width:
double
.
infinity
,
child:
ElevatedButton
(
onPressed:
()
{
double
enteredAmount
=
isPartPayment
?
double
.
tryParse
(
amountController
.
text
)
??
0
:
totalAmount
;
if
(
enteredAmount
<=
0
)
{
ScaffoldMessenger
.
of
(
context
).
showSnackBar
(
const
SnackBar
(
content:
Text
(
"Please enter a valid amount"
),
),
),
);
return
;
}
Navigator
.
pop
(
context
);
// Pass selected amount to your payAmountFunction
payAmountFunction
(
enteredAmount
.
toStringAsFixed
(
2
));
},
style:
ElevatedButton
.
styleFrom
(
backgroundColor:
const
Color
(
0xFF008CDE
),
foregroundColor:
Colors
.
white
,
shape:
RoundedRectangleBorder
(
borderRadius:
BorderRadius
.
circular
(
30
),
);
return
;
}
if
(
isPartPayment
&&
enteredAmount
>
totalAmount
)
{
ScaffoldMessenger
.
of
(
context
).
showSnackBar
(
const
SnackBar
(
content:
Text
(
"Entered amount cannot exceed total amount"
,
),
),
);
return
;
}
Navigator
.
pop
(
context
);
// Pass selected amount to your payAmountFunction
payAmountFunction
(
enteredAmount
.
toStringAsFixed
(
2
));
},
style:
ElevatedButton
.
styleFrom
(
backgroundColor:
const
Color
(
0xFF008CDE
),
foregroundColor:
Colors
.
white
,
shape:
RoundedRectangleBorder
(
borderRadius:
BorderRadius
.
circular
(
30
),
),
padding:
const
EdgeInsets
.
symmetric
(
vertical:
16
),
),
padding:
const
EdgeInsets
.
symmetric
(
vertical:
16
),
),
child:
Padding
(
padding:
const
EdgeInsets
.
symmetric
(
horizontal:
22
),
child:
Row
(
mainAxisAlignment:
MainAxisAlignment
.
spaceBetween
,
children:
[
const
Text
(
"Continue Payment"
,
style:
TextStyle
(
fontFamily:
"Poppins"
,
child:
Padding
(
padding:
const
EdgeInsets
.
symmetric
(
horizontal:
22
),
child:
Row
(
mainAxisAlignment:
MainAxisAlignment
.
spaceBetween
,
children:
[
const
Text
(
"Continue Payment"
,
style:
TextStyle
(
fontFamily:
"Poppins"
,
color:
Colors
.
white
,
fontSize:
16
,
),
),
SvgPicture
.
asset
(
"assets/svg/continue_ic.svg"
,
color:
Colors
.
white
,
fontSize:
16
,
height:
25
,
width:
25
,
),
),
SvgPicture
.
asset
(
"assets/svg/continue_ic.svg"
,
color:
Colors
.
white
,
height:
25
,
width:
25
,
),
],
],
),
),
),
),
),
const
SizedBox
(
height:
16
)
,
]
,
const
SizedBox
(
height:
16
),
]
,
)
,
),
);
},
...
...
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