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
Show whitespace changes
Inline
Side-by-side
lib/Utils/commonWidgets.dart
View file @
528df0d2
...
...
@@ -15,14 +15,18 @@ PreferredSizeWidget appbar(BuildContext context, title) {
onTap:
()
=>
Navigator
.
pop
(
context
,
true
),
child:
SvgPicture
.
asset
(
"assets/svg/app_bar_back.svg"
,
height:
25
),
),
Text
(
InkResponse
(
onTap:
()
=>
Navigator
.
pop
(
context
,
true
),
child:
Text
(
title
,
style:
TextStyle
(
fontSize:
16
,
height:
1.1
,
fontFamily:
"JakartaSemiBold"
,
color:
AppColors
.
semi_black
,
),
),
),
],
),
),
...
...
@@ -47,14 +51,18 @@ PreferredSizeWidget appbar2(BuildContext context, title,widget) {
onTap:
()
=>
Navigator
.
pop
(
context
,
true
),
child:
SvgPicture
.
asset
(
"assets/svg/app_bar_back.svg"
,
height:
25
),
),
Text
(
InkResponse
(
onTap:
()
=>
Navigator
.
pop
(
context
,
true
),
child:
Text
(
title
,
style:
TextStyle
(
fontSize:
16
,
height:
1.1
,
fontFamily:
"JakartaSemiBold"
,
color:
AppColors
.
semi_black
,
),
),
),
Spacer
(),
widget
],
...
...
@@ -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,9 +97,13 @@ 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:
WillPopScope
(
onWillPop:
()
=>
onBackPressed
(
context
),
child:
Scaffold
(
resizeToAvoidBottomInset:
true
,
backgroundColor:
AppColors
.
scaffold_bg_color
,
appBar:
appbar
(
context
,
"Attendance"
),
body:
Container
(
...
...
@@ -118,7 +122,7 @@ class _AttendanceScreenState extends State<AttendanceScreen> {
children:
[
Container
(
padding:
EdgeInsets
.
only
(
left:
1
0
,
left:
1
5
,
right:
10
,
top:
15
,
),
...
...
@@ -157,13 +161,17 @@ class _AttendanceScreenState extends State<AttendanceScreen> {
text:
formattedTime
,
style:
TextStyle
(
color:
Color
(
0xFFED3424
),
fontSize:
18
,
fontFamily:
"JakartaRegular"
,
fontSize:
30
,
),
),
TextSpan
(
text:
period
,
style:
TextStyle
(
color:
Color
(
0xFFED3424
),
fontFamily:
"JakartaRegular"
,
),
),
],
...
...
@@ -171,6 +179,9 @@ class _AttendanceScreenState extends State<AttendanceScreen> {
),
Text
(
"
${attendance.attendanceHistory.firstOrNull?['check_in_location']}
"
,
style:
TextStyle
(
color:
Color
(
0xFF818181
),
),
),
],
),
...
...
@@ -201,13 +212,17 @@ class _AttendanceScreenState extends State<AttendanceScreen> {
text:
formattedTime2
,
style:
TextStyle
(
color:
Color
(
0xFFED3424
),
fontSize:
18
,
fontFamily:
"JakartaRegular"
,
fontSize:
30
,
),
),
TextSpan
(
text:
period2
,
style:
TextStyle
(
color:
Color
(
0xFFED3424
),
fontFamily:
"JakartaRegular"
,
),
),
],
...
...
@@ -215,6 +230,9 @@ class _AttendanceScreenState extends State<AttendanceScreen> {
),
Text
(
"
${attendance.attendanceHistory.firstOrNull?['check_out_location']}
"
,
style:
TextStyle
(
color:
Color
(
0xFF818181
),
),
),
],
),
...
...
@@ -226,12 +244,25 @@ class _AttendanceScreenState extends State<AttendanceScreen> {
],
),
),
Text
(
Container
(
padding:
EdgeInsets
.
symmetric
(
horizontal:
10
,
vertical:
10
,
),
child:
Text
(
"Attendance Details"
,
style:
TextStyle
(
color:
Color
(
0xFF818181
)),
style:
TextStyle
(
fontFamily:
"JakartaSemiBold"
,
fontSize:
14
,
color:
Color
(
0xFF818181
),
),
),
),
Container
(
padding:
EdgeInsets
.
symmetric
(
horizontal:
10
,
vertical:
10
),
padding:
EdgeInsets
.
symmetric
(
horizontal:
10
,
vertical:
10
,
),
decoration:
BoxDecoration
(
color:
Colors
.
white
,
borderRadius:
BorderRadius
.
circular
(
16
),
...
...
@@ -240,7 +271,8 @@ class _AttendanceScreenState extends State<AttendanceScreen> {
itemCount:
4
,
shrinkWrap:
true
,
physics:
NeverScrollableScrollPhysics
(),
gridDelegate:
SliverGridDelegateWithFixedCrossAxisCount
(
gridDelegate:
SliverGridDelegateWithFixedCrossAxisCount
(
crossAxisCount:
2
,
crossAxisSpacing:
10
,
mainAxisSpacing:
10
,
...
...
@@ -285,6 +317,7 @@ class _AttendanceScreenState extends State<AttendanceScreen> {
numbers
[
index
].
toString
(),
style:
TextStyle
(
fontSize:
30
,
fontFamily:
"JakartaMedium"
,
color:
Color
(
textcolors
[
index
]),
),
),
...
...
@@ -302,7 +335,10 @@ class _AttendanceScreenState extends State<AttendanceScreen> {
///calendar
Container
(
// padding: EdgeInsets.symmetric(horizontal: 10,vertical: 5),
margin:
EdgeInsets
.
symmetric
(
horizontal:
10
,
vertical:
5
),
margin:
EdgeInsets
.
symmetric
(
horizontal:
10
,
vertical:
5
,
),
decoration:
BoxDecoration
(
borderRadius:
BorderRadius
.
circular
(
16
),
color:
Colors
.
white
,
...
...
@@ -313,7 +349,8 @@ class _AttendanceScreenState extends State<AttendanceScreen> {
padding:
const
EdgeInsets
.
fromLTRB
(
30
,
10
,
30
,
0
),
child:
Container
(
child:
Row
(
mainAxisAlignment:
MainAxisAlignment
.
spaceBetween
,
mainAxisAlignment:
MainAxisAlignment
.
spaceBetween
,
children:
[
SizedBox
(
child:
Row
(
...
...
@@ -325,18 +362,16 @@ class _AttendanceScreenState extends State<AttendanceScreen> {
context
,
);
},
child:
Icon
(
Icons
.
arrow_back_ios
,
color:
AppColors
.
semi_black
,
size:
20.0
,
child:
SvgPicture
.
asset
(
"assets/svg/arrow_left.svg"
,
),
),
Text
(
monthLabel
,
style:
TextStyle
(
fontWeight:
FontWeight
.
w500
,
overflow:
TextOverflow
.
ellipsis
,
color:
Colors
.
black
,
fontFamily:
"JakartaMedium"
,
color:
Color
(
0xFF2D2D2D
),
),
),
GestureDetector
(
...
...
@@ -346,10 +381,8 @@ class _AttendanceScreenState extends State<AttendanceScreen> {
context
,
);
},
child:
Icon
(
Icons
.
arrow_forward_ios
,
color:
AppColors
.
semi_black
,
size:
20.0
,
child:
SvgPicture
.
asset
(
"assets/svg/arrow_right_new.svg"
,
),
),
],
...
...
@@ -374,7 +407,7 @@ class _AttendanceScreenState extends State<AttendanceScreen> {
),
),
),
SizedBox
(
height:
5
,
),
SizedBox
(
height:
5
),
Padding
(
padding:
const
EdgeInsets
.
fromLTRB
(
8
,
10
,
8
,
0
),
child:
Container
(
...
...
@@ -396,7 +429,15 @@ class _AttendanceScreenState extends State<AttendanceScreen> {
)
Expanded
(
child:
Text
(
[
'S'
,
'M'
,
'T'
,
'W'
,
'T'
,
'F'
,
'S'
][
i
],
[
'S'
,
'M'
,
'T'
,
'W'
,
'T'
,
'F'
,
'S'
,
][
i
],
textAlign:
TextAlign
.
center
,
style:
TextStyle
(
overflow:
TextOverflow
.
ellipsis
,
...
...
@@ -424,7 +465,12 @@ class _AttendanceScreenState extends State<AttendanceScreen> {
mainAxisSpacing:
1
,
childAspectRatio:
(
255
/
245
),
),
padding:
const
EdgeInsets
.
fromLTRB
(
0
,
0
,
0
,
0
),
padding:
const
EdgeInsets
.
fromLTRB
(
0
,
0
,
0
,
0
,
),
shrinkWrap:
true
,
physics:
NeverScrollableScrollPhysics
(),
itemBuilder:
(
context
,
index
)
{
...
...
@@ -493,38 +539,48 @@ class _AttendanceScreenState extends State<AttendanceScreen> {
}
attendance
.
selectedDate
=
currentDay
.
toString
();
_showAttDetailsBottomSheet
(
context
);
_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
,
),
),
],
),
// 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:
(
isCurrentDay
||
(
selectedIndex
==
index
))
?
Color
(
0xFF1487C9
)
:
Colors
.
transparent
,
),
color:
isFutureDate
?
Colors
.
transparent
:
(
isCurrentDay
||
(
selectedIndex
==
index
))
?
Color
(
0xFFF
6F0
FF
)
?
Color
(
0xFFF
FFF
FF
)
:
dateColor
==
'g'
?
Color
(
0xFFE8FFE6
)
:
dateColor
==
'r'
...
...
@@ -532,7 +588,7 @@ class _AttendanceScreenState extends State<AttendanceScreen> {
:
dateColor
==
'b'
?
Color
(
0xFFFFE8D0
)
:
dateColor
==
'br'
?
Color
s
.
brown
?
Color
(
0xFFFFE8D0
)
:
dateColor
==
'y'
?
Color
(
0xFFFFF9B2
)
:
Colors
.
transparent
,
...
...
@@ -542,25 +598,41 @@ class _AttendanceScreenState extends State<AttendanceScreen> {
currentDay
.
toString
(),
style:
TextStyle
(
fontSize:
14
,
fontWeight:
FontWeight
.
w400
,
fontWeight:
FontWeight
.
w400
,
color:
isFutureDate
?
AppColors
.
semi_black
?
AppColors
.
semi_black
:
(
isCurrentDay
||
(
selectedIndex
==
index
))
?
Color
(
0xFF493272
)
?
Color
(
0xFF2D2D2D
,
)
:
dateColor
==
'g'
?
Color
(
0xFF6B3A02
)
?
Color
(
0xFF6B3A02
,
)
:
dateColor
==
'r'
?
Color
(
0xFFFF0000
)
?
Color
(
0xFFFF0000
,
)
:
dateColor
==
'b'
?
Color
(
0xFF493272
)
:
dateColor
==
'br'
?
Colors
.
brown
?
Color
(
0xFF493272
,
)
:
dateColor
==
'br'
?
Color
(
0xFF6B3A02
,
)
:
dateColor
==
'y'
?
Color
(
0xFF605C00
)
:
Colors
.
transparent
,
?
Color
(
0xFF605C00
,
)
:
Colors
.
transparent
,
),
),
),
...
...
@@ -582,7 +654,10 @@ class _AttendanceScreenState extends State<AttendanceScreen> {
),
),
),
floatingActionButton:
attendance
.
attendanceStatus
==
0
||
attendance
.
attendanceStatus
==
1
?
Align
(
floatingActionButton:
attendance
.
attendanceStatus
==
0
||
attendance
.
attendanceStatus
==
1
?
Align
(
alignment:
Alignment
.
bottomCenter
,
child:
InkWell
(
onTap:
()
async
{
...
...
@@ -591,12 +666,21 @@ class _AttendanceScreenState extends State<AttendanceScreen> {
MaterialPageRoute
(
builder:
(
context
)
=>
CheckInOutScreen
(
getAttendanceStatus:
attendance
.
attendanceStatus
,
getAttendanceStatus:
attendance
.
attendanceStatus
,
),
),
);
if
(
res
==
true
){
attendance
.
getAttendanceList
(
homeProvider
,
context
);
if
(
res
==
true
)
{
attendance
.
getAttendanceList
(
homeProvider
,
context
,
);
attendance
.
init
(
homeProvider
,
context
);
attendance
.
loadAttendanceDetails
(
homeProvider
,
context
,
);
}
var
f
=
FocusScope
.
of
(
context
);
...
...
@@ -611,21 +695,29 @@ class _AttendanceScreenState extends State<AttendanceScreen> {
width:
MediaQuery
.
of
(
context
).
size
.
width
,
decoration:
BoxDecoration
(
color:
AppColors
.
app_blue
,
borderRadius:
BorderRadius
.
circular
(
30
.0
),
borderRadius:
BorderRadius
.
circular
(
15
.0
),
),
child:
Center
(
child:
Text
(
attendance
.
attendanceStatus
==
0
?
"Check In"
:
"Check Out"
,
attendance
.
attendanceStatus
==
0
?
"Check In"
:
"Check Out"
,
textAlign:
TextAlign
.
center
,
style:
TextStyle
(
color:
Colors
.
white
),
style:
TextStyle
(
fontSize:
16
,
color:
Colors
.
white
,
fontFamily:
"JakartaMedium"
,
),
),
),
),
),
):
SizedBox
(
height:
0
,),
)
:
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
(
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:
ClipRRect
(
borderRadius:
BorderRadius
.
only
(
topLeft:
Radius
.
circular
(
30.0
),
topRight:
Radius
.
circular
(
30.0
),
),
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,16 +99,30 @@ class _CheckInOutScreenState extends State<CheckInOutScreen> {
CrossAxisAlignment
.
start
,
children:
[
SizedBox
(
height:
25
),
Padding
(
padding:
const
EdgeInsets
.
symmetric
(
horizontal:
20.0
),
child:
Text
(
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
(
fontWeight:
FontWeight
.
w400
,
color:
Colors
.
grey
,
fontFamily:
"JakartaMedium"
,
color:
App
Colors
.
semi_black
,
),
),
],
),
),
SizedBox
(
height:
5
),
Padding
(
...
...
@@ -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,11 +236,11 @@ 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,14 +44,15 @@ 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
(
builder:
(
context
)
=>
AlertDialog
(
title:
const
Text
(
'Are you sure?'
),
content:
const
Text
(
'Do you want to exit the App'
),
actions:
[
...
...
@@ -61,9 +64,7 @@ class _MyHomePageState extends State<MyHomePage> {
onPressed:
()
=>
Navigator
.
of
(
context
).
pop
(
false
),
child:
Text
(
"NO"
,
style:
TextStyle
(
fontWeight:
FontWeight
.
w500
,
),
style:
TextStyle
(
fontWeight:
FontWeight
.
w500
),
),
),
const
SizedBox
(
height:
16
),
...
...
@@ -72,13 +73,13 @@ class _MyHomePageState extends State<MyHomePage> {
backgroundColor:
MaterialStateProperty
.
all
(
Colors
.
white
),
overlayColor:
MaterialStateProperty
.
all
(
Colors
.
white70
),
),
onPressed:
()
=>
SystemChannels
.
platform
.
invokeMethod
(
'SystemNavigator.pop'
),
onPressed:
()
=>
SystemChannels
.
platform
.
invokeMethod
(
'SystemNavigator.pop'
,
),
child:
Text
(
"YES"
,
style:
TextStyle
(
fontWeight:
FontWeight
.
w500
,
),
style:
TextStyle
(
fontWeight:
FontWeight
.
w500
),
),
),
],
...
...
@@ -89,10 +90,59 @@ class _MyHomePageState extends State<MyHomePage> {
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
(
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
(
bool
isGpsEnabled
=
await
Geolocator
.
isLocationServiceEnabled
();
if
(
isGpsEnabled
)
{
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()));
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,13 +108,56 @@ 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
(
return
WillPopScope
(
onWillPop:
onBackPressed
,
child:
Scaffold
(
resizeToAvoidBottomInset:
true
,
backgroundColor:
AppColors
.
scaffold_bg_color
,
body:
KeyboardVisibilityProvider
(
controller:
_keyboardVisibilityController
,
...
...
@@ -127,7 +170,7 @@ class _LoginScreenState extends State<LoginScreen>
itemBuilder:
(
context
,
index
)
{
int
logoIndex
=
index
%
logos
.
length
;
return
Padding
(
padding:
const
EdgeInsets
.
all
(
5
.0
),
padding:
const
EdgeInsets
.
all
(
3
.0
),
child:
CustomGridRow
(
logos:
logos
,
logoIndex:
logoIndex
),
);
},
...
...
@@ -194,14 +237,7 @@ class _LoginScreenState extends State<LoginScreen>
const
SizedBox
(
width:
10
),
Expanded
(
flex:
3
,
child:
Text
(
"GEN ERP"
,
style:
TextStyle
(
fontFamily:
'LexendSemiBold'
,
color:
AppColors
.
ERP_text_color
,
fontSize:
25
,
),
),
child:
Image
.
asset
(
"assets/images/gen_logo_grad.png"
),
),
Expanded
(
flex:
1
,
...
...
@@ -218,31 +254,28 @@ class _LoginScreenState extends State<LoginScreen>
"assets/images/gen_logo.png"
,
),
),
Text
(
"GEN ERP"
,
style:
TextStyle
(
fontFamily:
'LexendSemiBold'
,
color:
AppColors
.
ERP_text_color
,
fontSize:
25
,
),
),
Image
.
asset
(
"assets/images/gen_logo_grad.png"
,
width:
150
,),
],
),
),
SizedBox
(
height:
10
,),
Text
(
"Login to enter"
,
style:
TextStyle
(
fontSize:
14
,
fontFamily:
"JakartaMedium"
,
color:
AppColors
.
app_blue
,
),
),
Container
(
padding:
EdgeInsets
.
only
(
left:
10
,
bottom:
5
),
alignment:
Alignment
.
topLeft
,
child:
Text
(
"Enter
Email"
,
"
Email
ID
"
,
style:
TextStyle
(
color:
AppColors
.
semi_black
,
fontSize:
12
,
fontFamily:
"JakartaMedium"
,
fontSize:
14
,
),
),
),
...
...
@@ -251,7 +284,7 @@ class _LoginScreenState extends State<LoginScreen>
alignment:
Alignment
.
center
,
decoration:
BoxDecoration
(
color:
AppColors
.
text_field_color
,
borderRadius:
BorderRadius
.
circular
(
20
),
borderRadius:
BorderRadius
.
circular
(
14
),
border:
_emailFocusNode
.
hasFocus
?
Border
.
all
(
color:
AppColors
.
app_blue
,
width:
0.5
):
null
),
// alignment: Alignment.center,
...
...
@@ -281,12 +314,13 @@ class _LoginScreenState extends State<LoginScreen>
isDense:
true
,
hintStyle:
TextStyle
(
fontWeight:
FontWeight
.
w400
,
fontSize:
14
fontSize:
14
,
color:
Color
(
0xFF818181
)
),
//contentPadding: EdgeInsets.fromLTRB(5.0, 10.0, 5.0, 10.0),
enabledBorder:
InputBorder
.
none
,
focusedBorder:
InputBorder
.
none
,
hintText:
'Enter Email'
,
hintText:
'Enter
Your
Email'
,
),
),
),
...
...
@@ -306,15 +340,17 @@ class _LoginScreenState extends State<LoginScreen>
),
),
]
else
...[
SizedBox
(
height:
1
5
.0
),
SizedBox
(
height:
1
0
.0
),
],
Container
(
padding:
EdgeInsets
.
only
(
left:
10
,
bottom:
5
),
alignment:
Alignment
.
topLeft
,
child:
Text
(
"Enter
Password"
,
"
Password"
,
style:
TextStyle
(
color:
AppColors
.
semi_black
,
fontSize:
12
,
fontFamily:
"JakartaMedium"
,
fontSize:
14
,
),
),
),
...
...
@@ -323,7 +359,7 @@ class _LoginScreenState extends State<LoginScreen>
alignment:
Alignment
.
center
,
decoration:
BoxDecoration
(
color:
AppColors
.
text_field_color
,
borderRadius:
BorderRadius
.
circular
(
20
),
borderRadius:
BorderRadius
.
circular
(
14
),
border:
_passwordFocusNode
.
hasFocus
?
Border
.
all
(
color:
AppColors
.
app_blue
,
width:
0.5
):
null
),
// alignment: Alignment.center,
...
...
@@ -341,7 +377,7 @@ class _LoginScreenState extends State<LoginScreen>
obscureText:
!
loginProv
.
pwdVisible
,
keyboardType:
TextInputType
.
visiblePassword
,
style:
TextStyle
(
fontSize:
14
fontSize:
14
,
),
onChanged:
(
value
)
{
loginProv
.
updatePassword
(
password
.
text
);
...
...
@@ -371,6 +407,7 @@ class _LoginScreenState extends State<LoginScreen>
),
hintStyle:
TextStyle
(
fontSize:
14
,
color:
Color
(
0xFF818181
),
fontWeight:
FontWeight
.
w400
,
),
isDense:
true
,
...
...
@@ -419,13 +456,14 @@ class _LoginScreenState extends State<LoginScreen>
),
decoration:
BoxDecoration
(
color:
loginProv
.
isButtonEnabled
?
AppColors
.
app_blue
:
AppColors
.
button_disabled
,
//1487C9
borderRadius:
BorderRadius
.
circular
(
30
.0
),
borderRadius:
BorderRadius
.
circular
(
15
.0
),
),
child:
Center
(
child:
Text
(
"Login"
,
textAlign:
TextAlign
.
center
,
style:
TextStyle
(
color:
Colors
.
white
),
style:
TextStyle
(
color:
Colors
.
white
,
fontFamily:
"JakartaRegular"
,),
),
),
),
...
...
@@ -479,6 +517,7 @@ class _LoginScreenState extends State<LoginScreen>
Text
(
"Device ID"
,
style:
TextStyle
(
fontSize:
16
,
fontFamily:
"JakartaMedium"
,
color:
AppColors
.
app_blue
),),
SizedBox
(
height:
15
,),
...
...
@@ -574,6 +613,7 @@ 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,7 +18,10 @@ class _ScannerloginState extends State<Scannerlogin> {
Widget
build
(
BuildContext
context
)
{
return
Consumer
<
Scanloginprovider
>(
builder:
(
context
,
provider
,
child
)
{
return
Scaffold
(
return
WillPopScope
(
onWillPop:
()
=>
onBackPressed
(
context
),
child:
Scaffold
(
resizeToAvoidBottomInset:
true
,
backgroundColor:
AppColors
.
scaffold_bg_color
,
appBar:
appbar
(
context
,
"QR Login"
),
body:
Container
(
...
...
@@ -65,6 +68,7 @@ class _ScannerloginState extends State<Scannerlogin> {
],
),
),
),
);
},
);
...
...
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,7 +11,10 @@ class UpdatePassword extends StatelessWidget {
Widget
build
(
BuildContext
context
)
{
final
provider
=
Provider
.
of
<
UpdatePasswordProvider
>(
context
);
return
Scaffold
(
return
WillPopScope
(
onWillPop:
()
=>
onBackPressed
(
context
),
child:
Scaffold
(
resizeToAvoidBottomInset:
true
,
appBar:
appbar
(
context
,
"Update Password"
),
backgroundColor:
AppColors
.
scaffold_bg_color
,
body:
Container
(
...
...
@@ -37,21 +40,33 @@ class UpdatePassword extends StatelessWidget {
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
(),
provider
.
isLoading
?
CircularProgressIndicator
()
:
InkWell
(
InkWell
(
onTap:
()
=>
provider
.
updatePassword
(
context
),
child:
Container
(
alignment:
Alignment
.
center
,
...
...
@@ -59,9 +74,14 @@ class UpdatePassword extends StatelessWidget {
margin:
EdgeInsets
.
symmetric
(
horizontal:
15
),
decoration:
BoxDecoration
(
color:
AppColors
.
app_blue
,
borderRadius:
BorderRadius
.
circular
(
30
.0
),
borderRadius:
BorderRadius
.
circular
(
15
.0
),
),
child:
Text
(
child:
provider
.
isLoading
?
CircularProgressIndicator
(
color:
Colors
.
white
,
)
:
Text
(
"Update"
,
style:
TextStyle
(
color:
Colors
.
white
),
),
...
...
@@ -78,6 +98,7 @@ class UpdatePassword extends StatelessWidget {
],
),
),
),
);
}
...
...
@@ -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,13 +34,18 @@ class _ComplainthistoryState extends State<Complainthistory> {
return
Consumer
<
Generatordetailsprovider
>(
builder:
(
context
,
provider
,
child
)
{
return
Scaffold
(
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
(
children:
[
if
(
provider
.
complaintList
.
isNotEmpty
)...[
ListView
.
builder
(
shrinkWrap:
true
,
physics:
NeverScrollableScrollPhysics
(),
...
...
@@ -118,12 +123,15 @@ class _ComplainthistoryState extends State<Complainthistory> {
],
);
},),
]
else
...[
Emptywidget
(
context
)
]
],
),
),
),
),
);
},
);
...
...
lib/screens/genTracker/GenTrackerDashboard.dart
View file @
528df0d2
...
...
@@ -18,7 +18,10 @@ class Gentrackerdashboard extends StatefulWidget {
class
_GentrackerdashboardState
extends
State
<
Gentrackerdashboard
>
{
@override
Widget
build
(
BuildContext
context
)
{
return
Scaffold
(
return
WillPopScope
(
onWillPop:
()
=>
onBackPressed
(
context
),
child:
Scaffold
(
resizeToAvoidBottomInset:
true
,
backgroundColor:
AppColors
.
scaffold_bg_color
,
appBar:
appbar
(
context
,
"Gen Tracker"
),
body:
GridView
.
builder
(
...
...
@@ -37,6 +40,12 @@ class _GentrackerdashboardState extends State<Gentrackerdashboard> {
"Tag Generator"
,
];
final
icons
=
[
"gent_gen_det"
,
"gent_reg_comp"
,
"gent_tag_loc"
,
"gent_tag_den"
,
];
return
InkResponse
(
onTap:
()
{
switch
(
names
[
index
])
{
...
...
@@ -68,8 +77,9 @@ class _GentrackerdashboardState extends State<Gentrackerdashboard> {
mainAxisAlignment:
MainAxisAlignment
.
center
,
children:
[
SvgPicture
.
asset
(
"assets/svg/
home_
icons
_
${
index
+ 1
}
.svg"
,
"assets/svg/
${
icons
[
index
]
}
.svg"
,
),
SizedBox
(
height:
10
,),
Text
(
names
[
index
]),
],
),
...
...
@@ -77,6 +87,7 @@ class _GentrackerdashboardState extends State<Gentrackerdashboard> {
);
},
),
),
);
}
}
lib/screens/genTracker/GeneratorDetails.dart
View file @
528df0d2
...
...
@@ -53,7 +53,7 @@ class _GeneratordetailsState extends State<Generatordetails> {
homeProvider
,
context
,
""
,
details
.
genID
,
widget
.
generatorId
,
);
}
});
...
...
@@ -89,7 +89,10 @@ class _GeneratordetailsState extends State<Generatordetails> {
child:
Icon
(
Icons
.
directions
),
),
);
return
Scaffold
(
return
WillPopScope
(
onWillPop:
()
=>
onBackPressed
(
context
),
child:
Scaffold
(
resizeToAvoidBottomInset:
true
,
appBar:
widget
.
activityName
==
"NearByGenerators"
?
appbar2
(
context
,
"Generator Details"
,
sendwidget
)
...
...
@@ -100,52 +103,41 @@ class _GeneratordetailsState extends State<Generatordetails> {
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
[
Text
(
"Customer Details"
),
Container
(
padding:
EdgeInsets
.
symmetric
(
horizontal:
10
,
vertical:
5
),
child:
Text
(
"Customer Details"
,
style:
TextStyle
(
color:
Color
(
0xFF818181
),
fontFamily:
"JakartaMedium"
),
),
),
Container
(
margin:
EdgeInsets
.
symmetric
(
horizontal:
10
,
vertical:
5
),
padding:
EdgeInsets
.
symmetric
(
horizontal:
15
,
vertical:
10
),
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
=
[
"
${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
(
Container
(
padding:
EdgeInsets
.
symmetric
(
vertical:
3
,
horizontal:
0
,
),
child:
Column
(
children:
[
Row
(
child:
Row
(
mainAxisAlignment:
MainAxisAlignment
.
spaceBetween
,
children:
[
if
(
j
==
0
)
...[
SvgPicture
.
asset
(
"assets/svg/se_block_head.svg"
,
),
SizedBox
(
width:
5
),
],
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
...
...
@@ -156,8 +148,16 @@ class _GeneratordetailsState extends State<Generatordetails> {
context
,
).
size
.
width
*
0.75
,
child:
Text
(
textheads
[
j
].
toString
(),
maxLines:
2
,
overflow:
TextOverflow
.
ellipsis
,),
child:
Text
(
"
${provider.cname}
"
,
maxLines:
2
,
overflow:
TextOverflow
.
ellipsis
,
style:
TextStyle
(
fontFamily:
"JakartaMedium"
,
fontSize:
14
),
),
),
SizedBox
(
// height:45,
...
...
@@ -167,45 +167,108 @@ class _GeneratordetailsState extends State<Generatordetails> {
).
size
.
width
*
0.75
,
child:
Text
(
textSubheads
[
j
]
,
"
${provider.aname}
"
,
maxLines:
2
,
overflow:
TextOverflow
.
ellipsis
,
style:
TextStyle
(
color:
Color
(
0xFF818181
),
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
(
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
,
),
),
),
),
),
],
),
);
}),
),
],
),
),
Text
(
"Generator Details"
),
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
),
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
=
[
...
...
@@ -225,54 +288,44 @@ class _GeneratordetailsState extends State<Generatordetails> {
"
${provider.dateOfEngineSale}
"
,
];
return
Container
(
padding:
EdgeInsets
.
symmetric
(
vertical:
3
),
child:
Column
(
children:
[
Row
(
mainAxisAlignment:
MainAxisAlignment
.
spaceBetween
,
children:
[
Container
(
padding:
EdgeInsets
.
symmetric
(
vertical:
3
,
vertical:
6
,
horizontal:
0
,
),
child:
Column
(
child:
Row
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
[
Text
(
textheads
[
j
].
toString
()),
SizedBox
(
// height:45,
width:
MediaQuery
.
of
(
context
,
).
size
.
width
*
0.8
,
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
(
color:
Color
(
0xFF818181
),
),
fontSize:
14
,
color:
Color
(
0xFF818181
,
),
),
],
),
),
],
),
],
),
);
}),
),
],
),
],
),
),
SizedBox
(
height:
75
),
...
...
@@ -296,13 +349,16 @@ class _GeneratordetailsState extends State<Generatordetails> {
margin:
EdgeInsets
.
symmetric
(
horizontal:
10
),
decoration:
BoxDecoration
(
color:
AppColors
.
app_blue
,
borderRadius:
BorderRadius
.
circular
(
30
.0
),
borderRadius:
BorderRadius
.
circular
(
15
.0
),
),
child:
Center
(
child:
Text
(
"Complaint History"
,
textAlign:
TextAlign
.
center
,
style:
TextStyle
(
color:
Colors
.
white
),
style:
TextStyle
(
fontFamily:
"JakartaMedium"
,
fontSize:
15
,
color:
Colors
.
white
),
),
),
),
...
...
@@ -310,6 +366,7 @@ class _GeneratordetailsState extends State<Generatordetails> {
),
floatingActionButtonLocation:
FloatingActionButtonLocation
.
centerFloat
,
),
);
},
);
...
...
lib/screens/genTracker/RegisterComplaint.dart
View file @
528df0d2
...
...
@@ -24,7 +24,10 @@ class _RegistercomplaintState extends State<Registercomplaint> {
Widget
build
(
BuildContext
context
)
{
return
Consumer2
<
Generatordetailsprovider
,
HomescreenNotifier
>(
builder:
(
context
,
provider
,
homeProvider
,
child
)
{
return
Scaffold
(
return
WillPopScope
(
onWillPop:
()
=>
onBackPressed
(
context
),
child:
Scaffold
(
resizeToAvoidBottomInset:
true
,
backgroundColor:
AppColors
.
scaffold_bg_color
,
appBar:
appbar
(
context
,
"Register Complaint"
),
body:
Container
(
...
...
@@ -40,9 +43,14 @@ class _RegistercomplaintState extends State<Registercomplaint> {
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
[
SizedBox
(
height:
25
),
Text
(
Container
(
padding:
EdgeInsets
.
symmetric
(
horizontal:
10
),
child:
Text
(
"Customer Details"
,
style:
TextStyle
(
color:
Color
(
0xFF818181
)),
style:
TextStyle
(
fontFamily:
"JakartaMedium"
,
color:
Color
(
0xFF818181
)),
),
),
Container
(
padding:
EdgeInsets
.
fromLTRB
(
10
,
10
,
10
,
10
),
...
...
@@ -74,7 +82,9 @@ class _RegistercomplaintState extends State<Registercomplaint> {
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
[
Text
(
"
${provider.cname}
"
),
Text
(
"
${provider.cname}
"
,
style:
TextStyle
(
fontFamily:
"JakartaMedium"
),),
Text
(
"
${provider.aname}
"
,
maxLines:
2
,
...
...
@@ -111,7 +121,9 @@ class _RegistercomplaintState extends State<Registercomplaint> {
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
[
Text
(
textheads
[
j
].
toString
()),
Text
(
textheads
[
j
].
toString
(),
style:
TextStyle
(
fontFamily:
"JakartaMedium"
),),
],
),
),
...
...
@@ -144,9 +156,15 @@ class _RegistercomplaintState extends State<Registercomplaint> {
],
),
),
Text
(
"Complaint Details"
,
style:
TextStyle
(
color:
Color
(
0xFF818181
)
),),
Container
(
padding:
EdgeInsets
.
symmetric
(
horizontal:
10
),
child:
Text
(
"Complaint Details"
,
style:
TextStyle
(
fontFamily:
"JakartaMedium"
,
color:
Color
(
0xFF818181
)),
),
),
Container
(
padding:
EdgeInsets
.
fromLTRB
(
10
,
10
,
10
,
10
),
margin:
EdgeInsets
.
symmetric
(
...
...
@@ -158,7 +176,12 @@ class _RegistercomplaintState extends State<Registercomplaint> {
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
[
Text
(
"Complaint Type"
),
Padding
(
padding:
const
EdgeInsets
.
only
(
bottom:
5.0
),
child:
Text
(
"Complaint Type"
,
style:
TextStyle
(
fontFamily:
"JakartaMedium"
,
),),
),
DropdownButtonHideUnderline
(
child:
Row
(
children:
[
...
...
@@ -172,6 +195,7 @@ class _RegistercomplaintState extends State<Registercomplaint> {
'Select Complaint Type'
,
style:
TextStyle
(
fontSize:
14
,
),
overflow:
TextOverflow
.
ellipsis
,
),
...
...
@@ -267,7 +291,12 @@ class _RegistercomplaintState extends State<Registercomplaint> {
),
),
SizedBox
(
height:
10.0
),
Text
(
"Complaint Category"
),
Padding
(
padding:
const
EdgeInsets
.
only
(
bottom:
5.0
),
child:
Text
(
"Complaint Category"
,
style:
TextStyle
(
fontFamily:
"JakartaMedium"
,
),),
),
DropdownButtonHideUnderline
(
child:
Row
(
children:
[
...
...
@@ -370,7 +399,12 @@ class _RegistercomplaintState extends State<Registercomplaint> {
),
SizedBox
(
height:
10.0
),
Text
(
"Select Description"
),
Padding
(
padding:
const
EdgeInsets
.
only
(
bottom:
5.0
),
child:
Text
(
"Select Description"
,
style:
TextStyle
(
fontFamily:
"JakartaMedium"
,
),),
),
DropdownButtonHideUnderline
(
child:
Row
(
children:
[
...
...
@@ -474,7 +508,12 @@ class _RegistercomplaintState extends State<Registercomplaint> {
),
SizedBox
(
height:
10.0
),
Text
(
"Duration"
),
Padding
(
padding:
const
EdgeInsets
.
only
(
bottom:
5.0
),
child:
Text
(
"Duration"
,
style:
TextStyle
(
fontFamily:
"JakartaMedium"
,
),),
),
Container
(
height:
50
,
...
...
@@ -513,7 +552,12 @@ class _RegistercomplaintState extends State<Registercomplaint> {
),
),
SizedBox
(
height:
10.0
),
Text
(
"Message"
),
Padding
(
padding:
const
EdgeInsets
.
only
(
bottom:
5.0
),
child:
Text
(
"Message"
,
style:
TextStyle
(
fontFamily:
"JakartaMedium"
,
),),
),
Container
(
height:
150
,
...
...
@@ -589,6 +633,8 @@ class _RegistercomplaintState extends State<Registercomplaint> {
"Submit Complaint"
,
textAlign:
TextAlign
.
center
,
style:
TextStyle
(
fontFamily:
"JakartaMedium"
,
fontSize:
15
,
color:
Colors
.
white
),
),
...
...
@@ -597,6 +643,7 @@ class _RegistercomplaintState extends State<Registercomplaint> {
),
floatingActionButtonLocation:
FloatingActionButtonLocation
.
centerFloat
,
),
);
},
);
...
...
lib/screens/genTracker/ScanEnterGeneratorIDScreen.dart
View file @
528df0d2
...
...
@@ -47,7 +47,10 @@ class _ScanentergeneratoridscreenState extends State<Scanentergeneratoridscreen>
Widget
build
(
BuildContext
context
)
{
return
Consumer
<
Generatordetailsprovider
>(
builder:
(
context
,
provider
,
child
)
{
return
Scaffold
(
return
WillPopScope
(
onWillPop:
()
=>
onBackPressed
(
context
),
child:
Scaffold
(
resizeToAvoidBottomInset:
true
,
backgroundColor:
AppColors
.
scaffold_bg_color
,
appBar:
appbar
(
context
,
"
${widget.from}
"
),
body:
Container
(
...
...
@@ -55,7 +58,7 @@ class _ScanentergeneratoridscreenState extends State<Scanentergeneratoridscreen>
child:
Column
(
children:
[
Spacer
(),
Container
(
SizedBox
(
height:
250
,
child:
QRView
(
...
...
@@ -66,7 +69,6 @@ class _ScanentergeneratoridscreenState extends State<Scanentergeneratoridscreen>
},
formatsAllowed:
[
BarcodeFormat
.
qrcode
],
cameraFacing:
CameraFacing
.
back
,
overlay:
QrScannerOverlayShape
(
borderColor:
AppColors
.
app_blue
,
...
...
@@ -81,7 +83,7 @@ class _ScanentergeneratoridscreenState extends State<Scanentergeneratoridscreen>
Text
(
"Scan QR"
,
textAlign:
TextAlign
.
center
,
style:
TextStyle
(
fontSize:
18
,
color:
Colors
.
white
),
style:
TextStyle
(
fontSize:
18
,
fontFamily:
"JakartaMedium"
,
color:
Colors
.
white
),
),
Text
(
provider
.
subTitle
,
...
...
@@ -92,7 +94,8 @@ class _ScanentergeneratoridscreenState extends State<Scanentergeneratoridscreen>
Text
(
"or"
,
textAlign:
TextAlign
.
center
,
style:
TextStyle
(
fontSize:
18
,
color:
Colors
.
white
),
style:
TextStyle
(
fontSize:
18
,
fontFamily:
"JakartaMedium"
,
color:
Colors
.
white
),
),
InkResponse
(
onTap:
()
async
{
...
...
@@ -101,13 +104,16 @@ class _ScanentergeneratoridscreenState extends State<Scanentergeneratoridscreen>
child:
Text
(
"Tap to Enter Generator ID"
,
textAlign:
TextAlign
.
center
,
style:
TextStyle
(
fontSize:
14
,
color:
Colors
.
white
),
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,45 +10,58 @@ 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
(
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
(
...
...
@@ -64,7 +78,15 @@ class _GeneratorPartDetailsScreenState extends State<GeneratorPartDetailsScreen>
),
child:
Row
(
children:
[
Expanded
(
child:
Text
(
"
${provider.partData.prodName}
"
)),
Expanded
(
child:
Text
(
"
${provider.partData.prodName}
"
,
style:
TextStyle
(
color:
AppColors
.
app_blue
,
fontFamily:
"JakartaMedium"
,
),
),
),
],
),
),
...
...
@@ -78,7 +100,7 @@ class _GeneratorPartDetailsScreenState extends State<GeneratorPartDetailsScreen>
vertical:
15
,
),
decoration:
BoxDecoration
(
color:
Color
(
0xFF
FFEFE
F
),
color:
Color
(
0xFF
E6F6F
F
),
borderRadius:
BorderRadius
.
circular
(
16
),
),
child:
Row
(
...
...
@@ -87,134 +109,377 @@ class _GeneratorPartDetailsScreenState extends State<GeneratorPartDetailsScreen>
Expanded
(
child:
SizedBox
(
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
center
,
crossAxisAlignment:
CrossAxisAlignment
.
center
,
children:
[
RichText
(
text:
TextSpan
(
children:
[
TextSpan
(
text:
"
${provider.partData.remainingQuantity}
"
,
text:
"
${provider.partData.remainingQuantity}
"
,
style:
TextStyle
(
color:
AppColors
.
semi_black
,
fontSize:
18
,
color:
AppColors
.
app_blue
,
fontSize:
30
,
),
),
],
),
),
Text
(
"Remaining Quantity"
),
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
),
),
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
),
),
),
),
),
),
),
],
),
),
Text
(
"Product Details"
),
],
),
),
Container
(
alignment:
Alignment
.
topLeft
,
padding:
EdgeInsets
.
symmetric
(
horizontal:
10
),
child:
Text
(
"Product Details"
,
style:
TextStyle
(
color:
Color
(
0xFF818181
),
fontFamily:
"JakartaMedium"
,
),
),
),
Container
(
padding:
EdgeInsets
.
symmetric
(
horizontal:
10
,
vertical:
10
),
margin:
EdgeInsets
.
symmetric
(
horizontal:
10
,
vertical:
10
),
padding:
EdgeInsets
.
symmetric
(
horizontal:
10
,
vertical:
10
,
),
margin:
EdgeInsets
.
symmetric
(
horizontal:
10
,
vertical:
10
,
),
decoration:
BoxDecoration
(
color:
Colors
.
white
,
borderRadius:
BorderRadius
.
circular
(
16
)
borderRadius:
BorderRadius
.
circular
(
16
)
,
),
child:
Column
(
children:
List
.
generate
(
9
,
(
index
)
{
children:
List
.
generate
(
3
,
(
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
,
];
return
Container
(
padding:
EdgeInsets
.
symmetric
(
horizontal:
10
,
vertical:
10
,
),
child:
Row
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
mainAxisAlignment:
MainAxisAlignment
.
start
,
children:
[
Expanded
(
flex:
1
,
child:
Text
(
"
${headings[index]}
"
,
style:
TextStyle
(
fontFamily:
"JakartaMedium"
,
),
),
),
Expanded
(
flex:
2
,
child:
Text
(
"
${values[index]}
"
,
style:
TextStyle
(
color:
Color
(
0xFF818181
)),
),
),
],
),
);
}),
),
),
Container
(
alignment:
Alignment
.
topLeft
,
padding:
EdgeInsets
.
symmetric
(
horizontal:
10
),
child:
Text
(
"Vendor Details"
,
style:
TextStyle
(
fontFamily:
"JakartaMedium"
,
color:
Color
(
0xFF818181
),
),
),
),
Container
(
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
,
provider
.
partData
.
units
,
provider
.
partData
.
msl
,
];
return
Container
(
padding:
EdgeInsets
.
symmetric
(
horizontal:
10
,
vertical:
10
),
child:
Column
(
padding:
EdgeInsets
.
symmetric
(
horizontal:
10
,
vertical:
10
,
),
child:
Row
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
mainAxisAlignment:
MainAxisAlignment
.
start
,
children:
[
Text
(
"
${headings[index]}
"
),
Text
(
"
${values[index]}
"
),
Divider
(
thickness:
0.5
,
color:
index
==
8
?
Colors
.
white
:
Color
(
0xFFD7D7D7
),)
Expanded
(
flex:
1
,
child:
Text
(
"
${headings[index]}
"
,
style:
TextStyle
(
fontFamily:
"JakartaMedium"
,
),
),
),
Expanded
(
flex:
2
,
child:
Text
(
"
${values[index]}
"
,
style:
TextStyle
(
color:
Color
(
0xFF818181
)),
),
),
],
),
);
}
,
),
}),
),
),
SizedBox
(
height:
150
,)
],
Container
(
alignment:
Alignment
.
topLeft
,
padding:
EdgeInsets
.
symmetric
(
horizontal:
10
),
child:
Text
(
"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
,
),
bottomSheet:
Container
(
padding:
EdgeInsets
.
symmetric
(
horizontal:
15
,
vertical:
15
),
child:
Row
(
mainAxisAlignment:
MainAxisAlignment
.
center
,
crossAxisAlignment:
CrossAxisAlignment
.
start
,
mainAxisAlignment:
MainAxisAlignment
.
start
,
children:
[
Expanded
(
child:
InkResponse
(
onTap:
()
{
_showStockIssueBottomSheet
(
context
,
"Recieve"
);
},
child:
Container
(
height:
45
,
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
(
"Description"
,
style:
TextStyle
(
fontFamily:
"JakartaMedium"
,
color:
Color
(
0xFF818181
),
),
),
),
Container
(
padding:
EdgeInsets
.
symmetric
(
horizontal:
10
,
vertical:
10
,
),
margin:
EdgeInsets
.
symmetric
(
horizontal:
10
,
vertical:
10
,
),
decoration:
BoxDecoration
(
color:
Colors
.
white
,
border:
Border
.
all
(
color:
AppColors
.
app_blue
,
width:
0.5
),
borderRadius:
BorderRadius
.
circular
(
12
)
borderRadius:
BorderRadius
.
circular
(
16
),
),
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
)
padding:
EdgeInsets
.
symmetric
(
horizontal:
10
,
vertical:
10
,
),
child:
Center
(
child:
Text
(
"Issue"
,
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:
Colors
.
white
),)),
),
)
),
color:
Color
(
0xFF818181
),
),
),
],
),
),
),
],
),
),
),
SizedBox
(
height:
150
),
],
),
),
),
),
);
}
}
,
);
}
Future
<
void
>
_showStockIssueBottomSheet
(
BuildContext
context
,
type
)
{
Future
<
void
>
_showStockIssueBottomSheet
(
BuildContext
context
,
type
)
{
return
showModalBottomSheet
(
useSafeArea:
true
,
isDismissible:
true
,
...
...
@@ -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"
,
style:
TextStyle
(
color:
AppColors
.
semi_black
,
fontSize:
1
2
,
fontSize:
1
4
,
),
),
),
SizedBox
(
height:
5
),
Container
(
height:
48
,
alignment:
Alignment
.
center
,
...
...
@@ -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
,
...
...
@@ -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,15 +652,51 @@ class _GeneratorPartDetailsScreenState extends State<GeneratorPartDetailsScreen>
),
),
InkWell
(
onTap:
()
{
onTap:
provider
.
isButtonEnabled
?
()
{
print
(
provider
.
isButtonEnabled
);
if
(
type
==
"Recieve"
){
if
(
type
==
"Recieve"
)
{
provider
.
issuetype
=
"Recieved"
;
}
else
{
}
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
,
...
...
@@ -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,7 +36,10 @@ class _InventoryScreenState extends State<InventoryScreen> {
Widget
build
(
BuildContext
context
)
{
return
Consumer
<
InventoryProvider
>(
builder:
(
context
,
provider
,
child
)
{
return
Scaffold
(
return
WillPopScope
(
onWillPop:
()
=>
onBackPressed
(
context
),
child:
Scaffold
(
resizeToAvoidBottomInset:
true
,
backgroundColor:
AppColors
.
scaffold_bg_color
,
appBar:
appbar
(
context
,
"Gen Inventory"
),
body:
Container
(
...
...
@@ -70,7 +73,7 @@ class _InventoryScreenState extends State<InventoryScreen> {
Text
(
"Scan QR"
,
textAlign:
TextAlign
.
center
,
style:
TextStyle
(
fontSize:
18
,
color:
Colors
.
white
),
style:
TextStyle
(
fontSize:
18
,
fontFamily:
"JakartaMedium"
,
color:
Colors
.
white
),
),
Text
(
"to open Inventory"
,
...
...
@@ -81,7 +84,8 @@ class _InventoryScreenState extends State<InventoryScreen> {
Text
(
"or"
,
textAlign:
TextAlign
.
center
,
style:
TextStyle
(
fontSize:
18
,
color:
Colors
.
white
),
style:
TextStyle
(
fontSize:
18
,
fontFamily:
"JakartaMedium"
,
color:
Colors
.
white
),
),
InkResponse
(
onTap:
()
async
{
...
...
@@ -90,13 +94,16 @@ class _InventoryScreenState extends State<InventoryScreen> {
child:
Text
(
"Tap To Enter Part ID"
,
textAlign:
TextAlign
.
center
,
style:
TextStyle
(
fontSize:
14
,
color:
Colors
.
white
),
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,38 +15,75 @@ 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
(
builder:
(
context
,
provider
,
child
)
{
return
WillPopScope
(
onWillPop:
()
=>
onBackPressed
(
context
),
child:
Scaffold
(
resizeToAvoidBottomInset:
true
,
appBar:
appbar
(
context
,
"Accounts"
),
backgroundColor:
AppColors
.
scaffold_bg_color
,
body:
Column
(
body:
Container
(
decoration:
BoxDecoration
(
color:
Colors
.
white
),
child:
Column
(
children:
[
const
SizedBox
(
height:
10
,
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
,
height:
55
,
margin:
EdgeInsets
.
only
(
left:
15.0
,
right:
15.0
),
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
,
onChanged:
(
value
)
{
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
(
hintText:
"Enter Account Name....."
,
isDense:
true
,
hintStyle:
TextStyle
(
fontWeight:
FontWeight
.
w400
),
filled:
true
,
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'
,
),
),
),
),
...
...
@@ -54,9 +92,7 @@ class _AccountsuggestionsState extends State<Accountsuggestions> {
alignment:
Alignment
.
topLeft
,
child:
Text
(
"Note: Enter Minimum 3 Characters"
,
style:
TextStyle
(
fontWeight:
FontWeight
.
w300
,
),
style:
TextStyle
(
fontWeight:
FontWeight
.
w300
),
),
),
...
...
@@ -64,17 +100,11 @@ class _AccountsuggestionsState extends State<Accountsuggestions> {
child:
SingleChildScrollView
(
physics:
AlwaysScrollableScrollPhysics
(),
child:
Container
(
child:
Grid
View
.
builder
(
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
;
...
...
@@ -85,29 +115,65 @@ class _AccountsuggestionsState extends State<Accountsuggestions> {
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
context
)
=>
Paymentdetails
(
builder:
(
context
)
=>
Paymentdetails
(
accountName:
"Account"
,
name:
accountList
![
index
].
accountName
,
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
),
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
(
fontWeight:
FontWeight
.
w300
,
color:
AppColors
.
semi_black
),
),
),
Expanded
(
flex:
1
,
child:
SvgPicture
.
asset
(
"assets/svg/arrow_right_new.svg"
,
),
),
],
),
),
),
...
...
@@ -118,17 +184,15 @@ class _AccountsuggestionsState extends State<Accountsuggestions> {
physics:
AlwaysScrollableScrollPhysics
(),
child:
Container
(
width:
double
.
infinity
,
height:
MediaQuery
.
of
(
context
)
.
size
.
height
,
// Set width to fill parent width
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
),
padding:
EdgeInsets
.
fromLTRB
(
10
,
10
,
10
,
10
),
child:
Container
(
child:
Align
(
alignment:
Alignment
.
center
,
...
...
@@ -138,17 +202,24 @@ class _AccountsuggestionsState extends State<Accountsuggestions> {
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,7 +34,10 @@ class _FollowupdetailsState extends State<Followupdetails> {
return
Consumer
<
Visitdetailsprovider
>(
builder:
(
context
,
provider
,
child
)
{
var
followups
=
provider
.
followUpList
;
return
Scaffold
(
return
WillPopScope
(
onWillPop:
()
=>
onBackPressed
(
context
),
child:
Scaffold
(
resizeToAvoidBottomInset:
true
,
appBar:
appbar
(
context
,
"Follow Up Details"
),
backgroundColor:
AppColors
.
scaffold_bg_color
,
body:
Container
(
...
...
@@ -122,6 +125,7 @@ class _FollowupdetailsState extends State<Followupdetails> {
},
),
),
),
);
},
);
...
...
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