|
|
|
|
@ -42,7 +42,7 @@ class _TodayAttendanceScreenState extends State<TodayAttendanceScreen> {
|
|
|
|
|
data = Provider.of<DashboardProviderModel>(context, listen: false);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
checkAttendanceAvailablity() async {
|
|
|
|
|
void checkAttendanceAvailablity() async {
|
|
|
|
|
bool isAvailable = await NfcManager.instance.isAvailable();
|
|
|
|
|
setState(() {
|
|
|
|
|
AppState().privilegeListModel!.forEach((element) {
|
|
|
|
|
@ -84,7 +84,7 @@ class _TodayAttendanceScreenState extends State<TodayAttendanceScreen> {
|
|
|
|
|
actions: [
|
|
|
|
|
IconButton(
|
|
|
|
|
onPressed: () {
|
|
|
|
|
data.fetchAttendanceTracking();
|
|
|
|
|
data.fetchAttendanceTracking(context);
|
|
|
|
|
},
|
|
|
|
|
icon: Icon(
|
|
|
|
|
Icons.ac_unit,
|
|
|
|
|
@ -192,8 +192,7 @@ class _TodayAttendanceScreenState extends State<TodayAttendanceScreen> {
|
|
|
|
|
attendanceMethod("NFC", "assets/images/nfc.svg", isNfcEnabled, () {
|
|
|
|
|
if (isNfcLocationEnabled) {
|
|
|
|
|
Location.getCurrentLocation((LatLng? latlng) {
|
|
|
|
|
print(latlng!.longitude.toString());
|
|
|
|
|
performNfcAttendance(model, lat: latlng.latitude.toString() ?? "", lng: latlng.longitude.toString() ?? "");
|
|
|
|
|
performNfcAttendance(model, lat: latlng?.latitude.toString() ?? "", lng: latlng?.longitude.toString() ?? "");
|
|
|
|
|
});
|
|
|
|
|
} else {
|
|
|
|
|
performNfcAttendance(model);
|
|
|
|
|
@ -246,12 +245,12 @@ class _TodayAttendanceScreenState extends State<TodayAttendanceScreen> {
|
|
|
|
|
Utils.showLoading(context);
|
|
|
|
|
try {
|
|
|
|
|
GenericResponseModel? g = await DashboardApiClient().markAttendance(pointType: 2, nfcValue: nfcId ?? "", isGpsRequired: isNfcLocationEnabled, lat: lat, long: lng);
|
|
|
|
|
bool status = await model.fetchAttendanceTracking();
|
|
|
|
|
bool status = await model.fetchAttendanceTracking(context);
|
|
|
|
|
Utils.hideLoading(context);
|
|
|
|
|
} catch (ex) {
|
|
|
|
|
print(ex);
|
|
|
|
|
Utils.hideLoading(context);
|
|
|
|
|
Utils.handleException(ex, (msg) {
|
|
|
|
|
Utils.handleException(ex, context, (msg) {
|
|
|
|
|
Utils.confirmDialog(context, msg);
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|