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
6f73c3f4
Commit
6f73c3f4
authored
Nov 15, 2025
by
Sai Srinivas
Browse files
UI changes
parent
72fe8e92
Changes
47
Hide whitespace changes
Inline
Side-by-side
lib/Screens/HelpAndComplaintScreens/ComplaintListScreen.dart
View file @
6f73c3f4
...
@@ -204,7 +204,7 @@ class _ComplaintListScreenState extends State<ComplaintListScreen> {
...
@@ -204,7 +204,7 @@ class _ComplaintListScreenState extends State<ComplaintListScreen> {
physics:
const
ClampingScrollPhysics
(),
physics:
const
ClampingScrollPhysics
(),
slivers:
<
Widget
>[
slivers:
<
Widget
>[
SliverAppBar
(
SliverAppBar
(
leading:
Container
()
,
automaticallyImplyLeading:
false
,
stretch:
_stretch
,
stretch:
_stretch
,
backgroundColor:
const
Color
(
0xFF4076FF
),
backgroundColor:
const
Color
(
0xFF4076FF
),
onStretchTrigger:
()
async
{
onStretchTrigger:
()
async
{
...
@@ -221,7 +221,7 @@ class _ComplaintListScreenState extends State<ComplaintListScreen> {
...
@@ -221,7 +221,7 @@ class _ComplaintListScreenState extends State<ComplaintListScreen> {
StretchMode
.
blurBackground
,
StretchMode
.
blurBackground
,
],
],
background:
Container
(
background:
Container
(
decoration:
const
BoxDecoration
(
color
:
AppColors
.
primary
),
decoration:
const
BoxDecoration
(
gradient
:
AppColors
.
commonAppBarGradient
),
child:
Padding
(
child:
Padding
(
padding:
const
EdgeInsets
.
symmetric
(
padding:
const
EdgeInsets
.
symmetric
(
horizontal:
16
,
horizontal:
16
,
...
@@ -259,7 +259,7 @@ class _ComplaintListScreenState extends State<ComplaintListScreen> {
...
@@ -259,7 +259,7 @@ class _ComplaintListScreenState extends State<ComplaintListScreen> {
SliverToBoxAdapter
(
SliverToBoxAdapter
(
child:
Container
(
child:
Container
(
padding:
const
EdgeInsets
.
only
(
top:
1
),
padding:
const
EdgeInsets
.
only
(
top:
1
),
color:
AppColors
.
primary
,
color:
AppColors
.
backgroundBottom
,
child:
Container
(
child:
Container
(
padding:
const
EdgeInsets
.
symmetric
(
padding:
const
EdgeInsets
.
symmetric
(
horizontal:
16
,
horizontal:
16
,
...
...
lib/Screens/HelpAndComplaintScreens/SelectOrderHelpScreen.dart
View file @
6f73c3f4
...
@@ -387,49 +387,76 @@ class _SelectOrderHelpScreenState extends State<SelectOrderHelpScreen> {
...
@@ -387,49 +387,76 @@ class _SelectOrderHelpScreenState extends State<SelectOrderHelpScreen> {
/// AMC & Warranty tags
/// AMC & Warranty tags
Row
(
Row
(
mainAxisAlignment:
MainAxisAlignment
.
s
paceBetween
,
mainAxisAlignment:
MainAxisAlignment
.
s
tart
,
children:
[
children:
[
// Status Badge with checkmark for AMC Protected
if
(
amc
==
"1"
||
amc
==
"2"
)
if
(
amc
==
"1"
||
amc
==
"2"
)
Container
(
Container
(
padding:
const
EdgeInsets
.
symmetric
(
padding:
const
EdgeInsets
.
symmetric
(
horizontal:
8
,
horizontal:
5
,
vertical:
4
,
vertical:
4
,
),
),
decoration:
BoxDecoration
(
decoration:
BoxDecoration
(
gradient:
gradient:
amc
==
"1"
amc
==
"1"
?
AppColors
.
greenStripGradient
?
AppColors
.
greenStripGradient
:
AppColors
.
fadeGradient
,
:
AppColors
.
fadeGradient
,
borderRadius:
BorderRadius
.
circular
(
12
),
borderRadius:
BorderRadius
.
circular
(
12
),
),
),
child:
Row
(
child:
Row
(
mainAxisSize:
MainAxisSize
.
min
,
mainAxisSize:
MainAxisSize
.
min
,
children:
[
children:
[
SvgPicture
.
asset
(
Row
(
"assets/svg/tick_ic.svg"
,
children:
[
height:
14
,
SvgPicture
.
asset
(
color:
"assets/svg/tick_ic.svg"
,
height:
14
,
color:
amc
==
"1"
amc
==
"1"
?
AppColors
.
greenICBg
?
AppColors
.
greenICBg
:
AppColors
.
subtitleText
,
:
AppColors
.
subtitleText
,
),
),
const
SizedBox
(
width:
4
),
const
SizedBox
(
width:
2
),
Text
(
Text
(
"AMC
Protected
"
,
"AMC "
,
style:
TextStyle
(
style:
TextStyle
(
fontSize:
11
,
fontSize:
11
,
fontFamily:
"PoppinsBold"
,
fontFamily:
"PoppinsBold"
,
fontStyle:
FontStyle
.
italic
,
fontStyle:
FontStyle
.
italic
,
fontWeight:
FontWeight
.
w700
,
fontWeight:
FontWeight
.
w700
,
color:
color:
amc
==
"1"
amc
==
"1"
?
AppColors
.
greenICBg
?
AppColors
.
greenICBg
:
AppColors
.
subtitleText
,
:
AppColors
.
subtitleText
,
),
),
),
Text
(
"Protected"
,
style:
TextStyle
(
fontSize:
11
,
fontFamily:
"PoppinsBold"
,
fontStyle:
FontStyle
.
italic
,
fontWeight:
FontWeight
.
w700
,
color:
amc
==
"1"
?
AppColors
.
normalText
:
AppColors
.
subtitleText
,
),
),
SizedBox
(
width:
4
),
if
(
amc
==
"2"
)
const
Icon
(
Icons
.
info_outline
,
color:
Colors
.
red
,
size:
12
,
),
],
),
),
],
],
),
),
),
),
if
(
amc
==
"1"
||
amc
==
"2"
)
SizedBox
(
width:
16
),
// for warranty
if
(
warranty
==
"1"
||
warranty
==
"2"
)
if
(
warranty
==
"1"
||
warranty
==
"2"
)
Container
(
Container
(
padding:
const
EdgeInsets
.
symmetric
(
padding:
const
EdgeInsets
.
symmetric
(
...
@@ -438,35 +465,44 @@ class _SelectOrderHelpScreenState extends State<SelectOrderHelpScreen> {
...
@@ -438,35 +465,44 @@ class _SelectOrderHelpScreenState extends State<SelectOrderHelpScreen> {
),
),
decoration:
BoxDecoration
(
decoration:
BoxDecoration
(
gradient:
gradient:
warranty
==
"1"
warranty
==
"1"
?
AppColors
.
yellowStripGradient
?
AppColors
.
yellowStripGradient
:
AppColors
.
fadeGradient
,
:
AppColors
.
fadeGradient
,
borderRadius:
BorderRadius
.
circular
(
12
),
borderRadius:
BorderRadius
.
circular
(
12
),
),
),
child:
Row
(
child:
Row
(
mainAxisSize:
MainAxisSize
.
min
,
mainAxisSize:
MainAxisSize
.
min
,
children:
[
children:
[
SvgPicture
.
asset
(
Row
(
"assets/svg/tick2_ic.svg"
,
children:
[
height:
14
,
SvgPicture
.
asset
(
color:
height:
14
,
warranty
==
"1"
warranty
==
"1"
?
AppColors
.
warning
?
"assets/svg/tick2_ic.svg"
:
AppColors
.
subtitleText
,
:
"assets/svg/tick3_ic.svg"
,
),
),
const
SizedBox
(
width:
4
),
const
SizedBox
(
width:
2
),
Text
(
Text
(
"Warranty"
,
"Warranty"
,
style:
TextStyle
(
style:
TextStyle
(
fontSize:
11
,
fontSize:
11
,
fontFamily:
"PoppinsBold"
,
fontFamily:
"PoppinsBold"
,
fontStyle:
FontStyle
.
italic
,
fontStyle:
FontStyle
.
italic
,
fontWeight:
FontWeight
.
w700
,
fontWeight:
FontWeight
.
w700
,
color:
color:
warranty
==
"1"
warranty
==
"1"
?
AppColors
.
normalText
?
AppColors
.
normalText
:
AppColors
.
subtitleText
,
:
AppColors
.
subtitleText
,
),
),
),
SizedBox
(
width:
4
),
if
(
warranty
==
"2"
)
const
Icon
(
Icons
.
info_outline
,
color:
Colors
.
red
,
size:
12
,
),
],
),
),
],
],
),
),
...
...
lib/Screens/HomeScreen.dart
View file @
6f73c3f4
...
@@ -793,7 +793,7 @@ class _HomeScreenState extends State<HomeScreen> {
...
@@ -793,7 +793,7 @@ class _HomeScreenState extends State<HomeScreen> {
if
(
amc
==
"1"
||
amc
==
"2"
)
if
(
amc
==
"1"
||
amc
==
"2"
)
Container
(
Container
(
padding:
const
EdgeInsets
.
symmetric
(
padding:
const
EdgeInsets
.
symmetric
(
horizontal:
8
,
horizontal:
5
,
vertical:
4
,
vertical:
4
,
),
),
decoration:
BoxDecoration
(
decoration:
BoxDecoration
(
...
@@ -816,7 +816,7 @@ class _HomeScreenState extends State<HomeScreen> {
...
@@ -816,7 +816,7 @@ class _HomeScreenState extends State<HomeScreen> {
?
AppColors
.
greenICBg
?
AppColors
.
greenICBg
:
AppColors
.
subtitleText
,
:
AppColors
.
subtitleText
,
),
),
const
SizedBox
(
width:
4
),
const
SizedBox
(
width:
2
),
Text
(
Text
(
"AMC "
,
"AMC "
,
style:
TextStyle
(
style:
TextStyle
(
...
@@ -881,9 +881,9 @@ class _HomeScreenState extends State<HomeScreen> {
...
@@ -881,9 +881,9 @@ class _HomeScreenState extends State<HomeScreen> {
?
"assets/svg/tick2_ic.svg"
?
"assets/svg/tick2_ic.svg"
:
"assets/svg/tick3_ic.svg"
,
:
"assets/svg/tick3_ic.svg"
,
),
),
const
SizedBox
(
width:
6
),
const
SizedBox
(
width:
2
),
Text
(
Text
(
"
Warranty"
,
"Warranty"
,
style:
TextStyle
(
style:
TextStyle
(
fontSize:
11
,
fontSize:
11
,
fontFamily:
"PoppinsBold"
,
fontFamily:
"PoppinsBold"
,
...
@@ -895,7 +895,7 @@ class _HomeScreenState extends State<HomeScreen> {
...
@@ -895,7 +895,7 @@ class _HomeScreenState extends State<HomeScreen> {
:
AppColors
.
subtitleText
,
:
AppColors
.
subtitleText
,
),
),
),
),
SizedBox
(
width:
6
),
SizedBox
(
width:
4
),
if
(
warranty
==
"2"
)
if
(
warranty
==
"2"
)
const
Icon
(
const
Icon
(
Icons
.
info_outline
,
Icons
.
info_outline
,
...
@@ -1356,227 +1356,229 @@ class _HomeScreenState extends State<HomeScreen> {
...
@@ -1356,227 +1356,229 @@ class _HomeScreenState extends State<HomeScreen> {
builder:
(
context
)
{
builder:
(
context
)
{
return
StatefulBuilder
(
return
StatefulBuilder
(
builder:
(
context
,
setState
)
{
builder:
(
context
,
setState
)
{
return
Padding
(
return
SafeArea
(
padding:
EdgeInsets
.
only
(
child:
Padding
(
bottom:
MediaQuery
.
of
(
context
).
viewInsets
.
bottom
,
padding:
EdgeInsets
.
only
(
top:
16
,
bottom:
MediaQuery
.
of
(
context
).
viewInsets
.
bottom
,
left:
16
,
top:
16
,
right:
16
,
left:
16
,
),
right:
16
,
child:
Column
(
),
mainAxisSize:
MainAxisSize
.
min
,
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
mainAxisSize:
MainAxisSize
.
min
,
children:
[
crossAxisAlignment:
CrossAxisAlignment
.
start
,
// Handle Bar
children:
[
Center
(
// Handle Bar
child:
Container
(
Center
(
width:
40
,
child:
Container
(
height:
4
,
width:
40
,
decoration:
BoxDecoration
(
height:
4
,
color:
Colors
.
grey
[
300
],
decoration:
BoxDecoration
(
borderRadius:
BorderRadius
.
circular
(
4
),
color:
Colors
.
grey
[
300
],
borderRadius:
BorderRadius
.
circular
(
4
),
),
),
),
),
),
),
const
SizedBox
(
height:
16
),
const
SizedBox
(
height:
16
),
// Title
// Title
const
Text
(
const
Text
(
"Balance Amount Bill"
,
"Balance Amount Bill"
,
style:
TextStyle
(
style:
TextStyle
(
fontSize:
14
,
font
Size:
14
,
font
Weight:
FontWeight
.
w500
,
font
Weight:
FontWeight
.
w500
,
font
Family:
"Poppins"
,
fontFamily:
"Poppins"
,
)
,
),
),
),
const
SizedBox
(
height:
6
),
const
SizedBox
(
height:
6
),
Divider
(),
Divider
(
),
const
SizedBox
(
height:
10
),
const
SizedBox
(
height:
10
),
// Pay Total Option
// Pay Total Option
GestureDetector
(
GestureDetector
(
onTap:
()
{
onTap:
()
{
setState
(()
=>
isPartPayment
=
false
);
setState
(()
=>
isPartPayment
=
false
);
},
},
child:
Row
(
child
:
Row
(
child
ren:
[
children:
[
Radio
<
bool
>(
Radio
<
bool
>(
value:
false
,
value:
false
,
groupValue:
isPartPayment
,
groupValue:
isPartPayment
,
onChanged:
(
v
)
=>
setState
(()
=>
isPartPayment
=
v
!)
,
onChanged:
(
v
)
=>
setState
(()
=>
isPartPayment
=
v
!
),
activeColor:
const
Color
(
0xFF008CDE
),
activeColor:
const
Color
(
0xFF008CDE
),
),
),
// Radio<bool>(
//
Radio<bool>(
//
value: false,
//
value: false
,
//
groupValue: isPartPayment
,
//
groupValue:
isPartPayment,
//
onChanged: (v) => setState(() =>
isPartPayment
= v!)
,
//
onChanged: (v) => setState(() => isPartPayment = v!
),
// ),
// ),
Column
(
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
crossAxisAlignm
en
t
:
CrossAxisAlignment
.
start
,
childr
en:
[
children:
[
const
Text
(
const
Text
(
"Pay Total"
,
"Pay Total"
,
style:
TextStyle
(
style:
TextStyle
(
fontSize:
14
,
font
Size:
14
,
font
Family:
"Poppins"
,
font
Family:
"Poppins"
,
font
Weight:
FontWeight
.
w400
,
fontWeight:
FontWeight
.
w400
,
)
,
),
),
),
Text
(
Text
(
"Avoid late payment fees."
,
"Avoid late payment fees."
,
style:
TextStyle
(
style:
TextStyle
(
color:
Color
(
0xff5FBB54
),
color:
Color
(
0xff5FBB54
)
,
fontSize:
12
,
font
Size:
12
,
font
Family:
"Poppins"
,
fontFamily:
"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
// Part Payment Option
GestureDetector
(
GestureDetector
(
onTap:
()
{
onTap:
()
{
setState
(()
=>
isPartPayment
=
true
);
setState
(()
=>
isPartPayment
=
true
);
},
},
child:
Row
(
child:
Row
(
children:
[
children:
[
Radio
<
bool
>(
Radio
<
bool
>(
value:
true
,
value:
true
,
groupValue:
isPartPayment
,
groupValue:
isPartPayment
,
onChanged:
(
v
)
=>
setState
(()
=>
isPartPayment
=
v
!),
onChanged:
(
v
)
=>
setState
(()
=>
isPartPayment
=
v
!),
activeColor:
const
Color
(
0xFF008CDE
),
activeColor:
const
Color
(
0xFF008CDE
),
),
const
Text
(
"Part Payment"
,
style:
TextStyle
(
fontSize:
14
,
fontFamily:
"Poppins"
,
fontWeight:
FontWeight
.
w400
,
),
),
),
const
Text
(
const
SizedBox
(
width:
24
),
"Part Payment"
,
style:
TextStyle
(
Expanded
(
fontSize:
14
,
child:
Container
(
fontFamily:
"Poppins"
,
height:
50
,
fontWeight:
FontWeight
.
w400
,
alignment:
Alignment
.
center
,
padding:
const
EdgeInsets
.
symmetric
(
horizontal:
10
),
decoration:
BoxDecoration
(
color:
Colors
.
grey
.
shade100
,
borderRadius:
BorderRadius
.
circular
(
12
),
),
),
child:
TextFormField
(
),
controller:
amountController
,
const
SizedBox
(
width:
24
),
enabled:
isPartPayment
,
style:
const
TextStyle
(
Expanded
(
fontSize:
14
,
child:
Container
(
fontFamily:
"Poppins"
,
height:
50
,
color:
Colors
.
black87
,
alignment:
Alignment
.
center
,
padding:
const
EdgeInsets
.
symmetric
(
horizontal:
10
),
decoration:
BoxDecoration
(
color:
Colors
.
grey
.
shade100
,
borderRadius:
BorderRadius
.
circular
(
12
),
),
),
keyboardType:
TextInputType
.
number
,
child:
TextFormField
(
decoration:
const
InputDecoration
(
controller:
amountController
,
hintText:
"Enter amou
nt
"
,
enabled:
isPartPayme
nt
,
hintStyle:
TextStyle
(
style:
const
TextStyle
(
fontSize:
14
,
fontSize:
14
,
fontFamily:
"Poppins"
,
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
(),
Divider
(),
const
SizedBox
(
height:
6
),
const
SizedBox
(
height:
6
),
// Continue Button
// Continue Button
SizedBox
(
SizedBox
(
width:
double
.
infinity
,
width:
double
.
infinity
,
child:
ElevatedButton
(
child:
ElevatedButton
(
onPressed:
()
{
onPressed:
()
{
double
enteredAmount
=
double
enteredAmount
=
isPartPayment
isPartPayment
?
double
.
tryParse
(
amountController
.
text
)
??
0
?
double
.
tryParse
(
amountController
.
text
)
??
0
:
totalAmount
;
:
totalAmount
;
if
(
enteredAmount
<=
0
)
{
if
(
enteredAmount
<=
0
)
{
ScaffoldMessenger
.
of
(
context
).
showSnackBar
(
ScaffoldMessenger
.
of
(
context
).
showSnackBar
(
const
SnackBar
(
const
SnackBar
(
content:
Text
(
"Please enter a valid amount"
),
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"
,
),
),
),
);
);
return
;
return
;
}
}
if
(
isPartPayment
&&
enteredAmount
>
totalAmount
)
{
Navigator
.
pop
(
context
);
ScaffoldMessenger
.
of
(
context
).
showSnackBar
(
const
SnackBar
(
// Pass selected amount to your payAmountFunction
content:
Text
(
payAmountFunction
(
enteredAmount
.
toStringAsFixed
(
2
));
"Entered amount cannot exceed total amount"
,
},
),
style:
ElevatedButton
.
styleFrom
(
),
backgroundColor:
const
Color
(
0xFF008CDE
),
);
foregroundColor:
Colors
.
white
,
return
;
shape:
RoundedRectangleBorder
(
}
borderRadius:
BorderRadius
.
circular
(
30
),
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:
Padding
(
child:
Row
(
padding:
const
EdgeInsets
.
symmetric
(
horizontal:
22
),
mainAxisAlignment:
MainAxisAlignment
.
spaceBetween
,
child:
Row
(
children:
[
mainAxisAlignment:
MainAxisAlignment
.
spaceBetween
,
const
Text
(
children:
[
"Continue Payment"
,
const
Text
(
style:
TextStyle
(
"Continue Payment"
,
fontFamily:
"Poppins"
,
style:
TextStyle
(
color:
Colors
.
white
,
fontFamily:
"Poppins"
,
fontSize:
16
,
),
),
SvgPicture
.
asset
(
"assets/svg/continue_ic.svg"
,
color:
Colors
.
white
,
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/SplashScreen.dart
View file @
6f73c3f4
...
@@ -399,7 +399,7 @@ class _SplashScreenState extends State<SplashScreen> with SingleTickerProviderSt
...
@@ -399,7 +399,7 @@ class _SplashScreenState extends State<SplashScreen> with SingleTickerProviderSt
child:
Column
(
child:
Column
(
children:
[
children:
[
Text
(
Text
(
"Gen
Services
"
,
"
My
Gen"
,
style:
TextStyle
(
style:
TextStyle
(
fontSize:
36
,
fontSize:
36
,
fontWeight:
FontWeight
.
w900
,
fontWeight:
FontWeight
.
w900
,
...
...
lib/Screens/TransactionScreens/TransactionListScreen.dart
View file @
6f73c3f4
import
'dart:io'
;
import
'package:flutter/material.dart'
;
import
'package:flutter/material.dart'
;
import
'package:flutter_svg/flutter_svg.dart'
;
import
'package:flutter_svg/flutter_svg.dart'
;
import
'package:gen_service/Screens/TransactionScreens/BillDetailScreen.dart'
;
import
'package:gen_service/Screens/TransactionScreens/BillDetailScreen.dart'
;
...
@@ -217,214 +219,220 @@ class _TransactionScreenState extends State<TransactionListScreen> {
...
@@ -217,214 +219,220 @@ class _TransactionScreenState extends State<TransactionListScreen> {
Provider
.
of
<
TransactionsProvider
>(
context
,
listen:
false
)
Provider
.
of
<
TransactionsProvider
>(
context
,
listen:
false
)
.
fetchTransactions
(
widget
.
accId
,
widget
.
sessionId
);
.
fetchTransactions
(
widget
.
accId
,
widget
.
sessionId
);
},
},
child:
Scaffold
(
child:
SafeArea
(
backgroundColor:
AppColors
.
backgroundRegular
,
top:
false
,
body:
CustomScrollView
(
bottom:
Platform
.
isIOS
?
false
:
true
,
controller:
_scrollController
,
// Add controller here
maintainBottomViewPadding:
true
,
physics:
const
BouncingScrollPhysics
(),
child:
Scaffold
(
slivers:
[
resizeToAvoidBottomInset:
true
,
/// Top SliverAppBar (balance card) - No changes
backgroundColor:
AppColors
.
backgroundRegular
,
SliverAppBar
(
body:
CustomScrollView
(
stretch:
_stretch
,
controller:
_scrollController
,
// Add controller here
pinned:
true
,
physics:
const
BouncingScrollPhysics
(),
expandedHeight:
isPending
?
252
:
210
,
slivers:
[
backgroundColor:
isPending
?
AppColors
.
errorBg
:
Color
(
0xFF4076FF
),
/// Top SliverAppBar (balance card) - No changes
elevation:
0
,
SliverAppBar
(
leading:
Container
(),
stretch:
_stretch
,
toolbarHeight:
0
,
pinned:
true
,
collapsedHeight:
0
,
expandedHeight:
isPending
?
252
:
210
,
flexibleSpace:
FlexibleSpaceBar
(
backgroundColor:
isPending
?
AppColors
.
errorBg
:
Color
(
0xFF4076FF
),
stretchModes:
const
[
StretchMode
.
zoomBackground
],
elevation:
0
,
background:
Container
(
leading:
Container
(),
decoration:
BoxDecoration
(
toolbarHeight:
0
,
gradient:
isPending
collapsedHeight:
0
,
?
AppColors
.
balanceBarGradientP
flexibleSpace:
FlexibleSpaceBar
(
:
AppColors
.
balanceBarGradientA
,
stretchModes:
const
[
StretchMode
.
zoomBackground
],
),
background:
Container
(
child:
SafeArea
(
decoration:
BoxDecoration
(
child:
Column
(
gradient:
isPending
children:
[
?
AppColors
.
balanceBarGradientP
Row
(
:
AppColors
.
balanceBarGradientA
,
crossAxisAlignment:
CrossAxisAlignment
.
end
,
),
children:
[
child:
SafeArea
(
SizedBox
(
width:
8
,),
child:
Column
(
InkResponse
(
children:
[
onTap:
()
=>
Navigator
.
pop
(
context
,
true
),
Row
(
child:
SvgPicture
.
asset
(
crossAxisAlignment:
CrossAxisAlignment
.
end
,
color:
Colors
.
white
,
"assets/svg/continue_left_ic.svg"
,
height:
30
,
),
),
const
SizedBox
(
width:
10
),
const
Text
(
"Transactions"
,
style:
TextStyle
(
fontSize:
16
,
fontFamily:
"Poppins"
,
fontWeight:
FontWeight
.
w400
,
color:
Colors
.
white
,
),
),
],
),
Padding
(
padding:
const
EdgeInsets
.
symmetric
(
horizontal:
16
,
vertical:
18
),
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
center
,
children:
[
children:
[
SizedBox
(
width:
8
,),
const
SizedBox
(
height:
20
),
InkResponse
(
Text
(
onTap:
()
=>
Navigator
.
pop
(
context
,
true
),
"₹
$balance
"
,
child:
SvgPicture
.
asset
(
style:
const
TextStyle
(
color:
Colors
.
white
,
color:
Colors
.
white
,
fontSize:
34
,
"assets/svg/continue_left_ic.svg"
,
fontW
eight:
FontWeight
.
w50
0
,
h
eight:
3
0
,
),
),
),
),
const
SizedBox
(
height:
2
),
const
SizedBox
(
width:
10
),
Text
(
const
Text
(
"
$balanceType
"
,
"Transactions"
,
style:
TextStyle
(
color:
Colors
.
white
,
fontSize:
14
,
fontWeight:
FontWeight
.
w400
),
style:
TextStyle
(
fontSize:
16
,
fontFamily:
"Poppins"
,
fontWeight:
FontWeight
.
w400
,
color:
Colors
.
white
,
),
),
),
],
if
(
isPending
==
false
)
),
const
SizedBox
(
height:
4
),
Padding
(
if
(
isPending
==
false
)
padding:
const
EdgeInsets
.
symmetric
(
horizontal:
16
,
vertical:
18
),
Row
(
child:
Column
(
mainAxisAlignment:
MainAxisAlignment
.
center
,
crossAxisAlignment:
CrossAxisAlignment
.
center
,
children:
[
children:
[
Icon
(
Icons
.
check_circle
,
const
SizedBox
(
height:
20
),
color:
Colors
.
green
,
Text
(
size:
20
,
"₹
$balance
"
,
style:
const
TextStyle
(
color:
Colors
.
white
,
fontSize:
34
,
fontWeight:
FontWeight
.
w500
,
),
),
SizedBox
(
width:
2
,),
),
Text
(
const
SizedBox
(
height:
2
),
"Last Paid on
$lastPaid
."
,
Text
(
maxLines:
1
,
"
$balanceType
"
,
style:
TextStyle
(
style:
TextStyle
(
color:
Colors
.
white
,
fontSize:
14
,
fontWeight:
FontWeight
.
w400
),
color:
const
Color
(
0xFeFFFFFF
),
),
fontSize:
12
,
fontWeight:
FontWeight
.
w400
,
if
(
isPending
==
false
)
const
SizedBox
(
height:
4
),
if
(
isPending
==
false
)
Row
(
mainAxisAlignment:
MainAxisAlignment
.
center
,
children:
[
Icon
(
Icons
.
check_circle
,
color:
Colors
.
green
,
size:
20
,
),
),
),
SizedBox
(
width:
2
,),
],
Text
(
),
"Last Paid on
$lastPaid
."
,
const
SizedBox
(
height:
10
),
maxLines:
1
,
if
(
isPending
)
style:
TextStyle
(
ElevatedButton
(
color:
const
Color
(
0xFeFFFFFF
),
onPressed:
()
=>
_openPaymentSheet
(
context
,
balance
),
fontSize:
12
,
style:
ElevatedButton
.
styleFrom
(
fontWeight:
FontWeight
.
w400
,
backgroundColor:
Colors
.
white
,
),
foregroundColor:
Colors
.
deepOrange
,
shape:
RoundedRectangleBorder
(
borderRadius:
BorderRadius
.
circular
(
20
),
),
),
),
],
child:
Text
(
),
"Pay Now"
,
const
SizedBox
(
height:
10
),
style:
TextStyle
(
if
(
isPending
)
fontSize:
14
,
ElevatedButton
(
fontFamily:
"Poppins"
,
onPressed:
()
=>
_openPaymentSheet
(
context
,
balance
),
fontWeight:
FontWeight
.
w500
,
style:
ElevatedButton
.
styleFrom
(
color:
AppColors
.
buttonColor
,
backgroundColor:
Colors
.
white
,
foregroundColor:
Colors
.
deepOrange
,
shape:
RoundedRectangleBorder
(
borderRadius:
BorderRadius
.
circular
(
20
),
),
),
child:
Text
(
"Pay Now"
,
style:
TextStyle
(
fontSize:
14
,
fontFamily:
"Poppins"
,
fontWeight:
FontWeight
.
w500
,
color:
AppColors
.
buttonColor
,
),
),
),
),
),
SizedBox
(
height:
8
,),
if
(
isPending
)
Text
(
"*Make sure to pay before you incur any fines."
,
maxLines:
1
,
style:
TextStyle
(
color:
const
Color
(
0xAAFFFFFF
),
fontSize:
12
,
fontWeight:
FontWeight
.
w400
,
),
),
),
SizedBox
(
height:
8
,),
],
if
(
isPending
)
),
Text
(
"*Make sure to pay before you incur any fines."
,
maxLines:
1
,
style:
TextStyle
(
color:
const
Color
(
0xAAFFFFFF
),
fontSize:
12
,
fontWeight:
FontWeight
.
w400
,
),
),
],
),
),
)
,
]
,
]
,
)
,
),
),
),
),
),
),
),
),
),
/// Summary Row and Transaction List
/// Summary Row and Transaction List
SliverToBoxAdapter
(
SliverToBoxAdapter
(
child:
Container
(
color:
isPending
?
AppColors
.
errorBg
:
Color
(
0xFF4076FF
),
child:
Container
(
child:
Container
(
decoration:
const
BoxDecoration
(
color:
isPending
?
AppColors
.
errorBg
:
Color
(
0xFF4076FF
),
color:
AppColors
.
backgroundRegular
,
child:
Container
(
borderRadius:
BorderRadius
.
only
(
decoration:
const
BoxDecoration
(
topLeft:
Radius
.
circular
(
30
),
color:
AppColors
.
backgroundRegular
,
topRight:
Radius
.
circular
(
30
),
borderRadius:
BorderRadius
.
only
(
topLeft:
Radius
.
circular
(
30
),
topRight:
Radius
.
circular
(
30
),
),
),
),
),
child:
Column
(
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
crossAxisAlignm
en
t
:
CrossAxisAlignment
.
start
,
childr
en:
[
children:
[
const
SizedBox
(
height:
4
),
const
SizedBox
(
height:
4
),
// Summary Card
// Summary Card
Container
(
Container
(
margin:
const
EdgeInsets
.
all
(
16
),
marg
in:
const
EdgeInsets
.
all
(
1
6
),
padd
in
g
:
const
EdgeInsets
.
all
(
1
4
),
padding:
const
EdgeInsets
.
all
(
14
),
decoration:
BoxDecoration
(
decoration:
BoxDecoration
(
color:
const
Color
(
0xFFD7F0FF
),
color:
const
Color
(
0xFFD7F0FF
),
borderRadius:
BorderRadius
.
circular
(
16
),
border
Radius
:
Border
Radius
.
circular
(
16
),
border:
Border
.
all
(
width:
1.1
,
color:
AppColors
.
buttonColor
),
border:
Border
.
all
(
width:
1.1
,
color:
AppColors
.
buttonColor
),
),
),
child:
Row
(
child:
Row
(
mainAxisAlignment:
MainAxisAlignment
.
spaceEvenly
,
mainAxisAlignm
en
t
:
MainAxisAlignment
.
spaceEvenly
,
childr
en:
[
children:
[
_buildSummaryItem
(
"₹
$totalCredit
"
,
"Bill Paid"
,
Colors
.
green
),
_buildSummaryItem
(
"₹
$totalCredit
"
,
"Bill Paid"
,
Colors
.
gre
en
),
Container
(
height:
30
,
width:
1
,
color:
Colors
.
gre
y
.
shade300
),
Container
(
height:
30
,
width:
1
,
color:
Colors
.
g
re
y
.
shade300
),
_buildSummaryItem
(
"₹
$totalDebit
"
,
"Bill Pending"
,
Colors
.
re
d
),
_buildSummaryItem
(
"₹
$totalDebit
"
,
"Bill Pending"
,
Colors
.
red
)
,
]
,
]
,
)
,
),
),
),
// Transaction List
//
Transaction
List
_build
TransactionList
(
provider
,
transactions
),
_buildTransactionList
(
provider
,
transactions
)
,
]
,
]
,
)
,
),
),
),
),
),
),
),
/// Loading indicator for pagination
/// Loading indicator for pagination
if
(
provider
.
isLoadingMore
)
if
(
provider
.
isLoadingMore
)
const
SliverToBoxAdapter
(
const
SliverToBoxAdapter
(
child:
Padding
(
child:
Padding
(
padding:
EdgeInsets
.
all
(
16.0
),
padding:
EdgeInsets
.
all
(
16.0
),
child:
Center
(
child:
C
enter
(
child:
C
ircularProgressIndicator
(
color:
AppColors
.
buttonColor
),
child:
CircularProgressIndicator
(
color:
AppColors
.
buttonColor
),
),
),
),
),
),
),
/// No more data indicator
/// No more data indicator
if
(!
provider
.
hasMore
&&
transactions
.
isNotEmpty
)
if
(!
provider
.
hasMore
&&
transactions
.
isNotEmpty
)
const
SliverToBoxAdapter
(
const
SliverToBoxAdapter
(
child:
Padding
(
child:
Padding
(
padding:
EdgeInsets
.
all
(
16.0
),
padding:
EdgeInsets
.
all
(
16.0
),
child:
Center
(
child:
Center
(
child:
Text
(
child:
Text
(
"No more transactions"
,
"No more transactions"
,
style:
TextStyle
(
style:
TextStyle
(
color:
Colors
.
grey
,
color:
Colors
.
grey
,
fontSize:
14
,
fontSize:
14
,
)
,
),
),
),
),
),
),
),
),
)
,
]
,
]
,
)
,
),
),
),
),
);
);
...
@@ -663,226 +671,228 @@ class _TransactionScreenState extends State<TransactionListScreen> {
...
@@ -663,226 +671,228 @@ class _TransactionScreenState extends State<TransactionListScreen> {
builder:
(
context
)
{
builder:
(
context
)
{
return
StatefulBuilder
(
return
StatefulBuilder
(
builder:
(
context
,
setState
)
{
builder:
(
context
,
setState
)
{
return
Padding
(
return
SafeArea
(
padding:
EdgeInsets
.
only
(
child:
Padding
(
bottom:
MediaQuery
.
of
(
context
).
viewInsets
.
bottom
,
padding:
EdgeInsets
.
only
(
top:
16
,
bottom:
MediaQuery
.
of
(
context
).
viewInsets
.
bottom
,
left:
16
,
top:
16
,
right:
16
,
left:
16
,
),
right:
16
,
child:
Column
(
),
mainAxisSize:
MainAxisSize
.
min
,
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
mainAxisSize:
MainAxisSize
.
min
,
children:
[
crossAxisAlignment:
CrossAxisAlignment
.
start
,
// Handle Bar
children:
[
Center
(
// Handle Bar
child:
Container
(
Center
(
width:
40
,
child:
Container
(
height:
4
,
width:
40
,
decoration:
BoxDecoration
(
height:
4
,
color:
Colors
.
grey
[
300
],
decoration:
BoxDecoration
(
borderRadius:
BorderRadius
.
circular
(
4
),
color:
Colors
.
grey
[
300
],
borderRadius:
BorderRadius
.
circular
(
4
),
),
),
),
),
),
),
const
SizedBox
(
height:
16
),
const
SizedBox
(
height:
16
),
// Title
// Title
const
Text
(
const
Text
(
"Balance Amount Bill"
,
"Balance Amount Bill"
,
style:
TextStyle
(
style:
TextStyle
(
fontSize:
14
,
font
Size:
14
,
font
Weight:
FontWeight
.
w500
,
font
Weight:
FontWeight
.
w500
,
font
Family:
"Poppins"
,
fontFamily:
"Poppins"
,
)
,
),
),
),
const
SizedBox
(
height:
6
),
const
SizedBox
(
height:
6
),
Divider
(),
Divider
(
),
const
SizedBox
(
height:
10
),
const
SizedBox
(
height:
10
),
// Pay Total Option
// Pay Total Option
GestureDetector
(
GestureDetector
(
onTap:
()
{
onTap:
()
{
setState
(()
=>
isPartPayment
=
false
);
setState
(()
=>
isPartPayment
=
false
);
},
},
child:
Row
(
child
:
Row
(
child
ren:
[
children:
[
Radio
<
bool
>(
Radio
<
bool
>(
value:
false
,
value:
false
,
groupValue:
isPartPayment
,
groupValue:
isPartPayment
,
onChanged:
(
v
)
=>
setState
(()
=>
isPartPayment
=
v
!)
,
onChanged:
(
v
)
=>
setState
(()
=>
isPartPayment
=
v
!
),
activeColor:
const
Color
(
0xFF008CDE
),
activeColor:
const
Color
(
0xFF008CDE
),
),
),
// Radio<bool>(
//
Radio<bool>(
//
value: false,
//
value: false
,
//
groupValue: isPartPayment
,
//
groupValue:
isPartPayment,
//
onChanged: (v) => setState(() =>
isPartPayment
= v!)
,
//
onChanged: (v) => setState(() => isPartPayment = v!
),
// ),
// ),
Column
(
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
crossAxisAlignm
en
t
:
CrossAxisAlignment
.
start
,
childr
en:
[
children:
[
const
Text
(
const
Text
(
"Pay Total"
,
"Pay Total"
,
style:
TextStyle
(
style:
TextStyle
(
fontSize:
14
,
font
Size:
14
,
font
Family:
"Poppins"
,
font
Family:
"Poppins"
,
font
Weight:
FontWeight
.
w400
,
fontWeight:
FontWeight
.
w400
,
)
,
),
),
),
Text
(
Text
(
"Avoid late payment fees."
,
"Avoid late payment fees."
,
style:
TextStyle
(
style:
TextStyle
(
color:
Color
(
0xff5FBB54
),
color:
Color
(
0xff5FBB54
)
,
fontSize:
12
,
font
Size:
12
,
font
Family:
"Poppins"
,
fontFamily:
"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
// Part Payment Option
GestureDetector
(
GestureDetector
(
onTap:
()
{
onTap:
()
{
setState
(()
=>
isPartPayment
=
true
);
setState
(()
=>
isPartPayment
=
true
);
},
},
child:
Row
(
child:
Row
(
children:
[
children:
[
Radio
<
bool
>(
Radio
<
bool
>(
value:
true
,
value:
true
,
groupValue:
isPartPayment
,
groupValue:
isPartPayment
,
onChanged:
(
v
)
=>
setState
(()
=>
isPartPayment
=
v
!),
onChanged:
(
v
)
=>
setState
(()
=>
isPartPayment
=
v
!),
activeColor:
const
Color
(
0xFF008CDE
),
activeColor:
const
Color
(
0xFF008CDE
),
),
const
Text
(
"Part Payment"
,
style:
TextStyle
(
fontSize:
14
,
fontFamily:
"Poppins"
,
fontWeight:
FontWeight
.
w400
,
),
),
),
const
Text
(
const
SizedBox
(
width:
24
),
"Part Payment"
,
style:
TextStyle
(
Expanded
(
fontSize:
14
,
child:
Container
(
fontFamily:
"Poppins"
,
height:
50
,
fontWeight:
FontWeight
.
w400
,
alignment:
Alignment
.
center
,
padding:
const
EdgeInsets
.
symmetric
(
horizontal:
10
),
decoration:
BoxDecoration
(
color:
Colors
.
grey
.
shade100
,
borderRadius:
BorderRadius
.
circular
(
12
),
),
),
child:
TextFormField
(
),
controller:
amountController
,
const
SizedBox
(
width:
24
),
enabled:
isPartPayment
,
style:
const
TextStyle
(
Expanded
(
fontSize:
14
,
child:
Container
(
fontFamily:
"Poppins"
,
height:
50
,
color:
Colors
.
black87
,
alignment:
Alignment
.
center
,
padding:
const
EdgeInsets
.
symmetric
(
horizontal:
10
),
decoration:
BoxDecoration
(
color:
Colors
.
grey
.
shade100
,
borderRadius:
BorderRadius
.
circular
(
12
),
),
),
keyboardType:
TextInputType
.
number
,
child:
TextFormField
(
decoration:
const
InputDecoration
(
controller:
amountController
,
hintText:
"Enter amou
nt
"
,
enabled:
isPartPayme
nt
,
hintStyle:
TextStyle
(
style:
const
TextStyle
(
fontSize:
14
,
fontSize:
14
,
fontFamily:
"Poppins"
,
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
(),
Divider
(),
const
SizedBox
(
height:
6
),
const
SizedBox
(
height:
6
),
// Continue Button
// Continue Button
SizedBox
(
SizedBox
(
width:
double
.
infinity
,
width:
double
.
infinity
,
child:
ElevatedButton
(
child:
ElevatedButton
(
onPressed:
()
{
onPressed:
()
{
double
enteredAmount
=
isPartPayment
double
enteredAmount
=
isPartPayment
?
double
.
tryParse
(
amountController
.
text
)
??
0
?
double
.
tryParse
(
amountController
.
text
)
??
0
:
totalAmount
;
:
totalAmount
;
if
(
enteredAmount
<=
0
)
{
if
(
enteredAmount
<=
0
)
{
ScaffoldMessenger
.
of
(
context
).
showSnackBar
(
ScaffoldMessenger
.
of
(
context
).
showSnackBar
(
const
SnackBar
(
const
SnackBar
(
content:
Text
(
"Please enter a valid amount"
),
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"
,
),
),
),
);
);
return
;
return
;
}
}
if
(
isPartPayment
&&
enteredAmount
>
totalAmount
)
{
Navigator
.
pop
(
context
);
ScaffoldMessenger
.
of
(
context
).
showSnackBar
(
const
SnackBar
(
// Pass selected amount to your payAmountFunction
content:
Text
(
payAmountFunction
(
enteredAmount
.
toStringAsFixed
(
2
));
"Entered amount cannot exceed total amount"
,
},
),
style:
ElevatedButton
.
styleFrom
(
),
backgroundColor:
const
Color
(
0xFF008CDE
),
);
foregroundColor:
Colors
.
white
,
return
;
shape:
RoundedRectangleBorder
(
}
borderRadius:
BorderRadius
.
circular
(
30
),
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:
Padding
(
child:
Row
(
padding:
const
EdgeInsets
.
symmetric
(
horizontal:
22
),
mainAxisAlignment:
MainAxisAlignment
.
spaceBetween
,
child:
Row
(
children:
[
mainAxisAlignment:
MainAxisAlignment
.
spaceBetween
,
const
Text
(
children:
[
"Continue Payment"
,
const
Text
(
style:
TextStyle
(
"Continue Payment"
,
fontFamily:
"Poppins"
,
style:
TextStyle
(
color:
Colors
.
white
,
fontFamily:
"Poppins"
,
fontSize:
16
,
),
),
SvgPicture
.
asset
(
"assets/svg/continue_ic.svg"
,
color:
Colors
.
white
,
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/generatorDetailsScreen.dart
View file @
6f73c3f4
...
@@ -53,6 +53,7 @@ class _GeneratordetailsscreenState extends State<Generatordetailsscreen> {
...
@@ -53,6 +53,7 @@ class _GeneratordetailsscreenState extends State<Generatordetailsscreen> {
@override
@override
Widget
build
(
BuildContext
context
)
{
Widget
build
(
BuildContext
context
)
{
double
screenHeight
=
MediaQuery
.
of
(
context
).
size
.
height
;
return
Consumer
<
Generatordetailsprovider
>(
return
Consumer
<
Generatordetailsprovider
>(
builder:
(
context
,
detailsProvider
,
child
)
{
builder:
(
context
,
detailsProvider
,
child
)
{
final
isLoading
=
detailsProvider
.
isLoading
;
final
isLoading
=
detailsProvider
.
isLoading
;
...
@@ -233,336 +234,355 @@ class _GeneratordetailsscreenState extends State<Generatordetailsscreen> {
...
@@ -233,336 +234,355 @@ class _GeneratordetailsscreenState extends State<Generatordetailsscreen> {
child:
Scaffold
(
child:
Scaffold
(
backgroundColor:
Color
(
0xFF4076FF
),
backgroundColor:
Color
(
0xFF4076FF
),
appBar:
AppBar
(
backgroundColor:
Color
(
0xFF4076FF
),
automaticallyImplyLeading:
false
,
// elevation: 2.0,
title:
SizedBox
(
child:
Row
(
mainAxisAlignment:
MainAxisAlignment
.
start
,
crossAxisAlignment:
CrossAxisAlignment
.
center
,
children:
[
InkResponse
(
onTap:
()
{
HapticFeedback
.
selectionClick
();
Navigator
.
pop
(
context
,
true
);
},
child:
SvgPicture
.
asset
(
"assets/svg/appbar_back.svg"
,
height:
25
,
),
),
SizedBox
(
width:
10
),
Expanded
(
flex:
4
,
child:
InkResponse
(
onTap:
()
{
HapticFeedback
.
selectionClick
();
Navigator
.
pop
(
context
,
true
);
},
child:
Text
(
"Generator Details"
,
overflow:
TextOverflow
.
ellipsis
,
maxLines:
1
,
style:
TextStyle
(
fontSize:
16
,
color:
Colors
.
white
,
height:
1.1
,
),
),
),
),
],
),
),
),
body:
CustomScrollView
(
body:
CustomScrollView
(
slivers:
[
slivers:
[
SliverToBoxAdapter
(
child:
Container
(
SliverAppBar
(
color:
const
Color
(
0xFF4076FF
),
automaticallyImplyLeading:
false
,
padding:
const
EdgeInsets
.
symmetric
(
stretch:
true
,
horizontal:
10
,
onStretchTrigger:
()
async
{
vertical:
12
,
},
),
stretchTriggerOffset:
300.0
,
child:
Column
(
backgroundColor:
Color
(
0xFF4076FF
),
children:
[
expandedHeight:
detailsProvider
.
showMoreDetails
?
screenHeight
*
0.62
:
screenHeight
*
0.211
,
// Product Info Row
flexibleSpace:
FlexibleSpaceBar
(
Row
(
stretchModes:
const
[
StretchMode
.
zoomBackground
,
StretchMode
.
blurBackground
,
],
background:
Container
(
decoration:
const
BoxDecoration
(
gradient:
AppColors
.
commonAppBarGradient
),
child:
SafeArea
(
child:
Column
(
children:
[
children:
[
Expanded
(
Row
(
flex:
5
,
mainAxisAlignment:
MainAxisAlignment
.
start
,
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
center
,
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
[
children:
[
SizedBox
(
width:
8
,),
RichText
(
InkResponse
(
text:
TextSpan
(
onTap:
()
{
style:
const
TextStyle
(
HapticFeedback
.
selectionClick
();
fontFamily:
'Poppins'
,
Navigator
.
pop
(
context
,
true
);
color:
Color
(
0xFF48F3FF
),
},
fontSize:
12
,
child:
SvgPicture
.
asset
(
),
"assets/svg/appbar_back.svg"
,
children:
[
height:
25
,
TextSpan
(
text:
"#
${data.hashId!}
"
),
TextSpan
(
text:
" | Engine:
${data.engine!}
"
,
),
],
),
),
),
Text
(
),
data
.
prodName
!,
SizedBox
(
width:
10
),
maxLines:
2
,
Expanded
(
style:
const
TextStyle
(
flex:
4
,
color:
Colors
.
white
,
child:
InkResponse
(
fontSize:
14
,
onTap:
()
{
HapticFeedback
.
selectionClick
();
Navigator
.
pop
(
context
,
true
);
},
child:
Text
(
"Generator Details"
,
overflow:
TextOverflow
.
ellipsis
,
maxLines:
1
,
style:
TextStyle
(
fontSize:
16
,
color:
Colors
.
white
,
height:
1.1
,
),
),
),
),
),
if
(
data
.
amc
!=
"0"
)
...[
),
Row
(
],
mainAxisSize:
MainAxisSize
.
min
,
),
children:
[
SvgPicture
.
asset
(
"assets/svg/tick_ic.svg"
,
Container
(
height:
15
,
padding:
const
EdgeInsets
.
symmetric
(
color:
horizontal:
10
,
data
.
amc
==
"1"
vertical:
12
,
?
AppColors
.
greenICBg
),
:
AppColors
.
subtitleText
,
child:
Column
(
),
children:
[
const
SizedBox
(
width:
4
),
// Product Info Row
Text
(
Row
(
"AMC "
,
children:
[
style:
TextStyle
(
Expanded
(
fontSize:
15
,
flex:
5
,
fontFamily:
"PoppinsBold"
,
child:
Column
(
fontStyle:
FontStyle
.
italic
,
crossAxisAlignment:
CrossAxisAlignment
.
start
,
fontWeight:
FontWeight
.
w700
,
color:
data
.
amc
==
"1"
?
AppColors
.
greenICBg
:
AppColors
.
subtitleText
,
),
),
Text
(
"Protected"
,
style:
TextStyle
(
fontSize:
15
,
fontFamily:
"PoppinsBold"
,
fontStyle:
FontStyle
.
italic
,
fontWeight:
FontWeight
.
w700
,
color:
data
.
amc
==
"1"
?
AppColors
.
normalText
:
AppColors
.
subtitleText
,
),
),
const
SizedBox
(
width:
4
),
if
(
data
.
amc
==
"2"
)
const
Icon
(
Icons
.
info_outline
,
color:
Colors
.
red
,
size:
15
,
),
],
),
],
if
(
data
.
warranty
!=
"0"
)
...[
Row
(
mainAxisSize:
MainAxisSize
.
min
,
children:
[
Row
(
children:
[
children:
[
SvgPicture
.
asset
(
RichText
(
"assets/svg/tick2_ic.svg"
,
text:
TextSpan
(
height:
15
,
style:
const
TextStyle
(
color:
fontFamily:
'Poppins'
,
data
.
warranty
==
"1"
color:
Color
(
0xFF48F3FF
),
?
AppColors
.
warning
fontSize:
12
,
:
AppColors
),
.
subtitleText
,
children:
[
TextSpan
(
text:
"#
${data.hashId!}
"
),
TextSpan
(
text:
" | Engine:
${data.engine!}
"
,
),
],
),
),
),
const
SizedBox
(
width:
6
),
Text
(
Text
(
"Warranty"
,
data
.
prodName
!,
style:
TextStyle
(
maxLines:
2
,
fontSize:
15
,
style:
const
TextStyle
(
fontFamily:
"PoppinsBold"
,
color:
Colors
.
white
,
fontStyle:
FontStyle
.
italic
,
fontSize:
14
,
fontWeight:
FontWeight
.
w700
,
color:
data
.
warranty
==
"1"
?
AppColors
.
normalText
:
AppColors
.
subtitleText
,
),
),
),
),
SizedBox
(
width:
6
),
if
(
data
.
amc
!=
"0"
)
...[
if
(
data
.
warranty
==
"2"
)
Row
(
const
Icon
(
mainAxisSize:
MainAxisSize
.
min
,
Icons
.
info_outline
,
children:
[
color:
Colors
.
red
,
SvgPicture
.
asset
(
size:
15
,
"assets/svg/tick_ic.svg"
,
height:
15
,
color:
data
.
amc
==
"1"
?
AppColors
.
greenICBg
:
AppColors
.
subtitleText
,
),
const
SizedBox
(
width:
4
),
Text
(
"AMC "
,
style:
TextStyle
(
fontSize:
15
,
fontFamily:
"PoppinsBold"
,
fontStyle:
FontStyle
.
italic
,
fontWeight:
FontWeight
.
w700
,
color:
data
.
amc
==
"1"
?
AppColors
.
greenICBg
:
AppColors
.
subtitleText
,
),
),
Text
(
"Protected"
,
style:
TextStyle
(
fontSize:
15
,
fontFamily:
"PoppinsBold"
,
fontStyle:
FontStyle
.
italic
,
fontWeight:
FontWeight
.
w700
,
color:
data
.
amc
==
"1"
?
AppColors
.
normalText
:
AppColors
.
subtitleText
,
),
),
const
SizedBox
(
width:
4
),
if
(
data
.
amc
==
"2"
)
const
Icon
(
Icons
.
info_outline
,
color:
Colors
.
red
,
size:
15
,
),
],
),
),
],
if
(
data
.
warranty
!=
"0"
)
...[
Row
(
mainAxisSize:
MainAxisSize
.
min
,
children:
[
Row
(
children:
[
SvgPicture
.
asset
(
"assets/svg/tick2_ic.svg"
,
height:
15
,
color:
data
.
warranty
==
"1"
?
AppColors
.
warning
:
AppColors
.
subtitleText
,
),
const
SizedBox
(
width:
6
),
Text
(
"Warranty"
,
style:
TextStyle
(
fontSize:
15
,
fontFamily:
"PoppinsBold"
,
fontStyle:
FontStyle
.
italic
,
fontWeight:
FontWeight
.
w700
,
color:
data
.
warranty
==
"1"
?
AppColors
.
normalText
:
AppColors
.
subtitleText
,
),
),
SizedBox
(
width:
6
),
if
(
data
.
warranty
==
"2"
)
const
Icon
(
Icons
.
info_outline
,
color:
Colors
.
red
,
size:
15
,
),
],
),
],
),
],
],
],
),
),
],
),
],
],
),
),
Expanded
(
flex:
2
,
child:
Image
.
network
(
data
.
prodImg
!,
fit:
BoxFit
.
scaleDown
,
),
),
],
),
// Show More Details
if
(
detailsProvider
.
showMoreDetails
)
...[
const
Divider
(
color:
Colors
.
white
),
...
List
.
generate
(
headings
.
length
,
(
index
)
{
final
sectionTitle
=
sectionTitles
[
index
];
final
sectionItems
=
headings
[
index
];
final
sectionSubItems
=
subHeadings
[
index
];
return
Padding
(
padding:
const
EdgeInsets
.
only
(
top:
12
),
child:
Row
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
[
Container
(
height:
25
,
width:
25
,
decoration:
const
BoxDecoration
(
shape:
BoxShape
.
circle
,
color:
Colors
.
white
,
),
child:
Center
(
child:
Text
(
index
==
0
?
"🔧"
:
"📍"
,
style:
const
TextStyle
(
fontSize:
14
),
),
),
),
Expanded
(
),
flex:
2
,
const
SizedBox
(
width:
8
),
child:
Image
.
network
(
Expanded
(
data
.
prodImg
!,
child:
Column
(
fit:
BoxFit
.
scaleDown
,
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
[
Text
(
sectionTitle
,
style:
const
TextStyle
(
fontWeight:
FontWeight
.
bold
,
color:
Colors
.
white
,
fontSize:
16
,
),
),
),
const
SizedBox
(
height:
8
),
),
...
List
.
generate
(
sectionItems
.
length
,
(
],
i
,
),
)
{
return
Padding
(
// Show More Details
padding:
const
EdgeInsets
.
symmetric
(
if
(
detailsProvider
.
showMoreDetails
)
...[
vertical:
3
,
const
Divider
(
color:
Colors
.
white
),
),
...
List
.
generate
(
headings
.
length
,
(
index
)
{
child:
Row
(
final
sectionTitle
=
sectionTitles
[
index
];
crossAxisAlignment:
CrossAxisAlignment
.
start
,
final
sectionItems
=
headings
[
index
];
children:
[
final
sectionSubItems
=
subHeadings
[
index
];
Expanded
(
return
Padding
(
child:
Text
(
padding:
const
EdgeInsets
.
only
(
top:
12
),
sectionItems
[
i
]??
"-"
,
child:
Row
(
style:
const
TextStyle
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
fontSize:
14
,
children:
[
color:
Color
(
0xFF48F3FF
),
Container
(
),
height:
25
,
),
width:
25
,
decoration:
const
BoxDecoration
(
shape:
BoxShape
.
circle
,
color:
Colors
.
white
,
),
child:
Center
(
child:
Text
(
index
==
0
?
"🔧"
:
"📍"
,
style:
const
TextStyle
(
fontSize:
14
),
),
),
Expanded
(
),
child:
Text
(
),
sectionSubItems
[
i
]??
"-"
,
const
SizedBox
(
width:
8
),
maxLines:
3
,
Expanded
(
overflow:
TextOverflow
.
ellipsis
,
child:
Column
(
textAlign:
TextAlign
.
end
,
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
[
Text
(
sectionTitle
,
style:
const
TextStyle
(
style:
const
TextStyle
(
font
Size:
14
,
font
Weight:
FontWeight
.
bold
,
color:
Colors
.
white
,
color:
Colors
.
white
,
fontSize:
16
,
),
),
),
),
),
const
SizedBox
(
height:
8
),
],
...
List
.
generate
(
sectionItems
.
length
,
(
i
,
)
{
return
Padding
(
padding:
const
EdgeInsets
.
symmetric
(
vertical:
3
,
),
child:
Row
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
[
Expanded
(
child:
Text
(
sectionItems
[
i
]??
"-"
,
style:
const
TextStyle
(
fontSize:
14
,
color:
Color
(
0xFF48F3FF
),
),
),
),
Expanded
(
child:
Text
(
sectionSubItems
[
i
]??
"-"
,
maxLines:
3
,
overflow:
TextOverflow
.
ellipsis
,
textAlign:
TextAlign
.
end
,
style:
const
TextStyle
(
fontSize:
14
,
color:
Colors
.
white
,
),
),
),
],
),
);
}),
],
),
),
),
);
],
}),
),
],
);
),
}),
),
],
],
),
);
}),
],
Center
(
Center
(
child:
InkResponse
(
child:
InkResponse
(
onTap:
onTap:
()
=>
()
=>
detailsProvider
.
showMoreDetails
=
detailsProvider
.
showMoreDetails
=
!
detailsProvider
.
showMoreDetails
,
!
detailsProvider
.
showMoreDetails
,
child:
Container
(
child:
Container
(
width:
125
,
width:
125
,
margin:
const
EdgeInsets
.
only
(
top:
5
),
margin:
const
EdgeInsets
.
only
(
top:
5
),
padding:
const
EdgeInsets
.
symmetric
(
vertical:
6
),
padding:
const
EdgeInsets
.
symmetric
(
vertical:
6
),
decoration:
BoxDecoration
(
decoration:
BoxDecoration
(
borderRadius:
BorderRadius
.
circular
(
16
),
borderRadius:
BorderRadius
.
circular
(
16
),
border:
Border
.
all
(
border:
Border
.
all
(
color:
Colors
.
white
,
color:
Colors
.
white
,
width:
0.7
,
width:
0.7
,
),
),
),
),
child:
Row
(
child:
Row
(
mainAxisAlignment:
MainAxisAlignment
.
center
,
mainAxisAlignment:
MainAxisAlignment
.
center
,
children:
[
children:
[
Text
(
Text
(
detailsProvider
.
showMoreDetails
detailsProvider
.
showMoreDetails
?
"Hide Details"
?
"Hide Details"
:
"View Details"
,
:
"View Details"
,
style:
const
TextStyle
(
style:
const
TextStyle
(
fontFamily:
"JakartaMedium"
,
fontFamily:
"JakartaMedium"
,
fontSize:
14
,
fontSize:
14
,
color:
Colors
.
white
,
color:
Colors
.
white
,
),
),
),
),
const
SizedBox
(
width:
4
),
const
SizedBox
(
width:
4
),
Transform
.
flip
(
Transform
.
flip
(
flipY:
detailsProvider
.
showMoreDetails
,
flipY:
detailsProvider
.
showMoreDetails
,
child:
SvgPicture
.
asset
(
child:
SvgPicture
.
asset
(
"assets/svg/arrow_dropdown.svg"
,
"assets/svg/arrow_dropdown.svg"
,
height:
12
,
height:
12
,
width:
12
,
width:
12
,
colorFilter:
const
ColorFilter
.
mode
(
colorFilter:
const
ColorFilter
.
mode
(
Colors
.
white
,
Colors
.
white
,
BlendMode
.
srcIn
,
BlendMode
.
srcIn
,
),
),
),
],
),
),
),
),
),
),
),
const
SizedBox
(
height:
10
),
],
],
),
),
),
),
)
,
]
,
),
),
const
SizedBox
(
height:
10
),
)
],
),
),
),
),
),
),
SliverFillRemaining
(
SliverFillRemaining
(
hasScrollBody:
false
,
hasScrollBody:
false
,
child:
Container
(
child:
Container
(
...
@@ -771,6 +791,7 @@ class _GeneratordetailsscreenState extends State<Generatordetailsscreen> {
...
@@ -771,6 +791,7 @@ class _GeneratordetailsscreenState extends State<Generatordetailsscreen> {
],
],
SizedBox
(
SizedBox
(
child:
Column
(
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
[
children:
[
if
(
data
.
status
==
"Completed"
)
...[
if
(
data
.
status
==
"Completed"
)
...[
Text
(
Text
(
...
@@ -791,6 +812,126 @@ class _GeneratordetailsscreenState extends State<Generatordetailsscreen> {
...
@@ -791,6 +812,126 @@ class _GeneratordetailsscreenState extends State<Generatordetailsscreen> {
:
Color
(
0xFF777777
),
:
Color
(
0xFF777777
),
),
),
),
),
///AMC Warranty
if
(
data
.
amc
!=
"0"
)
...[
SizedBox
(
height:
5
,),
Container
(
padding:
const
EdgeInsets
.
symmetric
(
horizontal:
5
,
vertical:
4
,
),
decoration:
BoxDecoration
(
gradient:
data
.
amc
==
"1"
?
AppColors
.
greenStripGradient
:
AppColors
.
fadeGradient
,
borderRadius:
BorderRadius
.
circular
(
12
),
),
child:
Row
(
mainAxisSize:
MainAxisSize
.
min
,
children:
[
SvgPicture
.
asset
(
"assets/svg/tick_ic.svg"
,
height:
15
,
color:
data
.
amc
==
"1"
?
AppColors
.
greenICBg
:
AppColors
.
subtitleText
,
),
const
SizedBox
(
width:
4
),
Text
(
"AMC "
,
style:
TextStyle
(
fontSize:
12
,
fontFamily:
"PoppinsBold"
,
fontStyle:
FontStyle
.
italic
,
fontWeight:
FontWeight
.
w700
,
color:
data
.
amc
==
"1"
?
AppColors
.
greenICBg
:
AppColors
.
subtitleText
,
),
),
Text
(
"Protected"
,
style:
TextStyle
(
fontSize:
12
,
fontFamily:
"PoppinsBold"
,
fontStyle:
FontStyle
.
italic
,
fontWeight:
FontWeight
.
w700
,
color:
data
.
amc
==
"1"
?
AppColors
.
normalText
:
AppColors
.
subtitleText
,
),
),
const
SizedBox
(
width:
4
),
if
(
data
.
amc
==
"2"
)
const
Icon
(
Icons
.
info_outline
,
color:
Colors
.
red
,
size:
15
,
),
],
),
),
],
if
(
data
.
warranty
!=
"0"
)
...[
SizedBox
(
height:
5
,),
Container
(
padding:
const
EdgeInsets
.
symmetric
(
horizontal:
8
,
vertical:
4
,
),
decoration:
BoxDecoration
(
gradient:
data
.
warranty
==
"1"
?
AppColors
.
yellowStripGradient
:
AppColors
.
fadeGradient
,
borderRadius:
BorderRadius
.
circular
(
12
),
),
child:
Row
(
mainAxisSize:
MainAxisSize
.
min
,
children:
[
Row
(
children:
[
SvgPicture
.
asset
(
"assets/svg/tick2_ic.svg"
,
height:
15
,
color:
data
.
warranty
==
"1"
?
AppColors
.
warning
:
AppColors
.
subtitleText
,
),
const
SizedBox
(
width:
6
),
Text
(
"Warranty"
,
style:
TextStyle
(
fontSize:
15
,
fontFamily:
"PoppinsBold"
,
fontStyle:
FontStyle
.
italic
,
fontWeight:
FontWeight
.
w700
,
color:
data
.
warranty
==
"1"
?
AppColors
.
normalText
:
AppColors
.
subtitleText
,
),
),
SizedBox
(
width:
6
),
if
(
data
.
warranty
==
"2"
)
const
Icon
(
Icons
.
info_outline
,
color:
Colors
.
red
,
size:
15
,
),
],
),
],
),
),
],
],
],
),
),
),
),
...
...
lib/main.dart
View file @
6f73c3f4
...
@@ -41,7 +41,7 @@ class MyApp extends StatelessWidget {
...
@@ -41,7 +41,7 @@ class MyApp extends StatelessWidget {
builder:
(
context
,
themeProvider
,
child
)
{
builder:
(
context
,
themeProvider
,
child
)
{
return
MaterialApp
(
return
MaterialApp
(
debugShowCheckedModeBanner:
false
,
debugShowCheckedModeBanner:
false
,
title:
'Gen
Services
'
,
title:
'
My
Gen'
,
theme:
ThemeData
(
theme:
ThemeData
(
fontFamily:
'Poppins'
,
fontFamily:
'Poppins'
,
),
),
...
...
Prev
1
2
3
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