|
|
|
|
@ -46,7 +46,7 @@ class _TodayAttendanceScreenState extends State<TodayAttendanceScreen> {
|
|
|
|
|
bool isAvailable = await NfcManager.instance.isAvailable();
|
|
|
|
|
setState(() {
|
|
|
|
|
AppState().privilegeListModel!.forEach((element) {
|
|
|
|
|
// Check availability
|
|
|
|
|
print(element.serviceName.toString() + " " + element.previlege.toString()); // Check availability
|
|
|
|
|
if (isAvailable) if (element.serviceName == "enableNFC") {
|
|
|
|
|
// if (element.previlege ?? false)
|
|
|
|
|
isNfcEnabled = true;
|
|
|
|
|
@ -190,21 +190,26 @@ class _TodayAttendanceScreenState extends State<TodayAttendanceScreen> {
|
|
|
|
|
gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount(crossAxisCount: 3, childAspectRatio: 1 / 1, crossAxisSpacing: 8, mainAxisSpacing: 8),
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
attendanceMethod("NFC", "assets/images/nfc.svg", isNfcEnabled, () {
|
|
|
|
|
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);
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
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 ?? "");
|
|
|
|
|
// 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());
|
|
|
|
|
// });
|
|
|
|
|
|