|  |  |  | @ -33,7 +33,7 @@ class TodayAttendanceScreen extends StatefulWidget { | 
		
	
		
			
				|  |  |  |  | class _TodayAttendanceScreenState extends State<TodayAttendanceScreen> { | 
		
	
		
			
				|  |  |  |  |   ValueNotifier<dynamic> result = ValueNotifier(null); | 
		
	
		
			
				|  |  |  |  |   late DashboardProviderModel data; | 
		
	
		
			
				|  |  |  |  |   bool isNfcEnabled = false, isNfcLocationEnabled = false, isQrEnabled = false, isQrLocationEnabled = false, isWifiEnabled = false, isWifiLocationEnabled = false; | 
		
	
		
			
				|  |  |  |  |   bool isNfcEnabled = true, isNfcLocationEnabled = false, isQrEnabled = false, isQrLocationEnabled = false, isWifiEnabled = false, isWifiLocationEnabled = false; | 
		
	
		
			
				|  |  |  |  | 
 | 
		
	
		
			
				|  |  |  |  |   @override | 
		
	
		
			
				|  |  |  |  |   void initState() { | 
		
	
	
		
			
				
					|  |  |  | @ -47,14 +47,14 @@ class _TodayAttendanceScreenState extends State<TodayAttendanceScreen> { | 
		
	
		
			
				|  |  |  |  |     setState(() { | 
		
	
		
			
				|  |  |  |  |       AppState().privilegeListModel!.forEach((element) { | 
		
	
		
			
				|  |  |  |  |         print(element.serviceName.toString() + "   " + element.previlege.toString()); // Check availability | 
		
	
		
			
				|  |  |  |  |         if (isAvailable) if (element.serviceName == "enableNFC") { | 
		
	
		
			
				|  |  |  |  |           // if (element.previlege ?? false) | 
		
	
		
			
				|  |  |  |  |           isNfcEnabled = true; | 
		
	
		
			
				|  |  |  |  | 
 | 
		
	
		
			
				|  |  |  |  |         if (element.serviceName == "enableNFC") { | 
		
	
		
			
				|  |  |  |  |           if (isAvailable) if (element.previlege ?? false) isNfcEnabled = true; | 
		
	
		
			
				|  |  |  |  |         } else if (element.serviceName == "enableQR") { | 
		
	
		
			
				|  |  |  |  |           if (element.previlege ?? false) isQrEnabled = true; | 
		
	
		
			
				|  |  |  |  |         } else if (element.serviceName == "enableWIFI") { | 
		
	
		
			
				|  |  |  |  |           if (element.previlege ?? false) isWifiEnabled = true; | 
		
	
		
			
				|  |  |  |  |         } else if (element.serviceName == "enableLocatoinNFC") { | 
		
	
		
			
				|  |  |  |  |         } else if (element.serviceName!.trim() == "enableLocationNFC") { | 
		
	
		
			
				|  |  |  |  |           if (element.previlege ?? false) isNfcLocationEnabled = true; | 
		
	
		
			
				|  |  |  |  |         } else if (element.serviceName == "enableLocationQR") { | 
		
	
		
			
				|  |  |  |  |           if (element.previlege ?? false) isQrLocationEnabled = true; | 
		
	
	
		
			
				
					|  |  |  | @ -191,28 +191,13 @@ class _TodayAttendanceScreenState extends State<TodayAttendanceScreen> { | 
		
	
		
			
				|  |  |  |  |                                       children: <Widget>[ | 
		
	
		
			
				|  |  |  |  |                                         attendanceMethod("NFC", "assets/images/nfc.svg", isNfcEnabled, () { | 
		
	
		
			
				|  |  |  |  |                                           if (isNfcLocationEnabled) { | 
		
	
		
			
				|  |  |  |  |                                             print("nfc location enabled"); | 
		
	
		
			
				|  |  |  |  |                                             Location.getCurrentLocation((LatLng? latlng) { | 
		
	
		
			
				|  |  |  |  |                                               print(latlng!.longitude.toString()); | 
		
	
		
			
				|  |  |  |  |                                               performNfcAttendance(model, lat: latlng.latitude.toString() ?? "", lng: latlng.longitude.toString() ?? ""); | 
		
	
		
			
				|  |  |  |  |                                             }); | 
		
	
		
			
				|  |  |  |  |                                           } else { | 
		
	
		
			
				|  |  |  |  |                                             print("nfc not location enabled"); | 
		
	
		
			
				|  |  |  |  |                                             performNfcAttendance(model); | 
		
	
		
			
				|  |  |  |  |                                           } | 
		
	
		
			
				|  |  |  |  |                                           // showNfcReader(context, onNcfScan: (String? nfcId) async { | 
		
	
		
			
				|  |  |  |  |                                           //   print(nfcId); | 
		
	
		
			
				|  |  |  |  |                                           //   Utils.showLoading(context); | 
		
	
		
			
				|  |  |  |  |                                           //   try { | 
		
	
		
			
				|  |  |  |  |                                           //     GenericResponseModel? g = await DashboardApiClient().markAttendance(pointType: 2, nfcValue: nfcId ?? ""); | 
		
	
		
			
				|  |  |  |  |                                           //     bool status = await model.fetchAttendanceTracking(); | 
		
	
		
			
				|  |  |  |  |                                           //     Utils.hideLoading(context); | 
		
	
		
			
				|  |  |  |  |                                           //   } catch (ex) { | 
		
	
		
			
				|  |  |  |  |                                           //     print(ex); | 
		
	
		
			
				|  |  |  |  |                                           //     Utils.hideLoading(context); | 
		
	
		
			
				|  |  |  |  |                                           //     Utils.handleException(ex, (msg) { | 
		
	
		
			
				|  |  |  |  |                                           //       Utils.confirmDialog(context, msg); | 
		
	
		
			
				|  |  |  |  |                                           //     }); | 
		
	
		
			
				|  |  |  |  |                                           //   } | 
		
	
		
			
				|  |  |  |  |                                           // }); | 
		
	
		
			
				|  |  |  |  |                                           // Location.getCurrentLocation((LatLng? latlng) { | 
		
	
		
			
				|  |  |  |  |                                           //   print(latlng!.longitude.toString()); | 
		
	
		
			
				|  |  |  |  |                                           // }); | 
		
	
		
			
				|  |  |  |  |                                         }), | 
		
	
		
			
				|  |  |  |  |                                         attendanceMethod("Wifi", "assets/images/wufu.svg", isWifiEnabled, () {}), | 
		
	
		
			
				|  |  |  |  |                                       ], | 
		
	
	
		
			
				
					|  |  |  | @ -249,6 +234,30 @@ class _TodayAttendanceScreenState extends State<TodayAttendanceScreen> { | 
		
	
		
			
				|  |  |  |  |     ); | 
		
	
		
			
				|  |  |  |  |   } | 
		
	
		
			
				|  |  |  |  | 
 | 
		
	
		
			
				|  |  |  |  |   Future<void> performNfcAttendance(DashboardProviderModel model, {String lat = "0", String lng = "0"}) async { | 
		
	
		
			
				|  |  |  |  |     if (isNfcLocationEnabled) { | 
		
	
		
			
				|  |  |  |  |       print("nfc location enabled"); | 
		
	
		
			
				|  |  |  |  |     } else { | 
		
	
		
			
				|  |  |  |  |       print("nfc not location enabled"); | 
		
	
		
			
				|  |  |  |  |     } | 
		
	
		
			
				|  |  |  |  | 
 | 
		
	
		
			
				|  |  |  |  |     showNfcReader(context, onNcfScan: (String? nfcId) async { | 
		
	
		
			
				|  |  |  |  |       print(nfcId); | 
		
	
		
			
				|  |  |  |  |       Utils.showLoading(context); | 
		
	
		
			
				|  |  |  |  |       try { | 
		
	
		
			
				|  |  |  |  |         GenericResponseModel? g = await DashboardApiClient().markAttendance(pointType: 2, nfcValue: nfcId ?? "", isGpsRequired: isNfcLocationEnabled, lat: lat, long: lng); | 
		
	
		
			
				|  |  |  |  |         bool status = await model.fetchAttendanceTracking(); | 
		
	
		
			
				|  |  |  |  |         Utils.hideLoading(context); | 
		
	
		
			
				|  |  |  |  |       } catch (ex) { | 
		
	
		
			
				|  |  |  |  |         print(ex); | 
		
	
		
			
				|  |  |  |  |         Utils.hideLoading(context); | 
		
	
		
			
				|  |  |  |  |         Utils.handleException(ex, (msg) { | 
		
	
		
			
				|  |  |  |  |           Utils.confirmDialog(context, msg); | 
		
	
		
			
				|  |  |  |  |         }); | 
		
	
		
			
				|  |  |  |  |       } | 
		
	
		
			
				|  |  |  |  |     }); | 
		
	
		
			
				|  |  |  |  |   } | 
		
	
		
			
				|  |  |  |  | 
 | 
		
	
		
			
				|  |  |  |  |   Widget attendanceMethod(String title, String image, bool isEnabled, VoidCallback onPress) => Container( | 
		
	
		
			
				|  |  |  |  |         decoration: BoxDecoration( | 
		
	
		
			
				|  |  |  |  |           borderRadius: BorderRadius.circular(15), | 
		
	
	
		
			
				
					|  |  |  | 
 |