|
|
|
@ -48,8 +48,6 @@ class _MarkAttendanceWidgetState extends State<MarkAttendanceWidget> {
|
|
|
|
|
bool isAvailable = await NfcManager.instance.isAvailable();
|
|
|
|
|
setState(() {
|
|
|
|
|
AppState().privilegeListModel!.forEach((element) {
|
|
|
|
|
print(element.serviceName.toString() + " " + element.previlege.toString()); // Check availability
|
|
|
|
|
|
|
|
|
|
if (element.serviceName == "enableNFC") {
|
|
|
|
|
if (isAvailable) if (element.previlege ?? false) isNfcEnabled = true;
|
|
|
|
|
} else if (element.serviceName == "enableQR") {
|
|
|
|
@ -76,7 +74,6 @@ class _MarkAttendanceWidgetState extends State<MarkAttendanceWidget> {
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
|
print(MediaQuery.of(context).size.width);
|
|
|
|
|
return Container(
|
|
|
|
|
padding: EdgeInsets.only(left: 21, right: 21, bottom: 21, top: widget.topPadding),
|
|
|
|
|
decoration: const BoxDecoration(borderRadius: BorderRadius.only(topLeft: Radius.circular(25), topRight: Radius.circular(25)), color: Colors.white),
|
|
|
|
@ -134,12 +131,6 @@ class _MarkAttendanceWidgetState extends State<MarkAttendanceWidget> {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Future<void> performNfcAttendance(DashboardProviderModel model, {String lat = "0", String lng = "0"}) async {
|
|
|
|
|
if (isNfcLocationEnabled) {
|
|
|
|
|
print("nfc location enabled");
|
|
|
|
|
} else {
|
|
|
|
|
print("nfc not location enabled");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (Platform.isIOS) {
|
|
|
|
|
Utils.readNFc(onRead: (String nfcId) async {
|
|
|
|
|
Utils.showLoading(context);
|
|
|
|
@ -177,7 +168,6 @@ class _MarkAttendanceWidgetState extends State<MarkAttendanceWidget> {
|
|
|
|
|
});
|
|
|
|
|
} else {
|
|
|
|
|
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);
|
|
|
|
@ -214,12 +204,6 @@ class _MarkAttendanceWidgetState extends State<MarkAttendanceWidget> {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Future<void> performWifiAttendance(DashboardProviderModel model, {String lat = "0", String lng = "0"}) async {
|
|
|
|
|
if (isWifiLocationEnabled) {
|
|
|
|
|
print("wifi location enabled");
|
|
|
|
|
} else {
|
|
|
|
|
print("wifi not location enabled");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Utils.showLoading(context);
|
|
|
|
|
bool isConnected = await WiFiForIoTPlugin.connect(AppState().getMohemmWifiSSID ?? "",
|
|
|
|
|
password: AppState().getMohemmWifiPassword ?? "", joinOnce: Platform.isIOS ? false : true, security: NetworkSecurity.WPA, withInternet: false);
|
|
|
|
@ -271,7 +255,6 @@ class _MarkAttendanceWidgetState extends State<MarkAttendanceWidget> {
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
if (qrCodeValue != null) {
|
|
|
|
|
print("qrCode: " + qrCodeValue);
|
|
|
|
|
Utils.showLoading(context);
|
|
|
|
|
try {
|
|
|
|
|
GenericResponseModel? g = await DashboardApiClient().markAttendance(pointType: 1, isGpsRequired: isQrLocationEnabled, lat: lat, long: lng, QRValue: qrCodeValue);
|
|
|
|
|