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/Utils/commonWidgets.dart
View file @
528df0d2
...
...
@@ -15,12 +15,16 @@ PreferredSizeWidget appbar(BuildContext context, title) {
onTap:
()
=>
Navigator
.
pop
(
context
,
true
),
child:
SvgPicture
.
asset
(
"assets/svg/app_bar_back.svg"
,
height:
25
),
),
Text
(
title
,
style:
TextStyle
(
fontSize:
16
,
height:
1.1
,
color:
AppColors
.
semi_black
,
InkResponse
(
onTap:
()
=>
Navigator
.
pop
(
context
,
true
),
child:
Text
(
title
,
style:
TextStyle
(
fontSize:
16
,
height:
1.1
,
fontFamily:
"JakartaSemiBold"
,
color:
AppColors
.
semi_black
,
),
),
),
],
...
...
@@ -47,12 +51,16 @@ PreferredSizeWidget appbar2(BuildContext context, title,widget) {
onTap:
()
=>
Navigator
.
pop
(
context
,
true
),
child:
SvgPicture
.
asset
(
"assets/svg/app_bar_back.svg"
,
height:
25
),
),
Text
(
title
,
style:
TextStyle
(
fontSize:
16
,
height:
1.1
,
color:
AppColors
.
semi_black
,
InkResponse
(
onTap:
()
=>
Navigator
.
pop
(
context
,
true
),
child:
Text
(
title
,
style:
TextStyle
(
fontSize:
16
,
height:
1.1
,
fontFamily:
"JakartaSemiBold"
,
color:
AppColors
.
semi_black
,
),
),
),
Spacer
(),
...
...
@@ -67,3 +75,16 @@ PreferredSizeWidget appbar2(BuildContext context, title,widget) {
),
);
}
Future
<
bool
>
onBackPressed
(
BuildContext
context
)
async
{
Navigator
.
pop
(
context
,
true
);
return
true
;
}
Widget
Emptywidget
(
BuildContext
context
){
return
SizedBox
(
height:
MediaQuery
.
of
(
context
).
size
.
height
*
0.8
,
child:
Center
(
child:
Text
(
"No Data Available"
)),
);
}
\ No newline at end of file
lib/main.dart
View file @
528df0d2
...
...
@@ -21,7 +21,7 @@ import 'package:generp/Notifiers/PendingComplaintsProvider.dart';
import
'package:generp/Notifiers/ProfileNotifier.dart'
;
import
'package:generp/Notifiers/ServiceEngineerDashboardProvider.dart'
;
import
'package:generp/Notifiers/TodayMontlyVisitsProvider.dart'
;
import
'package:generp/Notifiers/UpdatePasswordProvider'
;
import
'package:generp/Notifiers/UpdatePasswordProvider
.dart
'
;
import
'package:generp/Notifiers/VisitDetailsProvider.dart'
;
import
'package:generp/Notifiers/loginNotifier.dart'
;
import
'package:generp/Notifiers/scanLoginProvider.dart'
;
...
...
@@ -82,18 +82,18 @@ void main() async {
}
}
if
(
Platform
.
isAndroid
)
{
await
Firebase
.
initializeApp
(
options:
FirebaseOptions
(
apiKey:
"AIzaSyBmkmKdYfBt2n5QRlmZJ9MV_Amh9xR3UOY"
,
appId:
"1:329382566569:android:26dc8519537b04deff67b8"
,
messagingSenderId:
"329382566569"
,
projectId:
"generp-fe09d"
,
),
);
}
else
if
(
Platform
.
isIOS
)
{
//
if (Platform.isAndroid) {
//
await Firebase.initializeApp(
//
options: FirebaseOptions(
//
apiKey: "AIzaSyBmkmKdYfBt2n5QRlmZJ9MV_Amh9xR3UOY",
//
appId: "1:329382566569:android:26dc8519537b04deff67b8",
//
messagingSenderId: "329382566569",
//
projectId: "generp-fe09d",
//
),
//
);
//
} else if (Platform.isIOS) {
await
Firebase
.
initializeApp
();
}
//
}
FirebaseMessaging
messaging
=
FirebaseMessaging
.
instance
;
...
...
@@ -149,7 +149,7 @@ void main() async {
sound:
true
,
);
FirebaseMessaging
.
instance
.
getToken
().
then
((
value
)
{
await
FirebaseMessaging
.
instance
.
getToken
().
then
((
value
)
{
String
?
token
=
value
;
if
(
kDebugMode
)
{
print
(
"fbstoken:{
$token
}"
);
...
...
@@ -209,7 +209,7 @@ class MyApp extends StatelessWidget {
return
MaterialApp
(
debugShowCheckedModeBanner:
false
,
theme:
ThemeData
(
fontFamily:
'
Lexend
'
,
fontFamily:
'
JakartaRegular
'
,
splashColor:
Colors
.
transparent
,
highlightColor:
Colors
.
transparent
,
hoverColor:
Colors
.
transparent
,
...
...
lib/screens/AttendanceScreen.dart
View file @
528df0d2
...
...
@@ -97,534 +97,626 @@ class _AttendanceScreenState extends State<AttendanceScreen> {
onRefresh:
()
async
{
await
Future
.
delayed
(
const
Duration
(
milliseconds:
600
));
attendance
.
getAttendanceList
(
homeProvider
,
context
);
attendance
.
init
(
homeProvider
,
context
);
attendance
.
loadAttendanceDetails
(
homeProvider
,
context
);
},
child:
Scaffold
(
backgroundColor:
AppColors
.
scaffold_bg_color
,
appBar:
appbar
(
context
,
"Attendance"
),
body:
Container
(
child:
SingleChildScrollView
(
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
[
Container
(
margin:
EdgeInsets
.
only
(
top:
15
,
bottom:
15
),
decoration:
BoxDecoration
(
color:
Colors
.
white
,
borderRadius:
BorderRadius
.
circular
(
16
),
),
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
[
Container
(
padding:
EdgeInsets
.
only
(
left:
10
,
right:
10
,
top:
15
,
),
child:
Row
(
children:
[
Expanded
(
child:
Text
(
"Check-in"
)),
Expanded
(
child:
Text
(
"Check-out"
)),
],
child:
WillPopScope
(
onWillPop:
()
=>
onBackPressed
(
context
),
child:
Scaffold
(
resizeToAvoidBottomInset:
true
,
backgroundColor:
AppColors
.
scaffold_bg_color
,
appBar:
appbar
(
context
,
"Attendance"
),
body:
Container
(
child:
SingleChildScrollView
(
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
[
Container
(
margin:
EdgeInsets
.
only
(
top:
15
,
bottom:
15
),
decoration:
BoxDecoration
(
color:
Colors
.
white
,
borderRadius:
BorderRadius
.
circular
(
16
),
),
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
[
Container
(
padding:
EdgeInsets
.
only
(
left:
15
,
right:
10
,
top:
15
,
),
child:
Row
(
children:
[
Expanded
(
child:
Text
(
"Check-in"
)),
Expanded
(
child:
Text
(
"Check-out"
)),
],
),
),
),
SizedBox
(
child:
Row
(
children:
[
Expanded
(
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:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
[
RichText
(
text:
TextSpan
(
children:
[
TextSpan
(
text:
formattedTime
,
style:
TextStyle
(
color:
Color
(
0xFFED3424
),
fontSize:
18
,
SizedBox
(
child:
Row
(
children:
[
Expanded
(
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:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
[
RichText
(
text:
TextSpan
(
children:
[
TextSpan
(
text:
formattedTime
,
style:
TextStyle
(
color:
Color
(
0xFFED3424
),
fontFamily:
"JakartaRegular"
,
fontSize:
30
,
),
),
),
TextSpan
(
text:
period
,
style:
TextStyle
(
color:
Color
(
0xFFED3424
),
TextSpan
(
text:
period
,
style:
TextStyle
(
color:
Color
(
0xFFED3424
),
fontFamily:
"JakartaRegular"
,
),
),
)
,
]
,
]
,
)
,
),
),
Text
(
"
${attendance.attendanceHistory.firstOrNull?['check_in_location']}
"
,
),
],
Text
(
"
${attendance.attendanceHistory.firstOrNull?['check_in_location']}
"
,
style:
TextStyle
(
color:
Color
(
0xFF818181
),
),
),
],
),
),
),
),
Expanded
(
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:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
[
RichText
(
text:
TextSpan
(
children:
[
TextSpan
(
text:
formattedTime2
,
style:
TextStyle
(
color:
Color
(
0xFFED3424
),
fontSize:
18
,
Expanded
(
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:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
[
RichText
(
text:
TextSpan
(
children:
[
TextSpan
(
text:
formattedTime2
,
style:
TextStyle
(
color:
Color
(
0xFFED3424
),
fontFamily:
"JakartaRegular"
,
fontSize:
30
,
),
),
),
TextSpan
(
text:
period2
,
style:
TextStyle
(
color:
Color
(
0xFFED3424
),
TextSpan
(
text:
period2
,
style:
TextStyle
(
color:
Color
(
0xFFED3424
),
fontFamily:
"JakartaRegular"
,
),
),
)
,
]
,
]
,
)
,
),
),
Text
(
"
${attendance.attendanceHistory.firstOrNull?['check_out_location']}
"
,
),
],
Text
(
"
${attendance.attendanceHistory.firstOrNull?['check_out_location']}
"
,
style:
TextStyle
(
color:
Color
(
0xFF818181
),
),
),
],
),
),
),
)
,
]
,
]
,
)
,
),
)
,
]
,
]
,
)
,
),
),
Text
(
"Attendance Details"
,
style:
TextStyle
(
color:
Color
(
0xFF818181
)),
),
Container
(
padding:
EdgeInsets
.
symmetric
(
horizontal:
10
,
vertical:
10
),
decoration:
BoxDecoration
(
color:
Colors
.
white
,
borderRadius:
BorderRadius
.
circular
(
16
),
Container
(
padding:
EdgeInsets
.
symmetric
(
horizontal:
10
,
vertical:
10
,
),
child:
Text
(
"Attendance Details"
,
style:
TextStyle
(
fontFamily:
"JakartaSemiBold"
,
fontSize:
14
,
color:
Color
(
0xFF818181
),
),
),
),
child:
GridView
.
builder
(
itemCount:
4
,
shrinkWrap:
true
,
physics:
NeverScrollableScrollPhysics
(),
gridDelegate:
SliverGridDelegateWithFixedCrossAxisCount
(
crossAxisCount:
2
,
crossAxisSpacing:
10
,
mainAxisSpacing:
10
,
childAspectRatio:
20
/
10
,
Container
(
padding:
EdgeInsets
.
symmetric
(
horizontal:
10
,
vertical:
10
,
),
itemBuilder:
(
context
,
index
)
{
final
numbers
=
[
attendance
.
presentDays
,
attendance
.
absentDays
,
attendance
.
holidays
,
attendance
.
latePenalties
,
];
final
names
=
[
"Present Days"
,
"Absent Days"
,
"Holidays"
,
"Late Points"
,
];
final
colors
=
[
0xFFE7FFE5
,
0xFFFFEFEF
,
0xFFF3EDFF
,
0xFFFFF6F0
,
];
final
textcolors
=
[
0xFF0D9C00
,
0xFFFF0000
,
0xFF493272
,
0xFF91481B
,
];
return
Container
(
padding:
EdgeInsets
.
symmetric
(
horizontal:
13
),
decoration:
BoxDecoration
(
color:
Color
(
colors
[
index
]),
borderRadius:
BorderRadius
.
circular
(
12
),
),
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
mainAxisAlignment:
MainAxisAlignment
.
center
,
children:
[
Text
(
numbers
[
index
].
toString
(),
style:
TextStyle
(
fontSize:
30
,
color:
Color
(
textcolors
[
index
]),
decoration:
BoxDecoration
(
color:
Colors
.
white
,
borderRadius:
BorderRadius
.
circular
(
16
),
),
child:
GridView
.
builder
(
itemCount:
4
,
shrinkWrap:
true
,
physics:
NeverScrollableScrollPhysics
(),
gridDelegate:
SliverGridDelegateWithFixedCrossAxisCount
(
crossAxisCount:
2
,
crossAxisSpacing:
10
,
mainAxisSpacing:
10
,
childAspectRatio:
20
/
10
,
),
itemBuilder:
(
context
,
index
)
{
final
numbers
=
[
attendance
.
presentDays
,
attendance
.
absentDays
,
attendance
.
holidays
,
attendance
.
latePenalties
,
];
final
names
=
[
"Present Days"
,
"Absent Days"
,
"Holidays"
,
"Late Points"
,
];
final
colors
=
[
0xFFE7FFE5
,
0xFFFFEFEF
,
0xFFF3EDFF
,
0xFFFFF6F0
,
];
final
textcolors
=
[
0xFF0D9C00
,
0xFFFF0000
,
0xFF493272
,
0xFF91481B
,
];
return
Container
(
padding:
EdgeInsets
.
symmetric
(
horizontal:
13
),
decoration:
BoxDecoration
(
color:
Color
(
colors
[
index
]),
borderRadius:
BorderRadius
.
circular
(
12
),
),
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
mainAxisAlignment:
MainAxisAlignment
.
center
,
children:
[
Text
(
numbers
[
index
].
toString
(),
style:
TextStyle
(
fontSize:
30
,
fontFamily:
"JakartaMedium"
,
color:
Color
(
textcolors
[
index
]),
),
),
),
Text
(
names
[
index
]
,
style:
TextStyle
(
color:
Color
(
0xFF818181
)
),
)
,
]
,
)
,
);
}
,
Text
(
names
[
index
],
style:
TextStyle
(
color:
Color
(
0xFF818181
))
,
),
]
,
)
,
)
;
},
)
,
),
),
///calendar
Container
(
// padding: EdgeInsets.symmetric(horizontal: 10,vertical: 5),
margin:
EdgeInsets
.
symmetric
(
horizontal:
10
,
vertical:
5
),
decoration:
BoxDecoration
(
borderRadius:
BorderRadius
.
circular
(
16
),
color:
Colors
.
white
,
),
child:
Column
(
children:
[
Padding
(
padding:
const
EdgeInsets
.
fromLTRB
(
30
,
10
,
30
,
0
),
child:
Container
(
child:
Row
(
mainAxisAlignment:
MainAxisAlignment
.
spaceBetween
,
children:
[
SizedBox
(
child:
Row
(
children:
[
GestureDetector
(
onTap:
()
{
attendance
.
setPreviousMonth
(
homeProvider
,
context
,
);
},
child:
Icon
(
Icons
.
arrow_back_ios
,
color:
AppColors
.
semi_black
,
size:
20.0
,
///calendar
Container
(
// padding: EdgeInsets.symmetric(horizontal: 10,vertical: 5),
margin:
EdgeInsets
.
symmetric
(
horizontal:
10
,
vertical:
5
,
),
decoration:
BoxDecoration
(
borderRadius:
BorderRadius
.
circular
(
16
),
color:
Colors
.
white
,
),
child:
Column
(
children:
[
Padding
(
padding:
const
EdgeInsets
.
fromLTRB
(
30
,
10
,
30
,
0
),
child:
Container
(
child:
Row
(
mainAxisAlignment:
MainAxisAlignment
.
spaceBetween
,
children:
[
SizedBox
(
child:
Row
(
children:
[
GestureDetector
(
onTap:
()
{
attendance
.
setPreviousMonth
(
homeProvider
,
context
,
);
},
child:
SvgPicture
.
asset
(
"assets/svg/arrow_left.svg"
,
),
),
),
Text
(
monthLabel
,
style:
TextStyle
(
font
Weight:
FontWeight
.
w500
,
overf
lo
w
:
TextOverflow
.
ellipsis
,
color:
Colors
.
black
,
Text
(
monthLabel
,
style:
TextStyle
(
overflow:
TextOverflow
.
ellipsis
,
font
Family:
"JakartaMedium"
,
co
lo
r
:
Color
(
0xFF2D2D2D
)
,
)
,
),
),
GestureDetector
(
onTap:
()
{
attendance
.
setNextMonth
(
homeProvider
,
context
,
);
},
child:
Icon
(
Icons
.
arrow_forward_ios
,
color:
AppColors
.
semi_black
,
size:
20.0
,
GestureDetector
(
onTap:
()
{
attendance
.
setNextMonth
(
homeProvider
,
context
,
);
},
child:
SvgPicture
.
asset
(
"assets/svg/arrow_right_new.svg"
,
),
),
)
,
]
,
]
,
)
,
),
),
InkResponse
(
onTap:
()
{
_showInfoBottomSheet
(
context
);
},
child:
SizedBox
(
width:
20
,
height:
20
,
child:
SvgPicture
.
asset
(
"assets/svg/ic_info_new.svg"
,
InkResponse
(
onTap:
()
{
_showInfoBottomSheet
(
context
);
},
child:
SizedBox
(
width:
20
,
height:
20
,
child:
SvgPicture
.
asset
(
"assets/svg/ic_info_new.svg"
,
width:
20
,
height:
20
,
),
),
),
)
,
]
,
]
,
)
,
),
),
),
SizedBox
(
height:
5
,),
Padding
(
padding:
const
EdgeInsets
.
fromLTRB
(
8
,
10
,
8
,
0
),
child:
Container
(
child:
Row
(
children:
[
for
(
var
i
=
0
;
i
<
[
'S'
,
'M'
,
'T'
,
'W'
,
'T'
,
'F'
,
'S'
,
].
length
;
i
++
)
Expanded
(
child:
Text
(
[
'S'
,
'M'
,
'T'
,
'W'
,
'T'
,
'F'
,
'S'
][
i
],
textAlign:
TextAlign
.
center
,
style:
TextStyle
(
overflow:
TextOverflow
.
ellipsis
,
color:
i
==
0
?
Color
(
0xFFFF0000
)
:
AppColors
.
semi_black
,
SizedBox
(
height:
5
),
Padding
(
padding:
const
EdgeInsets
.
fromLTRB
(
8
,
10
,
8
,
0
),
child:
Container
(
child:
Row
(
children:
[
for
(
var
i
=
0
;
i
<
[
'S'
,
'M'
,
'T'
,
'W'
,
'T'
,
'F'
,
'S'
,
].
length
;
i
++
)
Expanded
(
child:
Text
(
[
'S'
,
'M'
,
'T'
,
'W'
,
'T'
,
'F'
,
'S'
,
][
i
],
textAlign:
TextAlign
.
center
,
style:
TextStyle
(
overflow:
TextOverflow
.
ellipsis
,
color:
i
==
0
?
Color
(
0xFFFF0000
)
:
AppColors
.
semi_black
,
),
),
),
)
,
]
,
]
,
)
,
),
),
),
Padding
(
padding:
const
EdgeInsets
.
fromLTRB
(
0
,
0
,
0
,
10
),
child:
Container
(
child:
GridView
.
builder
(
itemCount:
daysInPeriod
+
startingIndex
,
gridDelegate:
SliverGridDelegateWithFixedCrossAxisCount
(
crossAxisCount:
7
,
crossAxisSpacing:
2
,
mainAxisSpacing:
1
,
childAspectRatio:
(
255
/
245
),
),
padding:
const
EdgeInsets
.
fromLTRB
(
0
,
0
,
0
,
0
),
shrinkWrap:
true
,
physics:
NeverScrollableScrollPhysics
(),
itemBuilder:
(
context
,
index
)
{
if
(
index
<
startingIndex
)
{
return
SizedBox
.
shrink
();
}
final
dayIndex
=
index
-
startingIndex
;
final
currentDateInPeriod
=
startDate
.
add
(
Duration
(
days:
dayIndex
),
);
final
currentDay
=
currentDateInPeriod
.
day
;
final
isFutureDate
=
currentDateInPeriod
.
isAfter
(
currentDate
);
// Find matching date in dateArrayList
Map
<
String
,
dynamic
>?
dateMap
;
try
{
dateMap
=
dateArrayList
[
dayIndex
];
}
catch
(
e
)
{
dateMap
=
{};
}
// Find matching penalty
Map
<
String
,
dynamic
>?
penaltyMap
;
try
{
penaltyMap
=
penalityArrayList
[
dayIndex
];
}
catch
(
e
)
{
penaltyMap
=
{};
}
String
?
dateColor
=
dateMap
.
isNotEmpty
?
dateMap
.
values
.
first
:
null
;
String
?
penaltyKey
=
penaltyMap
.
isNotEmpty
?
penaltyMap
.
keys
.
first
:
null
;
int
?
datePenalty
=
penaltyMap
.
isNotEmpty
?
penaltyMap
.
values
.
first
:
0
;
// Determine if this is the current day
final
isCurrentDay
=
currentDateInPeriod
.
day
==
currentDate
.
day
&&
currentDateInPeriod
.
month
==
currentDate
.
month
&&
currentDateInPeriod
.
year
==
currentDate
.
year
;
return
InkWell
(
onTap:
isFutureDate
?
null
:
()
{
selectedIndex
=
index
;
if
(
penaltyKey
!=
null
)
{
attendance
.
dateWiseAttendance
(
homeProvider
,
penaltyKey
,
Padding
(
padding:
const
EdgeInsets
.
fromLTRB
(
0
,
0
,
0
,
10
),
child:
Container
(
child:
GridView
.
builder
(
itemCount:
daysInPeriod
+
startingIndex
,
gridDelegate:
SliverGridDelegateWithFixedCrossAxisCount
(
crossAxisCount:
7
,
crossAxisSpacing:
2
,
mainAxisSpacing:
1
,
childAspectRatio:
(
255
/
245
),
),
padding:
const
EdgeInsets
.
fromLTRB
(
0
,
0
,
0
,
0
,
),
shrinkWrap:
true
,
physics:
NeverScrollableScrollPhysics
(),
itemBuilder:
(
context
,
index
)
{
if
(
index
<
startingIndex
)
{
return
SizedBox
.
shrink
();
}
final
dayIndex
=
index
-
startingIndex
;
final
currentDateInPeriod
=
startDate
.
add
(
Duration
(
days:
dayIndex
),
);
final
currentDay
=
currentDateInPeriod
.
day
;
final
isFutureDate
=
currentDateInPeriod
.
isAfter
(
currentDate
);
// Find matching date in dateArrayList
Map
<
String
,
dynamic
>?
dateMap
;
try
{
dateMap
=
dateArrayList
[
dayIndex
];
}
catch
(
e
)
{
dateMap
=
{};
}
// Find matching penalty
Map
<
String
,
dynamic
>?
penaltyMap
;
try
{
penaltyMap
=
penalityArrayList
[
dayIndex
];
}
catch
(
e
)
{
penaltyMap
=
{};
}
String
?
dateColor
=
dateMap
.
isNotEmpty
?
dateMap
.
values
.
first
:
null
;
String
?
penaltyKey
=
penaltyMap
.
isNotEmpty
?
penaltyMap
.
keys
.
first
:
null
;
int
?
datePenalty
=
penaltyMap
.
isNotEmpty
?
penaltyMap
.
values
.
first
:
0
;
// Determine if this is the current day
final
isCurrentDay
=
currentDateInPeriod
.
day
==
currentDate
.
day
&&
currentDateInPeriod
.
month
==
currentDate
.
month
&&
currentDateInPeriod
.
year
==
currentDate
.
year
;
return
InkWell
(
onTap:
isFutureDate
?
null
:
()
{
selectedIndex
=
index
;
if
(
penaltyKey
!=
null
)
{
attendance
.
dateWiseAttendance
(
homeProvider
,
penaltyKey
,
context
,
);
}
attendance
.
selectedDate
=
currentDay
.
toString
();
_showAttDetailsBottomSheet
(
context
,
);
}
attendance
.
selectedDate
=
currentDay
.
toString
();
_showAttDetailsBottomSheet
(
context
);
},
child:
Card
(
elevation:
0
,
child:
Column
(
children:
[
Row
(
mainAxisAlignment:
MainAxisAlignment
.
center
,
children:
[
Text
(
datePenalty
!=
0
?
"(
$datePenalty
)"
:
""
,
style:
TextStyle
(
fontWeight:
FontWeight
.
w400
,
color:
Colors
.
black
,
),
),
],
),
Center
(
child:
Container
(
decoration:
BoxDecoration
(
shape:
BoxShape
.
circle
,
color:
isFutureDate
?
Colors
.
transparent
:
(
isCurrentDay
||
(
selectedIndex
==
index
))
?
Color
(
0xFFF6F0FF
)
:
dateColor
==
'g'
?
Color
(
0xFFE8FFE6
)
:
dateColor
==
'r'
?
Color
(
0xFFFFEFEF
)
:
dateColor
==
'b'
?
Color
(
0xFFFFE8D0
)
:
dateColor
==
'br'
?
Colors
.
brown
:
dateColor
==
'y'
?
Color
(
0xFFFFF9B2
)
:
Colors
.
transparent
,
),
child:
Center
(
child:
Text
(
currentDay
.
toString
(),
style:
TextStyle
(
fontSize:
14
,
fontWeight:
FontWeight
.
w400
,
},
child:
Card
(
elevation:
0
,
child:
Column
(
children:
[
// Row(
// mainAxisAlignment:
// MainAxisAlignment.center,
// children: [
// Text(
// "($datePenalty)",
// style: TextStyle(
// fontWeight: FontWeight.w400,
// color: Colors.black,
// fontSize: 5
// ),
// ),
// ],
// ),
Center
(
child:
Container
(
decoration:
BoxDecoration
(
shape:
BoxShape
.
circle
,
border:
Border
.
all
(
color:
isFutureDate
?
AppColors
.
semi_black
:
(
isCurrentDay
||
(
isCurrentDay
||
(
selectedIndex
==
index
))
?
Color
(
0xFF493272
)
:
dateColor
==
'g'
?
Color
(
0xFF6B3A02
)
:
dateColor
==
'r'
?
Color
(
0xFFFF0000
)
:
dateColor
==
'b'
?
Color
(
0xFF493272
)
:
dateColor
==
'br'
?
Colors
.
brown
:
dateColor
==
'y'
?
Color
(
0xFF605C00
)
:
Colors
.
transparent
,
?
Color
(
0xFF1487C9
)
:
Colors
.
transparent
,
),
color:
isFutureDate
?
Colors
.
transparent
:
(
isCurrentDay
||
(
selectedIndex
==
index
))
?
Color
(
0xFFFFFFFF
)
:
dateColor
==
'g'
?
Color
(
0xFFE8FFE6
)
:
dateColor
==
'r'
?
Color
(
0xFFFFEFEF
)
:
dateColor
==
'b'
?
Color
(
0xFFFFE8D0
)
:
dateColor
==
'br'
?
Color
(
0xFFFFE8D0
)
:
dateColor
==
'y'
?
Color
(
0xFFFFF9B2
)
:
Colors
.
transparent
,
),
child:
Center
(
child:
Text
(
currentDay
.
toString
(),
style:
TextStyle
(
fontSize:
14
,
fontWeight:
FontWeight
.
w400
,
color:
isFutureDate
?
AppColors
.
semi_black
:
(
isCurrentDay
||
(
selectedIndex
==
index
))
?
Color
(
0xFF2D2D2D
,
)
:
dateColor
==
'g'
?
Color
(
0xFF6B3A02
,
)
:
dateColor
==
'r'
?
Color
(
0xFFFF0000
,
)
:
dateColor
==
'b'
?
Color
(
0xFF493272
,
)
:
dateColor
==
'br'
?
Color
(
0xFF6B3A02
,
)
:
dateColor
==
'y'
?
Color
(
0xFF605C00
,
)
:
Colors
.
transparent
,
),
),
),
),
),
)
,
]
,
]
,
)
,
),
)
,
);
}
,
)
;
},
)
,
),
),
)
,
]
,
]
,
)
,
),
),
SizedBox
(
height:
70
),
],
),
),
),
floatingActionButton:
attendance
.
attendanceStatus
==
0
||
attendance
.
attendanceStatus
==
1
?
Align
(
alignment:
Alignment
.
bottomCenter
,
child:
InkWell
(
onTap:
()
async
{
var
res
=
await
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
context
)
=>
CheckInOutScreen
(
getAttendanceStatus:
attendance
.
attendanceStatus
,
),
),
);
if
(
res
==
true
){
attendance
.
getAttendanceList
(
homeProvider
,
context
);
}
var
f
=
FocusScope
.
of
(
context
);
if
(!
f
.
hasPrimaryFocus
)
{
f
.
unfocus
();
}
},
child:
Container
(
alignment:
Alignment
.
bottomCenter
,
height:
45
,
margin:
EdgeInsets
.
symmetric
(
horizontal:
10
),
width:
MediaQuery
.
of
(
context
).
size
.
width
,
decoration:
BoxDecoration
(
color:
AppColors
.
app_blue
,
borderRadius:
BorderRadius
.
circular
(
30.0
),
),
child:
Center
(
child:
Text
(
attendance
.
attendanceStatus
==
0
?
"Check In"
:
"Check Out"
,
textAlign:
TextAlign
.
center
,
style:
TextStyle
(
color:
Colors
.
white
),
),
SizedBox
(
height:
70
),
],
),
),
),
):
SizedBox
(
height:
0
,),
floatingActionButtonLocation:
FloatingActionButtonLocation
.
centerFloat
,
floatingActionButton:
attendance
.
attendanceStatus
==
0
||
attendance
.
attendanceStatus
==
1
?
Align
(
alignment:
Alignment
.
bottomCenter
,
child:
InkWell
(
onTap:
()
async
{
var
res
=
await
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
context
)
=>
CheckInOutScreen
(
getAttendanceStatus:
attendance
.
attendanceStatus
,
),
),
);
if
(
res
==
true
)
{
attendance
.
getAttendanceList
(
homeProvider
,
context
,
);
attendance
.
init
(
homeProvider
,
context
);
attendance
.
loadAttendanceDetails
(
homeProvider
,
context
,
);
}
var
f
=
FocusScope
.
of
(
context
);
if
(!
f
.
hasPrimaryFocus
)
{
f
.
unfocus
();
}
},
child:
Container
(
alignment:
Alignment
.
bottomCenter
,
height:
45
,
margin:
EdgeInsets
.
symmetric
(
horizontal:
10
),
width:
MediaQuery
.
of
(
context
).
size
.
width
,
decoration:
BoxDecoration
(
color:
AppColors
.
app_blue
,
borderRadius:
BorderRadius
.
circular
(
15.0
),
),
child:
Center
(
child:
Text
(
attendance
.
attendanceStatus
==
0
?
"Check In"
:
"Check Out"
,
textAlign:
TextAlign
.
center
,
style:
TextStyle
(
fontSize:
16
,
color:
Colors
.
white
,
fontFamily:
"JakartaMedium"
,
),
),
),
),
),
)
:
SizedBox
(
height:
0
),
floatingActionButtonLocation:
FloatingActionButtonLocation
.
centerFloat
,
),
),
);
},
...
...
@@ -663,6 +755,7 @@ class _AttendanceScreenState extends State<AttendanceScreen> {
"Indicators Info"
,
style:
TextStyle
(
color:
AppColors
.
app_blue
,
fontFamily:
"JakartaSemiBold"
,
fontSize:
16
,
),
),
...
...
@@ -766,6 +859,7 @@ class _AttendanceScreenState extends State<AttendanceScreen> {
"Attendance Info"
,
style:
TextStyle
(
color:
AppColors
.
app_blue
,
fontFamily:
"JakartaSemiBold"
,
fontSize:
16
,
),
),
...
...
@@ -790,7 +884,9 @@ class _AttendanceScreenState extends State<AttendanceScreen> {
),
child:
Row
(
children:
[
Text
(
"Late Points "
),
Text
(
"Late Points "
,
style:
TextStyle
(
fontFamily:
"JakartaMedium"
,
),),
Text
(
provider
.
penalties
,
style:
TextStyle
(
...
...
@@ -831,6 +927,7 @@ class _AttendanceScreenState extends State<AttendanceScreen> {
child:
Text
(
values
[
j
],
style:
TextStyle
(
fontFamily:
"JakartaMedium"
,
color:
AppColors
.
semi_black
,
),
),
...
...
@@ -838,7 +935,9 @@ class _AttendanceScreenState extends State<AttendanceScreen> {
Expanded
(
child:
Text
(
subvalues
[
j
],
style:
TextStyle
(
color:
Color
(
0xFF818181
)),
style:
TextStyle
(
color:
Color
(
0xFF818181
),
),
),
),
],
...
...
lib/screens/CheckInScreen.dart
View file @
528df0d2
...
...
@@ -48,29 +48,29 @@ class _CheckInOutScreenState extends State<CheckInOutScreen> {
return
Consumer
<
CheckInOutProvider
>(
builder:
(
context
,
provider
,
child
)
{
return
Scaffold
(
appBar:
appbar
(
context
,
widget
.
getAttendanceStatus
==
0
?
"Check In"
:
"Check Out"
),
body:
Container
(
child:
SafeArea
(
child:
Column
(
children:
[
Expanded
(
child:
ClipRRect
(
borderRadius:
BorderRadius
.
only
(
topLeft:
Radius
.
circular
(
30.0
),
topRight:
Radius
.
circular
(
30.0
),
),
return
WillPopScope
(
onWillPop:
()
=>
onBackPressed
(
context
),
child:
Scaffold
(
resizeToAvoidBottomInset:
true
,
appBar:
appbar
(
context
,
widget
.
getAttendanceStatus
==
0
?
"Check In"
:
"Check Out"
),
body:
Container
(
child:
SafeArea
(
child:
Column
(
children:
[
Expanded
(
child:
Stack
(
children:
[
GoogleMap
(
myLocationEnabled:
true
,
zoomGesturesEnabled:
true
,
scrollGesturesEnabled:
false
,
initialCameraPosition:
CameraPosition
(
target:
provider
.
currentLocationLatLng
??
provider
.
startLocation
,
zoom:
20.0
,
),
markers:
provider
.
markers
.
toSet
(),
myLocationButtonEnabled:
true
,
mapType:
MapType
.
normal
,
onMapCreated:
(
controller
)
{
provider
.
mapController
=
controller
;
...
...
@@ -99,15 +99,29 @@ class _CheckInOutScreenState extends State<CheckInOutScreen> {
CrossAxisAlignment
.
start
,
children:
[
SizedBox
(
height:
25
),
Padding
(
padding:
const
EdgeInsets
.
symmetric
(
horizontal:
20.0
),
child:
Text
(
"Location"
,
style:
TextStyle
(
fontWeight:
FontWeight
.
w400
,
color:
Colors
.
grey
,
),
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
[
Text
(
"Share Your Details"
,
style:
TextStyle
(
color:
AppColors
.
app_blue
,
fontFamily:
"JakartaSemiBold"
),
),
SizedBox
(
height:
10
,),
Text
(
"Location"
,
style:
TextStyle
(
fontFamily:
"JakartaMedium"
,
color:
AppColors
.
semi_black
,
),
),
],
),
),
SizedBox
(
height:
5
),
...
...
@@ -121,7 +135,7 @@ class _CheckInOutScreenState extends State<CheckInOutScreen> {
decoration:
BoxDecoration
(
color:
AppColors
.
text_field_color
,
borderRadius:
BorderRadius
.
circular
(
25
),
BorderRadius
.
circular
(
14
),
),
child:
Padding
(
padding:
...
...
@@ -138,7 +152,8 @@ class _CheckInOutScreenState extends State<CheckInOutScreen> {
"Enter Check
${widget.getAttendanceStatus==0?"In":"Out"}
Location"
,
hintStyle:
TextStyle
(
fontWeight:
FontWeight
.
w400
,
fontSize:
14
fontSize:
14
,
color:
Color
(
0xFF818181
)
),
enabledBorder:
InputBorder
.
none
,
...
...
@@ -201,12 +216,13 @@ class _CheckInOutScreenState extends State<CheckInOutScreen> {
decoration:
BoxDecoration
(
color:
AppColors
.
app_blue
,
borderRadius:
BorderRadius
.
circular
(
30
.0
),
BorderRadius
.
circular
(
15
.0
),
),
child:
Text
(
widget
.
getAttendanceStatus
==
0
?
"Check In"
:
"Check Out"
,
style:
TextStyle
(
fontWeight:
FontWeight
.
w500
,
fontFamily:
"JakartaMedium"
,
fontSize:
16
,
color:
Colors
.
white
),
),
...
...
@@ -220,8 +236,8 @@ class _CheckInOutScreenState extends State<CheckInOutScreen> {
],
),
),
)
,
]
,
]
,
)
,
),
),
),
...
...
lib/screens/HomeScreen.dart
View file @
528df0d2
...
...
@@ -13,10 +13,12 @@ import 'package:generp/screens/ScannerLogin.dart';
import
'package:generp/screens/WebERPScreen.dart'
;
import
'package:generp/screens/WebWhizzdomScreen.dart'
;
import
'package:generp/screens/genTracker/GenTrackerDashboard.dart'
;
import
'package:generp/screens/serviceEngineer/NearbyGenerators.dart'
;
import
'package:generp/screens/serviceEngineer/serviceEngineerDashboard.dart'
;
import
'package:geolocator/geolocator.dart'
;
import
'package:provider/provider.dart'
;
import
'package:cached_network_image/cached_network_image.dart'
;
import
'package:location/location.dart'
as
loc
;
import
'../Utils/app_colors.dart'
;
import
'AttendanceScreen.dart'
;
import
'inventory/InventoryScreen.dart'
;
...
...
@@ -42,57 +44,105 @@ class _MyHomePageState extends State<MyHomePage> {
Future
.
delayed
(
Duration
(
milliseconds:
600
),
()
{
prof_prov
.
ProfileApiFunction
(
prov
,
context
);
prof_prov
.
VersionApiFunction
();
});
super
.
initState
();
}
Future
<
bool
>
onBackPressed
()
async
{
return
await
showDialog
<
bool
>(
context:
context
,
builder:
(
context
)
=>
AlertDialog
(
title:
const
Text
(
'Are you sure?'
),
content:
const
Text
(
'Do you want to exit the App'
),
actions:
[
TextButton
(
style:
ButtonStyle
(
backgroundColor:
MaterialStateProperty
.
all
(
Colors
.
white
),
overlayColor:
MaterialStateProperty
.
all
(
Colors
.
white
),
),
onPressed:
()
=>
Navigator
.
of
(
context
).
pop
(
false
),
child:
Text
(
"NO"
,
style:
TextStyle
(
fontWeight:
FontWeight
.
w500
,
),
),
),
const
SizedBox
(
height:
16
),
TextButton
(
style:
ButtonStyle
(
backgroundColor:
MaterialStateProperty
.
all
(
Colors
.
white
),
overlayColor:
MaterialStateProperty
.
all
(
Colors
.
white70
),
),
onPressed:
()
=>
SystemChannels
.
platform
.
invokeMethod
(
'SystemNavigator.pop'
),
child:
Text
(
"YES"
,
style:
TextStyle
(
fontWeight:
FontWeight
.
w500
,
context:
context
,
builder:
(
context
)
=>
AlertDialog
(
title:
const
Text
(
'Are you sure?'
),
content:
const
Text
(
'Do you want to exit the App'
),
actions:
[
TextButton
(
style:
ButtonStyle
(
backgroundColor:
MaterialStateProperty
.
all
(
Colors
.
white
),
overlayColor:
MaterialStateProperty
.
all
(
Colors
.
white
),
),
onPressed:
()
=>
Navigator
.
of
(
context
).
pop
(
false
),
child:
Text
(
"NO"
,
style:
TextStyle
(
fontWeight:
FontWeight
.
w500
),
),
),
const
SizedBox
(
height:
16
),
TextButton
(
style:
ButtonStyle
(
backgroundColor:
MaterialStateProperty
.
all
(
Colors
.
white
),
overlayColor:
MaterialStateProperty
.
all
(
Colors
.
white70
),
),
onPressed:
()
=>
SystemChannels
.
platform
.
invokeMethod
(
'SystemNavigator.pop'
,
),
child:
Text
(
"YES"
,
style:
TextStyle
(
fontWeight:
FontWeight
.
w500
),
),
),
],
elevation:
30.0
,
),
),
),
],
elevation:
30.0
,
),
barrierDismissible:
false
,
)
??
barrierDismissible:
false
,
)
??
false
;
}
Future
<
void
>
requestGpsPermission
()
async
{
bool
isLocationEnabled
=
false
;
bool
hasLocationPermission
=
false
;
isLocationEnabled
=
await
Geolocator
.
isLocationServiceEnabled
();
// Check if the app has been granted location permission
LocationPermission
permission
=
await
Geolocator
.
checkPermission
();
hasLocationPermission
=
permission
==
LocationPermission
.
always
||
permission
==
LocationPermission
.
whileInUse
;
final
loc
.
Location
location
=
loc
.
Location
();
bool
serviceEnabled
;
serviceEnabled
=
await
location
.
serviceEnabled
();
if
(!
serviceEnabled
)
{
serviceEnabled
=
await
location
.
requestService
();
if
(!
serviceEnabled
)
{
return
;
}
}
}
@override
Widget
build
(
BuildContext
context
)
{
return
Consumer2
<
HomescreenNotifier
,
ProfileNotifer
>(
builder:
(
context
,
homescreen
,
profile
,
child
)
{
// Define the original data
final
names
=
[
"Attendance"
,
"ERP"
,
"Gen Tracker"
,
"Service Engineer"
,
"Nearby"
,
"Inventory"
,
"Whizzdom"
,
];
final
icons
=
[
"assets/svg/home_icons_1.svg"
,
"assets/svg/home_icons_2.svg"
,
"assets/svg/home_icons_31.svg"
,
"assets/svg/home_icons_4.svg"
,
"assets/svg/home_icons_5.svg"
,
"assets/svg/home_icons_6.svg"
,
"assets/svg/home_icons_81.svg"
,
];
final
requiredRoles
=
[
"430"
,
"431"
,
"434"
,
"433"
,
"433"
,
"432"
,
"431"
];
final
filteredItems
=
<
Map
<
String
,
String
>>[];
for
(
int
i
=
0
;
i
<
names
.
length
;
i
++)
{
if
(
homescreen
.
roleStatus
.
contains
(
requiredRoles
[
i
]))
{
filteredItems
.
add
({
'name'
:
names
[
i
],
'icon'
:
icons
[
i
]});
}
}
return
WillPopScope
(
onWillPop:
onBackPressed
,
child:
RefreshIndicator
.
adaptive
(
...
...
@@ -101,9 +151,9 @@ class _MyHomePageState extends State<MyHomePage> {
onRefresh:
()
async
{
await
Future
.
delayed
(
const
Duration
(
milliseconds:
600
));
homescreen
.
DashboardApiFunction
(
context
);
},
child:
Scaffold
(
resizeToAvoidBottomInset:
true
,
backgroundColor:
AppColors
.
scaffold_bg_color
,
body:
Container
(
...
...
@@ -129,7 +179,10 @@ class _MyHomePageState extends State<MyHomePage> {
decoration:
BoxDecoration
(
borderRadius:
BorderRadius
.
circular
(
30
),
gradient:
LinearGradient
(
colors:
[
AppColors
.
profile_card_gradient1
,
AppColors
.
profile_card_gradient2
],
colors:
[
AppColors
.
profile_card_gradient1
,
AppColors
.
profile_card_gradient2
,
],
),
),
child:
Row
(
...
...
@@ -143,40 +196,50 @@ class _MyHomePageState extends State<MyHomePage> {
children:
[
SizedBox
(
width:
66
,
width:
66
,
height:
66
,
child:
ClipRRect
(
borderRadius:
BorderRadius
.
circular
(
50
),
borderRadius:
BorderRadius
.
circular
(
50
,
),
child:
CachedNetworkImage
(
cacheKey:
profile
.
profileImage
,
fit:
BoxFit
.
cover
,
imageUrl:
"
${profile.profileImage}
"
,
useOldImageOnUrlChange:
false
,
placeholder:
(
context
,
url
)
=>
CircularProgressIndicator
.
adaptive
(
),
errorWidget:
(
context
,
url
,
error
)
=>
Icon
(
Icons
.
error
),
placeholder:
(
context
,
url
)
=>
CircularProgressIndicator
.
adaptive
(),
errorWidget:
(
context
,
url
,
error
)
=>
Icon
(
Icons
.
error
),
),
),
),
Row
(
mainAxisAlignment:
MainAxisAlignment
.
center
,
mainAxisAlignment:
MainAxisAlignment
.
center
,
children:
[
Container
(
width:
1
0
,
height:
1
0
,
width:
1
3
,
height:
1
3
,
decoration:
BoxDecoration
(
shape:
BoxShape
.
circle
,
color:
homescreen
.
onlineStatus
==
"Online"
?
Colors
.
green
:
Colors
.
yellow
,
color:
homescreen
.
onlineStatus
==
"Online"
?
Colors
.
green
:
Colors
.
yellow
,
),
),
SizedBox
(
width:
5
),
SizedBox
(
width:
6
),
Text
(
"
${homescreen.onlineStatus}
"
,
style:
TextStyle
(
fontSize:
14
,
color:
Colors
.
black
,
fontSize:
16
,
fontFamily:
"JakartaMedium"
,
color:
Color
(
0xFF2D2D2D
),
),
),
],
...
...
@@ -189,20 +252,23 @@ class _MyHomePageState extends State<MyHomePage> {
flex:
3
,
child:
SizedBox
(
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
crossAxisAlignment:
CrossAxisAlignment
.
start
,
mainAxisAlignment:
MainAxisAlignment
.
center
,
children:
[
Text
(
"
${profile.employeeName}
"
,
style:
TextStyle
(
color:
AppColors
.
app_blue
,
fontSize:
16
,
fontFamily:
"JakartaSemiBold"
,
fontSize:
18
,
),
),
Text
(
"
${profile.designation}
"
,
style:
TextStyle
(
color:
AppColors
.
semi_black
,
fontFamily:
"JakartaRegular"
,
fontSize:
14
,
),
),
...
...
@@ -210,6 +276,7 @@ class _MyHomePageState extends State<MyHomePage> {
"
${profile.employeeeID}
"
,
style:
TextStyle
(
color:
AppColors
.
semi_black
,
fontFamily:
"JakartaRegular"
,
fontSize:
14
,
),
),
...
...
@@ -227,7 +294,8 @@ class _MyHomePageState extends State<MyHomePage> {
"View Profile"
,
style:
TextStyle
(
color:
AppColors
.
app_blue
,
fontSize:
16
,
fontFamily:
"JakartaRegular"
,
fontSize:
14
,
),
),
SizedBox
(
width:
5
),
...
...
@@ -262,60 +330,109 @@ class _MyHomePageState extends State<MyHomePage> {
bottom:
10
,
),
child:
GridView
.
builder
(
itemCount:
8
,
gridDelegate:
SliverGridDelegateWithFixedCrossAxisCount
(
crossAxisCount:
2
,
crossAxisSpacing:
10
,
mainAxisSpacing:
10
,
),
itemCount:
filteredItems
.
length
,
gridDelegate:
SliverGridDelegateWithFixedCrossAxisCount
(
crossAxisCount:
2
,
crossAxisSpacing:
10
,
mainAxisSpacing:
10
,
),
itemBuilder:
(
context
,
index
)
{
var
roles
=
homescreen
.
roleStatus
;
final
names
=
[
"Attendance"
,
"ERP"
,
"Gen Tracker"
,
"Service Engineer"
,
"Nearby"
,
"Inventory"
,
"Whizzdom"
,
"CRM"
,
];
final
item
=
filteredItems
[
index
];
return
InkResponse
(
onTap:
()
async
{
var
res
;
switch
(
names
[
index
])
{
switch
(
item
[
'name'
])
{
case
"Attendance"
:
res
=
await
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
context
)
=>
AttendanceScreen
()));
res
=
await
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
context
)
=>
AttendanceScreen
(),
),
);
break
;
case
"ERP"
:
res
=
await
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
context
)
=>
WebErpScreen
(
erp_url:
homescreen
.
webPageUrl
)));
bool
isGpsEnabled
=
await
Geolocator
.
isLocationServiceEnabled
();
if
(
isGpsEnabled
)
{
res
=
await
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
context
)
=>
WebErpScreen
(
erp_url:
homescreen
.
webPageUrl
,
),
),
);
}
else
{
requestGpsPermission
();
}
break
;
case
"Gen Tracker"
:
res
=
await
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
context
)=>
Gentrackerdashboard
()));
res
=
await
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
context
)
=>
Gentrackerdashboard
(),
),
);
break
;
case
"Service Engineer"
:
res
=
await
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
context
)=>
Serviceengineerdashboard
()));
res
=
await
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
context
)
=>
Serviceengineerdashboard
(),
),
);
break
;
case
"Nearby"
:
//res = await Navigator.push(context, MaterialPageRoute(builder: (context)=>NearByGeneratorsScreen()));
res
=
await
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
context
)
=>
Nearbygenerators
(),
),
);
break
;
case
"Inventory"
:
res
=
await
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
context
)=>
InventoryScreen
()));
res
=
await
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
context
)
=>
InventoryScreen
(),
),
);
break
;
case
"Whizzdom"
:
res
=
await
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
context
)=>
WebWhizzdomScreen
(
whizzdom_url:
homescreen
.
whizzdomPageUrl
)));
break
;
case
"CRM"
:
//res = await Navigator.push(context, MaterialPageRoute(builder: (context)=>CRMScreen()));
bool
isGpsEnabled
=
await
Geolocator
.
isLocationServiceEnabled
();
if
(
isGpsEnabled
)
{
res
=
await
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
context
)
=>
WebWhizzdomScreen
(
whizzdom_url:
homescreen
.
whizzdomPageUrl
,
),
),
);
}
else
{
requestGpsPermission
();
}
break
;
// case "CRM":
// //res = await Navigator.push(context, MaterialPageRoute(builder: (context)=>CRMScreen()));
// break;
default
:
print
(
"111"
);
break
;
}
if
(
res
==
true
){
if
(
res
==
true
)
{
homescreen
.
DashboardApiFunction
(
context
);
}
},
...
...
@@ -328,10 +445,9 @@ class _MyHomePageState extends State<MyHomePage> {
crossAxisAlignment:
CrossAxisAlignment
.
center
,
mainAxisAlignment:
MainAxisAlignment
.
center
,
children:
[
SvgPicture
.
asset
(
"assets/svg/home_icons_
${index + 1}
.svg"
,
),
Text
(
names
[
index
]),
SvgPicture
.
asset
(
item
[
'icon'
]!,
height:
45
),
SizedBox
(
height:
10
),
Text
(
item
[
'name'
]!),
],
),
),
...
...
@@ -396,7 +512,12 @@ class _MyHomePageState extends State<MyHomePage> {
Spacer
(),
InkResponse
(
onTap:
()
{
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
context
)
=>
Scannerlogin
(),));
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
context
)
=>
Scannerlogin
(),
),
);
},
child:
SizedBox
(
height:
25
,
...
...
@@ -414,7 +535,10 @@ class _MyHomePageState extends State<MyHomePage> {
decoration:
BoxDecoration
(
borderRadius:
BorderRadius
.
circular
(
30
),
gradient:
LinearGradient
(
colors:
[
AppColors
.
profile_card_gradient1
,
AppColors
.
profile_card_gradient2
],
colors:
[
AppColors
.
profile_card_gradient1
,
AppColors
.
profile_card_gradient2
,
],
),
),
child:
Column
(
...
...
@@ -422,8 +546,8 @@ class _MyHomePageState extends State<MyHomePage> {
children:
[
Padding
(
padding:
EdgeInsets
.
all
(
10
),
child:
SizedBox
(
width:
70
,
child:
SizedBox
(
width:
70
,
height:
70
,
child:
ClipRRect
(
borderRadius:
BorderRadius
.
circular
(
50
),
...
...
@@ -432,10 +556,12 @@ class _MyHomePageState extends State<MyHomePage> {
fit:
BoxFit
.
cover
,
imageUrl:
"
${profile.profileImage}
"
,
useOldImageOnUrlChange:
false
,
placeholder:
(
context
,
url
)
=>
CircularProgressIndicator
.
adaptive
(
),
errorWidget:
(
context
,
url
,
error
)
=>
Icon
(
Icons
.
error
),
placeholder:
(
context
,
url
)
=>
CircularProgressIndicator
.
adaptive
(),
errorWidget:
(
context
,
url
,
error
)
=>
Icon
(
Icons
.
error
),
),
),
),
...
...
@@ -444,7 +570,8 @@ class _MyHomePageState extends State<MyHomePage> {
"
${profile.employeeName}
"
,
style:
TextStyle
(
color:
AppColors
.
app_blue
,
fontSize:
16
,
fontFamily:
"JakartaSemiBold"
,
fontSize:
18
,
),
),
Text
(
...
...
@@ -487,6 +614,7 @@ class _MyHomePageState extends State<MyHomePage> {
textAlign:
TextAlign
.
left
,
style:
TextStyle
(
fontSize:
14
,
fontFamily:
"JakartaMedium"
,
color:
AppColors
.
app_blue
,
),
),
...
...
@@ -533,6 +661,7 @@ class _MyHomePageState extends State<MyHomePage> {
],
),
),
SizedBox
(
height:
10
),
InkWell
(
onTap:
()
{
// LoginApiFunction();
...
...
@@ -556,7 +685,7 @@ class _MyHomePageState extends State<MyHomePage> {
),
decoration:
BoxDecoration
(
color:
AppColors
.
app_blue
,
//1487C9
borderRadius:
BorderRadius
.
circular
(
30
.0
),
borderRadius:
BorderRadius
.
circular
(
15
.0
),
),
child:
Center
(
child:
Text
(
...
...
@@ -622,16 +751,15 @@ class _MyHomePageState extends State<MyHomePage> {
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
center
,
children:
[
Text
(
"Are you sure you want
\n
to logout ?"
,
textAlign:
TextAlign
.
center
,
style:
TextStyle
(
fontFamily:
"JakartaMedium"
,
color:
AppColors
.
semi_black
,
fontSize:
18
,
),
),
],
),
SizedBox
(
height:
20
),
...
...
@@ -658,13 +786,16 @@ class _MyHomePageState extends State<MyHomePage> {
),
decoration:
BoxDecoration
(
color:
AppColors
.
app_blue
,
//1487C9
borderRadius:
BorderRadius
.
circular
(
30
.0
),
borderRadius:
BorderRadius
.
circular
(
15
.0
),
),
child:
Center
(
child:
Text
(
"Yes, Logout"
,
textAlign:
TextAlign
.
center
,
style:
TextStyle
(
color:
Colors
.
white
),
style:
TextStyle
(
color:
Colors
.
white
,
fontFamily:
"JakartaMedium"
,
),
),
),
),
...
...
@@ -695,7 +826,10 @@ class _MyHomePageState extends State<MyHomePage> {
child:
Text
(
"Cancel"
,
textAlign:
TextAlign
.
center
,
style:
TextStyle
(
color:
AppColors
.
app_blue
),
style:
TextStyle
(
color:
AppColors
.
app_blue
,
fontFamily:
"JakartaMedium"
,
),
),
),
),
...
...
lib/screens/LoginScreen.dart
View file @
528df0d2
...
...
@@ -108,459 +108,499 @@ class _LoginScreenState extends State<LoginScreen>
_scrollController
.
dispose
();
super
.
dispose
();
}
Future
<
bool
>
onBackPressed
()
async
{
return
await
showDialog
<
bool
>(
context:
context
,
builder:
(
context
)
=>
AlertDialog
(
title:
const
Text
(
'Are you sure?'
),
content:
const
Text
(
'Do you want to exit the App'
),
actions:
[
TextButton
(
style:
ButtonStyle
(
backgroundColor:
MaterialStateProperty
.
all
(
Colors
.
white
),
overlayColor:
MaterialStateProperty
.
all
(
Colors
.
white
),
),
onPressed:
()
=>
Navigator
.
of
(
context
).
pop
(
false
),
child:
Text
(
"NO"
,
style:
TextStyle
(
fontWeight:
FontWeight
.
w500
),
),
),
const
SizedBox
(
height:
16
),
TextButton
(
style:
ButtonStyle
(
backgroundColor:
MaterialStateProperty
.
all
(
Colors
.
white
),
overlayColor:
MaterialStateProperty
.
all
(
Colors
.
white70
),
),
onPressed:
()
=>
SystemChannels
.
platform
.
invokeMethod
(
'SystemNavigator.pop'
,
),
child:
Text
(
"YES"
,
style:
TextStyle
(
fontWeight:
FontWeight
.
w500
),
),
),
],
elevation:
30.0
,
),
barrierDismissible:
false
,
)
??
false
;
}
@override
Widget
build
(
BuildContext
context
)
{
var
loginProv
=
Provider
.
of
<
Loginnotifier
>(
context
,
listen:
true
);
double
screenWidth
=
MediaQuery
.
of
(
context
).
size
.
width
;
double
screenHeight
=
MediaQuery
.
of
(
context
).
size
.
height
;
return
Scaffold
(
backgroundColor:
AppColors
.
scaffold_bg_color
,
body:
KeyboardVisibilityProvider
(
controller:
_keyboardVisibilityController
,
child:
Stack
(
alignment:
Alignment
.
center
,
children:
[
// Background scrolling logos
ListView
.
builder
(
controller:
_scrollController
,
itemBuilder:
(
context
,
index
)
{
int
logoIndex
=
index
%
logos
.
length
;
return
Padding
(
padding:
const
EdgeInsets
.
all
(
5.0
),
child:
CustomGridRow
(
logos:
logos
,
logoIndex:
logoIndex
),
);
},
),
AnimatedPositioned
(
bottom:
0
,
left:
0
,
right:
0
,
duration:
Duration
(
milliseconds:
300
),
child:
Container
(
clipBehavior:
Clip
.
antiAlias
,
decoration:
BoxDecoration
(
gradient:
LinearGradient
(
begin:
Alignment
(-
0.00
,
-
1.00
),
end:
Alignment
(
0
,
1
),
colors:
[
Colors
.
white
.
withOpacity
(
0.0
),
// Fully transparent at the very top
Colors
.
white
.
withOpacity
(
0.3
),
// Light fade-in
Colors
.
white
.
withOpacity
(
0.6
),
// Mid fade
Colors
.
white
,
// Solid white for the rest
],
stops:
[
0.0
,
0.05
,
0.1
,
0.15
],
return
WillPopScope
(
onWillPop:
onBackPressed
,
child:
Scaffold
(
resizeToAvoidBottomInset:
true
,
backgroundColor:
AppColors
.
scaffold_bg_color
,
body:
KeyboardVisibilityProvider
(
controller:
_keyboardVisibilityController
,
child:
Stack
(
alignment:
Alignment
.
center
,
children:
[
// Background scrolling logos
ListView
.
builder
(
controller:
_scrollController
,
itemBuilder:
(
context
,
index
)
{
int
logoIndex
=
index
%
logos
.
length
;
return
Padding
(
padding:
const
EdgeInsets
.
all
(
3.0
),
child:
CustomGridRow
(
logos:
logos
,
logoIndex:
logoIndex
),
);
},
),
AnimatedPositioned
(
bottom:
0
,
left:
0
,
right:
0
,
duration:
Duration
(
milliseconds:
300
),
child:
Container
(
clipBehavior:
Clip
.
antiAlias
,
decoration:
BoxDecoration
(
gradient:
LinearGradient
(
begin:
Alignment
(-
0.00
,
-
1.00
),
end:
Alignment
(
0
,
1
),
colors:
[
Colors
.
white
.
withOpacity
(
0.0
),
// Fully transparent at the very top
Colors
.
white
.
withOpacity
(
0.3
),
// Light fade-in
Colors
.
white
.
withOpacity
(
0.6
),
// Mid fade
Colors
.
white
,
// Solid white for the rest
],
stops:
[
0.0
,
0.05
,
0.1
,
0.15
],
),
),
),
child:
SingleChildScrollView
(
child:
Stack
(
alignment:
Alignment
.
center
,
children:
[
Container
(
alignment:
Alignment
.
center
,
padding:
EdgeInsets
.
symmetric
(
horizontal:
15
,
vertical:
10
,
),
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
center
,
mainAxisAlignment:
MainAxisAlignment
.
center
,
children:
[
AnimatedContainer
(
duration:
const
Duration
(
milliseconds:
1200
),
curve:
Curves
.
easeInOut
,
child:
_isTextFieldFocused
?
Row
(
mainAxisAlignment:
MainAxisAlignment
.
center
,
crossAxisAlignment:
CrossAxisAlignment
.
center
,
children:
[
Expanded
(
flex:
1
,
child:
SizedBox
(
width:
10
),
),
Expanded
(
flex:
2
,
child:
Image
.
asset
(
"assets/images/gen_logo.png"
,
child:
SingleChildScrollView
(
child:
Stack
(
alignment:
Alignment
.
center
,
children:
[
Container
(
alignment:
Alignment
.
center
,
padding:
EdgeInsets
.
symmetric
(
horizontal:
15
,
vertical:
10
,
),
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
center
,
mainAxisAlignment:
MainAxisAlignment
.
center
,
children:
[
AnimatedContainer
(
duration:
const
Duration
(
milliseconds:
1200
),
curve:
Curves
.
easeInOut
,
child:
_isTextFieldFocused
?
Row
(
mainAxisAlignment:
MainAxisAlignment
.
center
,
crossAxisAlignment:
CrossAxisAlignment
.
center
,
children:
[
Expanded
(
flex:
1
,
child:
SizedBox
(
width:
10
),
),
),
const
SizedBox
(
width:
10
),
Expanded
(
flex:
3
,
child:
Text
(
"GEN ERP"
,
style:
TextStyle
(
fontFamily:
'LexendSemiBold'
,
color:
AppColors
.
ERP_text_color
,
fontSize:
25
,
Expanded
(
flex:
2
,
child:
Image
.
asset
(
"assets/images/gen_logo.png"
,
),
),
),
Expanded
(
flex:
1
,
child:
SizedBox
(
width:
10
),
),
],
)
:
Column
(
children:
[
Container
(
width:
180
,
height:
120
,
child:
Image
.
asset
(
"assets/images/gen_logo.png"
,
const
SizedBox
(
width:
10
),
Expanded
(
flex:
3
,
child:
Image
.
asset
(
"assets/images/gen_logo_grad.png"
),
),
),
Text
(
"GEN ERP"
,
style:
TextStyle
(
fontFamily:
'LexendSemiBold'
,
color:
AppColors
.
ERP_text_color
,
fontSize:
25
,
Expanded
(
flex:
1
,
child:
SizedBox
(
width:
10
),
),
),
],
),
),
Text
(
"Login to enter"
,
style:
TextStyle
(
fontSize:
14
,
color:
AppColors
.
app_blue
,
],
)
:
Column
(
children:
[
Container
(
width:
180
,
height:
120
,
child:
Image
.
asset
(
"assets/images/gen_logo.png"
,
),
),
Image
.
asset
(
"assets/images/gen_logo_grad.png"
,
width:
150
,),
],
),
),
),
Container
(
alignment:
Alignment
.
topLeft
,
child:
Text
(
"Enter Email"
,
SizedBox
(
height:
10
,),
Text
(
"Login to enter"
,
style:
TextStyle
(
color:
AppColors
.
semi_black
,
fontSize:
12
,
fontSize:
14
,
fontFamily:
"JakartaMedium"
,
color:
AppColors
.
app_blue
,
),
),
),
Container
(
height:
48
,
alignment:
Alignment
.
center
,
decoration:
BoxDecoration
(
color:
AppColors
.
text_field_color
,
borderRadius:
BorderRadius
.
circular
(
20
),
border:
_emailFocusNode
.
hasFocus
?
Border
.
all
(
color:
AppColors
.
app_blue
,
width:
0.5
):
null
Container
(
padding:
EdgeInsets
.
only
(
left:
10
,
bottom:
5
),
alignment:
Alignment
.
topLeft
,
child:
Text
(
"Email ID"
,
style:
TextStyle
(
color:
AppColors
.
semi_black
,
fontFamily:
"JakartaMedium"
,
fontSize:
14
,
),
),
),
// alignment: Alignment.center,
margin:
EdgeInsets
.
only
(
left:
5.0
,
right:
5.0
),
child:
Padding
(
padding:
const
EdgeInsets
.
fromLTRB
(
10.0
,
0.0
,
15
,
0
,
Container
(
height:
48
,
alignment:
Alignment
.
center
,
decoration:
BoxDecoration
(
color:
AppColors
.
text_field_color
,
borderRadius:
BorderRadius
.
circular
(
14
),
border:
_emailFocusNode
.
hasFocus
?
Border
.
all
(
color:
AppColors
.
app_blue
,
width:
0.5
):
null
),
child:
TextField
(
controller:
email
,
keyboardType:
TextInputType
.
emailAddress
,
focusNode:
_emailFocusNode
,
style:
TextStyle
(
fontSize:
14
// alignment: Alignment.center,
margin:
EdgeInsets
.
only
(
left:
5.0
,
right:
5.0
),
child:
Padding
(
padding:
const
EdgeInsets
.
fromLTRB
(
10.0
,
0.0
,
15
,
0
,
),
onChanged:
(
value
)
{
loginProv
.
updateEmail
(
email
.
text
);
},
onTapOutside:
(
event
)
{
// Handle onTapOutside
FocusScope
.
of
(
context
).
unfocus
();
},
decoration:
InputDecoration
(
isDense:
true
,
hintStyle:
TextStyle
(
fontWeight:
FontWeight
.
w400
,
fontSize:
14
child:
TextField
(
controller:
email
,
keyboardType:
TextInputType
.
emailAddress
,
focusNode:
_emailFocusNode
,
style:
TextStyle
(
fontSize:
14
),
onChanged:
(
value
)
{
loginProv
.
updateEmail
(
email
.
text
);
},
onTapOutside:
(
event
)
{
// Handle onTapOutside
FocusScope
.
of
(
context
).
unfocus
();
},
decoration:
InputDecoration
(
isDense:
true
,
hintStyle:
TextStyle
(
fontWeight:
FontWeight
.
w400
,
fontSize:
14
,
color:
Color
(
0xFF818181
)
),
//contentPadding: EdgeInsets.fromLTRB(5.0, 10.0, 5.0, 10.0),
enabledBorder:
InputBorder
.
none
,
focusedBorder:
InputBorder
.
none
,
hintText:
'Enter Your Email'
,
),
//contentPadding: EdgeInsets.fromLTRB(5.0, 10.0, 5.0, 10.0),
enabledBorder:
InputBorder
.
none
,
focusedBorder:
InputBorder
.
none
,
hintText:
'Enter Email'
,
),
),
),
),
if
(
loginProv
.
emailError
!=
null
)
...[
if
(
loginProv
.
emailError
!=
null
)
...[
Container
(
alignment:
Alignment
.
topLeft
,
margin:
EdgeInsets
.
only
(
top:
2.5
,
bottom:
2.5
,
left:
25
,
),
child:
Text
(
loginProv
.
emailError
,
textAlign:
TextAlign
.
start
,
style:
TextStyle
(
color:
Colors
.
red
),
),
),
]
else
...[
SizedBox
(
height:
10.0
),
],
Container
(
padding:
EdgeInsets
.
only
(
left:
10
,
bottom:
5
),
alignment:
Alignment
.
topLeft
,
margin:
EdgeInsets
.
only
(
top:
2.5
,
bottom:
2.5
,
left:
25
,
),
child:
Text
(
loginProv
.
emailError
,
textAlign:
TextAlign
.
start
,
style:
TextStyle
(
color:
Colors
.
red
),
),
),
]
else
...[
SizedBox
(
height:
15.0
),
],
Container
(
alignment:
Alignment
.
topLeft
,
child:
Text
(
"Enter Password"
,
style:
TextStyle
(
color:
AppColors
.
semi_black
,
fontSize:
12
,
"Password"
,
style:
TextStyle
(
color:
AppColors
.
semi_black
,
fontFamily:
"JakartaMedium"
,
fontSize:
14
,
),
),
),
),
Container
(
height:
48
,
alignment:
Alignment
.
center
,
decoration:
BoxDecoration
(
color:
AppColors
.
text_field_color
,
borderRadius:
BorderRadius
.
circular
(
20
),
border:
_passwordFocusNode
.
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
,
0
,
0
,
Container
(
height:
48
,
alignment:
Alignment
.
center
,
decoration:
BoxDecoration
(
color:
AppColors
.
text_field_color
,
borderRadius:
BorderRadius
.
circular
(
14
),
border:
_passwordFocusNode
.
hasFocus
?
Border
.
all
(
color:
AppColors
.
app_blue
,
width:
0.5
):
null
),
child:
TextField
(
controller:
password
,
focusNode:
_passwordFocusNode
,
obscureText:
!
loginProv
.
pwdVisible
,
keyboardType:
TextInputType
.
visiblePassword
,
style:
TextStyle
(
fontSize:
14
// alignment: Alignment.center,
margin:
EdgeInsets
.
only
(
left:
5.0
,
right:
5.0
),
child:
Padding
(
padding:
const
EdgeInsets
.
fromLTRB
(
10.0
,
0.0
,
0
,
0
,
),
onChanged:
(
value
)
{
loginProv
.
updatePassword
(
password
.
text
);
},
onEditingComplete:
()
{
child:
TextField
(
controller:
password
,
focusNode:
_passwordFocusNode
,
obscureText:
!
loginProv
.
pwdVisible
,
keyboardType:
TextInputType
.
visiblePassword
,
style:
TextStyle
(
fontSize:
14
,
),
onChanged:
(
value
)
{
loginProv
.
updatePassword
(
password
.
text
);
},
onEditingComplete:
()
{
},
decoration:
InputDecoration
(
},
decoration:
InputDecoration
(
contentPadding:
EdgeInsets
.
fromLTRB
(
0
,
10
,
0
,
0
,
),
hintText:
"Enter Password"
,
suffixIcon:
IconButton
(
icon:
Icon
(
loginProv
.
pwdVisible
?
CupertinoIcons
.
eye_solid
:
CupertinoIcons
.
eye_slash_fill
,
size:
30
,
contentPadding:
EdgeInsets
.
fromLTRB
(
0
,
10
,
0
,
0
,
),
onPressed:
()
{
loginProv
.
visibility_ov
();
},
),
hintStyle:
TextStyle
(
fontSize:
14
,
fontWeight:
FontWeight
.
w400
,
hintText:
"Enter Password"
,
suffixIcon:
IconButton
(
icon:
Icon
(
loginProv
.
pwdVisible
?
CupertinoIcons
.
eye_solid
:
CupertinoIcons
.
eye_slash_fill
,
size:
30
,
),
onPressed:
()
{
loginProv
.
visibility_ov
();
},
),
hintStyle:
TextStyle
(
fontSize:
14
,
color:
Color
(
0xFF818181
),
fontWeight:
FontWeight
.
w400
,
),
isDense:
true
,
enabledBorder:
InputBorder
.
none
,
focusedBorder:
InputBorder
.
none
,
),
isDense:
true
,
enabledBorder:
InputBorder
.
none
,
focusedBorder:
InputBorder
.
none
,
),
),
),
),
if
(
loginProv
.
passwordError
!=
null
)
...[
Container
(
alignment:
Alignment
.
topLeft
,
margin:
EdgeInsets
.
only
(
top:
2.5
,
bottom:
2.5
,
left:
25
,
),
child:
Text
(
loginProv
.
passwordError
,
textAlign:
TextAlign
.
start
,
style:
TextStyle
(
color:
Colors
.
red
),
),
),
]
else
...[
SizedBox
(
height:
25.0
),
],
Container
(
child:
InkWell
(
onTap:
()
{
// LoginApiFunction();
loginProv
.
LoginApiFunction
(
context
,
email
.
text
,
password
.
text
);
var
f
=
FocusScope
.
of
(
context
);
if
(!
f
.
hasPrimaryFocus
)
{
f
.
unfocus
();
}
// Navigator.push(context,MaterialPageRoute(builder: (context)=>Profile()));
},
child:
Container
(
alignment:
Alignment
.
center
,
height:
45
,
width:
screenWidth
,
if
(
loginProv
.
passwordError
!=
null
)
...[
Container
(
alignment:
Alignment
.
topLeft
,
margin:
EdgeInsets
.
only
(
left:
5.0
,
right:
5.0
,
top:
2.5
,
bottom:
2.5
,
left:
25
,
),
decoration:
BoxDecoration
(
color:
loginProv
.
isButtonEnabled
?
AppColors
.
app_blue
:
AppColors
.
button_disabled
,
//1487C9
borderRadius:
BorderRadius
.
circular
(
30.0
),
child:
Text
(
loginProv
.
passwordError
,
textAlign:
TextAlign
.
start
,
style:
TextStyle
(
color:
Colors
.
red
),
),
child:
Center
(
child:
Text
(
"Login"
,
textAlign:
TextAlign
.
center
,
style:
TextStyle
(
color:
Colors
.
white
),
),
]
else
...[
SizedBox
(
height:
25.0
),
],
Container
(
child:
InkWell
(
onTap:
()
{
// LoginApiFunction();
loginProv
.
LoginApiFunction
(
context
,
email
.
text
,
password
.
text
);
var
f
=
FocusScope
.
of
(
context
);
if
(!
f
.
hasPrimaryFocus
)
{
f
.
unfocus
();
}
// Navigator.push(context,MaterialPageRoute(builder: (context)=>Profile()));
},
child:
Container
(
alignment:
Alignment
.
center
,
height:
45
,
width:
screenWidth
,
margin:
EdgeInsets
.
only
(
left:
5.0
,
right:
5.0
,
),
decoration:
BoxDecoration
(
color:
loginProv
.
isButtonEnabled
?
AppColors
.
app_blue
:
AppColors
.
button_disabled
,
//1487C9
borderRadius:
BorderRadius
.
circular
(
15.0
),
),
child:
Center
(
child:
Text
(
"Login"
,
textAlign:
TextAlign
.
center
,
style:
TextStyle
(
color:
Colors
.
white
,
fontFamily:
"JakartaRegular"
,),
),
),
),
),
),
)
,
]
,
]
,
)
,
),
)
,
]
,
]
,
)
,
),
),
),
),
Positioned
(
top:
50
,
right:
20
,
child:
InkResponse
(
Positioned
(
top:
50
,
right:
20
,
child:
InkResponse
(
child:
GestureDetector
(
onTap:
()
async
{
await
tooltipcontroller
.
showTooltip
();
child:
GestureDetector
(
onTap:
()
async
{
await
tooltipcontroller
.
showTooltip
();
},
child:
SuperTooltip
(
controller:
tooltipcontroller
,
popupDirection:
TooltipDirection
.
down
,
backgroundColor:
Colors
.
white
,
borderColor:
Colors
.
white
,
showCloseButton:
true
,
left:
50
,
right:
30
,
barrierColor:
Colors
.
transparent
,
arrowTipDistance:
20.0
,
minimumOutsideMargin:
120
,
arrowBaseWidth:
20.0
,
arrowLength:
20.0
,
borderWidth:
2.0
,
constraints:
const
BoxConstraints
(
minHeight:
0.0
,
maxHeight:
100
,
minWidth:
0.0
,
maxWidth:
100
,
),
touchThroughAreaShape:
ClipAreaShape
.
rectangle
,
touchThroughAreaCornerRadius:
30
,
content:
Container
(
height:
100
,
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
center
,
children:
[
Text
(
"Device ID"
,
style:
TextStyle
(
fontSize:
16
,
color:
AppColors
.
app_blue
),),
SizedBox
(
height:
15
,),
Row
(
mainAxisAlignment:
MainAxisAlignment
.
start
,
children:
[
Container
(
height:
50
,
padding:
EdgeInsets
.
symmetric
(
horizontal:
10
,
vertical:
10
),
decoration:
BoxDecoration
(
borderRadius:
BorderRadius
.
circular
(
18
),
color:
AppColors
.
text_field_color
),
child:
Row
(
children:
[
Container
(
width:
180
,
height:
45
,
alignment:
Alignment
.
center
,
margin:
EdgeInsets
.
only
(
right:
5.0
),
decoration:
BoxDecoration
(
borderRadius:
BorderRadius
.
circular
(
10.0
)),
child:
Text
(
'
${loginProv.deviceId}
'
,
style:
TextStyle
(
fontSize:
16
,
color:
AppColors
.
semi_black
},
child:
SuperTooltip
(
controller:
tooltipcontroller
,
popupDirection:
TooltipDirection
.
down
,
backgroundColor:
Colors
.
white
,
borderColor:
Colors
.
white
,
showCloseButton:
true
,
left:
50
,
right:
30
,
barrierColor:
Colors
.
transparent
,
arrowTipDistance:
20.0
,
minimumOutsideMargin:
120
,
arrowBaseWidth:
20.0
,
arrowLength:
20.0
,
borderWidth:
2.0
,
constraints:
const
BoxConstraints
(
minHeight:
0.0
,
maxHeight:
100
,
minWidth:
0.0
,
maxWidth:
100
,
),
touchThroughAreaShape:
ClipAreaShape
.
rectangle
,
touchThroughAreaCornerRadius:
30
,
content:
Container
(
height:
100
,
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
center
,
children:
[
Text
(
"Device ID"
,
style:
TextStyle
(
fontSize:
16
,
fontFamily:
"JakartaMedium"
,
color:
AppColors
.
app_blue
),),
SizedBox
(
height:
15
,),
Row
(
mainAxisAlignment:
MainAxisAlignment
.
start
,
children:
[
Container
(
height:
50
,
padding:
EdgeInsets
.
symmetric
(
horizontal:
10
,
vertical:
10
),
decoration:
BoxDecoration
(
borderRadius:
BorderRadius
.
circular
(
18
),
color:
AppColors
.
text_field_color
),
child:
Row
(
children:
[
Container
(
width:
180
,
height:
45
,
alignment:
Alignment
.
center
,
margin:
EdgeInsets
.
only
(
right:
5.0
),
decoration:
BoxDecoration
(
borderRadius:
BorderRadius
.
circular
(
10.0
)),
child:
Text
(
'
${loginProv.deviceId}
'
,
style:
TextStyle
(
fontSize:
16
,
color:
AppColors
.
semi_black
),
)),
Container
(
child:
InkWell
(
onTap:
()
async
{
Clipboard
.
setData
(
ClipboardData
(
text:
loginProv
.
deviceId
.
trim
()));
toast
(
context
,
"Device ID has been copied!"
);
},
child:
Icon
(
Icons
.
copy
),
)),
Container
(
child:
InkWell
(
onTap:
()
async
{
Clipboard
.
setData
(
ClipboardData
(
text:
loginProv
.
deviceId
.
trim
()));
toast
(
context
,
"Device ID has been copied!"
);
},
child:
Icon
(
Icons
.
copy
),
),
),
],
),
),
Spacer
(),
Container
(
width:
60
,
height:
50
,
decoration:
BoxDecoration
(
color:
AppColors
.
app_blue
,
borderRadius:
BorderRadius
.
circular
(
18
)
],
),
),
child:
InkWell
(
onTap:
()
{
Share
.
share
(
"
${loginProv.deviceId}
"
);
},
child:
Icon
(
Icons
.
share_outlined
,
color:
Colors
.
white
,
),
)),
],
),
],
),
),
child:
Align
(
alignment:
Alignment
.
topRight
,
child:
Container
(
width:
100
,
padding:
EdgeInsets
.
symmetric
(
horizontal:
10
,
vertical:
5
),
decoration:
BoxDecoration
(
color:
AppColors
.
overlay_box_color
,
borderRadius:
BorderRadius
.
circular
(
8
),
border:
Border
.
all
(
color:
AppColors
.
app_blue
,
width:
0.5
),
Spacer
(),
Container
(
width:
60
,
height:
50
,
decoration:
BoxDecoration
(
color:
AppColors
.
app_blue
,
borderRadius:
BorderRadius
.
circular
(
18
)
),
child:
InkWell
(
onTap:
()
{
Share
.
share
(
"
${loginProv.deviceId}
"
);
},
child:
Icon
(
Icons
.
share_outlined
,
color:
Colors
.
white
,
),
)),
],
),
],
),
child:
Center
(
child:
Text
(
"Device ID"
,
textAlign:
TextAlign
.
center
,
style:
TextStyle
(
color:
AppColors
.
app_blue
,
fontSize:
14
,
),
child:
Align
(
alignment:
Alignment
.
topRight
,
child:
Container
(
width:
100
,
padding:
EdgeInsets
.
symmetric
(
horizontal:
10
,
vertical:
5
),
decoration:
BoxDecoration
(
color:
AppColors
.
overlay_box_color
,
borderRadius:
BorderRadius
.
circular
(
8
),
border:
Border
.
all
(
color:
AppColors
.
app_blue
,
width:
0.5
),
),
child:
Center
(
child:
Text
(
"Device ID"
,
textAlign:
TextAlign
.
center
,
style:
TextStyle
(
color:
AppColors
.
app_blue
,
fontSize:
14
,
),
),
),
),
...
...
@@ -569,9 +609,9 @@ class _LoginScreenState extends State<LoginScreen>
),
),
),
),
],
],
),
),
),
);
...
...
@@ -611,8 +651,8 @@ class LogoWidget extends StatelessWidget {
@override
Widget
build
(
BuildContext
context
)
{
return
Container
(
width:
80
,
height:
80
,
width:
MediaQuery
.
of
(
context
).
size
.
width
/
4.5
,
height:
MediaQuery
.
of
(
context
).
size
.
width
/
4.5
,
decoration:
BoxDecoration
(
image:
DecorationImage
(
image:
AssetImage
(
imagePath
),
fit:
BoxFit
.
cover
),
),
...
...
lib/screens/ScannerLogin.dart
View file @
528df0d2
...
...
@@ -18,51 +18,55 @@ class _ScannerloginState extends State<Scannerlogin> {
Widget
build
(
BuildContext
context
)
{
return
Consumer
<
Scanloginprovider
>(
builder:
(
context
,
provider
,
child
)
{
return
Scaffold
(
backgroundColor:
AppColors
.
scaffold_bg_color
,
appBar:
appbar
(
context
,
"QR Login"
),
body:
Container
(
decoration:
BoxDecoration
(
color:
Colors
.
black
),
child:
Column
(
children:
[
Spacer
(),
Container
(
height:
250
,
return
WillPopScope
(
onWillPop:
()
=>
onBackPressed
(
context
),
child:
Scaffold
(
resizeToAvoidBottomInset:
true
,
backgroundColor:
AppColors
.
scaffold_bg_color
,
appBar:
appbar
(
context
,
"QR Login"
),
body:
Container
(
decoration:
BoxDecoration
(
color:
Colors
.
black
),
child:
Column
(
children:
[
Spacer
(),
Container
(
height:
250
,
child:
QRView
(
child:
QRView
(
key:
provider
.
scannerKey
,
onQRViewCreated:
(
p0
)
{
provider
.
onQRViewCreated
(
p0
,
context
);
},
formatsAllowed:
[
BarcodeFormat
.
qrcode
],
cameraFacing:
CameraFacing
.
back
,
key:
provider
.
scannerKey
,
onQRViewCreated:
(
p0
)
{
provider
.
onQRViewCreated
(
p0
,
context
);
},
formatsAllowed:
[
BarcodeFormat
.
qrcode
],
cameraFacing:
CameraFacing
.
back
,
overlay:
QrScannerOverlayShape
(
overlay:
QrScannerOverlayShape
(
borderColor:
AppColors
.
app_blue
,
borderRadius:
20
,
borderLength:
60
,
borderWidth:
10
,
cutOutSize:
250.0
,
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 Login"
,
textAlign:
TextAlign
.
center
,
style:
TextStyle
(
fontSize:
14
,
color:
Colors
.
white
),
),
Spacer
(),
SizedBox
(
height:
25
),
Text
(
"Scan QR"
,
textAlign:
TextAlign
.
center
,
style:
TextStyle
(
fontSize:
18
,
color:
Colors
.
white
),
),
Text
(
"to Login"
,
textAlign:
TextAlign
.
center
,
style:
TextStyle
(
fontSize:
14
,
color:
Colors
.
white
),
),
Spacer
(),
SizedBox
(
height:
50
),
],
SizedBox
(
height:
50
),
],
),
),
),
);
...
...
lib/screens/UpdatePasswordScreen.dart
View file @
528df0d2
import
'package:flutter/material.dart'
;
import
'package:generp/Notifiers/UpdatePasswordProvider'
;
import
'package:generp/Notifiers/UpdatePasswordProvider
.dart
'
;
import
'package:generp/Utils/app_colors.dart'
;
import
'package:generp/Utils/commonWidgets.dart'
;
import
'package:provider/provider.dart'
;
...
...
@@ -11,71 +11,92 @@ class UpdatePassword extends StatelessWidget {
Widget
build
(
BuildContext
context
)
{
final
provider
=
Provider
.
of
<
UpdatePasswordProvider
>(
context
);
return
Scaffold
(
appBar:
appbar
(
context
,
"Update Password"
),
backgroundColor:
AppColors
.
scaffold_bg_color
,
body:
Container
(
child:
Column
(
children:
[
Expanded
(
child:
Container
(
width:
double
.
infinity
,
decoration:
BoxDecoration
(
borderRadius:
BorderRadius
.
vertical
(
top:
Radius
.
circular
(
30.0
),
return
WillPopScope
(
onWillPop:
()
=>
onBackPressed
(
context
),
child:
Scaffold
(
resizeToAvoidBottomInset:
true
,
appBar:
appbar
(
context
,
"Update Password"
),
backgroundColor:
AppColors
.
scaffold_bg_color
,
body:
Container
(
child:
Column
(
children:
[
Expanded
(
child:
Container
(
width:
double
.
infinity
,
decoration:
BoxDecoration
(
borderRadius:
BorderRadius
.
vertical
(
top:
Radius
.
circular
(
30.0
),
),
),
),
padding:
EdgeInsets
.
all
(
10
),
child:
Column
(
children:
[
Container
(
height:
280
,
decoration:
BoxDecoration
(
color:
Colors
.
white
,
borderRadius:
BorderRadius
.
circular
(
20.0
),
),
child:
Column
(
children:
[
SizedBox
(
height:
10
),
_buildTextField
(
controller:
provider
.
password
,
hintText:
"New Password*"
,
errorText:
provider
.
passwordError
,
),
SizedBox
(
height:
10
),
_buildTextField
(
controller:
provider
.
confPassword
,
hintText:
"Confirm New Password*"
,
errorText:
provider
.
confirmPasswordError
,
),
Spacer
(),
provider
.
isLoading
?
CircularProgressIndicator
()
:
InkWell
(
onTap:
()
=>
provider
.
updatePassword
(
context
),
child:
Container
(
alignment:
Alignment
.
center
,
height:
45
,
margin:
EdgeInsets
.
symmetric
(
horizontal:
15
),
decoration:
BoxDecoration
(
color:
AppColors
.
app_blue
,
borderRadius:
BorderRadius
.
circular
(
30.0
),
),
child:
Text
(
"Update"
,
style:
TextStyle
(
color:
Colors
.
white
),
padding:
EdgeInsets
.
all
(
10
),
child:
Column
(
children:
[
Container
(
height:
280
,
decoration:
BoxDecoration
(
color:
Colors
.
white
,
borderRadius:
BorderRadius
.
circular
(
20.0
),
),
child:
Column
(
children:
[
SizedBox
(
height:
10
),
Container
(
alignment:
Alignment
.
topLeft
,
padding:
EdgeInsets
.
symmetric
(
horizontal:
10
),
child:
Text
(
"New Password"
,
style:
TextStyle
(
color:
AppColors
.
semi_black
),)),
SizedBox
(
height:
5
),
_buildTextField
(
controller:
provider
.
password
,
hintText:
"New Password*"
,
errorText:
provider
.
passwordError
,
),
SizedBox
(
height:
10
),
Container
(
alignment:
Alignment
.
topLeft
,
padding:
EdgeInsets
.
symmetric
(
horizontal:
10
),
child:
Text
(
"Confirm Password"
,
style:
TextStyle
(
color:
AppColors
.
semi_black
),)),
SizedBox
(
height:
5
),
_buildTextField
(
controller:
provider
.
confPassword
,
hintText:
"Confirm New Password*"
,
errorText:
provider
.
confirmPasswordError
,
),
Spacer
(),
InkWell
(
onTap:
()
=>
provider
.
updatePassword
(
context
),
child:
Container
(
alignment:
Alignment
.
center
,
height:
45
,
margin:
EdgeInsets
.
symmetric
(
horizontal:
15
),
decoration:
BoxDecoration
(
color:
AppColors
.
app_blue
,
borderRadius:
BorderRadius
.
circular
(
15.0
),
),
child:
provider
.
isLoading
?
CircularProgressIndicator
(
color:
Colors
.
white
,
)
:
Text
(
"Update"
,
style:
TextStyle
(
color:
Colors
.
white
),
),
),
),
),
SizedBox
(
height:
10
)
,
]
,
SizedBox
(
height:
10
),
]
,
)
,
),
)
,
]
,
]
,
)
,
),
),
)
,
]
,
]
,
)
,
),
),
);
...
...
@@ -103,7 +124,8 @@ class UpdatePassword extends StatelessWidget {
obscureText:
true
,
decoration:
InputDecoration
(
hintText:
hintText
,
hintStyle:
TextStyle
(
color:
Color
(
0xFF818181
)),
hintStyle:
TextStyle
(
color:
Color
(
0xFF818181
),
fontSize:
14
),
border:
InputBorder
.
none
,
),
),
...
...
lib/screens/WebERPScreen.dart
View file @
528df0d2
...
...
@@ -80,6 +80,7 @@ class _WebErpScreenState extends State<WebErpScreen> {
return
true
;
// Allow default back button behavior
},
child:
Scaffold
(
resizeToAvoidBottomInset:
true
,
appBar:
appbar
(
context
,
"Web ERP"
),
body:
Container
(
child:
Column
(
children:
<
Widget
>[
...
...
lib/screens/WebWhizzdomScreen.dart
View file @
528df0d2
...
...
@@ -78,6 +78,7 @@ class _WebWhizzdomScreenState extends State<WebWhizzdomScreen> {
return
true
;
// Allow default back button behavior
},
child:
Scaffold
(
resizeToAvoidBottomInset:
true
,
appBar:
appbar
(
context
,
"Whizzdom"
),
body:
Container
(
child:
Column
(
children:
<
Widget
>[
...
...
lib/screens/genTracker/ComplaintHistory.dart
View file @
528df0d2
...
...
@@ -34,96 +34,104 @@ class _ComplainthistoryState extends State<Complainthistory> {
return
Consumer
<
Generatordetailsprovider
>(
builder:
(
context
,
provider
,
child
)
{
return
Scaffold
(
appBar:
appbar
(
context
,
"Complaint History"
),
backgroundColor:
AppColors
.
scaffold_bg_color
,
body:
Container
(
child:
SingleChildScrollView
(
child:
Column
(
children:
[
ListView
.
builder
(
shrinkWrap:
true
,
physics:
NeverScrollableScrollPhysics
(),
itemCount:
provider
.
complaintList
.
length
,
itemBuilder:
(
context
,
index
)
{
return
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
[
Text
(
"
${ provider.complaintList[index].compRegdate}
"
,
style:
TextStyle
(
color:
Color
(
0xFF818181
)
),),
Container
(
margin:
EdgeInsets
.
symmetric
(
horizontal:
10
,
vertical:
5
),
decoration:
BoxDecoration
(
color:
Colors
.
white
,
borderRadius:
BorderRadius
.
circular
(
16
),
return
WillPopScope
(
onWillPop:
()
=>
onBackPressed
(
context
),
child:
Scaffold
(
resizeToAvoidBottomInset:
true
,
appBar:
appbar
(
context
,
"Complaint History"
),
backgroundColor:
AppColors
.
scaffold_bg_color
,
body:
Container
(
child:
SingleChildScrollView
(
child:
Column
(
),
child:
Column
(
children:
[
children:
[
if
(
provider
.
complaintList
.
isNotEmpty
)...[
ListView
.
builder
(
shrinkWrap:
true
,
physics:
NeverScrollableScrollPhysics
(),
itemCount:
provider
.
complaintList
.
length
,
itemBuilder:
(
context
,
index
)
{
return
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
[
Text
(
"
${ provider.complaintList[index].compRegdate}
"
,
style:
TextStyle
(
color:
Color
(
0xFF818181
)
),),
Container
(
margin:
EdgeInsets
.
symmetric
(
horizontal:
10
,
vertical:
5
),
decoration:
BoxDecoration
(
color:
Colors
.
white
,
borderRadius:
BorderRadius
.
circular
(
16
),
),
child:
Column
(
children:
[
...
List
.
generate
(
4
,
(
index
)
{
final
headings
=
[
"Technician Name"
,
"ID"
,
"Complaint Type"
,
"Complaint Status"
,];
...
List
.
generate
(
4
,
(
index
)
{
final
headings
=
[
"Technician Name"
,
"ID"
,
"Complaint Type"
,
"Complaint Status"
,];
final
values
=
[
provider
.
complaintList
[
index
].
techName
,
provider
.
complaintList
[
index
].
compId
,
provider
.
complaintList
[
index
].
compType
,
provider
.
complaintList
[
index
].
compStatus
,
final
values
=
[
provider
.
complaintList
[
index
].
techName
,
provider
.
complaintList
[
index
].
compId
,
provider
.
complaintList
[
index
].
compType
,
provider
.
complaintList
[
index
].
compStatus
,
];
return
Container
(
];
return
Container
(
padding:
EdgeInsets
.
symmetric
(
horizontal:
15
,
vertical:
15
),
child:
Row
(
children:
[
Expanded
(
child:
SizedBox
(
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
mainAxisAlignment:
MainAxisAlignment
.
start
,
children:
[
Text
(
"
${headings[index]}
"
),
padding:
EdgeInsets
.
symmetric
(
horizontal:
15
,
vertical:
15
),
child:
Row
(
children:
[
Expanded
(
child:
SizedBox
(
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
mainAxisAlignment:
MainAxisAlignment
.
start
,
children:
[
Text
(
"
${headings[index]}
"
),
],
],
),
),
),
),
Expanded
(
child:
SizedBox
(
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
mainAxisAlignment:
MainAxisAlignment
.
start
,
children:
[
Text
(
"
${values[index]}
"
,
style:
TextStyle
(
color:
Color
(
0xFF818181
)
),),
Expanded
(
child:
SizedBox
(
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
mainAxisAlignment:
MainAxisAlignment
.
start
,
children:
[
Text
(
"
${values[index]}
"
,
style:
TextStyle
(
color:
Color
(
0xFF818181
)
),),
],
],
),
),
),
)
,
]
,
)
,
);
},),
]
]
,
)
,
)
;
},),
]
),
),
),
],
);
},),
],
],
);
},),
]
else
...[
Emptywidget
(
context
)
]
],
),
),
),
),
),
);
},
);
...
...
lib/screens/genTracker/GenTrackerDashboard.dart
View file @
528df0d2
...
...
@@ -18,64 +18,75 @@ class Gentrackerdashboard extends StatefulWidget {
class
_GentrackerdashboardState
extends
State
<
Gentrackerdashboard
>
{
@override
Widget
build
(
BuildContext
context
)
{
return
Scaffold
(
backgroundColor:
AppColors
.
scaffold_bg_color
,
appBar:
appbar
(
context
,
"Gen Tracker"
),
body:
GridView
.
builder
(
padding:
EdgeInsets
.
symmetric
(
vertical:
10
,
horizontal:
10
),
itemCount:
4
,
gridDelegate:
SliverGridDelegateWithFixedCrossAxisCount
(
crossAxisCount:
2
,
crossAxisSpacing:
10
,
mainAxisSpacing:
10
,
),
itemBuilder:
(
context
,
index
)
{
final
names
=
[
"Generator Details"
,
"Register Complaint"
,
"Tag Location"
,
"Tag Generator"
,
return
WillPopScope
(
onWillPop:
()
=>
onBackPressed
(
context
),
child:
Scaffold
(
resizeToAvoidBottomInset:
true
,
backgroundColor:
AppColors
.
scaffold_bg_color
,
appBar:
appbar
(
context
,
"Gen Tracker"
),
body:
GridView
.
builder
(
padding:
EdgeInsets
.
symmetric
(
vertical:
10
,
horizontal:
10
),
itemCount:
4
,
gridDelegate:
SliverGridDelegateWithFixedCrossAxisCount
(
crossAxisCount:
2
,
crossAxisSpacing:
10
,
mainAxisSpacing:
10
,
),
itemBuilder:
(
context
,
index
)
{
final
names
=
[
"Generator Details"
,
"Register Complaint"
,
"Tag Location"
,
"Tag Generator"
,
];
return
InkResponse
(
onTap:
()
{
switch
(
names
[
index
])
{
case
"Generator Details"
:
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
context
)
=>
Scanentergeneratoridscreen
(
from:
"Generator Details"
,)));
break
;
case
"Register Complaint"
:
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
context
)
=>
Scanentergeneratoridscreen
(
from:
"Register Complaint"
,)));
break
;
case
"Tag Location"
:
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
context
)=>
Scanentergeneratoridscreen
(
from:
"Tag Location"
,)));
break
;
case
"Tag Generator"
:
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
context
)=>
Scanentergeneratoridscreen
(
from:
"Tag Generator"
,)));
break
;
];
final
icons
=
[
"gent_gen_det"
,
"gent_reg_comp"
,
"gent_tag_loc"
,
"gent_tag_den"
,
];
return
InkResponse
(
onTap:
()
{
switch
(
names
[
index
])
{
case
"Generator Details"
:
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
context
)
=>
Scanentergeneratoridscreen
(
from:
"Generator Details"
,)));
break
;
case
"Register Complaint"
:
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
context
)
=>
Scanentergeneratoridscreen
(
from:
"Register Complaint"
,)));
break
;
case
"Tag Location"
:
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
context
)=>
Scanentergeneratoridscreen
(
from:
"Tag Location"
,)));
break
;
case
"Tag Generator"
:
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
context
)=>
Scanentergeneratoridscreen
(
from:
"Tag Generator"
,)));
break
;
default
:
print
(
"111"
);
break
;
}
},
child:
Container
(
decoration:
BoxDecoration
(
color:
Colors
.
white
,
borderRadius:
BorderRadius
.
circular
(
30
),
),
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
center
,
mainAxisAlignment:
MainAxisAlignment
.
center
,
children:
[
SvgPicture
.
asset
(
"assets/svg/home_icons_
${index + 1}
.svg"
,
),
Text
(
names
[
index
]),
],
default
:
print
(
"111"
);
break
;
}
},
child:
Container
(
decoration:
BoxDecoration
(
color:
Colors
.
white
,
borderRadius:
BorderRadius
.
circular
(
30
),
),
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
center
,
mainAxisAlignment:
MainAxisAlignment
.
center
,
children:
[
SvgPicture
.
asset
(
"assets/svg/
${icons[index]}
.svg"
,
),
SizedBox
(
height:
10
,),
Text
(
names
[
index
]),
],
),
),
)
,
);
}
,
)
;
},
)
,
),
);
}
...
...
lib/screens/genTracker/GeneratorDetails.dart
View file @
528df0d2
...
...
@@ -53,7 +53,7 @@ class _GeneratordetailsState extends State<Generatordetails> {
homeProvider
,
context
,
""
,
details
.
genID
,
widget
.
generatorId
,
);
}
});
...
...
@@ -89,227 +89,284 @@ class _GeneratordetailsState extends State<Generatordetails> {
child:
Icon
(
Icons
.
directions
),
),
);
return
Scaffold
(
appBar:
widget
.
activityName
==
"NearByGenerators"
?
appbar2
(
context
,
"Generator Details"
,
sendwidget
)
:
appbar
(
context
,
"Generator 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
),
return
WillPopScope
(
onWillPop:
()
=>
onBackPressed
(
context
),
child:
Scaffold
(
resizeToAvoidBottomInset:
true
,
appBar:
widget
.
activityName
==
"NearByGenerators"
?
appbar2
(
context
,
"Generator Details"
,
sendwidget
)
:
appbar
(
context
,
"Generator Details"
),
backgroundColor:
AppColors
.
scaffold_bg_color
,
body:
Container
(
child:
SingleChildScrollView
(
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
[
Container
(
padding:
EdgeInsets
.
symmetric
(
horizontal:
10
,
vertical:
5
),
child:
Text
(
"Customer Details"
,
style:
TextStyle
(
color:
Color
(
0xFF818181
),
fontFamily:
"JakartaMedium"
),
),
),
child:
Column
(
children:
[
Row
(
children:
[
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
List
.
generate
(
4
,
(
j
)
{
final
textheads
=
[
"
${provider.cname}
"
,
"Mobile Number"
,
"Contact Person Number"
,
"Mail ID"
,
];
final
textSubheads
=
[
"
${provider.aname}
"
,
"
${provider.mob1}
"
,
"
${provider.mob2}
"
,
"
${provider.mail}
"
,
];
return
Container
(
padding:
EdgeInsets
.
symmetric
(
vertical:
3
),
child:
Container
(
padding:
EdgeInsets
.
symmetric
(
vertical:
3
,
horizontal:
0
,
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:
[
Container
(
padding:
EdgeInsets
.
symmetric
(
vertical:
3
,
horizontal:
0
,
),
child:
Row
(
mainAxisAlignment:
MainAxisAlignment
.
spaceBetween
,
children:
[
SvgPicture
.
asset
(
"assets/svg/se_block_head.svg"
,
),
SizedBox
(
width:
5
),
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
[
SizedBox
(
width:
MediaQuery
.
of
(
context
,
).
size
.
width
*
0.75
,
child:
Text
(
"
${provider.cname}
"
,
maxLines:
2
,
overflow:
TextOverflow
.
ellipsis
,
style:
TextStyle
(
fontFamily:
"JakartaMedium"
,
fontSize:
14
),
),
),
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:
[
SizedBox
(
width:
MediaQuery
.
of
(
context
,
).
size
.
width
*
0.75
,
child:
Text
(
textheads
[
j
].
toString
(),
maxLines:
2
,
overflow:
TextOverflow
.
ellipsis
,),
),
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
),
),
),
),
],
),
],
SizedBox
(
// height:45,
width:
MediaQuery
.
of
(
context
,
).
size
.
width
*
0.75
,
child:
Text
(
"
${provider.aname}
"
,
maxLines:
2
,
overflow:
TextOverflow
.
ellipsis
,
style:
TextStyle
(
fontSize:
14
,
color:
Color
(
0xFF818181
,
),
),
]
,
)
,
),
)
,
)
;
})
,
]
,
)
,
]
,
),
],
),
],
),
),
),
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
List
.
generate
(
3
,
(
j
)
{
final
textheads
=
[
"Mobile Number"
,
"Contact Person Number"
,
"Mail ID"
,
];
final
textSubheads
=
[
"
${provider.mob1}
"
,
"
${provider.mob2}
"
,
"
${provider.mail}
"
,
];
return
Container
(
padding:
EdgeInsets
.
symmetric
(
vertical:
6
,
horizontal:
0
,
),
child:
Row
(
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
=
[
"
${provider.genID}
"
,
"
${provider.engineNo}
"
,
"
${provider.address}
"
,
"
${provider.spname}
"
,
"
${provider.emodel}
"
,
"
${provider.dateOfEngineSale}
"
,
];
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
),
),
),
),
],
children:
[
Expanded
(
flex:
1
,
child:
SizedBox
(
child:
Text
(
textheads
[
j
].
toString
(),
maxLines:
2
,
overflow:
TextOverflow
.
ellipsis
,
style:
TextStyle
(
fontFamily:
"JakartaMedium"
,
fontSize:
14
),
),
),
),
SizedBox
(
width:
5
,),
Expanded
(
flex:
2
,
child:
SizedBox
(
child:
Text
(
textSubheads
[
j
],
maxLines:
2
,
overflow:
TextOverflow
.
ellipsis
,
style:
TextStyle
(
fontSize:
14
,
color:
Color
(
0xFF818181
,
),
),
],
),
),
),
],
),
);
}),
),
],
),
),
Container
(
padding:
EdgeInsets
.
symmetric
(
horizontal:
10
,
vertical:
5
),
child:
Text
(
"Generator Details"
,
style:
TextStyle
(
color:
Color
(
0xFF818181
),
fontFamily:
"JakartaMedium"
),
),
),
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
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
List
.
generate
(
6
,
(
j
)
{
final
textheads
=
[
"Gen ID"
,
"Engine Number"
,
"Address"
,
"Product Name"
,
"Engine Model"
,
"Date Of Supply"
,
];
final
textSubheads
=
[
"
${provider.genID}
"
,
"
${provider.engineNo}
"
,
"
${provider.address}
"
,
"
${provider.spname}
"
,
"
${provider.emodel}
"
,
"
${provider.dateOfEngineSale}
"
,
];
return
Container
(
padding:
EdgeInsets
.
symmetric
(
vertical:
6
,
horizontal:
0
,
),
child:
Row
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
[
Expanded
(
flex:
1
,
child:
Text
(
textheads
[
j
].
toString
(),
style:
TextStyle
(
fontSize:
14
,
fontFamily:
"JakartaMedium"
),),),
SizedBox
(
width:
5
,),
Expanded
(
flex:
2
,
child:
SizedBox
(
child:
Text
(
textSubheads
[
j
],
maxLines:
2
,
overflow:
TextOverflow
.
ellipsis
,
style:
TextStyle
(
fontSize:
14
,
color:
Color
(
0xFF818181
,
),
),
]
,
)
,
),
)
;
})
,
)
,
]
,
),
],
),
]
,
);
}
),
)
,
),
),
SizedBox
(
height:
75
),
],
SizedBox
(
height:
75
),
],
),
),
),
),
floatingActionButton:
Align
(
alignment:
Alignment
.
bottomCenter
,
child:
InkWell
(
onTap:
()
{
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
context
)
=>
Complainthistory
()),
);
},
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
(
"Complaint History"
,
textAlign:
TextAlign
.
center
,
style:
TextStyle
(
color:
Colors
.
white
),
floatingActionButton:
Align
(
alignment:
Alignment
.
bottomCenter
,
child:
InkWell
(
onTap:
()
{
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
context
)
=>
Complainthistory
()),
);
},
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
(
15.0
),
),
child:
Center
(
child:
Text
(
"Complaint History"
,
textAlign:
TextAlign
.
center
,
style:
TextStyle
(
fontFamily:
"JakartaMedium"
,
fontSize:
15
,
color:
Colors
.
white
),
),
),
),
),
),
floatingActionButtonLocation:
FloatingActionButtonLocation
.
centerFloat
,
),
floatingActionButtonLocation:
FloatingActionButtonLocation
.
centerFloat
,
);
},
);
...
...
lib/screens/genTracker/RegisterComplaint.dart
View file @
528df0d2
...
...
@@ -24,579 +24,626 @@ class _RegistercomplaintState extends State<Registercomplaint> {
Widget
build
(
BuildContext
context
)
{
return
Consumer2
<
Generatordetailsprovider
,
HomescreenNotifier
>(
builder:
(
context
,
provider
,
homeProvider
,
child
)
{
return
Scaffold
(
backgroundColor:
AppColors
.
scaffold_bg_color
,
appBar:
appbar
(
context
,
"Register Complaint"
),
body:
Container
(
child:
SingleChildScrollView
(
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
[
SizedBox
(
height:
5.0
),
Container
(
padding:
EdgeInsets
.
fromLTRB
(
10
,
0
,
10
,
0
),
return
WillPopScope
(
onWillPop:
()
=>
onBackPressed
(
context
),
child:
Scaffold
(
resizeToAvoidBottomInset:
true
,
backgroundColor:
AppColors
.
scaffold_bg_color
,
appBar:
appbar
(
context
,
"Register Complaint"
),
body:
Container
(
child:
SingleChildScrollView
(
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
[
SizedBox
(
height:
5.0
),
Container
(
padding:
EdgeInsets
.
fromLTRB
(
10
,
0
,
10
,
0
),
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
[
SizedBox
(
height:
25
),
Text
(
"Customer Details"
,
style:
TextStyle
(
color:
Color
(
0xFF818181
)),
),
Container
(
padding:
EdgeInsets
.
fromLTRB
(
10
,
10
,
10
,
10
),
margin:
EdgeInsets
.
symmetric
(
horizontal:
10
,
vertical:
5
),
decoration:
BoxDecoration
(
color:
Colors
.
white
,
borderRadius:
BorderRadius
.
circular
(
16
)
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
[
SizedBox
(
height:
25
),
Container
(
padding:
EdgeInsets
.
symmetric
(
horizontal:
10
),
child:
Text
(
"Customer Details"
,
style:
TextStyle
(
fontFamily:
"JakartaMedium"
,
color:
Color
(
0xFF818181
)),
),
),
child:
Column
(
Container
(
padding:
EdgeInsets
.
fromLTRB
(
10
,
10
,
10
,
10
),
margin:
EdgeInsets
.
symmetric
(
horizontal:
10
,
vertical:
5
),
decoration:
BoxDecoration
(
color:
Colors
.
white
,
borderRadius:
BorderRadius
.
circular
(
16
)
),
child:
Column
(
children:
[
Row
(
crossAxisAlignment:
CrossAxisAlignment
.
center
,
mainAxisAlignment:
MainAxisAlignment
.
center
,
children:
[
Expanded
(
flex:
1
,
child:
SvgPicture
.
asset
(
"assets/svg/se_block_head.svg"
,
children:
[
Row
(
crossAxisAlignment:
CrossAxisAlignment
.
center
,
mainAxisAlignment:
MainAxisAlignment
.
center
,
children:
[
Expanded
(
flex:
1
,
child:
SvgPicture
.
asset
(
"assets/svg/se_block_head.svg"
,
),
),
),
SizedBox
(
width:
10
),
SizedBox
(
width:
10
),
Expanded
(
flex:
9
,
child:
SizedBox
(
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
[
Text
(
"
${provider.cname}
"
),
Text
(
"
${provider.aname}
"
,
maxLines:
2
,
overflow:
TextOverflow
.
ellipsis
,
style:
TextStyle
(
color:
Color
(
0xFF818181
),
Expanded
(
flex:
9
,
child:
SizedBox
(
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
[
Text
(
"
${provider.cname}
"
,
style:
TextStyle
(
fontFamily:
"JakartaMedium"
),),
Text
(
"
${provider.aname}
"
,
maxLines:
2
,
overflow:
TextOverflow
.
ellipsis
,
style:
TextStyle
(
color:
Color
(
0xFF818181
),
),
),
),
// Text("Gen Pvt. Ltd")
,
]
,
// Text("Gen Pvt. Ltd"
),
]
,
)
,
),
),
),
],
),
Divider
(
thickness:
0.5
,
color:
Color
(
0xFFD7D7D7
)),
...
List
.
generate
(
2
,
(
j
)
{
final
textheads
=
[
"Product Name"
,
"Engine ID"
];
final
textSubheads
=
[
provider
.
spname
,
provider
.
engineNo
,
];
return
Container
(
padding:
EdgeInsets
.
symmetric
(
vertical:
3
),
child:
Column
(
children:
[
Row
(
mainAxisAlignment:
MainAxisAlignment
.
spaceBetween
,
children:
[
Expanded
(
child:
SizedBox
(
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
[
Text
(
textheads
[
j
].
toString
()),
],
],
),
Divider
(
thickness:
0.5
,
color:
Color
(
0xFFD7D7D7
)),
...
List
.
generate
(
2
,
(
j
)
{
final
textheads
=
[
"Product Name"
,
"Engine ID"
];
final
textSubheads
=
[
provider
.
spname
,
provider
.
engineNo
,
];
return
Container
(
padding:
EdgeInsets
.
symmetric
(
vertical:
3
),
child:
Column
(
children:
[
Row
(
mainAxisAlignment:
MainAxisAlignment
.
spaceBetween
,
children:
[
Expanded
(
child:
SizedBox
(
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
[
Text
(
textheads
[
j
].
toString
(),
style:
TextStyle
(
fontFamily:
"JakartaMedium"
),),
],
),
),
),
),
Expanded
(
child:
SizedBox
(
child:
Column
(
c
rossAxisAlignment
:
CrossAxisAlignment
.
start
,
children:
[
Text
(
textSubheads
[
j
].
toString
(),
style:
TextStyle
(
color:
Color
(
0xFF818181
),
Expanded
(
child:
SizedBox
(
child:
Column
(
crossAxisAlignment:
C
rossAxisAlignment
.
start
,
children:
[
Text
(
textSubheads
[
j
].
toString
(),
style:
TextStyle
(
color:
Color
(
0xFF818181
),
),
),
)
,
]
,
]
,
)
,
),
),
),
],
),
],
),
);
}),
SizedBox
(
height:
10.0
),
],
),
],
),
);
}),
SizedBox
(
height:
10.0
),
],
],
),
),
),
Text
(
"Complaint Details"
,
style:
TextStyle
(
color:
Color
(
0xFF818181
)
),),
Container
(
padding:
EdgeInsets
.
fromLTRB
(
10
,
10
,
10
,
10
),
margin:
EdgeInsets
.
symmetric
(
horizontal:
10
,
vertical:
5
),
decoration:
BoxDecoration
(
color:
Colors
.
white
,
borderRadius:
BorderRadius
.
circular
(
16
)
Container
(
padding:
EdgeInsets
.
symmetric
(
horizontal:
10
),
child:
Text
(
"Complaint Details"
,
style:
TextStyle
(
fontFamily:
"JakartaMedium"
,
color:
Color
(
0xFF818181
)),
),
),
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
[
Text
(
"Complaint Type"
),
DropdownButtonHideUnderline
(
child:
Row
(
children:
[
Expanded
(
child:
DropdownButton2
<
ComplaintTypeList
>(
isExpanded:
true
,
hint:
const
Row
(
children:
[
Expanded
(
child:
Text
(
'Select Complaint Type'
,
style:
TextStyle
(
fontSize:
14
,
),
overflow:
TextOverflow
.
ellipsis
,
),
),
],
),
items:
provider
.
complaintTypeDropdown
.
map
(
(
complaintType
)
=>
DropdownMenuItem
<
ComplaintTypeList
>(
value:
complaintType
,
Container
(
padding:
EdgeInsets
.
fromLTRB
(
10
,
10
,
10
,
10
),
margin:
EdgeInsets
.
symmetric
(
horizontal:
10
,
vertical:
5
),
decoration:
BoxDecoration
(
color:
Colors
.
white
,
borderRadius:
BorderRadius
.
circular
(
16
)
),
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
[
Padding
(
padding:
const
EdgeInsets
.
only
(
bottom:
5.0
),
child:
Text
(
"Complaint Type"
,
style:
TextStyle
(
fontFamily:
"JakartaMedium"
,
),),
),
DropdownButtonHideUnderline
(
child:
Row
(
children:
[
Expanded
(
child:
DropdownButton2
<
ComplaintTypeList
>(
isExpanded:
true
,
hint:
const
Row
(
children:
[
Expanded
(
child:
Text
(
c
omplaintType
.
name
??
'
'
,
style:
const
TextStyle
(
'Select C
omplaint
Type'
,
style:
TextStyle
(
fontSize:
14
,
),
overflow:
TextOverflow
.
ellipsis
,
overflow:
TextOverflow
.
ellipsis
,
),
),
)
.
toList
(),
value:
provider
.
selectedComplaintType
,
onChanged:
(
ComplaintTypeList
?
value
)
{
if
(
value
!=
null
)
{
if
(
provider
.
complaintCategorydropdown
.
isNotEmpty
)
{
provider
.
selectedComplaintType
=
value
;
print
(
"Selected Complaint Type:
${value
.name}
, ID:
${value.id}
"
,
);
provider
.
selectedType
=
value
?.
name
;
provider
.
selectedTypeId
=
value
?.
id
;
print
(
"hfjkshfg"
+
provider
.
selectedTypeId
.
toString
(),
);
],
),
items:
provider
.
complaintTypeDropdown
.
map
(
(
complaintType
)
=>
DropdownMenuItem
<
ComplaintTypeList
>(
value:
complaintType
,
child:
Text
(
complaintType
.
name
??
''
,
style:
const
TextStyle
(
fontSize:
14
,
),
overflow:
TextOverflow
.
ellipsis
,
),
),
)
.
toList
(),
value:
provider
.
selectedComplaintType
,
onChanged:
(
ComplaintTypeList
?
value
)
{
if
(
value
!=
null
)
{
if
(
provider
.
complaintCategorydropdown
.
isNotEmpty
)
{
provider
.
selectedComplaintType
=
value
;
print
(
"Selected Complaint Type:
${value
.name}
, ID:
${value.id}
"
,
);
provider
.
selectedType
=
value
?.
name
;
provider
.
selectedTypeId
=
value
?.
id
;
print
(
"hfjkshfg"
+
provider
.
selectedTypeId
.
toString
(),
);
}
}
}
},
buttonStyleData:
ButtonStyleData
(
height:
50
,
width:
160
,
padding:
const
EdgeInsets
.
only
(
left:
14
,
right:
14
,
},
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
,
),
),
decoration:
BoxDecoration
(
borderRadius:
BorderRadius
.
circular
(
14
),
color:
AppColors
.
text_field_color
,
iconStyleData:
const
IconStyleData
(
icon:
Icon
(
Icons
.
keyboard_arrow_down
),
iconSize:
12
,
iconEnabledColor:
Color
(
0xFF2D2D2D
),
iconDisabledColor:
Colors
.
grey
,
),
),
iconStyleData:
const
IconStyleData
(
icon:
Icon
(
Icons
.
keyboard_arrow_down
),
iconSize:
12
,
iconEnabledColor:
Color
(
0xFF2D2D2D
),
iconDisabledColor:
Colors
.
grey
,
),
dropdownStyleData:
DropdownStyleData
(
maxHeight:
200
,
width:
350
,
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:
10.0
),
Text
(
"Complaint Category"
),
DropdownButtonHideUnderline
(
child:
Row
(
children:
[
Expanded
(
child:
DropdownButton2
<
ComplaintCategoryList
>(
isExpanded:
true
,
hint:
const
Row
(
children:
[
Expanded
(
child:
Text
(
'Select Complaint Category'
,
style:
TextStyle
(
fontSize:
14
,
),
overflow:
TextOverflow
.
ellipsis
,
),
),
],
),
items:
provider
.
complaintCategorydropdown
.
map
(
(
Category
)
=>
DropdownMenuItem
<
ComplaintCategoryList
>(
value:
Category
,
SizedBox
(
height:
10.0
),
Padding
(
padding:
const
EdgeInsets
.
only
(
bottom:
5.0
),
child:
Text
(
"Complaint Category"
,
style:
TextStyle
(
fontFamily:
"JakartaMedium"
,
),),
),
DropdownButtonHideUnderline
(
child:
Row
(
children:
[
Expanded
(
child:
DropdownButton2
<
ComplaintCategoryList
>(
isExpanded:
true
,
hint:
const
Row
(
children:
[
Expanded
(
child:
Text
(
Category
.
name
??
""
,
style:
const
TextStyle
(
'Select Complaint Category'
,
style:
TextStyle
(
fontSize:
14
,
),
overflow:
TextOverflow
.
ellipsis
,
overflow:
TextOverflow
.
ellipsis
,
),
),
)
.
toList
(),
value:
provider
.
selectedCategoryType
,
onChanged:
(
ComplaintCategoryList
?
value
)
{
if
(
provider
.
complaintCategorydropdown
.
isNotEmpty
)
{
provider
.
selectedCategoryType
=
value
;
provider
.
selectedCategory
=
value
?.
name
;
provider
.
selectedCategoryId
=
value
?.
id
;
}
},
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
,
items:
provider
.
complaintCategorydropdown
.
map
(
(
Category
)
=>
DropdownMenuItem
<
ComplaintCategoryList
>(
value:
Category
,
child:
Text
(
Category
.
name
??
""
,
style:
const
TextStyle
(
fontSize:
14
,
),
overflow:
TextOverflow
.
ellipsis
,
),
),
)
.
toList
(),
value:
provider
.
selectedCategoryType
,
onChanged:
(
ComplaintCategoryList
?
value
)
{
if
(
provider
.
complaintCategorydropdown
.
isNotEmpty
)
{
provider
.
selectedCategoryType
=
value
;
provider
.
selectedCategory
=
value
?.
name
;
provider
.
selectedCategoryId
=
value
?.
id
;
}
},
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
),
iconSize:
12
,
iconEnabledColor:
Color
(
0xFF2D2D2D
),
iconDisabledColor:
Colors
.
grey
,
),
dropdownStyleData:
DropdownStyleData
(
maxHeight:
200
,
width:
350
,
decoration:
BoxDecoration
(
borderRadius:
BorderRadius
.
circular
(
14
),
color:
AppColors
.
text_field_color
,
iconStyleData:
const
IconStyleData
(
icon:
Icon
(
Icons
.
keyboard_arrow_down
),
iconSize:
12
,
iconEnabledColor:
Color
(
0xFF2D2D2D
),
iconDisabledColor:
Colors
.
grey
,
),
scrollbarTheme:
ScrollbarThemeData
(
radius:
const
Radius
.
circular
(
15
),
thickness:
MaterialStateProperty
.
all
<
double
>(
6
),
thumbVisibility:
MaterialStateProperty
.
all
<
bool
>(
true
),
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
),
),
),
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.0
),
Text
(
"Select Description"
),
DropdownButtonHideUnderline
(
child:
Row
(
children:
[
Expanded
(
child:
DropdownButton2
<
ComplaintDescriptionList
>(
isExpanded:
true
,
hint:
const
Row
(
children:
[
Expanded
(
child:
Text
(
'Select Description'
,
style:
TextStyle
(
fontSize:
14
,
),
overflow:
TextOverflow
.
ellipsis
,
),
),
],
),
items:
provider
.
complaintDescriptionDropdown
.
map
(
(
Description
)
=>
DropdownMenuItem
<
ComplaintDescriptionList
>(
value:
Description
,
SizedBox
(
height:
10.0
),
Padding
(
padding:
const
EdgeInsets
.
only
(
bottom:
5.0
),
child:
Text
(
"Select Description"
,
style:
TextStyle
(
fontFamily:
"JakartaMedium"
,
),),
),
DropdownButtonHideUnderline
(
child:
Row
(
children:
[
Expanded
(
child:
DropdownButton2
<
ComplaintDescriptionList
>(
isExpanded:
true
,
hint:
const
Row
(
children:
[
Expanded
(
child:
Text
(
Description
.
name
??
""
,
style:
const
TextStyle
(
'Select
Description
'
,
style:
TextStyle
(
fontSize:
14
,
),
overflow:
TextOverflow
.
ellipsis
,
overflow:
TextOverflow
.
ellipsis
,
),
),
)
.
toList
(),
value:
provider
.
selectedDescriptionType
,
onChanged:
(
ComplaintDescriptionList
?
value
)
{
if
(
provider
.
complaintDescriptionDropdown
.
isNotEmpty
)
{
provider
.
selectedDescriptionType
=
value
;
provider
.
selectedDescription
=
value
?.
name
;
provider
.
selectedDescriptionId
=
value
?.
id
;
}
},
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
,
items:
provider
.
complaintDescriptionDropdown
.
map
(
(
Description
)
=>
DropdownMenuItem
<
ComplaintDescriptionList
>(
value:
Description
,
child:
Text
(
Description
.
name
??
""
,
style:
const
TextStyle
(
fontSize:
14
,
),
overflow:
TextOverflow
.
ellipsis
,
),
),
)
.
toList
(),
value:
provider
.
selectedDescriptionType
,
onChanged:
(
ComplaintDescriptionList
?
value
)
{
if
(
provider
.
complaintDescriptionDropdown
.
isNotEmpty
)
{
provider
.
selectedDescriptionType
=
value
;
provider
.
selectedDescription
=
value
?.
name
;
provider
.
selectedDescriptionId
=
value
?.
id
;
}
},
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
),
iconSize:
12
,
iconEnabledColor:
Color
(
0xFF2D2D2D
),
iconDisabledColor:
Colors
.
grey
,
),
dropdownStyleData:
DropdownStyleData
(
maxHeight:
200
,
width:
350
,
decoration:
BoxDecoration
(
borderRadius:
BorderRadius
.
circular
(
14
),
color:
AppColors
.
text_field_color
,
iconStyleData:
const
IconStyleData
(
icon:
Icon
(
Icons
.
keyboard_arrow_down
),
iconSize:
12
,
iconEnabledColor:
Color
(
0xFF2D2D2D
),
iconDisabledColor:
Colors
.
grey
,
),
scrollbarTheme:
ScrollbarThemeData
(
radius:
const
Radius
.
circular
(
15
),
thickness:
MaterialStateProperty
.
all
<
double
>(
6
,
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
),
),
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.0
),
Text
(
"Duration"
),
Container
(
height:
50
,
alignment:
Alignment
.
center
,
decoration:
BoxDecoration
(
color:
AppColors
.
text_field_color
,
borderRadius:
BorderRadius
.
circular
(
14
),
SizedBox
(
height:
10.0
),
Padding
(
padding:
const
EdgeInsets
.
only
(
bottom:
5.0
),
child:
Text
(
"Duration"
,
style:
TextStyle
(
fontFamily:
"JakartaMedium"
,
),),
),
child:
Padding
(
padding:
const
EdgeInsets
.
fromLTRB
(
10.0
,
0.0
,
10
,
0
),
child:
TextFormField
(
controller:
running_hrs
,
keyboardType:
TextInputType
.
text
,
decoration:
InputDecoration
(
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:
running_hrs
,
keyboardType:
TextInputType
.
text
,
decoration:
InputDecoration
(
hintText:
"Enter Running Number"
,
hintStyle:
TextStyle
(
fontWeight:
FontWeight
.
w400
,
color:
Color
(
0xFFB4BEC0
),
fontSize:
14
),
hintText:
"Enter Running 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.0
),
Text
(
"Message"
),
Container
(
height:
150
,
alignment:
Alignment
.
center
,
decoration:
BoxDecoration
(
color:
AppColors
.
text_field_color
,
borderRadius:
BorderRadius
.
circular
(
14
),
SizedBox
(
height:
10.0
),
Padding
(
padding:
const
EdgeInsets
.
only
(
bottom:
5.0
),
child:
Text
(
"Message"
,
style:
TextStyle
(
fontFamily:
"JakartaMedium"
,
),),
),
child:
Padding
(
padding:
const
EdgeInsets
.
fromLTRB
(
10.0
,
0.0
,
10
,
0
),
child:
TextFormField
(
maxLines:
6
,
controller:
Complaint_Note
,
keyboardType:
TextInputType
.
text
,
decoration:
InputDecoration
(
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
(
maxLines:
6
,
controller:
Complaint_Note
,
keyboardType:
TextInputType
.
text
,
decoration:
InputDecoration
(
hintText:
"Enter Message"
,
hintStyle:
TextStyle
(
fontWeight:
FontWeight
.
w400
,
color:
Color
(
0xFFB4BEC0
),
fontSize:
14
hintText:
"Enter Message"
,
hintStyle:
TextStyle
(
fontWeight:
FontWeight
.
w400
,
color:
Color
(
0xFFB4BEC0
),
fontSize:
14
),
enabledBorder:
InputBorder
.
none
,
focusedBorder:
InputBorder
.
none
,
),
enabledBorder:
InputBorder
.
none
,
focusedBorder:
InputBorder
.
none
,
),
),
),
)
,
]
,
]
,
)
,
),
),
SizedBox
(
height:
65.0
),
SizedBox
(
height:
65.0
),
],
],
),
),
)
,
]
,
]
,
)
,
),
),
),
floatingActionButton:
Container
(
child:
InkWell
(
onTap:
()
{
provider
.
SubmitComplaintFunction
(
context
,
homeProvider
,
provider
.
genID
,
provider
.
selectedTypeId
,
provider
.
selectedDescriptionId
,
running_hrs
.
text
,
Complaint_Note
.
text
);
},
child:
Container
(
alignment:
Alignment
.
center
,
height:
45
,
margin:
EdgeInsets
.
only
(
left:
15.0
,
right:
15.0
),
decoration:
BoxDecoration
(
color:
AppColors
.
app_blue
,
borderRadius:
BorderRadius
.
circular
(
10.0
),
),
child:
Text
(
"Submit Complaint"
,
textAlign:
TextAlign
.
center
,
style:
TextStyle
(
color:
Colors
.
white
floatingActionButton:
Container
(
child:
InkWell
(
onTap:
()
{
provider
.
SubmitComplaintFunction
(
context
,
homeProvider
,
provider
.
genID
,
provider
.
selectedTypeId
,
provider
.
selectedDescriptionId
,
running_hrs
.
text
,
Complaint_Note
.
text
);
},
child:
Container
(
alignment:
Alignment
.
center
,
height:
45
,
margin:
EdgeInsets
.
only
(
left:
15.0
,
right:
15.0
),
decoration:
BoxDecoration
(
color:
AppColors
.
app_blue
,
borderRadius:
BorderRadius
.
circular
(
10.0
),
),
child:
Text
(
"Submit Complaint"
,
textAlign:
TextAlign
.
center
,
style:
TextStyle
(
fontFamily:
"JakartaMedium"
,
fontSize:
15
,
color:
Colors
.
white
),
),
),
),
),
floatingActionButtonLocation:
FloatingActionButtonLocation
.
centerFloat
,
),
floatingActionButtonLocation:
FloatingActionButtonLocation
.
centerFloat
,
);
},
);
...
...
lib/screens/genTracker/ScanEnterGeneratorIDScreen.dart
View file @
528df0d2
...
...
@@ -47,65 +47,71 @@ class _ScanentergeneratoridscreenState extends State<Scanentergeneratoridscreen>
Widget
build
(
BuildContext
context
)
{
return
Consumer
<
Generatordetailsprovider
>(
builder:
(
context
,
provider
,
child
)
{
return
Scaffold
(
backgroundColor:
AppColors
.
scaffold_bg_color
,
appBar:
appbar
(
context
,
"
${widget.from}
"
),
body:
Container
(
decoration:
BoxDecoration
(
color:
Colors
.
black
),
child:
Column
(
children:
[
Spacer
(),
Container
(
height:
250
,
return
WillPopScope
(
onWillPop:
()
=>
onBackPressed
(
context
),
child:
Scaffold
(
resizeToAvoidBottomInset:
true
,
backgroundColor:
AppColors
.
scaffold_bg_color
,
appBar:
appbar
(
context
,
"
${widget.from}
"
),
body:
Container
(
decoration:
BoxDecoration
(
color:
Colors
.
black
),
child:
Column
(
children:
[
Spacer
(),
SizedBox
(
height:
250
,
child:
QRView
(
child:
QRView
(
key:
provider
.
scannerKey
,
onQRViewCreated:
(
p0
)
{
provider
.
onQRViewCreated
(
p0
,
provider
.
title
,
context
);
},
formatsAllowed:
[
BarcodeFormat
.
qrcode
],
cameraFacing:
CameraFacing
.
back
,
overlay:
QrScannerOverlayShape
(
key:
provider
.
scannerKey
,
onQRViewCreated:
(
p0
)
{
provider
.
onQRViewCreated
(
p0
,
provider
.
title
,
context
);
},
formatsAllowed:
[
BarcodeFormat
.
qrcode
],
cameraFacing:
CameraFacing
.
back
,
overlay:
QrScannerOverlayShape
(
borderColor:
AppColors
.
app_blue
,
borderRadius:
20
,
borderLength:
60
,
borderWidth:
10
,
cutOutSize:
250.0
,
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
(
provider
.
subTitle
,
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
{
_showgenIdBottomSheet
(
context
);
},
child:
Text
(
"Tap to Enter Generator ID"
,
SizedBox
(
height:
25
),
Text
(
"Scan QR"
,
textAlign:
TextAlign
.
center
,
style:
TextStyle
(
fontSize:
18
,
fontFamily:
"JakartaMedium"
,
color:
Colors
.
white
),
),
Text
(
provider
.
subTitle
,
textAlign:
TextAlign
.
center
,
style:
TextStyle
(
fontSize:
14
,
color:
Colors
.
white
),
),
),
SizedBox
(
height:
50
),
],
Spacer
(),
Text
(
"or"
,
textAlign:
TextAlign
.
center
,
style:
TextStyle
(
fontSize:
18
,
fontFamily:
"JakartaMedium"
,
color:
Colors
.
white
),
),
InkResponse
(
onTap:
()
async
{
_showgenIdBottomSheet
(
context
);
},
child:
Text
(
"Tap to Enter Generator ID"
,
textAlign:
TextAlign
.
center
,
style:
TextStyle
(
fontSize:
18
,
fontFamily:
"JakartaMedium"
,
color:
AppColors
.
app_blue
),
),
),
SizedBox
(
height:
50
),
],
),
),
),
);
...
...
@@ -148,12 +154,14 @@ class _ScanentergeneratoridscreenState extends State<Scanentergeneratoridscreen>
mainAxisSize:
MainAxisSize
.
min
,
children:
[
Container
(
padding:
EdgeInsets
.
symmetric
(
horizontal:
10
,
vertical:
5
),
alignment:
Alignment
.
topLeft
,
child:
Text
(
"Generator ID"
,
style:
TextStyle
(
color:
AppColors
.
semi_black
,
fontSize:
12
,
fontFamily:
"JakartaMedium"
,
fontSize:
14
,
),
),
),
...
...
@@ -162,7 +170,7 @@ class _ScanentergeneratoridscreenState extends State<Scanentergeneratoridscreen>
alignment:
Alignment
.
center
,
decoration:
BoxDecoration
(
color:
AppColors
.
text_field_color
,
borderRadius:
BorderRadius
.
circular
(
20
),
borderRadius:
BorderRadius
.
circular
(
14
),
border:
genIDFocusNode
.
hasFocus
?
Border
.
all
(
...
...
@@ -195,7 +203,7 @@ class _ScanentergeneratoridscreenState extends State<Scanentergeneratoridscreen>
decoration:
InputDecoration
(
isDense:
true
,
hintStyle:
TextStyle
(
fontWeight:
FontWeight
.
w400
,
color:
Color
(
0xFF818181
)
,
fontSize:
14
,
),
//contentPadding: EdgeInsets.fromLTRB(5.0, 10.0, 5.0, 10.0),
...
...
@@ -206,6 +214,7 @@ class _ScanentergeneratoridscreenState extends State<Scanentergeneratoridscreen>
),
),
),
SizedBox
(
height:
15
,),
InkWell
(
onTap:
()
{
switch
(
widget
.
from
){
...
...
@@ -248,13 +257,16 @@ class _ScanentergeneratoridscreenState extends State<Scanentergeneratoridscreen>
),
decoration:
BoxDecoration
(
color:
AppColors
.
app_blue
,
//1487C9
borderRadius:
BorderRadius
.
circular
(
30
.0
),
borderRadius:
BorderRadius
.
circular
(
15
.0
),
),
child:
Center
(
child:
Text
(
"Submit"
,
textAlign:
TextAlign
.
center
,
style:
TextStyle
(
color:
Colors
.
white
),
style:
TextStyle
(
color:
Colors
.
white
,
fontFamily:
"JakartaMedium"
,
fontSize:
16
),
),
),
),
...
...
lib/screens/inventory/GeneratorPartDetailsScreen.dart
View file @
528df0d2
...
...
@@ -2,6 +2,7 @@ import 'package:flutter/material.dart';
import
'package:generp/Notifiers/HomeScreenNotifier.dart'
;
import
'package:generp/Notifiers/InventoryProvider.dart'
;
import
'package:generp/Utils/app_colors.dart'
;
import
'package:generp/Utils/commonServices.dart'
;
import
'package:generp/Utils/commonWidgets.dart'
;
import
'package:provider/provider.dart'
;
...
...
@@ -9,212 +10,476 @@ class GeneratorPartDetailsScreen extends StatefulWidget {
const
GeneratorPartDetailsScreen
({
super
.
key
});
@override
State
<
GeneratorPartDetailsScreen
>
createState
()
=>
_GeneratorPartDetailsScreenState
();
State
<
GeneratorPartDetailsScreen
>
createState
()
=>
_GeneratorPartDetailsScreenState
();
}
class
_GeneratorPartDetailsScreenState
extends
State
<
GeneratorPartDetailsScreen
>
{
FocusNode
descriptionFocusNode
=
FocusNode
();
class
_GeneratorPartDetailsScreenState
extends
State
<
GeneratorPartDetailsScreen
>
{
FocusNode
descriptionFocusNode
=
FocusNode
();
FocusNode
quantityFocusNode
=
FocusNode
();
TextEditingController
descriptioncontroller
=
TextEditingController
();
TextEditingController
quantitycontroller
=
TextEditingController
();
@override
void
initState
()
{
// TODO: implement initState
super
.
initState
();
WidgetsBinding
.
instance
.
addPostFrameCallback
((
_
)
{
var
homeProvider
=
Provider
.
of
<
HomescreenNotifier
>(
context
,
listen:
false
);
var
homeProvider
=
Provider
.
of
<
HomescreenNotifier
>(
context
,
listen:
false
,
);
initialiseFunction
(
context
,
homeProvider
);
});
}
void
initialiseFunction
(
BuildContext
context
,
homeProvider
)
async
{
var
inventoryProvider
=
Provider
.
of
<
InventoryProvider
>(
context
,
listen:
false
);
inventoryProvider
.
LoadPartDetailsApifunction
(
homeProvider
,
context
,
""
,
inventoryProvider
.
partID
);
void
initialiseFunction
(
BuildContext
context
,
homeProvider
)
async
{
var
inventoryProvider
=
Provider
.
of
<
InventoryProvider
>(
context
,
listen:
false
,
);
inventoryProvider
.
LoadPartDetailsApifunction
(
homeProvider
,
context
,
""
,
inventoryProvider
.
partID
,
);
}
@override
Widget
build
(
BuildContext
context
)
{
return
Consumer
<
InventoryProvider
>(
builder:
(
context
,
provider
,
child
)
{
return
Scaffold
(
backgroundColor:
AppColors
.
scaffold_bg_color
,
appBar:
appbar
(
context
,
"Gen Inventory"
),
body:
Container
(
child:
SingleChildScrollView
(
child:
Column
(
children:
[
Container
(
margin:
EdgeInsets
.
only
(
top:
15
,
bottom:
15
),
decoration:
BoxDecoration
(
color:
Colors
.
white
,
borderRadius:
BorderRadius
.
circular
(
16
),
),
child:
Column
(
children:
[
Container
(
padding:
EdgeInsets
.
only
(
left:
10
,
right:
10
,
top:
15
,
),
child:
Row
(
children:
[
Expanded
(
child:
Text
(
"
${provider.partData.prodName}
"
)),
],
),
),
Container
(
padding:
EdgeInsets
.
symmetric
(
horizontal:
10
,
vertical:
15
,
),
margin:
EdgeInsets
.
symmetric
(
horizontal:
10
,
vertical:
15
,
),
decoration:
BoxDecoration
(
color:
Color
(
0xFFFFEFEF
),
borderRadius:
BorderRadius
.
circular
(
16
),
builder:
(
context
,
provider
,
child
)
{
return
WillPopScope
(
onWillPop:
()
=>
onBackPressed
(
context
),
child:
Scaffold
(
resizeToAvoidBottomInset:
true
,
backgroundColor:
AppColors
.
scaffold_bg_color
,
appBar:
appbar
(
context
,
"Gen Inventory"
),
body:
Container
(
child:
SingleChildScrollView
(
child:
Column
(
children:
[
Container
(
margin:
EdgeInsets
.
only
(
top:
15
,
bottom:
15
),
decoration:
BoxDecoration
(
color:
Colors
.
white
,
borderRadius:
BorderRadius
.
circular
(
16
),
),
child:
Column
(
children:
[
Container
(
padding:
EdgeInsets
.
only
(
left:
10
,
right:
10
,
top:
15
,
),
child:
Row
(
children:
[
Expanded
(
child:
Text
(
"
${provider.partData.prodName}
"
,
style:
TextStyle
(
color:
AppColors
.
app_blue
,
fontFamily:
"JakartaMedium"
,
),
),
),
],
),
),
child:
Row
(
mainAxisAlignment:
MainAxisAlignment
.
center
,
children:
[
Expanded
(
child:
SizedBox
(
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
center
,
children:
[
RichText
(
text:
TextSpan
(
children:
[
TextSpan
(
text:
"
${provider.partData.remainingQuantity}
"
,
style:
TextStyle
(
color:
AppColors
.
semi_black
,
fontSize:
18
,
Container
(
padding:
EdgeInsets
.
symmetric
(
horizontal:
10
,
vertical:
15
,
),
margin:
EdgeInsets
.
symmetric
(
horizontal:
10
,
vertical:
15
,
),
decoration:
BoxDecoration
(
color:
Color
(
0xFFE6F6FF
),
borderRadius:
BorderRadius
.
circular
(
16
),
),
child:
Row
(
mainAxisAlignment:
MainAxisAlignment
.
center
,
children:
[
Expanded
(
child:
SizedBox
(
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
center
,
children:
[
RichText
(
text:
TextSpan
(
children:
[
TextSpan
(
text:
"
${provider.partData.remainingQuantity}
"
,
style:
TextStyle
(
color:
AppColors
.
app_blue
,
fontSize:
30
,
),
),
),
],
],
),
),
Text
(
"Remaining Quantity"
,
style:
TextStyle
(
color:
Color
(
0xFF818181
),
),
),
],
),
),
),
],
),
),
Container
(
padding:
EdgeInsets
.
symmetric
(
horizontal:
15
,
vertical:
15
,
),
child:
Row
(
mainAxisAlignment:
MainAxisAlignment
.
center
,
children:
[
Expanded
(
child:
InkResponse
(
onTap:
()
{
_showStockIssueBottomSheet
(
context
,
"Issue"
,
);
},
child:
Container
(
height:
45
,
decoration:
BoxDecoration
(
color:
Color
(
0xFFFFEFEF
),
border:
Border
.
all
(
color:
Color
(
0xFFED3424
),
width:
0.5
,
),
borderRadius:
BorderRadius
.
circular
(
12
),
),
Text
(
"Remaining Quantity"
),
],
child:
Center
(
child:
Text
(
"- Issue"
,
style:
TextStyle
(
color:
Color
(
0xFFED3424
),
),
),
),
),
),
),
),
],
SizedBox
(
width:
10
),
Expanded
(
child:
InkResponse
(
onTap:
()
{
_showStockIssueBottomSheet
(
context
,
"Recieve"
,
);
},
child:
Container
(
height:
45
,
decoration:
BoxDecoration
(
color:
Color
(
0xFFE7FFE5
),
border:
Border
.
all
(
color:
Color
(
0xFF0D9C00
),
width:
0.5
,
),
borderRadius:
BorderRadius
.
circular
(
12
),
),
child:
Center
(
child:
Text
(
"+ Recieve"
,
style:
TextStyle
(
color:
Color
(
0xFF0D9C00
),
),
),
),
),
),
),
],
),
),
],
),
),
Container
(
alignment:
Alignment
.
topLeft
,
padding:
EdgeInsets
.
symmetric
(
horizontal:
10
),
child:
Text
(
"Product Details"
,
style:
TextStyle
(
color:
Color
(
0xFF818181
),
fontFamily:
"JakartaMedium"
,
),
]
,
)
,
),
),
Text
(
"Product Details"
),
Container
(
padding:
EdgeInsets
.
symmetric
(
horizontal:
10
,
vertical:
10
),
margin:
EdgeInsets
.
symmetric
(
horizontal:
10
,
vertical:
10
),
decoration:
BoxDecoration
(
color:
Colors
.
white
,
borderRadius:
BorderRadius
.
circular
(
16
)
Container
(
padding:
EdgeInsets
.
symmetric
(
horizontal:
10
,
vertical:
10
,
),
margin:
EdgeInsets
.
symmetric
(
horizontal:
10
,
vertical:
10
,
),
decoration:
BoxDecoration
(
color:
Colors
.
white
,
borderRadius:
BorderRadius
.
circular
(
16
),
),
child:
Column
(
children:
List
.
generate
(
3
,
(
index
)
{
final
headings
=
[
"Product Name"
,
"Product ID"
,
"Project"
,
];
final
values
=
[
provider
.
partData
.
prodName
,
provider
.
partData
.
id
,
provider
.
partData
.
project
,
];
return
Container
(
padding:
EdgeInsets
.
symmetric
(
horizontal:
10
,
vertical:
10
,
),
child:
Row
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
mainAxisAlignment:
MainAxisAlignment
.
start
,
children:
[
Expanded
(
flex:
1
,
child:
Text
(
"
${headings[index]}
"
,
style:
TextStyle
(
fontFamily:
"JakartaMedium"
,
),
),
),
Expanded
(
flex:
2
,
child:
Text
(
"
${values[index]}
"
,
style:
TextStyle
(
color:
Color
(
0xFF818181
)),
),
),
],
),
);
}),
),
),
child:
Column
(
children:
List
.
generate
(
9
,
(
index
)
{
final
headings
=
[
"Product Name"
,
"Product ID"
,
"Project"
,
"Description"
,
"Sub Group"
,
"Vendor 1"
,
"Vendor 2"
,
"Units"
,
"MSL"
];
final
values
=
[
provider
.
partData
.
prodName
,
provider
.
partData
.
id
,
provider
.
partData
.
project
,
provider
.
partData
.
prodDesc
,
provider
.
partData
.
subGroup
,
provider
.
partData
.
vendor1
,
provider
.
partData
.
vendor2
,
provider
.
partData
.
units
,
provider
.
partData
.
msl
,
];
return
Container
(
padding:
EdgeInsets
.
symmetric
(
horizontal:
10
,
vertical:
10
),
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
mainAxisAlignment:
MainAxisAlignment
.
start
,
children:
[
Text
(
"
${headings[index]}
"
),
Text
(
"
${values[index]}
"
),
Divider
(
thickness:
0.5
,
color:
index
==
8
?
Colors
.
white
:
Color
(
0xFFD7D7D7
),)
],
),
);
},),
Container
(
alignment:
Alignment
.
topLeft
,
padding:
EdgeInsets
.
symmetric
(
horizontal:
10
),
child:
Text
(
"Vendor Details"
,
style:
TextStyle
(
fontFamily:
"JakartaMedium"
,
color:
Color
(
0xFF818181
),
),
),
),
),
SizedBox
(
height:
150
,)
],
),
),
),
bottomSheet:
Container
(
padding:
EdgeInsets
.
symmetric
(
horizontal:
15
,
vertical:
15
),
child:
Row
(
mainAxisAlignment:
MainAxisAlignment
.
center
,
children:
[
Expanded
(
child:
InkResponse
(
onTap:
()
{
_showStockIssueBottomSheet
(
context
,
"Recieve"
);
},
child:
Container
(
height:
45
,
decoration:
BoxDecoration
(
color:
Colors
.
white
,
border:
Border
.
all
(
color:
AppColors
.
app_blue
,
width:
0.5
),
borderRadius:
BorderRadius
.
circular
(
12
)
Container
(
padding:
EdgeInsets
.
symmetric
(
horizontal:
10
,
vertical:
10
,
),
margin:
EdgeInsets
.
symmetric
(
horizontal:
10
,
vertical:
10
,
),
decoration:
BoxDecoration
(
color:
Colors
.
white
,
borderRadius:
BorderRadius
.
circular
(
16
),
),
child:
Column
(
children:
List
.
generate
(
2
,
(
index
)
{
final
headings
=
[
"Vendor 1"
,
"Vendor 2"
];
final
values
=
[
provider
.
partData
.
vendor1
,
provider
.
partData
.
vendor2
,
];
return
Container
(
padding:
EdgeInsets
.
symmetric
(
horizontal:
10
,
vertical:
10
,
),
child:
Row
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
mainAxisAlignment:
MainAxisAlignment
.
start
,
children:
[
Expanded
(
flex:
1
,
child:
Text
(
"
${headings[index]}
"
,
style:
TextStyle
(
fontFamily:
"JakartaMedium"
,
),
),
),
Expanded
(
flex:
2
,
child:
Text
(
"
${values[index]}
"
,
style:
TextStyle
(
color:
Color
(
0xFF818181
)),
),
),
],
),
);
}),
),
),
Container
(
alignment:
Alignment
.
topLeft
,
padding:
EdgeInsets
.
symmetric
(
horizontal:
10
),
child:
Text
(
"Other Details"
,
style:
TextStyle
(
fontFamily:
"JakartaMedium"
,
color:
Color
(
0xFF818181
),
),
),
),
Container
(
padding:
EdgeInsets
.
symmetric
(
horizontal:
10
,
vertical:
10
,
),
margin:
EdgeInsets
.
symmetric
(
horizontal:
10
,
vertical:
10
,
),
decoration:
BoxDecoration
(
color:
Colors
.
white
,
borderRadius:
BorderRadius
.
circular
(
16
),
),
child:
Column
(
children:
List
.
generate
(
3
,
(
index
)
{
final
headings
=
[
"Sub Group"
,
"Units"
,
"MSL"
];
final
values
=
[
provider
.
partData
.
subGroup
,
provider
.
partData
.
units
,
provider
.
partData
.
msl
,
];
return
Container
(
padding:
EdgeInsets
.
symmetric
(
horizontal:
10
,
vertical:
10
,
),
child:
Row
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
mainAxisAlignment:
MainAxisAlignment
.
start
,
children:
[
Expanded
(
flex:
1
,
child:
Text
(
"
${headings[index]}
"
,
style:
TextStyle
(
fontFamily:
"JakartaMedium"
,
),
),
),
Expanded
(
flex:
2
,
child:
Text
(
"
${values[index]}
"
,
style:
TextStyle
(
color:
Color
(
0xFF818181
)),
),
),
],
),
);
}),
),
),
child:
Center
(
child:
Text
(
"Recieve"
,
style:
TextStyle
(
color:
AppColors
.
app_blue
),)),),
)),
SizedBox
(
width:
10
,),
Expanded
(
child:
InkResponse
(
onTap:
()
{
_showStockIssueBottomSheet
(
context
,
"Issue"
);
},
child:
Container
(
height:
45
,
decoration:
BoxDecoration
(
color:
AppColors
.
app_blue
,
border:
Border
.
all
(
color:
AppColors
.
app_blue
,
width:
0.5
),
borderRadius:
BorderRadius
.
circular
(
12
)
Container
(
alignment:
Alignment
.
topLeft
,
padding:
EdgeInsets
.
symmetric
(
horizontal:
10
),
child:
Text
(
"Description"
,
style:
TextStyle
(
fontFamily:
"JakartaMedium"
,
color:
Color
(
0xFF818181
),
),
),
),
child:
Center
(
child:
Text
(
"Issue"
,
style:
TextStyle
(
color:
Colors
.
white
),)),),
)),
],
Container
(
padding:
EdgeInsets
.
symmetric
(
horizontal:
10
,
vertical:
10
,
),
margin:
EdgeInsets
.
symmetric
(
horizontal:
10
,
vertical:
10
,
),
decoration:
BoxDecoration
(
color:
Colors
.
white
,
borderRadius:
BorderRadius
.
circular
(
16
),
),
child:
Container
(
padding:
EdgeInsets
.
symmetric
(
horizontal:
10
,
vertical:
10
,
),
child:
Row
(
children:
[
Expanded
(
child:
SizedBox
(
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
mainAxisAlignment:
MainAxisAlignment
.
start
,
children:
[
Text
(
"Description"
,
style:
TextStyle
(
fontFamily:
"JakartaMedium"
,
),
),
Text
(
"
${provider.partData.prodDesc}
"
,
style:
TextStyle
(
color:
Color
(
0xFF818181
),
),
),
],
),
),
),
],
),
),
),
SizedBox
(
height:
150
),
],
),
),
),
),
);
}
}
,
);
}
Future
<
void
>
_showStockIssueBottomSheet
(
BuildContext
context
,
type
)
{
Future
<
void
>
_showStockIssueBottomSheet
(
BuildContext
context
,
type
)
{
return
showModalBottomSheet
(
useSafeArea:
true
,
isDismissible:
true
,
...
...
@@ -230,9 +495,9 @@ class _GeneratorPartDetailsScreenState extends State<GeneratorPartDetailsScreen>
child:
Padding
(
padding:
EdgeInsets
.
only
(
bottom:
MediaQuery
.
of
(
context
,
).
viewInsets
.
bottom
,
// This handles keyboard
MediaQuery
.
of
(
context
,
).
viewInsets
.
bottom
,
// This handles keyboard
),
child:
Container
(
margin:
EdgeInsets
.
only
(
...
...
@@ -246,20 +511,29 @@ class _GeneratorPartDetailsScreenState extends State<GeneratorPartDetailsScreen>
builder:
(
context
,
provider
,
homeProvider
,
child
)
{
return
SingleChildScrollView
(
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
center
,
crossAxisAlignment:
CrossAxisAlignment
.
start
,
mainAxisSize:
MainAxisSize
.
min
,
children:
[
Text
(
"Inventory
${type}
"
),
Text
(
"Inventory
${type}
"
,
style:
TextStyle
(
color:
AppColors
.
app_blue
,
fontWeight:
FontWeight
.
w600
,
fontSize:
16
,
),
),
SizedBox
(
height:
10
),
Container
(
alignment:
Alignment
.
topLeft
,
child:
Text
(
"Quantity"
,
"Quantity"
,
style:
TextStyle
(
color:
AppColors
.
semi_black
,
fontSize:
1
2
,
fontSize:
1
4
,
),
),
),
SizedBox
(
height:
5
),
Container
(
height:
48
,
alignment:
Alignment
.
center
,
...
...
@@ -267,12 +541,12 @@ class _GeneratorPartDetailsScreenState extends State<GeneratorPartDetailsScreen>
color:
AppColors
.
text_field_color
,
borderRadius:
BorderRadius
.
circular
(
20
),
border:
quantityFocusNode
.
hasFocus
?
Border
.
all
(
color:
AppColors
.
app_blue
,
width:
0.5
,
)
:
null
,
quantityFocusNode
.
hasFocus
?
Border
.
all
(
color:
AppColors
.
app_blue
,
width:
0.5
,
)
:
null
,
),
// alignment: Alignment.center,
margin:
EdgeInsets
.
only
(
left:
5.0
,
right:
5.0
),
...
...
@@ -288,8 +562,11 @@ class _GeneratorPartDetailsScreenState extends State<GeneratorPartDetailsScreen>
keyboardType:
TextInputType
.
text
,
focusNode:
quantityFocusNode
,
style:
TextStyle
(
fontSize:
14
),
onChanged:
(
value
)
{
provider
.
updateQuantity
(
quantitycontroller
.
text
);
provider
.
updateQuantity
(
quantitycontroller
.
text
,
);
},
onTapOutside:
(
event
)
{
// Handle onTapOutside
...
...
@@ -298,9 +575,10 @@ class _GeneratorPartDetailsScreenState extends State<GeneratorPartDetailsScreen>
decoration:
InputDecoration
(
isDense:
true
,
hintStyle:
TextStyle
(
fontWeight:
FontWeight
.
w400
,
color:
Color
(
0xFF818181
)
,
fontSize:
14
,
),
//contentPadding: EdgeInsets.fromLTRB(5.0, 10.0, 5.0, 10.0),
enabledBorder:
InputBorder
.
none
,
focusedBorder:
InputBorder
.
none
,
...
...
@@ -309,16 +587,18 @@ class _GeneratorPartDetailsScreenState extends State<GeneratorPartDetailsScreen>
),
),
),
SizedBox
(
height:
10
),
Container
(
alignment:
Alignment
.
topLeft
,
child:
Text
(
"Description"
,
style:
TextStyle
(
color:
AppColors
.
semi_black
,
fontSize:
1
2
,
fontSize:
1
4
,
),
),
),
SizedBox
(
height:
5
),
Container
(
height:
180
,
alignment:
Alignment
.
center
,
...
...
@@ -326,12 +606,12 @@ class _GeneratorPartDetailsScreenState extends State<GeneratorPartDetailsScreen>
color:
AppColors
.
text_field_color
,
borderRadius:
BorderRadius
.
circular
(
20
),
border:
descriptionFocusNode
.
hasFocus
?
Border
.
all
(
color:
AppColors
.
app_blue
,
width:
0.5
,
)
:
null
,
descriptionFocusNode
.
hasFocus
?
Border
.
all
(
color:
AppColors
.
app_blue
,
width:
0.5
,
)
:
null
,
),
// alignment: Alignment.center,
margin:
EdgeInsets
.
only
(
left:
5.0
,
right:
5.0
),
...
...
@@ -349,7 +629,9 @@ class _GeneratorPartDetailsScreenState extends State<GeneratorPartDetailsScreen>
focusNode:
descriptionFocusNode
,
style:
TextStyle
(
fontSize:
14
),
onChanged:
(
value
)
{
provider
.
updateQuantity
(
descriptioncontroller
.
text
);
provider
.
updateQuantity
(
descriptioncontroller
.
text
,
);
},
onTapOutside:
(
event
)
{
// Handle onTapOutside
...
...
@@ -358,7 +640,7 @@ class _GeneratorPartDetailsScreenState extends State<GeneratorPartDetailsScreen>
decoration:
InputDecoration
(
isDense:
true
,
hintStyle:
TextStyle
(
fontWeight:
FontWeight
.
w400
,
color:
Color
(
0xFF818181
)
,
fontSize:
14
,
),
//contentPadding: EdgeInsets.fromLTRB(5.0, 10.0, 5.0, 10.0),
...
...
@@ -370,16 +652,52 @@ class _GeneratorPartDetailsScreenState extends State<GeneratorPartDetailsScreen>
),
),
InkWell
(
onTap:
()
{
print
(
provider
.
isButtonEnabled
);
if
(
type
==
"Recieve"
){
provider
.
issuetype
=
"Recieved"
;
}
else
{
provider
.
issuetype
=
"Issued"
;
}
onTap:
provider
.
isButtonEnabled
?
()
{
print
(
provider
.
isButtonEnabled
);
if
(
type
==
"Recieve"
)
{
provider
.
issuetype
=
"Recieved"
;
}
else
{
provider
.
issuetype
=
"Issued"
;
}
provider
.
StockRecieveIssueAPI
(
homeProvider
,
context
,
quantitycontroller
.
text
,
descriptioncontroller
.
text
,
provider
.
partID
,
provider
.
issuetype
);
},
provider
.
StockRecieveIssueAPI
(
homeProvider
,
context
,
quantitycontroller
.
text
,
descriptioncontroller
.
text
,
provider
.
partID
,
provider
.
issuetype
,
);
quantitycontroller
.
clear
();
descriptioncontroller
.
clear
();
}
:
()
{
if
(
quantitycontroller
.
text
.
isEmpty
)
{
toast
(
context
,
"Please Enter Quantity."
,
);
}
else
if
(
descriptioncontroller
.
text
.
isEmpty
)
{
toast
(
context
,
"Please Enter Description."
,
);
}
else
if
(
quantitycontroller
.
text
.
isEmpty
&&
descriptioncontroller
.
text
.
isEmpty
)
{
toast
(
context
,
"Quantity and Description are mandatory."
,
);
}
},
child:
Container
(
alignment:
Alignment
.
center
,
height:
45
,
...
...
@@ -390,8 +708,12 @@ class _GeneratorPartDetailsScreenState extends State<GeneratorPartDetailsScreen>
bottom:
5.0
,
),
decoration:
BoxDecoration
(
color:
provider
.
isButtonEnabled
?
AppColors
.
app_blue
:
AppColors
.
button_disabled
,
//1487C9
borderRadius:
BorderRadius
.
circular
(
30.0
),
color:
quantitycontroller
.
text
.
isEmpty
||
descriptioncontroller
.
text
.
isEmpty
?
AppColors
.
button_disabled
:
AppColors
.
app_blue
,
//1487C9
borderRadius:
BorderRadius
.
circular
(
12.0
),
),
child:
Center
(
child:
Text
(
...
...
lib/screens/inventory/InventoryScreen.dart
View file @
528df0d2
...
...
@@ -36,65 +36,72 @@ class _InventoryScreenState extends State<InventoryScreen> {
Widget
build
(
BuildContext
context
)
{
return
Consumer
<
InventoryProvider
>(
builder:
(
context
,
provider
,
child
)
{
return
Scaffold
(
backgroundColor:
AppColors
.
scaffold_bg_color
,
appBar:
appbar
(
context
,
"Gen Inventory"
),
body:
Container
(
decoration:
BoxDecoration
(
color:
Colors
.
black
),
child:
Column
(
children:
[
Spacer
(),
Container
(
height:
250
,
return
WillPopScope
(
onWillPop:
()
=>
onBackPressed
(
context
),
child:
Scaffold
(
resizeToAvoidBottomInset:
true
,
backgroundColor:
AppColors
.
scaffold_bg_color
,
appBar:
appbar
(
context
,
"Gen Inventory"
),
body:
Container
(
decoration:
BoxDecoration
(
color:
Colors
.
black
),
child:
Column
(
children:
[
Spacer
(),
Container
(
height:
250
,
child:
QRView
(
child:
QRView
(
key:
provider
.
scannerKey
,
onQRViewCreated:
(
p0
)
{
provider
.
onQRViewCreated
(
p0
,
"inventory"
,
context
);
},
formatsAllowed:
[
BarcodeFormat
.
qrcode
],
cameraFacing:
CameraFacing
.
back
,
key:
provider
.
scannerKey
,
onQRViewCreated:
(
p0
)
{
provider
.
onQRViewCreated
(
p0
,
"inventory"
,
context
);
},
formatsAllowed:
[
BarcodeFormat
.
qrcode
],
cameraFacing:
CameraFacing
.
back
,
overlay:
QrScannerOverlayShape
(
overlay:
QrScannerOverlayShape
(
borderColor:
AppColors
.
app_blue
,
borderRadius:
20
,
borderLength:
60
,
borderWidth:
10
,
cutOutSize:
250.0
,
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 Inventory"
,
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 Part ID"
,
SizedBox
(
height:
25
),
Text
(
"Scan QR"
,
textAlign:
TextAlign
.
center
,
style:
TextStyle
(
fontSize:
18
,
fontFamily:
"JakartaMedium"
,
color:
Colors
.
white
),
),
Text
(
"to open Inventory"
,
textAlign:
TextAlign
.
center
,
style:
TextStyle
(
fontSize:
14
,
color:
Colors
.
white
),
),
),
SizedBox
(
height:
50
),
],
Spacer
(),
Text
(
"or"
,
textAlign:
TextAlign
.
center
,
style:
TextStyle
(
fontSize:
18
,
fontFamily:
"JakartaMedium"
,
color:
Colors
.
white
),
),
InkResponse
(
onTap:
()
async
{
_showPartIdBottomSheet
(
context
);
},
child:
Text
(
"Tap To Enter Part ID"
,
textAlign:
TextAlign
.
center
,
style:
TextStyle
(
fontSize:
17
,
fontFamily:
"JakartaMedium"
,
color:
AppColors
.
app_blue
),
),
),
SizedBox
(
height:
50
),
],
),
),
),
);
...
...
@@ -137,21 +144,24 @@ class _InventoryScreenState extends State<InventoryScreen> {
mainAxisSize:
MainAxisSize
.
min
,
children:
[
Container
(
padding:
EdgeInsets
.
symmetric
(
horizontal:
10
),
alignment:
Alignment
.
topLeft
,
child:
Text
(
"Part ID"
,
style:
TextStyle
(
color:
AppColors
.
semi_black
,
fontSize:
12
,
color:
Color
(
0xFF818181
),
fontFamily:
"JakartaMedium"
,
fontSize:
14
,
),
),
),
SizedBox
(
height:
5
,),
Container
(
height:
48
,
alignment:
Alignment
.
center
,
decoration:
BoxDecoration
(
color:
AppColors
.
text_field_color
,
borderRadius:
BorderRadius
.
circular
(
20
),
borderRadius:
BorderRadius
.
circular
(
14
),
border:
partIDfocusNode
.
hasFocus
?
Border
.
all
(
...
...
@@ -173,6 +183,8 @@ class _InventoryScreenState extends State<InventoryScreen> {
controller:
partIDcontroller
,
keyboardType:
TextInputType
.
emailAddress
,
focusNode:
partIDfocusNode
,
textCapitalization:
TextCapitalization
.
characters
,
style:
TextStyle
(
fontSize:
14
),
onChanged:
(
value
)
{},
onTapOutside:
(
event
)
{
...
...
@@ -182,7 +194,7 @@ class _InventoryScreenState extends State<InventoryScreen> {
decoration:
InputDecoration
(
isDense:
true
,
hintStyle:
TextStyle
(
fontWeight:
FontWeight
.
w400
,
color:
Color
(
0xFF818181
)
,
fontSize:
14
,
),
//contentPadding: EdgeInsets.fromLTRB(5.0, 10.0, 5.0, 10.0),
...
...
@@ -193,6 +205,7 @@ class _InventoryScreenState extends State<InventoryScreen> {
),
),
),
SizedBox
(
height:
15
,),
InkWell
(
onTap:
()
{
provider
.
LoadPartDetailsApifunction
(
...
...
@@ -201,6 +214,7 @@ class _InventoryScreenState extends State<InventoryScreen> {
"inventory"
,
partIDcontroller
.
text
,
);
partIDcontroller
.
clear
();
},
child:
Container
(
alignment:
Alignment
.
center
,
...
...
@@ -213,13 +227,15 @@ class _InventoryScreenState extends State<InventoryScreen> {
),
decoration:
BoxDecoration
(
color:
AppColors
.
app_blue
,
//1487C9
borderRadius:
BorderRadius
.
circular
(
30
.0
),
borderRadius:
BorderRadius
.
circular
(
15
.0
),
),
child:
Center
(
child:
Text
(
"Submit"
,
textAlign:
TextAlign
.
center
,
style:
TextStyle
(
color:
Colors
.
white
),
style:
TextStyle
(
color:
Colors
.
white
,
fontFamily:
"JakartaMedium"
,
fontSize:
15
),
),
),
),
...
...
lib/screens/serviceEngineer/AccountSuggestions.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/app_colors.dart'
;
import
'package:generp/Utils/commonWidgets.dart'
;
...
...
@@ -14,67 +15,96 @@ class Accountsuggestions extends StatefulWidget {
class
_AccountsuggestionsState
extends
State
<
Accountsuggestions
>
{
final
TextEditingController
_searchController
=
TextEditingController
();
FocusNode
searchFocusNode
=
FocusNode
();
@override
Widget
build
(
BuildContext
context
)
{
return
Consumer
<
Paymentcollectionprovider
>(
builder:
(
context
,
provider
,
child
)
{
return
Scaffold
(
appBar:
appbar
(
context
,
"Accounts"
),
backgroundColor:
AppColors
.
scaffold_bg_color
,
body:
Column
(
children:
[
const
SizedBox
(
height:
10
,
),
Container
(
alignment:
Alignment
.
center
,
height:
55
,
margin:
EdgeInsets
.
only
(
left:
15.0
,
right:
15.0
),
child:
TextField
(
controller:
_searchController
,
keyboardType:
TextInputType
.
text
,
onChanged:
(
value
)
{
if
(
value
.
length
>=
3
)
{
provider
.
AccountSuggestionAPI
(
context
,
value
);
}
},
decoration:
InputDecoration
(
hintText:
"Enter Account Name....."
,
hintStyle:
TextStyle
(
fontWeight:
FontWeight
.
w400
),
filled:
true
,
builder:
(
context
,
provider
,
child
)
{
return
WillPopScope
(
onWillPop:
()
=>
onBackPressed
(
context
),
child:
Scaffold
(
resizeToAvoidBottomInset:
true
,
appBar:
appbar
(
context
,
"Accounts"
),
backgroundColor:
AppColors
.
scaffold_bg_color
,
body:
Container
(
decoration:
BoxDecoration
(
color:
Colors
.
white
),
child:
Column
(
children:
[
const
SizedBox
(
height:
10
),
Container
(
alignment:
Alignment
.
topLeft
,
padding:
EdgeInsets
.
symmetric
(
horizontal:
10
),
child:
Text
(
"Search Account"
,
style:
TextStyle
(
color:
Color
(
0xFF2d2d2d
)),
),
),
SizedBox
(
height:
5
),
Container
(
height:
48
,
alignment:
Alignment
.
center
,
decoration:
BoxDecoration
(
color:
AppColors
.
text_field_color
,
borderRadius:
BorderRadius
.
circular
(
16
),
border:
searchFocusNode
.
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:
_searchController
,
keyboardType:
TextInputType
.
text
,
focusNode:
searchFocusNode
,
textCapitalization:
TextCapitalization
.
characters
,
style:
TextStyle
(
fontSize:
14
),
onChanged:
(
value
)
{
if
(
value
.
length
>=
3
)
{
provider
.
AccountSuggestionAPI
(
context
,
value
);
}
},
onTapOutside:
(
event
)
{
// Handle onTapOutside
FocusScope
.
of
(
context
).
unfocus
();
},
decoration:
InputDecoration
(
isDense:
true
,
hintStyle:
TextStyle
(
fontWeight:
FontWeight
.
w400
,
color:
Color
(
0xFF818181
),
fontSize:
14
,
),
//contentPadding: EdgeInsets.fromLTRB(5.0, 10.0, 5.0, 10.0),
enabledBorder:
InputBorder
.
none
,
focusedBorder:
InputBorder
.
none
,
hintText:
'Enter Account Name'
,
),
),
),
),
),
),
Container
(
margin:
EdgeInsets
.
only
(
top:
5.0
,
left:
25.0
),
alignment:
Alignment
.
topLeft
,
child:
Text
(
"Note: Enter Minimum 3 Characters"
,
style:
TextStyle
(
fontWeight:
FontWeight
.
w300
,
Container
(
margin:
EdgeInsets
.
only
(
top:
5.0
,
left:
25.0
),
alignment:
Alignment
.
topLeft
,
child:
Text
(
"Note: Enter Minimum 3 Characters"
,
style:
TextStyle
(
fontWeight:
FontWeight
.
w300
),
),
),
),
),
Expanded
(
child:
SingleChildScrollView
(
physics:
AlwaysScrollableScrollPhysics
(),
child:
Container
(
child:
Grid
View
.
builder
(
Expanded
(
child:
SingleChildScrollView
(
physics:
AlwaysScrollableScrollPhysics
(),
child:
Container
(
child:
List
View
.
builder
(
itemCount:
provider
.
accountList
!.
length
,
gridDelegate:
SliverGridDelegateWithFixedCrossAxisCount
(
crossAxisCount:
1
,
// 4 items in a row for tablet
crossAxisSpacing:
4
,
mainAxisSpacing:
2
,
childAspectRatio:
(
100
/
25
)),
padding:
const
EdgeInsets
.
all
(
5
),
physics:
const
Bouncing
ScrollPhysics
(),
physics:
const
NeverScrollable
ScrollPhysics
(),
shrinkWrap:
true
,
itemBuilder:
(
context
,
index
)
{
var
accountList
=
provider
.
accountList
;
...
...
@@ -83,72 +113,113 @@ class _AccountsuggestionsState extends State<Accountsuggestions> {
onTap:
()
{
// if(actname == "pendingComplaints"&&status=="Open"){
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
context
)
=>
Paymentdetails
(
accountName:
"Account"
,
name:
accountList
![
index
].
accountName
,
genId:
""
,
referenceID:
accountList
![
index
].
accountId
,
),
));
context
,
MaterialPageRoute
(
builder:
(
context
)
=>
Paymentdetails
(
accountName:
"Account"
,
name:
accountList
![
index
].
accountName
,
genId:
""
,
referenceID:
accountList
![
index
].
accountId
,
),
),
);
// }
},
child:
SizedBox
(
child:
Container
(
width:
MediaQuery
.
of
(
context
).
size
.
width
*
0.9
,
padding:
EdgeInsets
.
fromLTRB
(
0
,
5
,
0
,
5
),
child:
Text
(
"
${accountList![index].accountName}
"
,
textAlign:
TextAlign
.
start
,
maxLines:
3
,
overflow:
TextOverflow
.
ellipsis
,
style:
TextStyle
(
fontWeight:
FontWeight
.
w300
,
),
width:
MediaQuery
.
of
(
context
).
size
.
width
*
0.9
,
padding:
EdgeInsets
.
fromLTRB
(
0
,
5
,
0
,
10
),
child:
Row
(
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:
10
,),
Expanded
(
flex:
5
,
child:
Text
(
"
${accountList![index].accountName}
"
,
textAlign:
TextAlign
.
start
,
maxLines:
3
,
overflow:
TextOverflow
.
ellipsis
,
style:
TextStyle
(
color:
AppColors
.
semi_black
),
),
),
Expanded
(
flex:
1
,
child:
SvgPicture
.
asset
(
"assets/svg/arrow_right_new.svg"
,
),
),
],
),
),
),
);
}
else
{
return
Expanded
(
child:
SingleChildScrollView
(
physics:
AlwaysScrollableScrollPhysics
(),
child:
SingleChildScrollView
(
physics:
AlwaysScrollableScrollPhysics
(),
child:
Container
(
width:
double
.
infinity
,
height:
MediaQuery
.
of
(
context
).
size
.
height
,
// Set width to fill parent width
decoration:
BoxDecoration
(
borderRadius:
BorderRadius
.
only
(
topLeft:
Radius
.
circular
(
30.0
),
topRight:
Radius
.
circular
(
30.0
),
),
),
padding:
EdgeInsets
.
fromLTRB
(
10
,
10
,
10
,
10
),
child:
Container
(
width:
double
.
infinity
,
height:
MediaQuery
.
of
(
context
)
.
size
.
height
,
// Set width to fill parent width
decoration:
BoxDecoration
(
borderRadius:
BorderRadius
.
only
(
topLeft:
Radius
.
circular
(
30.0
),
topRight:
Radius
.
circular
(
30.0
),
child:
Align
(
alignment:
Alignment
.
center
,
child:
Text
(
"No Data Available"
,
style:
TextStyle
(
fontWeight:
FontWeight
.
bold
,
overflow:
TextOverflow
.
ellipsis
,
),
),
padding:
EdgeInsets
.
fromLTRB
(
10
,
10
,
10
,
10
),
child:
Container
(
child:
Align
(
alignment:
Alignment
.
center
,
child:
Text
(
"No Data Available"
,
style:
TextStyle
(
fontWeight:
FontWeight
.
bold
,
overflow:
TextOverflow
.
ellipsis
,
),
)),
)),
));
),
),
),
),
);
}
}),
},
),
),
),
))
],
),
],
),
),
),
);
}
}
,
);
}
}
lib/screens/serviceEngineer/ComplaintDetailsScreen.dart
0 → 100644
View file @
528df0d2
import
'package:flutter/material.dart'
;
class
Complaintdetailsscreen
extends
StatefulWidget
{
const
Complaintdetailsscreen
({
super
.
key
});
@override
State
<
Complaintdetailsscreen
>
createState
()
=>
_ComplaintdetailsscreenState
();
}
class
_ComplaintdetailsscreenState
extends
State
<
Complaintdetailsscreen
>
{
@override
Widget
build
(
BuildContext
context
)
{
return
const
Placeholder
();
}
}
lib/screens/serviceEngineer/Followupdetails.dart
View file @
528df0d2
...
...
@@ -34,92 +34,96 @@ class _FollowupdetailsState extends State<Followupdetails> {
return
Consumer
<
Visitdetailsprovider
>(
builder:
(
context
,
provider
,
child
)
{
var
followups
=
provider
.
followUpList
;
return
Scaffold
(
appBar:
appbar
(
context
,
"Follow Up Details"
),
backgroundColor:
AppColors
.
scaffold_bg_color
,
body:
Container
(
child:
ListView
.
builder
(
itemCount:
provider
.
followUpList
.
length
,
itemBuilder:
(
context
,
index
)
{
return
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
=
[
"Name"
,
"Date"
,
"Type"
,
"Time"
,
"Feedback"
,
];
final
textSubheads
=
[
"
${followups[index].ename}
"
,
"
${followups[index].date}
"
,
"
${followups[index].type}
"
,
"
${followups[index].time}
"
,
"
${followups[index].feedback}
"
,
];
return
Container
(
padding:
EdgeInsets
.
symmetric
(
vertical:
3
),
child:
Container
(
padding:
EdgeInsets
.
symmetric
(
vertical:
3
,
horizontal:
0
,
),
child:
Column
(
children:
[
Row
(
mainAxisAlignment:
MainAxisAlignment
.
spaceBetween
,
children:
[
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
),
return
WillPopScope
(
onWillPop:
()
=>
onBackPressed
(
context
),
child:
Scaffold
(
resizeToAvoidBottomInset:
true
,
appBar:
appbar
(
context
,
"Follow Up Details"
),
backgroundColor:
AppColors
.
scaffold_bg_color
,
body:
Container
(
child:
ListView
.
builder
(
itemCount:
provider
.
followUpList
.
length
,
itemBuilder:
(
context
,
index
)
{
return
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
=
[
"Name"
,
"Date"
,
"Type"
,
"Time"
,
"Feedback"
,
];
final
textSubheads
=
[
"
${followups[index].ename}
"
,
"
${followups[index].date}
"
,
"
${followups[index].type}
"
,
"
${followups[index].time}
"
,
"
${followups[index].feedback}
"
,
];
return
Container
(
padding:
EdgeInsets
.
symmetric
(
vertical:
3
),
child:
Container
(
padding:
EdgeInsets
.
symmetric
(
vertical:
3
,
horizontal:
0
,
),
child:
Column
(
children:
[
Row
(
mainAxisAlignment:
MainAxisAlignment
.
spaceBetween
,
children:
[
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
),
),
),
),
)
,
]
,
)
,
]
,
)
,
]
,
]
,
)
,
]
,
)
,
]
,
)
,
),
)
,
);
}
),
)
,
]
,
)
,
]
,
)
,
);
}
,
)
;
}),
),
]
,
)
,
]
,
)
,
)
;
},
)
,
),
),
);
...
...
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