|
|
|
|
@ -157,7 +157,7 @@ class SwipeGeneralUtils {
|
|
|
|
|
(Location location) async {
|
|
|
|
|
hideLoading(context);
|
|
|
|
|
await locationService.removeLocationUpdates(requestCode);
|
|
|
|
|
handleSwipeOperation(swipeType: attendanceType, context: context);
|
|
|
|
|
handleSwipeOperation(swipeType: attendanceType, context: context,lat:location.latitude ,long:location.longitude );
|
|
|
|
|
requestCode = 0;
|
|
|
|
|
},
|
|
|
|
|
);
|
|
|
|
|
@ -234,13 +234,13 @@ class SwipeGeneralUtils {
|
|
|
|
|
// }
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void handleSwipeOperation({@required SwipeTypeEnum swipeType, double lat, double lang, BuildContext context}) {
|
|
|
|
|
void handleSwipeOperation({@required SwipeTypeEnum swipeType, double lat, double long, BuildContext context}) {
|
|
|
|
|
switch (swipeType) {
|
|
|
|
|
case SwipeTypeEnum.NFC:
|
|
|
|
|
handleNfcAttendance(latitude: lat, longitude: lang, context: context);
|
|
|
|
|
handleNfcAttendance(latitude: lat, longitude: long, context: context);
|
|
|
|
|
return;
|
|
|
|
|
case SwipeTypeEnum.QR:
|
|
|
|
|
performQrCodeAttendance(latitude: lat, longitude: lang, context: context);
|
|
|
|
|
performQrCodeAttendance(latitude: lat, longitude: long, context: context);
|
|
|
|
|
return;
|
|
|
|
|
case SwipeTypeEnum.Wifi:
|
|
|
|
|
//TODO need to implement.
|
|
|
|
|
@ -333,6 +333,7 @@ class SwipeGeneralUtils {
|
|
|
|
|
|
|
|
|
|
final swipeResponse = await userProvider.makeSwipe(model: swipeModel);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (swipeResponse.isSuccess) {
|
|
|
|
|
hideLoading(context);
|
|
|
|
|
Navigator.pushNamed(context, SwipeSuccessView.routeName);
|
|
|
|
|
@ -361,7 +362,7 @@ class SwipeGeneralUtils {
|
|
|
|
|
markFakeAttendance(swipeType.name, position.latitude.toString() ?? "", position.longitude.toString() ?? "", context);
|
|
|
|
|
} else {
|
|
|
|
|
hideLoading(context);
|
|
|
|
|
handleSwipeOperation(swipeType: swipeType, lat: position.latitude, lang: position.longitude, context: context);
|
|
|
|
|
handleSwipeOperation(swipeType: swipeType, lat: position.latitude, long: position.longitude, context: context);
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
() {
|
|
|
|
|
|