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
2d144052
Commit
2d144052
authored
May 13, 2025
by
Sai Srinivas
Browse files
13-05-2025 By Sai Srinivas
Attendance, JKS file
parent
479f7f07
Changes
10
Show whitespace changes
Inline
Side-by-side
generp.jks
0 → 100644
View file @
2d144052
File added
lib/Notifiers/GeneratorDetailsProvider.dart
View file @
2d144052
...
@@ -384,7 +384,7 @@ class Generatordetailsprovider extends ChangeNotifier {
...
@@ -384,7 +384,7 @@ class Generatordetailsprovider extends ChangeNotifier {
_genID
=
scanData
.
code
;
_genID
=
scanData
.
code
;
Navigator
.
push
(
Navigator
.
push
(
context
,
context
,
MaterialPageRoute
(
builder:
(
context
)
=>
Generatordetails
()),
MaterialPageRoute
(
builder:
(
context
)
=>
Generatordetails
(
generatorId:
scanData
.
code
,
)),
);
);
}
else
if
(
from
==
"Register Complaint"
)
{
}
else
if
(
from
==
"Register Complaint"
)
{
_genID
=
scanData
.
code
;
_genID
=
scanData
.
code
;
...
@@ -420,7 +420,7 @@ class Generatordetailsprovider extends ChangeNotifier {
...
@@ -420,7 +420,7 @@ class Generatordetailsprovider extends ChangeNotifier {
if
(
data
!=
null
)
{
if
(
data
!=
null
)
{
if
(
data
.
error
==
0
)
{
if
(
data
.
error
==
0
)
{
_genID
=
genI
D
;
_genID
=
data
.
genI
d
;
_aname
=
data
.
aname
;
_aname
=
data
.
aname
;
_emodel
=
data
.
emodel
;
_emodel
=
data
.
emodel
;
_spname
=
data
.
spname
;
_spname
=
data
.
spname
;
...
@@ -464,12 +464,11 @@ class Generatordetailsprovider extends ChangeNotifier {
...
@@ -464,12 +464,11 @@ class Generatordetailsprovider extends ChangeNotifier {
_selectedDescription
=
""
;
_selectedDescription
=
""
;
_selectedDescriptionId
=
""
;
_selectedDescriptionId
=
""
;
}
}
notifyListeners
();
if
(
from
==
"Generator Details"
)
{
if
(
from
==
"Generator Details"
)
{
this
.
_qrViewController
!.
pauseCamera
();
this
.
_qrViewController
!.
pauseCamera
();
Navigator
.
push
(
Navigator
.
push
(
context
,
context
,
MaterialPageRoute
(
builder:
(
context
)
=>
Generatordetails
()),
MaterialPageRoute
(
builder:
(
context
)
=>
Generatordetails
(
generatorId:
_genID
,
)),
);
);
}
else
if
(
from
==
"Register Complaint"
)
{
}
else
if
(
from
==
"Register Complaint"
)
{
this
.
_qrViewController
!.
pauseCamera
();
this
.
_qrViewController
!.
pauseCamera
();
...
@@ -479,7 +478,6 @@ class Generatordetailsprovider extends ChangeNotifier {
...
@@ -479,7 +478,6 @@ class Generatordetailsprovider extends ChangeNotifier {
);
);
}
}
notifyListeners
();
}
else
if
(
data
.
error
==
1
)
{
}
else
if
(
data
.
error
==
1
)
{
toast
(
context
,
"Enter Correct ID"
);
toast
(
context
,
"Enter Correct ID"
);
}
else
{}
}
else
{}
...
@@ -491,6 +489,92 @@ class Generatordetailsprovider extends ChangeNotifier {
...
@@ -491,6 +489,92 @@ class Generatordetailsprovider extends ChangeNotifier {
}
}
}
}
Future
<
void
>
LoadTechniciangeneratorDetailsApifunction
(
homeProvider
,
BuildContext
context
,
from
,
genID
,
)
async
{
try
{
final
data
=
await
ApiCalling
.
LoadTechnicianGeneratorDetailsAPI
(
homeProvider
.
empId
,
homeProvider
.
session
,
genID
,
);
if
(
data
!=
null
)
{
if
(
data
.
error
==
0
)
{
_genID
=
genID
;
_aname
=
data
.
aname
;
_emodel
=
data
.
emodel
;
_spname
=
data
.
spname
;
_mob1
=
data
.
mob1
;
_mob2
=
data
.
mob2
;
_mail
=
data
.
mail
;
_cname
=
data
.
cname
;
_engineNo
=
data
.
engineNo
;
_dateOfEngineSale
=
data
.
dateOfEngineSale
;
_altNo
=
data
.
altNo
;
_btryNo
=
data
.
btryNo
;
_dgSetNo
=
data
.
dgSetNo
;
_state
=
data
.
state
;
_district
=
data
.
district
;
_address
=
data
.
address
;
_dispDate
=
data
.
dispDate
;
_cmsngDate
=
data
.
cmsngDate
;
_status
=
data
.
status
;
_complaintTypeDropdown
=
data
.
complaintTypeList
!;
_complaintCategorydropdown
=
data
.
complaintCategoryList
!;
_complaintDescriptionDropdown
=
data
.
complaintDescriptionList
!;
if
(
_selectedComplaintType
!=
null
&&
!
_complaintTypeDropdown
.
contains
(
_selectedComplaintType
))
{
_selectedComplaintType
=
null
;
_selectedType
=
""
;
_selectedTypeId
=
""
;
}
if
(
_selectedCategoryType
!=
null
&&
!
_complaintCategorydropdown
.
contains
(
_selectedCategoryType
))
{
_selectedCategoryType
=
null
;
_selectedCategory
=
""
;
_selectedCategoryId
=
""
;
}
if
(
_selectedDescriptionType
!=
null
&&
!
_complaintDescriptionDropdown
.
contains
(
_selectedDescriptionType
,
))
{
_selectedDescriptionType
=
null
;
_selectedDescription
=
""
;
_selectedDescriptionId
=
""
;
}
if
(
from
==
"Generator Details"
)
{
this
.
_qrViewController
!.
pauseCamera
();
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
context
)
=>
Generatordetails
(
generatorId:
_genID
,)),
);
}
else
if
(
from
==
"Register Complaint"
)
{
this
.
_qrViewController
!.
pauseCamera
();
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
context
)
=>
Registercomplaint
()),
);
}
}
else
if
(
data
.
error
==
1
)
{
toast
(
context
,
"Enter Correct ID"
);
}
else
{}
notifyListeners
();
}
}
on
Error
catch
(
e
)
{
print
(
e
.
toString
());
}
}
Future
<
void
>
LoadgeneratorComplaintHistoryApifunction
(
Future
<
void
>
LoadgeneratorComplaintHistoryApifunction
(
homeProvider
,
homeProvider
,
BuildContext
context
,
BuildContext
context
,
...
...
lib/Notifiers/NearByGeneratorsProvider.dart
View file @
2d144052
...
@@ -43,7 +43,7 @@ class Nearbygeneratorsprovider extends ChangeNotifier {
...
@@ -43,7 +43,7 @@ class Nearbygeneratorsprovider extends ChangeNotifier {
bool
_isLoading
=
true
;
bool
_isLoading
=
true
;
String
_selectedItem
=
'Active'
;
String
_selectedItem
=
'Active'
;
double
_currentValue
=
1.0
;
double
_currentValue
=
1.0
;
Timer
?
_debounceTimer
;
List
<
Nearbygenerators
>
get
generatorsList
=>
_generatorslist
;
List
<
Nearbygenerators
>
get
generatorsList
=>
_generatorslist
;
...
@@ -64,6 +64,19 @@ class Nearbygeneratorsprovider extends ChangeNotifier {
...
@@ -64,6 +64,19 @@ class Nearbygeneratorsprovider extends ChangeNotifier {
String
get
selectedItem
=>
_selectedItem
;
String
get
selectedItem
=>
_selectedItem
;
double
get
currentValue
=>
_currentValue
;
double
get
currentValue
=>
_currentValue
;
set
currentValue
(
value
){
_currentValue
=
value
;
notifyListeners
();
}
set
selectedItem
(
String
value
){
_selectedItem
=
value
;
notifyListeners
();
}
set
markers
(
List
<
Marker
>
value
){
_markers
=
value
;
notifyListeners
();
}
set
mapController
(
value
){
set
mapController
(
value
){
_mapController
=
value
;
_mapController
=
value
;
notifyListeners
();
notifyListeners
();
...
@@ -120,9 +133,17 @@ class Nearbygeneratorsprovider extends ChangeNotifier {
...
@@ -120,9 +133,17 @@ class Nearbygeneratorsprovider extends ChangeNotifier {
getLocationPermission
(
context
);
getLocationPermission
(
context
);
});
});
}
}
void
debounce
(
VoidCallback
callback
,
Duration
duration
)
{
_debounceTimer
?.
cancel
();
_debounceTimer
=
Timer
(
duration
,
callback
);
}
Future
<
void
>
LoadNearbyGeneratorsAPI
(
BuildContext
context
)
async
{
Future
<
void
>
LoadNearbyGeneratorsAPI
(
BuildContext
context
)
async
{
if
(
_latlongs
.
isEmpty
||
_currentValue
<=
0
)
{
print
(
"Invalid parameters: latlongs=
$_latlongs
, currentValue=
$_currentValue
"
);
return
;
}
try
{
try
{
var
provider
=
Provider
.
of
<
HomescreenNotifier
>(
context
,
listen:
false
);
var
provider
=
Provider
.
of
<
HomescreenNotifier
>(
context
,
listen:
false
);
final
data
=
await
ApiCalling
.
loadNearbyGeneratorsAPI
(
final
data
=
await
ApiCalling
.
loadNearbyGeneratorsAPI
(
...
@@ -138,7 +159,7 @@ class Nearbygeneratorsprovider extends ChangeNotifier {
...
@@ -138,7 +159,7 @@ class Nearbygeneratorsprovider extends ChangeNotifier {
if
(
data
.
error
==
0
)
{
if
(
data
.
error
==
0
)
{
_generatorslist
=
data
.
list
!;
_generatorslist
=
data
.
list
!;
updateMarkersFromApiResponse
(
context
,
data
.
list
!);
await
updateMarkersFromApiResponse
(
context
,
data
.
list
!);
_isLoading
=
false
;
_isLoading
=
false
;
notifyListeners
();
notifyListeners
();
}
else
{}
}
else
{}
...
@@ -162,16 +183,17 @@ class Nearbygeneratorsprovider extends ChangeNotifier {
...
@@ -162,16 +183,17 @@ class Nearbygeneratorsprovider extends ChangeNotifier {
List
<
Nearbygenerators
>
generatorslist
,
List
<
Nearbygenerators
>
generatorslist
,
)
async
{
)
async
{
_markers
=
await
createMarkersFromApiResponse
(
context
,
generatorslist
);
_markers
=
await
createMarkersFromApiResponse
(
context
,
generatorslist
);
_addresses
.
clear
();
await
Future
.
forEach
(
generatorslist
,
(
store
)
async
{
await
Future
.
forEach
(
generatorslist
,
(
store
)
async
{
String
address
=
await
_getAddressFromLatLng
(
store
.
loc
);
String
address
=
await
_getAddressFromLatLng
(
store
.
loc
);
_addresses
.
add
(
address
);
_addresses
.
add
(
address
);
notifyListeners
();
});
});
for
(
int
i
=
0
;
i
<
_addresses
.
length
;
i
++)
{
notifyListeners
();
//print('List of Addresses:' "${addresses[i]}");
// for (int i = 0; i < _addresses.length; i++) {
// print('List of Addresses:' "${addresses[1]}" );
// //print('List of Addresses:' "${addresses[i]}");
}
// // print('List of Addresses:' "${addresses[1]}" );
// }
}
}
Future
<
List
<
Marker
>>
createMarkersFromApiResponse
(
Future
<
List
<
Marker
>>
createMarkersFromApiResponse
(
...
@@ -217,9 +239,9 @@ class Nearbygeneratorsprovider extends ChangeNotifier {
...
@@ -217,9 +239,9 @@ class Nearbygeneratorsprovider extends ChangeNotifier {
MaterialPageRoute
(
MaterialPageRoute
(
builder:
builder:
(
context
)
=>
Generatordetails
(
(
context
)
=>
Generatordetails
(
//
actName: "NearByGenerators",
act
ivity
Name:
"NearByGenerators"
,
// l
ocation: generator.loc,
genL
ocation:
generator
.
loc
,
//
generatorId: generator.generatorId,
generatorId:
generator
.
generatorId
,
),
),
),
),
);
);
...
@@ -273,171 +295,4 @@ class Nearbygeneratorsprovider extends ChangeNotifier {
...
@@ -273,171 +295,4 @@ class Nearbygeneratorsprovider extends ChangeNotifier {
return
"Address not found"
;
return
"Address not found"
;
}
}
Future
infoDialogue
(
BuildContext
context
)
async
{
return
await
showDialog
(
context:
context
,
builder:
(
context
)
=>
StatefulBuilder
(
builder:
(
context
,
setState
)
=>
AlertDialog
(
shape:
RoundedRectangleBorder
(
borderRadius:
BorderRadius
.
circular
(
10.0
),
),
title:
Column
(
children:
[
Row
(
children:
[
Expanded
(
child:
Align
(
alignment:
Alignment
.
topLeft
,
child:
Text
(
'Filter'
,
style:
TextStyle
(
color:
Colors
.
black
,
fontWeight:
FontWeight
.
w500
,
),
),
),
),
InkWell
(
child:
SvgPicture
.
asset
(
"assets/ic_cancel.svg"
,
height:
35
,
width:
35
,
),
onTap:
()
{
setState
(()
{
_currentValue
=
0.0
;
_selectedItem
=
"Active"
;
});
Navigator
.
pop
(
context
);
},
),
],
),
Divider
(
color:
Colors
.
grey
,
thickness:
1.0
,
height:
0.0
,
),
],
),
content:
Container
(
height:
230
,
child:
Column
(
children:
[
Row
(
children:
[
Text
(
"Radius"
,
style:
TextStyle
(
fontSize:
18.0
,
fontWeight:
FontWeight
.
w500
,
),
),
Spacer
(),
Text
(
'
${_currentValue.toStringAsFixed(2)}
KM'
,
style:
TextStyle
(
fontSize:
18.0
,
fontWeight:
FontWeight
.
w500
,
),
),
],
),
Slider
(
value:
_currentValue
,
max:
100
,
divisions:
100
,
label:
_currentValue
.
toStringAsFixed
(
2
),
inactiveColor:
Colors
.
grey
,
onChanged:
(
value
)
{
_currentValue
=
value
;
notifyListeners
();
},
),
Text
(
'Status'
,
style:
TextStyle
(
color:
Colors
.
black
,
fontWeight:
FontWeight
.
w500
,
),
),
Container
(
width:
200
,
// Set the desired width here
child:
DropdownButton
<
String
>(
value:
_selectedItem
,
items:
<
String
>[
'Active'
,
'Inactive'
,
'Suspense'
,
].
map
<
DropdownMenuItem
<
String
>>((
String
value
,
)
{
return
DropdownMenuItem
<
String
>(
value:
value
,
child:
Text
(
value
),
);
}).
toList
(),
onChanged:
(
String
?
newValue
)
{
setState
(()
{
_selectedItem
=
newValue
!;
});
},
icon:
Icon
(
CupertinoIcons
.
arrowtriangle_down_fill
,
),
iconSize:
12
,
iconEnabledColor:
Colors
.
black
,
// Remove the default dropdown icon
),
),
SizedBox
(
height:
30.0
),
Container
(
child:
InkWell
(
onTap:
()
{
_markers
=
[];
LoadNearbyGeneratorsAPI
(
context
);
Navigator
.
pop
(
context
);
_currentValue
=
0.0
;
_selectedItem
=
"Active"
;
notifyListeners
();
},
child:
Container
(
alignment:
Alignment
.
center
,
height:
45
,
margin:
EdgeInsets
.
only
(
left:
15.0
,
right:
15.0
,
),
decoration:
BoxDecoration
(
borderRadius:
BorderRadius
.
circular
(
10.0
),
),
child:
Text
(
"Search"
,
textAlign:
TextAlign
.
center
,
style:
TextStyle
(
fontFamily:
'Nexa'
,
fontWeight:
FontWeight
.
w700
,
),
),
),
),
),
],
),
),
),
),
barrierDismissible:
true
,
)
??
false
;
}
}
}
lib/Utils/commonWidgets.dart
View file @
2d144052
...
@@ -33,3 +33,37 @@ PreferredSizeWidget appbar(BuildContext context, title) {
...
@@ -33,3 +33,37 @@ PreferredSizeWidget appbar(BuildContext context, title) {
),
),
);
);
}
}
PreferredSizeWidget
appbar2
(
BuildContext
context
,
title
,
widget
)
{
return
AppBar
(
automaticallyImplyLeading:
false
,
elevation:
2.0
,
title:
SizedBox
(
child:
Row
(
mainAxisAlignment:
MainAxisAlignment
.
start
,
crossAxisAlignment:
CrossAxisAlignment
.
center
,
children:
[
InkResponse
(
onTap:
()
=>
Navigator
.
pop
(
context
,
true
),
child:
SvgPicture
.
asset
(
"assets/svg/app_bar_back.svg"
,
height:
25
),
),
Text
(
title
,
style:
TextStyle
(
fontSize:
16
,
height:
1.1
,
color:
AppColors
.
semi_black
,
),
),
Spacer
(),
widget
],
),
),
shape:
RoundedRectangleBorder
(
borderRadius:
BorderRadius
.
vertical
(
bottom:
Radius
.
circular
(
30
),
// Adjust the radius as needed
),
),
);
}
lib/screens/AttendanceScreen.dart
View file @
2d144052
...
@@ -91,7 +91,15 @@ class _AttendanceScreenState extends State<AttendanceScreen> {
...
@@ -91,7 +91,15 @@ class _AttendanceScreenState extends State<AttendanceScreen> {
?
'
$currentMonthName
$year
'
?
'
$currentMonthName
$year
'
:
'
$prevMonthName
-
$currentMonthName
$year
'
;
:
'
$prevMonthName
-
$currentMonthName
$year
'
;
return
Scaffold
(
return
RefreshIndicator
.
adaptive
(
color:
AppColors
.
app_blue
,
onRefresh:
()
async
{
await
Future
.
delayed
(
const
Duration
(
milliseconds:
600
));
attendance
.
getAttendanceList
(
homeProvider
,
context
);
},
child:
Scaffold
(
backgroundColor:
AppColors
.
scaffold_bg_color
,
backgroundColor:
AppColors
.
scaffold_bg_color
,
appBar:
appbar
(
context
,
"Attendance"
),
appBar:
appbar
(
context
,
"Attendance"
),
body:
Container
(
body:
Container
(
...
@@ -146,14 +154,14 @@ class _AttendanceScreenState extends State<AttendanceScreen> {
...
@@ -146,14 +154,14 @@ class _AttendanceScreenState extends State<AttendanceScreen> {
text:
TextSpan
(
text:
TextSpan
(
children:
[
children:
[
TextSpan
(
TextSpan
(
text:
"
$
formattedTime
"
,
text:
formattedTime
,
style:
TextStyle
(
style:
TextStyle
(
color:
Color
(
0xFFED3424
),
color:
Color
(
0xFFED3424
),
fontSize:
18
,
fontSize:
18
,
),
),
),
),
TextSpan
(
TextSpan
(
text:
"
$
period
"
,
text:
period
,
style:
TextStyle
(
style:
TextStyle
(
color:
Color
(
0xFFED3424
),
color:
Color
(
0xFFED3424
),
),
),
...
@@ -190,14 +198,14 @@ class _AttendanceScreenState extends State<AttendanceScreen> {
...
@@ -190,14 +198,14 @@ class _AttendanceScreenState extends State<AttendanceScreen> {
text:
TextSpan
(
text:
TextSpan
(
children:
[
children:
[
TextSpan
(
TextSpan
(
text:
"
$
formattedTime2
"
,
text:
formattedTime2
,
style:
TextStyle
(
style:
TextStyle
(
color:
Color
(
0xFFED3424
),
color:
Color
(
0xFFED3424
),
fontSize:
18
,
fontSize:
18
,
),
),
),
),
TextSpan
(
TextSpan
(
text:
"
$
period2
"
,
text:
period2
,
style:
TextStyle
(
style:
TextStyle
(
color:
Color
(
0xFFED3424
),
color:
Color
(
0xFFED3424
),
),
),
...
@@ -317,10 +325,10 @@ class _AttendanceScreenState extends State<AttendanceScreen> {
...
@@ -317,10 +325,10 @@ class _AttendanceScreenState extends State<AttendanceScreen> {
context
,
context
,
);
);
},
},
child:
const
Icon
(
child:
Icon
(
Icons
.
arrow_back_ios
,
Icons
.
arrow_back_ios
,
color:
Colors
.
black
,
color:
App
Colors
.
semi_
black
,
size:
3
0.0
,
size:
2
0.0
,
),
),
),
),
Text
(
Text
(
...
@@ -338,10 +346,10 @@ class _AttendanceScreenState extends State<AttendanceScreen> {
...
@@ -338,10 +346,10 @@ class _AttendanceScreenState extends State<AttendanceScreen> {
context
,
context
,
);
);
},
},
child:
const
Icon
(
child:
Icon
(
Icons
.
arrow_forward_ios
,
Icons
.
arrow_forward_ios
,
color:
Colors
.
black
,
color:
App
Colors
.
semi_
black
,
size:
3
0.0
,
size:
2
0.0
,
),
),
),
),
],
],
...
@@ -353,12 +361,12 @@ class _AttendanceScreenState extends State<AttendanceScreen> {
...
@@ -353,12 +361,12 @@ class _AttendanceScreenState extends State<AttendanceScreen> {
_showInfoBottomSheet
(
context
);
_showInfoBottomSheet
(
context
);
},
},
child:
SizedBox
(
child:
SizedBox
(
width:
2
5
,
width:
2
0
,
height:
2
5
,
height:
2
0
,
child:
SvgPicture
.
asset
(
child:
SvgPicture
.
asset
(
"assets/svg/ic_info_new.svg"
,
"assets/svg/ic_info_new.svg"
,
width:
2
5
,
width:
2
0
,
height:
2
5
,
height:
2
0
,
),
),
),
),
),
),
...
@@ -366,6 +374,7 @@ class _AttendanceScreenState extends State<AttendanceScreen> {
...
@@ -366,6 +374,7 @@ class _AttendanceScreenState extends State<AttendanceScreen> {
),
),
),
),
),
),
SizedBox
(
height:
5
,),
Padding
(
Padding
(
padding:
const
EdgeInsets
.
fromLTRB
(
8
,
10
,
8
,
0
),
padding:
const
EdgeInsets
.
fromLTRB
(
8
,
10
,
8
,
0
),
child:
Container
(
child:
Container
(
...
@@ -484,6 +493,7 @@ class _AttendanceScreenState extends State<AttendanceScreen> {
...
@@ -484,6 +493,7 @@ class _AttendanceScreenState extends State<AttendanceScreen> {
}
}
attendance
.
selectedDate
=
attendance
.
selectedDate
=
currentDay
.
toString
();
currentDay
.
toString
();
_showAttDetailsBottomSheet
(
context
);
},
},
child:
Card
(
child:
Card
(
elevation:
0
,
elevation:
0
,
...
@@ -514,13 +524,13 @@ class _AttendanceScreenState extends State<AttendanceScreen> {
...
@@ -514,13 +524,13 @@ class _AttendanceScreenState extends State<AttendanceScreen> {
:
(
isCurrentDay
||
:
(
isCurrentDay
||
(
selectedIndex
==
(
selectedIndex
==
index
))
index
))
?
Color
(
0xFFF
FE8D0
)
?
Color
(
0xFFF
6F0FF
)
:
dateColor
==
'g'
:
dateColor
==
'g'
?
Color
(
0xFFE8FFE6
)
?
Color
(
0xFFE8FFE6
)
:
dateColor
==
'r'
:
dateColor
==
'r'
?
Color
(
0xFFFFEFEF
)
?
Color
(
0xFFFFEFEF
)
:
dateColor
==
'b'
:
dateColor
==
'b'
?
Color
(
0xFFF
6F0FF
)
?
Color
(
0xFFF
FE8D0
)
:
dateColor
==
'br'
:
dateColor
==
'br'
?
Colors
.
brown
?
Colors
.
brown
:
dateColor
==
'y'
:
dateColor
==
'y'
...
@@ -567,16 +577,16 @@ class _AttendanceScreenState extends State<AttendanceScreen> {
...
@@ -567,16 +577,16 @@ class _AttendanceScreenState extends State<AttendanceScreen> {
],
],
),
),
),
),
SizedBox
(
height:
6
0
),
SizedBox
(
height:
7
0
),
],
],
),
),
),
),
),
),
floatingActionButton:
Align
(
floatingActionButton:
attendance
.
attendanceStatus
==
0
||
attendance
.
attendanceStatus
==
1
?
Align
(
alignment:
Alignment
.
bottomCenter
,
alignment:
Alignment
.
bottomCenter
,
child:
InkWell
(
child:
InkWell
(
onTap:
()
{
onTap:
()
async
{
Navigator
.
push
(
var
res
=
await
Navigator
.
push
(
context
,
context
,
MaterialPageRoute
(
MaterialPageRoute
(
builder:
builder:
...
@@ -585,6 +595,9 @@ class _AttendanceScreenState extends State<AttendanceScreen> {
...
@@ -585,6 +595,9 @@ class _AttendanceScreenState extends State<AttendanceScreen> {
),
),
),
),
);
);
if
(
res
==
true
){
attendance
.
getAttendanceList
(
homeProvider
,
context
);
}
var
f
=
FocusScope
.
of
(
context
);
var
f
=
FocusScope
.
of
(
context
);
if
(!
f
.
hasPrimaryFocus
)
{
if
(!
f
.
hasPrimaryFocus
)
{
...
@@ -594,6 +607,7 @@ class _AttendanceScreenState extends State<AttendanceScreen> {
...
@@ -594,6 +607,7 @@ class _AttendanceScreenState extends State<AttendanceScreen> {
child:
Container
(
child:
Container
(
alignment:
Alignment
.
bottomCenter
,
alignment:
Alignment
.
bottomCenter
,
height:
45
,
height:
45
,
margin:
EdgeInsets
.
symmetric
(
horizontal:
10
),
width:
MediaQuery
.
of
(
context
).
size
.
width
,
width:
MediaQuery
.
of
(
context
).
size
.
width
,
decoration:
BoxDecoration
(
decoration:
BoxDecoration
(
color:
AppColors
.
app_blue
,
color:
AppColors
.
app_blue
,
...
@@ -608,13 +622,15 @@ class _AttendanceScreenState extends State<AttendanceScreen> {
...
@@ -608,13 +622,15 @@ class _AttendanceScreenState extends State<AttendanceScreen> {
),
),
),
),
),
),
),
):
SizedBox
(
height:
0
,
),
floatingActionButtonLocation:
floatingActionButtonLocation:
FloatingActionButtonLocation
.
centerFloat
,
FloatingActionButtonLocation
.
centerFloat
,
),
);
);
},
},
);
);
}
}
Future
<
void
>
_showInfoBottomSheet
(
BuildContext
context
)
{
Future
<
void
>
_showInfoBottomSheet
(
BuildContext
context
)
{
return
showModalBottomSheet
(
return
showModalBottomSheet
(
useSafeArea:
true
,
useSafeArea:
true
,
...
@@ -643,7 +659,6 @@ class _AttendanceScreenState extends State<AttendanceScreen> {
...
@@ -643,7 +659,6 @@ class _AttendanceScreenState extends State<AttendanceScreen> {
Column
(
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
[
children:
[
Text
(
Text
(
"Indicators Info"
,
"Indicators Info"
,
style:
TextStyle
(
style:
TextStyle
(
...
@@ -651,9 +666,13 @@ class _AttendanceScreenState extends State<AttendanceScreen> {
...
@@ -651,9 +666,13 @@ class _AttendanceScreenState extends State<AttendanceScreen> {
fontSize:
16
,
fontSize:
16
,
),
),
),
),
SizedBox
(
height:
15
,
),
SizedBox
(
height:
15
),
GridView
.
builder
(
GridView
.
builder
(
gridDelegate:
SliverGridDelegateWithFixedCrossAxisCount
(
crossAxisCount:
3
,
childAspectRatio:
5
/
1
),
gridDelegate:
SliverGridDelegateWithFixedCrossAxisCount
(
crossAxisCount:
3
,
childAspectRatio:
5
/
1
,
),
physics:
NeverScrollableScrollPhysics
(),
physics:
NeverScrollableScrollPhysics
(),
shrinkWrap:
true
,
shrinkWrap:
true
,
itemCount:
5
,
itemCount:
5
,
...
@@ -665,13 +684,14 @@ class _AttendanceScreenState extends State<AttendanceScreen> {
...
@@ -665,13 +684,14 @@ class _AttendanceScreenState extends State<AttendanceScreen> {
0xFFFF0000
,
0xFFFF0000
,
0xFF6B3A02
,
0xFF6B3A02
,
0xFFFFEC1C
,
0xFFFFEC1C
,
];
];
final
text
=
[
"Holiday"
,
final
text
=
[
"Holiday"
,
"Present"
,
"Present"
,
"Absent"
,
"Absent"
,
"Half Day"
,
"Half Day"
,
"Not Checked Out"
];
"Not Checked Out"
,
];
return
Row
(
return
Row
(
children:
[
children:
[
Container
(
Container
(
...
@@ -686,7 +706,7 @@ class _AttendanceScreenState extends State<AttendanceScreen> {
...
@@ -686,7 +706,7 @@ class _AttendanceScreenState extends State<AttendanceScreen> {
Expanded
(
Expanded
(
child:
Text
(
child:
Text
(
text
[
index
],
text
[
index
],
maxLines:
2
,
maxLines:
2
,
style:
TextStyle
(
style:
TextStyle
(
fontSize:
14
,
fontSize:
14
,
color:
Colors
.
black
,
color:
Colors
.
black
,
...
@@ -695,16 +715,142 @@ class _AttendanceScreenState extends State<AttendanceScreen> {
...
@@ -695,16 +715,142 @@ class _AttendanceScreenState extends State<AttendanceScreen> {
),
),
],
],
);
);
},)
},
),
],
],
),
),
],
],
),
),
)
),
),
);
},
);
},
);
}
Future
<
void
>
_showAttDetailsBottomSheet
(
BuildContext
context
)
{
return
showModalBottomSheet
(
useSafeArea:
true
,
isDismissible:
true
,
isScrollControlled:
true
,
showDragHandle:
true
,
enableDrag:
true
,
context:
context
,
builder:
(
context
)
{
return
StatefulBuilder
(
builder:
(
context
,
setState
)
{
return
Consumer
<
AttendanceNotifier
>(
builder:
(
context
,
provider
,
child
)
{
return
SafeArea
(
child:
Container
(
margin:
EdgeInsets
.
only
(
bottom:
15
,
left:
15
,
right:
15
,
top:
15
,
),
child:
SingleChildScrollView
(
child:
Column
(
mainAxisSize:
MainAxisSize
.
min
,
children:
[
Row
(
children:
[
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
[
Text
(
"Attendance Info"
,
style:
TextStyle
(
color:
AppColors
.
app_blue
,
fontSize:
16
,
),
),
Text
(
provider
.
date
,
style:
TextStyle
(
color:
Color
(
0xFF818181
),
fontSize:
12
,
),
),
],
),
Spacer
(),
Container
(
padding:
EdgeInsets
.
symmetric
(
horizontal:
10
,
vertical:
10
,
),
decoration:
BoxDecoration
(
color:
Color
(
0xFFFFF6F0
),
borderRadius:
BorderRadius
.
circular
(
12
),
),
child:
Row
(
children:
[
Text
(
"Late Points "
),
Text
(
provider
.
penalties
,
style:
TextStyle
(
color:
Color
(
0xFF91481B
),
),
),
],
),
),
],
),
Padding
(
padding:
EdgeInsets
.
symmetric
(
horizontal:
5
),
child:
Divider
(
color:
Color
(
0xFFD7D7D7
),
thickness:
0.5
,
),
),
SizedBox
(
height:
15
),
...
List
.
generate
(
4
,
(
j
)
{
final
values
=
[
"Check-in Time"
,
"Check-in Location"
,
"Check-out Time"
,
"Check-out Location"
,
];
final
subvalues
=
[
(
provider
.
intime
),
(
provider
.
inlocation
),
(
provider
.
outtime
),
(
provider
.
outlocation
),
];
return
SizedBox
(
height:
35
,
child:
Row
(
children:
[
Expanded
(
child:
Text
(
values
[
j
],
style:
TextStyle
(
color:
AppColors
.
semi_black
,
),
),
),
),
Expanded
(
child:
Text
(
subvalues
[
j
],
style:
TextStyle
(
color:
Color
(
0xFF818181
)),
),
),
],
),
);
}),
],
),
),
),
);
},
);
);
},
},
);
);
...
...
lib/screens/HomeScreen.dart
View file @
2d144052
...
@@ -2,6 +2,7 @@ import 'dart:async';
...
@@ -2,6 +2,7 @@ import 'dart:async';
import
'package:flutter/cupertino.dart'
;
import
'package:flutter/cupertino.dart'
;
import
'package:flutter/material.dart'
;
import
'package:flutter/material.dart'
;
import
'package:flutter/services.dart'
;
import
'package:flutter_svg/flutter_svg.dart'
;
import
'package:flutter_svg/flutter_svg.dart'
;
import
'package:generp/Notifiers/Counter.dart'
;
import
'package:generp/Notifiers/Counter.dart'
;
import
'package:generp/Notifiers/HomeScreenNotifier.dart'
;
import
'package:generp/Notifiers/HomeScreenNotifier.dart'
;
...
@@ -45,12 +46,64 @@ class _MyHomePageState extends State<MyHomePage> {
...
@@ -45,12 +46,64 @@ class _MyHomePageState extends State<MyHomePage> {
});
});
super
.
initState
();
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
,
),
),
),
],
elevation:
30.0
,
),
barrierDismissible:
false
,
)
??
false
;
}
@override
@override
Widget
build
(
BuildContext
context
)
{
Widget
build
(
BuildContext
context
)
{
return
Consumer2
<
HomescreenNotifier
,
ProfileNotifer
>(
return
Consumer2
<
HomescreenNotifier
,
ProfileNotifer
>(
builder:
(
context
,
homescreen
,
profile
,
child
)
{
builder:
(
context
,
homescreen
,
profile
,
child
)
{
return
Scaffold
(
return
WillPopScope
(
onWillPop:
onBackPressed
,
child:
RefreshIndicator
.
adaptive
(
color:
AppColors
.
app_blue
,
onRefresh:
()
async
{
await
Future
.
delayed
(
const
Duration
(
milliseconds:
600
));
homescreen
.
DashboardApiFunction
(
context
);
},
child:
Scaffold
(
backgroundColor:
AppColors
.
scaffold_bg_color
,
backgroundColor:
AppColors
.
scaffold_bg_color
,
body:
Container
(
body:
Container
(
...
@@ -228,39 +281,43 @@ class _MyHomePageState extends State<MyHomePage> {
...
@@ -228,39 +281,43 @@ class _MyHomePageState extends State<MyHomePage> {
"CRM"
,
"CRM"
,
];
];
return
InkResponse
(
return
InkResponse
(
onTap:
()
{
onTap:
()
async
{
var
res
;
switch
(
names
[
index
])
{
switch
(
names
[
index
])
{
case
"Attendance"
:
case
"Attendance"
:
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
context
)
=>
AttendanceScreen
()));
res
=
await
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
context
)
=>
AttendanceScreen
()));
break
;
break
;
case
"ERP"
:
case
"ERP"
:
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
context
)
=>
WebErpScreen
(
erp_url:
homescreen
.
webPageUrl
)));
res
=
await
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
context
)
=>
WebErpScreen
(
erp_url:
homescreen
.
webPageUrl
)));
break
;
break
;
case
"Gen Tracker"
:
case
"Gen Tracker"
:
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
context
)=>
Gentrackerdashboard
()));
res
=
await
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
context
)=>
Gentrackerdashboard
()));
break
;
break
;
case
"Service Engineer"
:
case
"Service Engineer"
:
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
context
)=>
Serviceengineerdashboard
()));
res
=
await
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
context
)=>
Serviceengineerdashboard
()));
break
;
break
;
case
"Nearby"
:
case
"Nearby"
:
//
Navigator.push(context, MaterialPageRoute(builder: (context)=>NearByGeneratorsScreen()));
//res = await
Navigator.push(context, MaterialPageRoute(builder: (context)=>NearByGeneratorsScreen()));
break
;
break
;
case
"Inventory"
:
case
"Inventory"
:
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
context
)=>
InventoryScreen
()));
res
=
await
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
context
)=>
InventoryScreen
()));
break
;
break
;
case
"Whizzdom"
:
case
"Whizzdom"
:
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
context
)=>
WebWhizzdomScreen
(
res
=
await
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
context
)=>
WebWhizzdomScreen
(
whizzdom_url:
whizzdom_url:
homescreen
.
whizzdomPageUrl
homescreen
.
whizzdomPageUrl
)));
)));
break
;
break
;
case
"CRM"
:
case
"CRM"
:
//
Navigator.push(context, MaterialPageRoute(builder: (context)=>CRMScreen()));
//res = await
Navigator.push(context, MaterialPageRoute(builder: (context)=>CRMScreen()));
break
;
break
;
default
:
default
:
print
(
"111"
);
print
(
"111"
);
break
;
break
;
}
}
if
(
res
==
true
){
homescreen
.
DashboardApiFunction
(
context
);
}
},
},
child:
Container
(
child:
Container
(
decoration:
BoxDecoration
(
decoration:
BoxDecoration
(
...
@@ -286,6 +343,8 @@ class _MyHomePageState extends State<MyHomePage> {
...
@@ -286,6 +343,8 @@ class _MyHomePageState extends State<MyHomePage> {
],
],
),
),
),
),
),
),
);
);
},
},
);
);
...
...
lib/screens/genTracker/GeneratorDetails.dart
View file @
2d144052
import
'dart:io'
;
import
'package:flutter/material.dart'
;
import
'package:flutter/material.dart'
;
import
'package:flutter_svg/svg.dart'
;
import
'package:flutter_svg/svg.dart'
;
import
'package:generp/Notifiers/GeneratorDetailsProvider.dart'
;
import
'package:generp/Notifiers/GeneratorDetailsProvider.dart'
;
import
'package:generp/screens/genTracker/ComplaintHistory.dart'
;
import
'package:generp/screens/genTracker/ComplaintHistory.dart'
;
import
'package:provider/provider.dart'
;
import
'package:provider/provider.dart'
;
import
'package:url_launcher/url_launcher.dart'
;
import
'../../Notifiers/HomeScreenNotifier.dart'
;
import
'../../Notifiers/HomeScreenNotifier.dart'
;
import
'../../Utils/app_colors.dart'
;
import
'../../Utils/app_colors.dart'
;
import
'../../Utils/commonWidgets.dart'
;
import
'../../Utils/commonWidgets.dart'
;
class
Generatordetails
extends
StatefulWidget
{
class
Generatordetails
extends
StatefulWidget
{
const
Generatordetails
({
super
.
key
});
final
activityName
;
final
genLocation
;
final
generatorId
;
const
Generatordetails
({
super
.
key
,
this
.
activityName
,
this
.
genLocation
,
required
this
.
generatorId
,
});
@override
@override
State
<
Generatordetails
>
createState
()
=>
_GeneratordetailsState
();
State
<
Generatordetails
>
createState
()
=>
_GeneratordetailsState
();
...
@@ -24,8 +37,25 @@ class _GeneratordetailsState extends State<Generatordetails> {
...
@@ -24,8 +37,25 @@ class _GeneratordetailsState extends State<Generatordetails> {
context
,
context
,
listen:
false
,
listen:
false
,
);
);
var
homeProvider
=
Provider
.
of
<
HomescreenNotifier
>(
context
,
listen:
false
);
var
homeProvider
=
Provider
.
of
<
HomescreenNotifier
>(
details
.
LoadgeneratorDetailsApifunction
(
homeProvider
,
context
,
""
,
details
.
genID
);
context
,
listen:
false
,
);
if
(
widget
.
activityName
==
"NearByGenerators"
)
{
details
.
LoadTechniciangeneratorDetailsApifunction
(
homeProvider
,
context
,
""
,
widget
.
generatorId
,
);
}
else
{
details
.
LoadgeneratorDetailsApifunction
(
homeProvider
,
context
,
""
,
details
.
genID
,
);
}
});
});
}
}
...
@@ -33,9 +63,37 @@ class _GeneratordetailsState extends State<Generatordetails> {
...
@@ -33,9 +63,37 @@ class _GeneratordetailsState extends State<Generatordetails> {
Widget
build
(
BuildContext
context
)
{
Widget
build
(
BuildContext
context
)
{
return
Consumer
<
Generatordetailsprovider
>(
return
Consumer
<
Generatordetailsprovider
>(
builder:
(
context
,
provider
,
child
)
{
builder:
(
context
,
provider
,
child
)
{
var
sendwidget
=
Container
(
padding:
EdgeInsets
.
only
(
right:
10.0
),
child:
InkWell
(
onTap:
()
async
{
if
(
widget
.
genLocation
!=
null
)
{
var
loc
=
widget
.
genLocation
?.
split
(
","
).
toString
();
var
uri
=
Uri
.
parse
(
"google.navigation:q=
${loc![0]}
,
${loc![1]}
&mode=d"
,
);
if
(
Platform
.
isIOS
)
{
uri
=
Uri
.
parse
(
"maps://?q=
${loc![0]}
,
${loc![1]}
&z=10&daddr=
${loc![0]}
,
${loc![1]}
&dirflg=d"
,
);
}
if
(
await
canLaunch
(
uri
.
toString
()))
{
await
launch
(
uri
.
toString
());
}
else
{
throw
'Could not launch
${uri.toString()}
'
;
}
// val intent = Intent(Intent.ACTION_VIEW, Uri.parse(uri))
}
},
child:
Icon
(
Icons
.
directions
),
),
);
return
Scaffold
(
return
Scaffold
(
appBar:
appbar
(
context
,
"Visit Details"
),
appBar:
widget
.
activityName
==
"NearByGenerators"
?
appbar2
(
context
,
"Generator Details"
,
sendwidget
)
:
appbar
(
context
,
"Generator Details"
),
backgroundColor:
AppColors
.
scaffold_bg_color
,
backgroundColor:
AppColors
.
scaffold_bg_color
,
body:
Container
(
body:
Container
(
child:
SingleChildScrollView
(
child:
SingleChildScrollView
(
...
@@ -92,7 +150,15 @@ class _GeneratordetailsState extends State<Generatordetails> {
...
@@ -92,7 +150,15 @@ class _GeneratordetailsState extends State<Generatordetails> {
crossAxisAlignment:
crossAxisAlignment:
CrossAxisAlignment
.
start
,
CrossAxisAlignment
.
start
,
children:
[
children:
[
Text
(
textheads
[
j
].
toString
()),
SizedBox
(
width:
MediaQuery
.
of
(
context
,
).
size
.
width
*
0.75
,
child:
Text
(
textheads
[
j
].
toString
(),
maxLines:
2
,
overflow:
TextOverflow
.
ellipsis
,),
),
SizedBox
(
SizedBox
(
// height:45,
// height:45,
width:
width:
...
@@ -209,7 +275,6 @@ class _GeneratordetailsState extends State<Generatordetails> {
...
@@ -209,7 +275,6 @@ class _GeneratordetailsState extends State<Generatordetails> {
),
),
),
),
SizedBox
(
height:
75
),
SizedBox
(
height:
75
),
],
],
),
),
...
@@ -219,8 +284,10 @@ class _GeneratordetailsState extends State<Generatordetails> {
...
@@ -219,8 +284,10 @@ class _GeneratordetailsState extends State<Generatordetails> {
alignment:
Alignment
.
bottomCenter
,
alignment:
Alignment
.
bottomCenter
,
child:
InkWell
(
child:
InkWell
(
onTap:
()
{
onTap:
()
{
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
context
)
=>
Complainthistory
(),));
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
context
)
=>
Complainthistory
()),
);
},
},
child:
Container
(
child:
Container
(
alignment:
Alignment
.
bottomCenter
,
alignment:
Alignment
.
bottomCenter
,
...
...
lib/screens/serviceEngineer/NearbyGenerators.dart
View file @
2d144052
...
@@ -23,28 +23,203 @@ class _NearbygeneratorsState extends State<Nearbygenerators> {
...
@@ -23,28 +23,203 @@ class _NearbygeneratorsState extends State<Nearbygenerators> {
},);
},);
}
}
Future
infoDialogue
(
BuildContext
context
)
async
{
return
await
showDialog
(
context:
context
,
builder:
(
context
)
=>
Consumer
<
Nearbygeneratorsprovider
>(
builder:
(
context
,
provider
,
child
)
{
return
StatefulBuilder
(
builder:
(
context
,
setState
)
=>
AlertDialog
(
shape:
RoundedRectangleBorder
(
borderRadius:
BorderRadius
.
circular
(
10.0
),
),
title:
Column
(
children:
[
Row
(
children:
[
Expanded
(
child:
Align
(
alignment:
Alignment
.
topLeft
,
child:
Text
(
'Filter'
,
style:
TextStyle
(
color:
Colors
.
black
,
fontWeight:
FontWeight
.
w500
,
),
),
),
),
InkWell
(
child:
Icon
(
Icons
.
close
),
onTap:
()
{
setState
(()
{
provider
.
currentValue
=
0.0
;
provider
.
selectedItem
=
"Active"
;
});
Navigator
.
pop
(
context
);
},
),
],
),
Divider
(
color:
Colors
.
grey
,
thickness:
1.0
,
height:
0.0
,
),
],
),
content:
Container
(
height:
230
,
child:
Column
(
children:
[
Row
(
children:
[
Text
(
"Radius"
,
style:
TextStyle
(
fontSize:
18.0
,
fontWeight:
FontWeight
.
w500
,
),
),
Spacer
(),
Text
(
'
${provider.currentValue.toStringAsFixed(2)}
KM'
,
style:
TextStyle
(
fontSize:
18.0
,
fontWeight:
FontWeight
.
w500
,
),
),
],
),
Slider
(
value:
provider
.
currentValue
,
max:
100
,
divisions:
100
,
label:
provider
.
currentValue
.
toStringAsFixed
(
2
),
inactiveColor:
Colors
.
grey
,
onChanged:
(
value
)
{
provider
.
currentValue
=
value
;
provider
.
debounce
(()
{
provider
.
LoadNearbyGeneratorsAPI
(
context
);
},
Duration
(
milliseconds:
500
));
},
),
Text
(
'Status'
,
style:
TextStyle
(
color:
Colors
.
black
,
fontWeight:
FontWeight
.
w500
,
),
),
Container
(
width:
200
,
// Set the desired width here
child:
DropdownButton
<
String
>(
value:
provider
.
selectedItem
,
items:
<
String
>[
'Active'
,
'Inactive'
,
'Suspense'
,
].
map
<
DropdownMenuItem
<
String
>>((
String
value
,)
{
return
DropdownMenuItem
<
String
>(
value:
value
,
child:
Text
(
value
),
);
}).
toList
(),
onChanged:
(
String
?
newValue
)
{
setState
(()
{
provider
.
selectedItem
=
newValue
!;
});
},
icon:
Icon
(
Icons
.
keyboard_arrow_down
,
),
iconSize:
12
,
iconEnabledColor:
Colors
.
black
,
// Remove the default dropdown icon
),
),
SizedBox
(
height:
30.0
),
Container
(
child:
InkWell
(
onTap:
()
{
provider
.
debounce
(()
{
provider
.
LoadNearbyGeneratorsAPI
(
context
);
Navigator
.
pop
(
context
);
},
Duration
(
milliseconds:
500
));
},
child:
Container
(
alignment:
Alignment
.
center
,
height:
45
,
margin:
EdgeInsets
.
only
(
left:
15.0
,
right:
15.0
,
),
decoration:
BoxDecoration
(
borderRadius:
BorderRadius
.
circular
(
10.0
),
),
child:
Text
(
"Search"
,
textAlign:
TextAlign
.
center
,
style:
TextStyle
(
fontFamily:
'Nexa'
,
fontWeight:
FontWeight
.
w700
,
),
),
),
),
),
],
),
),
),
);
}),
barrierDismissible:
true
,
)
??
false
;
}
@override
@override
Widget
build
(
BuildContext
context
)
{
Widget
build
(
BuildContext
context
)
{
debugPrint
(
"Nearbygenerators widget rebuilt"
);
return
Consumer
<
Nearbygeneratorsprovider
>(
builder:
(
context
,
provider
,
child
)
{
return
Consumer
<
Nearbygeneratorsprovider
>(
builder:
(
context
,
provider
,
child
)
{
var
sendWidget
=
GestureDetector
(
onTap:
()
{
infoDialogue
(
context
);
},
child:
InkWell
(
child:
Icon
(
Icons
.
filter_alt_outlined
),
));
return
Scaffold
(
return
Scaffold
(
appBar:
appbar
(
context
,
"Nearby Generators"
),
appBar:
appbar
2
(
context
,
"Nearby Generators"
,
sendWidget
),
backgroundColor:
AppColors
.
scaffold_bg_color
,
backgroundColor:
AppColors
.
scaffold_bg_color
,
body:
Container
(
body:
Container
(
child:
SingleChildScrollView
(
child:
SingleChildScrollView
(
child:
Column
(
child:
Column
(
children:
[
children:
[
Expanded
(
ClipRRect
(
child:
ClipRRect
(
// Apply border radius using ClipRRect
// Apply border radius using ClipRRect
borderRadius:
BorderRadius
.
only
(
borderRadius:
BorderRadius
.
only
(
topLeft:
Radius
.
circular
(
30.0
),
topLeft:
Radius
.
circular
(
30.0
),
topRight:
Radius
.
circular
(
30.0
),
topRight:
Radius
.
circular
(
30.0
),
),
),
// padding: EdgeInsets.fromLTRB(10, 20, 10, 20),
// padding: EdgeInsets.fromLTRB(10, 20, 10, 20),
child:
Container
(
height:
MediaQuery
.
of
(
context
).
size
.
height
,
child:
Stack
(
children:
[
child:
Stack
(
children:
[
GoogleMap
(
GoogleMap
(
myLocationEnabled:
true
,
myLocationEnabled:
true
,
zoomGesturesEnabled:
true
,
zoomGesturesEnabled:
true
,
initialCameraPosition:
CameraPosition
(
initialCameraPosition:
CameraPosition
(
target:
provider
.
startLocation
,
target:
provider
.
startLocation
,
zoom:
14.0
,
zoom:
14.0
,
...
...
lib/screens/serviceEngineer/serviceEngineerDashboard.dart
View file @
2d144052
...
@@ -4,6 +4,7 @@ import 'package:generp/Notifiers/ServiceEngineerDashboardProvider.dart';
...
@@ -4,6 +4,7 @@ import 'package:generp/Notifiers/ServiceEngineerDashboardProvider.dart';
import
'package:generp/Utils/app_colors.dart'
;
import
'package:generp/Utils/app_colors.dart'
;
import
'package:generp/Utils/commonWidgets.dart'
;
import
'package:generp/Utils/commonWidgets.dart'
;
import
'package:generp/screens/serviceEngineer/MonthlyCollection.dart'
;
import
'package:generp/screens/serviceEngineer/MonthlyCollection.dart'
;
import
'package:generp/screens/serviceEngineer/NearbyGenerators.dart'
;
import
'package:generp/screens/serviceEngineer/PCWallet.dart'
;
import
'package:generp/screens/serviceEngineer/PCWallet.dart'
;
import
'package:generp/screens/serviceEngineer/PendingComplaints.dart'
;
import
'package:generp/screens/serviceEngineer/PendingComplaints.dart'
;
import
'package:generp/screens/serviceEngineer/TodayMontlyVisists.dart'
;
import
'package:generp/screens/serviceEngineer/TodayMontlyVisists.dart'
;
...
@@ -261,7 +262,11 @@ class _ServiceengineerdashboardState extends State<Serviceengineerdashboard> {
...
@@ -261,7 +262,11 @@ class _ServiceengineerdashboardState extends State<Serviceengineerdashboard> {
},
},
),
),
),
),
Container
(
InkResponse
(
onTap:
()
{
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
context
)
=>
Nearbygenerators
(),));
},
child:
Container
(
height:
60
,
height:
60
,
margin:
EdgeInsets
.
symmetric
(
horizontal:
10
,
vertical:
0
),
margin:
EdgeInsets
.
symmetric
(
horizontal:
10
,
vertical:
0
),
decoration:
BoxDecoration
(
decoration:
BoxDecoration
(
...
@@ -284,6 +289,7 @@ class _ServiceengineerdashboardState extends State<Serviceengineerdashboard> {
...
@@ -284,6 +289,7 @@ class _ServiceengineerdashboardState extends State<Serviceengineerdashboard> {
],
],
),
),
),
),
),
],
],
),
),
),
),
...
...
lib/services/api_calling.dart
View file @
2d144052
...
@@ -691,6 +691,7 @@ class ApiCalling {
...
@@ -691,6 +691,7 @@ class ApiCalling {
};
};
final
res
=
await
post
(
data
,
technicianNearbyGeneratorsUrl
,
{});
final
res
=
await
post
(
data
,
technicianNearbyGeneratorsUrl
,
{});
if
(
res
!=
null
)
{
if
(
res
!=
null
)
{
print
(
data
);
debugPrint
(
res
.
body
);
debugPrint
(
res
.
body
);
return
NearbyGeneratorsResponse
.
fromJson
(
jsonDecode
(
res
.
body
));
return
NearbyGeneratorsResponse
.
fromJson
(
jsonDecode
(
res
.
body
));
}
else
{
}
else
{
...
...
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