From e8fbffdc9c537678af346e5dc8afcda3a613e1e9 Mon Sep 17 00:00:00 2001 From: Sikander Saleem Date: Wed, 5 Jun 2024 14:58:07 +0300 Subject: [PATCH 1/5] scroll, padding & content by language added on image ad. --- .../itg/its_add_screen_video_image.dart | 57 ++++++++++--------- 1 file changed, 29 insertions(+), 28 deletions(-) diff --git a/lib/ui/landing/itg/its_add_screen_video_image.dart b/lib/ui/landing/itg/its_add_screen_video_image.dart index 60bd4ba..cf2d92b 100644 --- a/lib/ui/landing/itg/its_add_screen_video_image.dart +++ b/lib/ui/landing/itg/its_add_screen_video_image.dart @@ -1,8 +1,3 @@ -import 'dart:convert'; -import 'dart:io' as Io; -import 'dart:io'; -import 'dart:typed_data'; - import 'package:flutter/material.dart'; import 'package:flutter_countdown_timer/index.dart'; import 'package:lottie/lottie.dart'; @@ -17,7 +12,6 @@ import 'package:mohem_flutter_app/extensions/widget_extensions.dart'; import 'package:mohem_flutter_app/main.dart'; import 'package:mohem_flutter_app/models/itg/advertisement.dart' as ads; import 'package:mohem_flutter_app/widgets/button/default_button.dart'; -import 'package:path_provider/path_provider.dart'; import 'package:video_player/video_player.dart'; class ITGAdsScreen extends StatefulWidget { @@ -51,6 +45,10 @@ class _ITGAdsScreenState extends State { void checkFileType() { String? rFile = advertisementData!.viewAttachFileColl!.first.base64String; + try { + rFile = advertisementData!.viewAttachFileColl!.where((element) => element.languageId == AppState().getLanguageID(context)).toList().first.base64String; + } catch (ex) {} + String? rFileExt = advertisementData!.viewAttachFileColl!.first.fileName; ext = "." + rFileExt!.split(".").last.toLowerCase(); if (ext == ".png" || ext == ".jpg" || ext == ".jpeg" || ext == ".gif") { @@ -65,8 +63,8 @@ class _ITGAdsScreenState extends State { _futureController = createVideoPlayer(rFile!); } - // advertisementData?.actionButtonsColl!.forEach((element) { - advertisementData?.actionButtonsColl!.removeWhere((element1) => element1.actionButtonId == advertisementData?.skipButtonId); + // advertisementData?.actionButtonsColl!.forEach((element) { + advertisementData?.actionButtonsColl!.removeWhere((element1) => element1.actionButtonId == advertisementData?.skipButtonId); //}); // setState(() {}); @@ -264,26 +262,29 @@ class _ITGAdsScreenState extends State { }, ), if (isImage) - Column( - crossAxisAlignment: CrossAxisAlignment.center, - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Image.network(imageUrl), - 50.height, - Container(padding: const EdgeInsets.all(16), decoration: Utils.containerRadius(MyColors.white, 10), child: const Icon(Icons.thumb_up, color: MyColors.gradiantEndColor)).onPress( - () { - try { - Navigator.pop(context); - DashboardApiClient().setAdvertisementViewed(masterID!, advertisementData!.advertisementId!, "Like").then((value) { - logger.d(value); - }); - } catch (ex) { - logger.wtf(ex); - Utils.handleException(ex, context, null); - } - }, - ), - ], + SingleChildScrollView( + padding: const EdgeInsets.only(top: 60, left: 12, right: 12), + child: Column( + crossAxisAlignment: CrossAxisAlignment.center, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Image.network(imageUrl), + 50.height, + Container(padding: const EdgeInsets.all(16), decoration: Utils.containerRadius(MyColors.white, 10), child: const Icon(Icons.thumb_up, color: MyColors.gradiantEndColor)).onPress( + () { + try { + Navigator.pop(context); + DashboardApiClient().setAdvertisementViewed(masterID!, advertisementData!.advertisementId!, "Like").then((value) { + logger.d(value); + }); + } catch (ex) { + logger.wtf(ex); + Utils.handleException(ex, context, null); + } + }, + ), + ], + ), ), ], ), From 030887452da4960450bbd6c30c0ab1e51d84fad8 Mon Sep 17 00:00:00 2001 From: Sikander Saleem Date: Thu, 25 Jul 2024 10:40:33 +0300 Subject: [PATCH 2/5] generate QR Api added. --- assets/langs/ar-SA.json | 1 + assets/langs/en-US.json | 3 +- lib/api/worklist/worklist_api_client.dart | 31 +++++++++++++---- lib/generated/codegen_loader.g.dart | 4 ++- lib/generated/locale_keys.g.dart | 1 + lib/ui/login/login_screen.dart | 9 ++--- lib/ui/work_list/itg_detail_screen.dart | 41 +++++++++++++++++++++-- 7 files changed, 75 insertions(+), 15 deletions(-) diff --git a/assets/langs/ar-SA.json b/assets/langs/ar-SA.json index 8f127f2..c59641b 100644 --- a/assets/langs/ar-SA.json +++ b/assets/langs/ar-SA.json @@ -97,6 +97,7 @@ "reject": "يرفض", "approve": "يوافق", "cancel": "إلغاء", + "generate": "يولد", "requestedItems": "العناصر المطلوبة", "request": "طلب", "myRequest": "طلبي", diff --git a/assets/langs/en-US.json b/assets/langs/en-US.json index eec20d4..275864f 100644 --- a/assets/langs/en-US.json +++ b/assets/langs/en-US.json @@ -93,6 +93,7 @@ "whatsapp": "Whatsapp", "reject": "Reject", "approve": "Approve", + "generate": "Generate", "cancel": "Cancel", "requestedItems": "Requested Items", "request": "Request", @@ -547,7 +548,7 @@ "manageGroup": "Manage Group", "admin": "Admin", "addUsers": "Add users to the group", - "editGroups":"Edit Group", + "editGroups": "Edit Group", "groupNameshouldbe": "Group name should be minimum 10 character long", "enterGroupName": "Please enter valid group Name", "groupName": "Group Name", diff --git a/lib/api/worklist/worklist_api_client.dart b/lib/api/worklist/worklist_api_client.dart index d2389ab..732ed06 100644 --- a/lib/api/worklist/worklist_api_client.dart +++ b/lib/api/worklist/worklist_api_client.dart @@ -380,7 +380,7 @@ class WorkListApiClient { }, url, postParams); } - Future rejectITGRequest(String requestType, taskId, itemId, String employeeNumber, String comments) async { + Future rejectITGRequest(String requestType, taskId, itemId, String employeeNumber, String comments) async { String url = "${ApiConsts.cocRest}ITGRejectRequest"; Map postParams = { "RequestType": requestType, @@ -396,7 +396,7 @@ class WorkListApiClient { }, url, postParams); } - Future approveITGRequest(String requestType, taskId, itemId, String employeeNumber, String comments) async { + Future approveITGRequest(String requestType, taskId, itemId, String employeeNumber, String comments) async { String url = "${ApiConsts.cocRest}ITGApproveRequest"; Map postParams = { "RequestType": requestType, @@ -412,7 +412,7 @@ class WorkListApiClient { }, url, postParams); } - Future delegateITGRequest(String requestType, taskId, itemId, String employeeNumber, String newUserEMPId, String comments) async { + Future delegateITGRequest(String requestType, taskId, itemId, String employeeNumber, String newUserEMPId, String comments) async { String url = "${ApiConsts.cocRest}ITGDelegateRequest"; Map postParams = { "RequestType": requestType, @@ -431,7 +431,7 @@ class WorkListApiClient { // ANSWER = 'Services/COCWS.svc/REST/ITGAnswer'; - Future answerITGRequest(String requestType, taskId, itemId, String employeeNumber, String newUserEMPId, String comments) async { + Future answerITGRequest(String requestType, taskId, itemId, String employeeNumber, String newUserEMPId, String comments) async { String url = "${ApiConsts.cocRest}ITGAnswer"; Map postParams = { "RequestType": requestType, @@ -447,6 +447,25 @@ class WorkListApiClient { }, url, postParams); } + Future requestActionITGRequest(String requestType, taskId, itemId, String employeeNumber, String newUserEMPId, String comments) async { + String url = "${ApiConsts.cocRest}Mohemm_ITG_GenerateQR_RequestAction"; + Map postParams = { + "RequestType": requestType, + "TaskID": taskId, + "ItemIDStr":itemId, + "EmployeeNumber": employeeNumber, + "Comments": comments, + "RequestID": itemId, + "RequestActionId": 3, + "IsQRCodeGenerate": true, + }; + postParams.addAll(AppState().postParamsJson); + return await ApiClient().postJsonForObject((json) { + ItgFormsModel responseData = ItgFormsModel.fromJson(json); + return responseData.itgRequest; + }, url, postParams); + } + Future grantITGRequest(String requestType, int taskId, int itemId, String employeeNumber, String newUserEMPId, String comments) async { String url = "${ApiConsts.cocRest}ITGGrantAccess"; Map postParams = { @@ -465,7 +484,7 @@ class WorkListApiClient { }, url, postParams); } - Future informationITGRequest(String requestType, taskId, itemId, String employeeNumber, String newUserEMPId, String comments) async { + Future informationITGRequest(String requestType, taskId, itemId, String employeeNumber, String newUserEMPId, String comments) async { String url = "${ApiConsts.cocRest}ITGRequestInformation"; Map postParams = { "RequestType": requestType, @@ -581,8 +600,6 @@ class WorkListApiClient { }, url, postParams); } - - Future?> getFavoriteReplacementWithoutImage() async { String url = "${ApiConsts.erpRest}Mohemm_GetFavoriteReplacementsWithoutImage"; Map postParams = {}; diff --git a/lib/generated/codegen_loader.g.dart b/lib/generated/codegen_loader.g.dart index af972f6..1251dd6 100644 --- a/lib/generated/codegen_loader.g.dart +++ b/lib/generated/codegen_loader.g.dart @@ -551,6 +551,7 @@ class CodegenLoader extends AssetLoader { "uploadedDocuments": "المستندات التي تم تحميلها", "youCannotJoinTheMarathon": "لا يمكنك الانضمام إلى الماراثون لأنك تجاوزت الحد الزمني", "pleaseClickButtonToJoinMarathon": "الرجاء الضغط على الزر أدناه للانضمام إلى الماراثون", + "generate": "يولد", }; static const Map en_US = { "mohemm": "Mohemm", @@ -1107,7 +1108,8 @@ class CodegenLoader extends AssetLoader { "userName": "User Name", "userId": "UserID", "pleaseClickButtonToJoinMarathon": "Press the button below to join the Marathon.", - "youCannotJoinTheMarathon": "You cannot join the Marathon because you have exceeded the time limit." + "youCannotJoinTheMarathon": "You cannot join the Marathon because you have exceeded the time limit.", + "generate": "Generate" }; static const Map> mapLocales = {"ar_SA": ar_SA, "en_US": en_US}; } diff --git a/lib/generated/locale_keys.g.dart b/lib/generated/locale_keys.g.dart index a6fd43d..cc7f2b4 100644 --- a/lib/generated/locale_keys.g.dart +++ b/lib/generated/locale_keys.g.dart @@ -550,4 +550,5 @@ abstract class LocaleKeys { static const pleaseClickButtonToJoinMarathon ='pleaseClickButtonToJoinMarathon'; static const youCannotJoinTheMarathon ='youCannotJoinTheMarathon'; static const open ='open'; + static const generate = 'generate'; } diff --git a/lib/ui/login/login_screen.dart b/lib/ui/login/login_screen.dart index c85ecb7..d4f1644 100644 --- a/lib/ui/login/login_screen.dart +++ b/lib/ui/login/login_screen.dart @@ -8,7 +8,6 @@ import 'package:firebase_messaging/firebase_messaging.dart'; import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; - // import 'package:huawei_hmsavailability/huawei_hmsavailability.dart'; import 'package:mohem_flutter_app/api/login_api_client.dart'; import 'package:mohem_flutter_app/app_state/app_state.dart'; @@ -31,7 +30,6 @@ import 'package:mohem_flutter_app/models/member_login_list_model.dart'; import 'package:mohem_flutter_app/models/privilege_list_model.dart'; import 'package:mohem_flutter_app/widgets/button/default_button.dart'; import 'package:mohem_flutter_app/widgets/input_widget.dart'; - // import 'package:safe_device/safe_device.dart'; import 'package:wifi_iot/wifi_iot.dart'; @@ -116,8 +114,11 @@ class _LoginScreenState extends State { print("GOOGLE PLAY STOREEEE!!!!"); await Firebase.initializeApp(); _firebaseMessaging = FirebaseMessaging.instance; - firebaseToken = await _firebaseMessaging.getToken(); - print(firebaseToken); + try { + firebaseToken = await _firebaseMessaging.getToken(); + } catch (ex) { + firebaseToken = ""; + } AppNotifications().init(firebaseToken, context); checkLoginInfo(); await FirebaseCrashlytics.instance.setCrashlyticsCollectionEnabled(true); diff --git a/lib/ui/work_list/itg_detail_screen.dart b/lib/ui/work_list/itg_detail_screen.dart index e0c65cc..2aa9490 100644 --- a/lib/ui/work_list/itg_detail_screen.dart +++ b/lib/ui/work_list/itg_detail_screen.dart @@ -45,6 +45,7 @@ class _ItgDetailScreenState extends State { bool isCloseAvailable = false; bool isApproveAvailable = false; bool isRejectAvailable = false; + bool isGenerateAvailable = false; List allowedActionList = []; List itgFormAttachmentsList = []; @@ -76,6 +77,7 @@ class _ItgDetailScreenState extends State { isCloseAvailable = allowedActionList.any((element) => element.action == "CLOSE"); isApproveAvailable = itgRequest!.allowedActions!.any((element) => element.action == "Approve"); isRejectAvailable = itgRequest!.allowedActions!.any((element) => element.action == "Reject"); + isGenerateAvailable = itgRequest!.allowedActions!.any((element) => element.action == "Generate"); } Utils.hideLoading(context); setState(() { @@ -209,6 +211,16 @@ class _ItgDetailScreenState extends State { Color(0xff1BB271), ], ).expanded, + if ((isApproveAvailable ||isRejectAvailable) && isGenerateAvailable) 8.width, + if (isGenerateAvailable) + DefaultButton( + LocaleKeys.generate.tr(), + () => performAction("Generate"), + colors: const [ + Color(0xff28C884), + Color(0xff1BB271), + ], + ).expanded, if (isCloseAvailable) DefaultButton( LocaleKeys.ok.tr(), @@ -279,7 +291,7 @@ class _ItgDetailScreenState extends State { ], ), ), - floatingActionButton: (!isApproveAvailable && !isRejectAvailable && !isCloseAvailable) + floatingActionButton: (!isApproveAvailable && !isRejectAvailable && !isCloseAvailable && !isGenerateAvailable) ? Container( height: 43, width: 43, @@ -300,7 +312,7 @@ class _ItgDetailScreenState extends State { List viewApiButtonsList(List allowedActionList) { List fabs = []; for (int i = 0; i < allowedActionList.length; i++) { - if (allowedActionList[i].action! == "Reject" || allowedActionList[i].action! == "Approve" || allowedActionList[i].action! == "CLOSE") { + if (allowedActionList[i].action! == "Reject" || allowedActionList[i].action! == "Approve" || allowedActionList[i].action! == "CLOSE" || allowedActionList[i].action! == "Generate") { continue; } fabs.add(myFab(getFabActionTitle(allowedActionList[i].action!), getFabActionImages(allowedActionList[i].action!)).paddingOnly(bottom: 12).onPress(() => handleFabAction(allowedActionList[i]))); @@ -487,6 +499,8 @@ class _ItgDetailScreenState extends State { performApproveAction(requestDetails!.requestType!, requestDetails!.iD, requestDetails!.itemID, AppState().memberInformationList?.eMPLOYEENUMBER ?? "", note); } else if (actionMode == "Answer") { performAnswerAction(requestDetails!.requestType!, requestDetails!.iD, requestDetails!.itemID, AppState().memberInformationList?.eMPLOYEENUMBER ?? "", note); + } else if (actionMode == "Generate") { + performGenerateQrAction(requestDetails!.requestType!, requestDetails!.iD, requestDetails!.itemID, AppState().memberInformationList?.eMPLOYEENUMBER ?? "", note); } else { performRejectAction(requestDetails!.requestType!, requestDetails!.iD, requestDetails!.itemID, AppState().memberInformationList?.eMPLOYEENUMBER ?? "", note); } @@ -495,6 +509,29 @@ class _ItgDetailScreenState extends State { ); } + void performGenerateQrAction(String requestType, taskId, itemId, String employeeNumber, String comments) async { + try { + Utils.showLoading(context); + ITGRequest? itgRequest = await WorkListApiClient().requestActionITGRequest(requestType, taskId, itemId, employeeNumber, "", comments); + Utils.hideLoading(context); + Utils.showToast(LocaleKeys.yourChangeHasBeenSavedSuccessfully.tr()); + // Navigator.pop(context, "delegate_reload"); + AppState().requestAllList!.removeAt(AppState().itgWorkListIndex!); + if (AppState().requestAllList!.isEmpty) { + Navigator.pop(context, "delegate_reload"); + } else { + if (AppState().requestAllList!.length <= AppState().itgWorkListIndex!) { + Navigator.pop(context, "delegate_reload"); + } else { + requestDetails = null; + getDataFromState(); + } + } + } catch (ex) { + Utils.hideLoading(context); + Utils.handleException(ex, context, null); + } + } void performAnswerAction(String requestType, taskId, itemId, String employeeNumber, String comments) async { try { Utils.showLoading(context); From 550992ccf40b275e0e63b2b71f5d73cba74df628 Mon Sep 17 00:00:00 2001 From: Sikander Saleem Date: Sun, 28 Jul 2024 10:54:50 +0300 Subject: [PATCH 3/5] generate QR Api email parameter added. --- lib/api/worklist/worklist_api_client.dart | 5 +++-- lib/ui/work_list/itg_detail_screen.dart | 7 ++++--- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/lib/api/worklist/worklist_api_client.dart b/lib/api/worklist/worklist_api_client.dart index 732ed06..91cd04f 100644 --- a/lib/api/worklist/worklist_api_client.dart +++ b/lib/api/worklist/worklist_api_client.dart @@ -447,14 +447,15 @@ class WorkListApiClient { }, url, postParams); } - Future requestActionITGRequest(String requestType, taskId, itemId, String employeeNumber, String newUserEMPId, String comments) async { + Future requestActionITGRequest(String requestType, taskId, itemId, String employeeNumber, String newUserEMPId, String comments, String email) async { String url = "${ApiConsts.cocRest}Mohemm_ITG_GenerateQR_RequestAction"; Map postParams = { "RequestType": requestType, "TaskID": taskId, - "ItemIDStr":itemId, + "ItemIDStr": itemId, "EmployeeNumber": employeeNumber, "Comments": comments, + "EmailAddress": email, "RequestID": itemId, "RequestActionId": 3, "IsQRCodeGenerate": true, diff --git a/lib/ui/work_list/itg_detail_screen.dart b/lib/ui/work_list/itg_detail_screen.dart index 2aa9490..2381b70 100644 --- a/lib/ui/work_list/itg_detail_screen.dart +++ b/lib/ui/work_list/itg_detail_screen.dart @@ -211,11 +211,11 @@ class _ItgDetailScreenState extends State { Color(0xff1BB271), ], ).expanded, - if ((isApproveAvailable ||isRejectAvailable) && isGenerateAvailable) 8.width, + if ((isApproveAvailable || isRejectAvailable) && isGenerateAvailable) 8.width, if (isGenerateAvailable) DefaultButton( LocaleKeys.generate.tr(), - () => performAction("Generate"), + () => performAction("Generate"), colors: const [ Color(0xff28C884), Color(0xff1BB271), @@ -512,7 +512,8 @@ class _ItgDetailScreenState extends State { void performGenerateQrAction(String requestType, taskId, itemId, String employeeNumber, String comments) async { try { Utils.showLoading(context); - ITGRequest? itgRequest = await WorkListApiClient().requestActionITGRequest(requestType, taskId, itemId, employeeNumber, "", comments); + ITGRequest? itgRequest = + await WorkListApiClient().requestActionITGRequest(requestType, taskId, itemId, employeeNumber, "", comments, AppState().memberInformationList?.eMPLOYEEEMAILADDRESS ?? ""); Utils.hideLoading(context); Utils.showToast(LocaleKeys.yourChangeHasBeenSavedSuccessfully.tr()); // Navigator.pop(context, "delegate_reload"); From 3327130e74d4e64624975d2333c04792fde5042f Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Thu, 27 Jun 2024 17:04:40 +0300 Subject: [PATCH 4/5] Attendance location updates --- lib/app_state/app_state.dart | 2 +- lib/widgets/location/Location.dart | 4 +++- lib/widgets/mark_attendance_widget.dart | 21 +++++++++++++++++++++ 3 files changed, 25 insertions(+), 2 deletions(-) diff --git a/lib/app_state/app_state.dart b/lib/app_state/app_state.dart index 2e8e2ad..cc11126 100644 --- a/lib/app_state/app_state.dart +++ b/lib/app_state/app_state.dart @@ -90,7 +90,7 @@ class AppState { String get getHuaweiPushToken => _huaweiPushToken; - final PostParamsModel _postParamsInitConfig = PostParamsModel(channel: 31, versionID: 6.0, mobileType: Platform.isAndroid ? "android" : "ios"); + final PostParamsModel _postParamsInitConfig = PostParamsModel(channel: 31, versionID: 8.0, mobileType: Platform.isAndroid ? "android" : "ios"); void setPostParamsInitConfig() { isAuthenticated = false; diff --git a/lib/widgets/location/Location.dart b/lib/widgets/location/Location.dart index 67d3cdd..47babca 100644 --- a/lib/widgets/location/Location.dart +++ b/lib/widgets/location/Location.dart @@ -35,7 +35,7 @@ class Location { }); } - static void getCurrentLocation(Function(Position position, bool isMocked) callback, BuildContext context) { + static void getCurrentLocation(Function(Position position, bool isMocked) callback, Function errorCallBack, BuildContext context) { void done(Position position) { //AppStorage.sp.saveLocation(position); bool isMocked = position.isMocked; @@ -46,6 +46,8 @@ class Location { if (granted) { Geolocator.getCurrentPosition(desiredAccuracy: LocationAccuracy.medium, timeLimit: const Duration(seconds: 5)).then((value) { done(value); + }).catchError((err) { + errorCallBack(); }); } else { // AppPermissions diff --git a/lib/widgets/mark_attendance_widget.dart b/lib/widgets/mark_attendance_widget.dart index 75a5ef5..508ed00 100644 --- a/lib/widgets/mark_attendance_widget.dart +++ b/lib/widgets/mark_attendance_widget.dart @@ -171,14 +171,21 @@ class _MarkAttendanceWidgetState extends State { 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 { 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 { 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 { From 096c52d979a611cd7189a28eae0fb4b3528bfa90 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Sun, 28 Jul 2024 10:14:40 +0300 Subject: [PATCH 5/5] worklist updates --- android/app/build.gradle | 2 +- android/build.gradle | 2 +- lib/ui/work_list/worklist_detail_screen.dart | 8 +++++++- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/android/app/build.gradle b/android/app/build.gradle index 5279c1f..20bf8fb 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -34,7 +34,7 @@ apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" apply plugin: 'com.huawei.agconnect' android { - compileSdkVersion 33 + compileSdkVersion 34 compileOptions { sourceCompatibility JavaVersion.VERSION_1_8 diff --git a/android/build.gradle b/android/build.gradle index 5effa33..23ea6ba 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -7,7 +7,7 @@ buildscript { } dependencies { - classpath 'com.android.tools.build:gradle:7.0.3' + classpath 'com.android.tools.build:gradle:7.1.3' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" classpath 'com.google.gms:google-services:4.3.8' classpath 'com.huawei.agconnect:agcp:1.8.0.300' diff --git a/lib/ui/work_list/worklist_detail_screen.dart b/lib/ui/work_list/worklist_detail_screen.dart index 3bb3b5d..146bd44 100644 --- a/lib/ui/work_list/worklist_detail_screen.dart +++ b/lib/ui/work_list/worklist_detail_screen.dart @@ -499,6 +499,12 @@ class _WorkListDetailScreenState extends State { case "APPROVE": performAction(notificationButton.bUTTONACTION!); break; + case "TRY_APPROVE_AGAIN": + performAction(notificationButton.bUTTONACTION!); + break; + case "SEND_BACK_TO_PREPARER": + performAction(notificationButton.bUTTONACTION!); + break; case "UPDATE_ACTION": showMyBottomSheet( context, @@ -691,7 +697,7 @@ class _WorkListDetailScreenState extends State { "P_NOTIFICATION_ID": workListData!.nOTIFICATIONID, "RespondAttributeList":responseAttribute, }; - if (actionMode == "APPROVED" || actionMode == "APPROVE" || actionMode == "CLOSE" || actionMode == "ANSWER_INFO" || actionMode == "RFC") { + if (actionMode == "APPROVED" || actionMode == "APPROVE" || actionMode == "CLOSE" || actionMode == "ANSWER_INFO" || actionMode == "RFC" || actionMode == "TRY_APPROVE_AGAIN" || actionMode == "SEND_BACK_TO_PREPARER") { performNotificationAction(payload); } else if (note.isNotEmpty && (actionMode != "APPROVED" || actionMode != "APPROVE")) { performNotificationAction(payload);