|
|
|
|
@ -171,14 +171,21 @@ class _MarkAttendanceWidgetState extends State<MarkAttendanceWidget> {
|
|
|
|
|
if (isEnabled) {
|
|
|
|
|
location.Location.havePermission((bool permission) {
|
|
|
|
|
if (permission) {
|
|
|
|
|
Utils.showLoading(context);
|
|
|
|
|
location.Location.getCurrentLocation(
|
|
|
|
|
(Position position, bool isMocked) {
|
|
|
|
|
if (isMocked) {
|
|
|
|
|
Utils.hideLoading(context);
|
|
|
|
|
markFakeAttendance("NFC", position.latitude.toString() ?? "", position.longitude.toString() ?? "");
|
|
|
|
|
} else {
|
|
|
|
|
Utils.hideLoading(context);
|
|
|
|
|
performNfcAttendance(widget.model, lat: position.latitude.toString() ?? "", lng: position.longitude.toString() ?? "");
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
() {
|
|
|
|
|
Utils.hideLoading(context);
|
|
|
|
|
Utils.confirmDialog(context, "Unable to determine your location, Please make sure that your location services are turned on & working.");
|
|
|
|
|
},
|
|
|
|
|
context,
|
|
|
|
|
);
|
|
|
|
|
} else {
|
|
|
|
|
@ -218,14 +225,21 @@ class _MarkAttendanceWidgetState extends State<MarkAttendanceWidget> {
|
|
|
|
|
if (isEnabled) {
|
|
|
|
|
location.Location.havePermission((bool permission) {
|
|
|
|
|
if (permission) {
|
|
|
|
|
Utils.showLoading(context);
|
|
|
|
|
location.Location.getCurrentLocation(
|
|
|
|
|
(Position position, bool isMocked) {
|
|
|
|
|
if (isMocked) {
|
|
|
|
|
Utils.hideLoading(context);
|
|
|
|
|
markFakeAttendance("WIFI", position.latitude.toString() ?? "", position.longitude.toString() ?? "");
|
|
|
|
|
} else {
|
|
|
|
|
Utils.hideLoading(context);
|
|
|
|
|
performWifiAttendance(widget.model, lat: position.latitude.toString() ?? "", lng: position.longitude.toString() ?? "");
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
() {
|
|
|
|
|
Utils.hideLoading(context);
|
|
|
|
|
Utils.confirmDialog(context, "Unable to determine your location, Please make sure that your location services are turned on & working.");
|
|
|
|
|
},
|
|
|
|
|
context,
|
|
|
|
|
);
|
|
|
|
|
} else {
|
|
|
|
|
@ -265,14 +279,21 @@ class _MarkAttendanceWidgetState extends State<MarkAttendanceWidget> {
|
|
|
|
|
if (isEnabled) {
|
|
|
|
|
location.Location.havePermission((bool permission) {
|
|
|
|
|
if (permission) {
|
|
|
|
|
Utils.showLoading(context);
|
|
|
|
|
location.Location.getCurrentLocation(
|
|
|
|
|
(Position position, bool isMocked) {
|
|
|
|
|
if (isMocked) {
|
|
|
|
|
Utils.hideLoading(context);
|
|
|
|
|
markFakeAttendance("QR", position.latitude.toString() ?? "", position.longitude.toString() ?? "");
|
|
|
|
|
} else {
|
|
|
|
|
Utils.hideLoading(context);
|
|
|
|
|
performQrCodeAttendance(widget.model, lat: position.latitude.toString() ?? "", lng: position.longitude.toString() ?? "");
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
() {
|
|
|
|
|
Utils.hideLoading(context);
|
|
|
|
|
Utils.confirmDialog(context, "Unable to determine your location, Please make sure that your location services are turned on & working.");
|
|
|
|
|
},
|
|
|
|
|
context,
|
|
|
|
|
);
|
|
|
|
|
} else {
|
|
|
|
|
|