From 2bdaaf9e16da41ad193b82a4bd00bde1f2b80308 Mon Sep 17 00:00:00 2001 From: "taha.alam" Date: Wed, 31 Jul 2024 11:50:29 +0300 Subject: [PATCH 01/26] WD: flutter upgrade fron 3.7 to 3.19.0 --- lib/classes/notifications.dart | 4 +-- lib/dialogs/otp_dialog.dart | 1 + lib/theme/app_theme.dart | 4 +-- .../attendance/monthly_attendance_screen.dart | 6 ++-- lib/ui/chat/chat_home_screen.dart | 2 ++ lib/ui/login/verify_last_login_screen.dart | 28 +++++++++++++++---- lib/ui/login/verify_login_screen.dart | 21 ++++++++++++-- lib/ui/my_team/view_attendance.dart | 6 ++-- lib/ui/profile/delete_family_member.dart | 5 ++-- .../offers_and_discounts_details.dart | 2 +- lib/widgets/app_bar_widget.dart | 2 ++ lib/widgets/chat_app_bar_widge.dart | 2 ++ lib/widgets/nfc/nfc_reader_sheet.dart | 1 + pubspec.yaml | 14 +++++----- 14 files changed, 69 insertions(+), 29 deletions(-) diff --git a/lib/classes/notifications.dart b/lib/classes/notifications.dart index 8f432d7..058606c 100644 --- a/lib/classes/notifications.dart +++ b/lib/classes/notifications.dart @@ -34,8 +34,8 @@ class AppNotifications { if (Platform.isIOS) { await flutterLocalNotificationsPlugin.resolvePlatformSpecificImplementation()?.requestPermissions(alert: true, badge: true, sound: true); } else if (Platform.isAndroid) { - AndroidFlutterLocalNotificationsPlugin? androidImplementation = flutterLocalNotificationsPlugin.resolvePlatformSpecificImplementation(); - bool? granted = await androidImplementation?.requestPermission(); + AndroidFlutterLocalNotificationsPlugin? androidImplementation = flutterLocalNotificationsPlugin.resolvePlatformSpecificImplementation(); + bool? granted = await androidImplementation?.requestNotificationsPermission(); if (granted == false) { if (kDebugMode) { print("-------------------- Permission Granted ------------------------"); diff --git a/lib/dialogs/otp_dialog.dart b/lib/dialogs/otp_dialog.dart index 9f7c82e..1404131 100644 --- a/lib/dialogs/otp_dialog.dart +++ b/lib/dialogs/otp_dialog.dart @@ -67,6 +67,7 @@ class OtpDialog { // projectProvider = Provider.of(context); return Dialog( backgroundColor: Colors.white, + surfaceTintColor: Colors.transparent, shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(20)), insetPadding: const EdgeInsets.only(left: 21, right: 21), child: StatefulBuilder(builder: (context, setState) { diff --git a/lib/theme/app_theme.dart b/lib/theme/app_theme.dart index 586c3aa..e46ee34 100644 --- a/lib/theme/app_theme.dart +++ b/lib/theme/app_theme.dart @@ -1,4 +1,5 @@ import 'package:flutter/material.dart'; +import 'package:flutter/services.dart'; import 'package:mohem_flutter_app/classes/colors.dart'; import 'package:mohem_flutter_app/theme/colors.dart'; @@ -26,7 +27,6 @@ class AppTheme { splashColor: Colors.transparent, primaryColor: primaryColor, primaryColorDark: primaryColor, - buttonColor: Colors.black, toggleableActiveColor: secondaryColor, indicatorColor: secondaryColor, bottomSheetTheme: const BottomSheetThemeData( @@ -44,7 +44,7 @@ class AppTheme { floatingActionButtonTheme: const FloatingActionButtonThemeData(highlightElevation: 2, disabledElevation: 0, elevation: 2), appBarTheme: AppBarTheme( color: const Color(0xff515A5D), - brightness: Brightness.light, + systemOverlayStyle: const SystemUiOverlayStyle(statusBarBrightness: Brightness.light), elevation: 0.0, actionsIconTheme: IconThemeData( color: Colors.grey[800], diff --git a/lib/ui/attendance/monthly_attendance_screen.dart b/lib/ui/attendance/monthly_attendance_screen.dart index 65f101b..821a4f0 100644 --- a/lib/ui/attendance/monthly_attendance_screen.dart +++ b/lib/ui/attendance/monthly_attendance_screen.dart @@ -16,7 +16,7 @@ import 'package:mohem_flutter_app/models/get_schedule_shifts_details_list_model. import 'package:mohem_flutter_app/models/get_time_card_summary_list_model.dart'; import 'package:mohem_flutter_app/widgets/app_bar_widget.dart'; import 'package:mohem_flutter_app/widgets/circular_step_progress_bar.dart'; -import 'package:month_picker_dialog_2/month_picker_dialog_2.dart'; +import 'package:month_picker_dialog/month_picker_dialog.dart'; import 'package:pie_chart/pie_chart.dart'; import 'package:syncfusion_flutter_calendar/calendar.dart'; @@ -117,8 +117,8 @@ class _MonthlyAttendanceScreenState extends State { initialDate: formattedDate, firstDate: DateTime(searchYear - 2), lastDate: DateTime.now(), - confirmText: Text(LocaleKeys.confirm.tr()), - cancelText: Text(LocaleKeys.cancel.tr()), + confirmWidget: Text(LocaleKeys.confirm.tr()), + cancelWidget: Text(LocaleKeys.cancel.tr()), ).then((selectedDate) { if (selectedDate != null) { searchMonth = getMonth(selectedDate.month); diff --git a/lib/ui/chat/chat_home_screen.dart b/lib/ui/chat/chat_home_screen.dart index 04d7c2e..68cc7fb 100644 --- a/lib/ui/chat/chat_home_screen.dart +++ b/lib/ui/chat/chat_home_screen.dart @@ -214,6 +214,8 @@ class _ChatHomeScreenState extends State { }, ), floatingActionButton: FloatingActionButton( + elevation: 0, + backgroundColor : Colors.transparent, child: Container( width: 60, height: 60, diff --git a/lib/ui/login/verify_last_login_screen.dart b/lib/ui/login/verify_last_login_screen.dart index c6bd0f3..b63fb84 100644 --- a/lib/ui/login/verify_last_login_screen.dart +++ b/lib/ui/login/verify_last_login_screen.dart @@ -4,8 +4,9 @@ import 'package:easy_localization/src/public_ext.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:flutter_svg/svg.dart'; -import 'package:local_auth/auth_strings.dart'; import 'package:local_auth/local_auth.dart'; +import 'package:local_auth_darwin/local_auth_darwin.dart'; +import 'package:local_auth_android/local_auth_android.dart'; import 'package:mohem_flutter_app/api/login_api_client.dart'; import 'package:mohem_flutter_app/app_state/app_state.dart'; import 'package:mohem_flutter_app/classes/colors.dart'; @@ -63,6 +64,7 @@ class _VerifyLastLoginScreenState extends State { return Scaffold( appBar: AppBar( + surfaceTintColor: Colors.transparent, backgroundColor: Colors.transparent, automaticallyImplyLeading: false, title: (mobileLoginInfoListModel?.businessCardPrivilege ?? false) @@ -219,11 +221,17 @@ class _VerifyLastLoginScreenState extends State { } Future loginWithFaceIDAndBiometrics() async { - IOSAuthMessages iosStrings = - const IOSAuthMessages(cancelButton: 'cancel', goToSettingsButton: 'settings', goToSettingsDescription: 'Please set up your Touch ID.', lockOut: 'Please reenable your Touch ID'); + IOSAuthMessages iosStrings = const IOSAuthMessages(cancelButton: 'cancel', goToSettingsButton: 'settings', goToSettingsDescription: 'Please set up your Touch ID.', lockOut: 'Please reenable your Touch ID'); bool authenticated = false; try { - authenticated = await auth.authenticate(localizedReason: 'Scan your fingerprint to authenticate', useErrorDialogs: true, stickyAuth: true, biometricOnly: true, iOSAuthStrings: iosStrings); + authenticated = await auth.authenticate(localizedReason: 'Scan your fingerprint to authenticate', options: const AuthenticationOptions( + useErrorDialogs: true, stickyAuth: true, biometricOnly: true, + ), + authMessages: [ + iosStrings, + const AndroidAuthMessages(), + ], + ); } on PlatformException catch (e) { print(e); Utils.hideLoading(context); @@ -233,7 +241,17 @@ class _VerifyLastLoginScreenState extends State { } Widget _loginOptionButton(String _title, String _icon, int _flag, int? _loginIndex) { - bool isDisable = ((_flag == 3 && !checkBiometricIsAvailable(BiometricType.face)) || (_flag == 4 && !checkBiometricIsAvailable(BiometricType.fingerprint))); + bool isDisable = false; + if(_flag >= 3 && _flag <= 4) { + bool isFaceEnabled = (_flag == 3 && (checkBiometricIsAvailable(BiometricType.face) || + checkBiometricIsAvailable(BiometricType.weak))); + + bool isThumbEnabled = + (_flag == 4 && (checkBiometricIsAvailable(BiometricType.fingerprint) || + checkBiometricIsAvailable(BiometricType.strong))); + + isDisable = !(isFaceEnabled || isThumbEnabled); + } return InkWell( onTap: isDisable ? null diff --git a/lib/ui/login/verify_login_screen.dart b/lib/ui/login/verify_login_screen.dart index ac3c454..4358190 100644 --- a/lib/ui/login/verify_login_screen.dart +++ b/lib/ui/login/verify_login_screen.dart @@ -4,7 +4,8 @@ import 'package:easy_localization/src/public_ext.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:flutter_svg/svg.dart'; -import 'package:local_auth/auth_strings.dart'; +import 'package:local_auth_darwin/local_auth_darwin.dart'; +import 'package:local_auth_android/local_auth_android.dart'; import 'package:local_auth/local_auth.dart'; import 'package:mohem_flutter_app/api/login_api_client.dart'; import 'package:mohem_flutter_app/app_state/app_state.dart'; @@ -516,7 +517,11 @@ class _VerifyLoginScreenState extends State { const IOSAuthMessages(cancelButton: 'cancel', goToSettingsButton: 'settings', goToSettingsDescription: 'Please set up your Touch ID.', lockOut: 'Please reenable your Touch ID'); bool authenticated = false; try { - authenticated = await auth.authenticate(localizedReason: 'Scan your fingerprint to authenticate', useErrorDialogs: true, stickyAuth: true, biometricOnly: true, iOSAuthStrings: iosStrings); + authenticated = await auth.authenticate(localizedReason: 'Scan your fingerprint to authenticate', + options: const AuthenticationOptions(useErrorDialogs: true, stickyAuth: true, biometricOnly: true,), authMessages: [ + iosStrings, + const AndroidAuthMessages(), + ],); } on PlatformException catch (e) { print(e); Utils.hideLoading(context); @@ -526,7 +531,17 @@ class _VerifyLoginScreenState extends State { } Widget _loginOptionButton(String _title, String _icon, int _flag, int? _loginIndex) { - bool isDisable = ((_flag == 3 && !checkBiometricIsAvailable(BiometricType.face)) || (_flag == 4 && !checkBiometricIsAvailable(BiometricType.fingerprint))); + bool isDisable = false; + if(_flag >= 3 && _flag <= 4) { + bool isFaceEnabled = (_flag == 3 && (checkBiometricIsAvailable(BiometricType.face) || + checkBiometricIsAvailable(BiometricType.weak))); + + bool isThumbEnabled = + (_flag == 4 && (checkBiometricIsAvailable(BiometricType.fingerprint) || + checkBiometricIsAvailable(BiometricType.strong))); + + isDisable = !(isFaceEnabled || isThumbEnabled); + } return InkWell( onTap: isDisable ? null diff --git a/lib/ui/my_team/view_attendance.dart b/lib/ui/my_team/view_attendance.dart index a45f35c..15c4325 100644 --- a/lib/ui/my_team/view_attendance.dart +++ b/lib/ui/my_team/view_attendance.dart @@ -15,7 +15,7 @@ import 'package:mohem_flutter_app/models/get_time_card_summary_list_model.dart'; import 'package:mohem_flutter_app/models/my_team/get_employee_subordinates_list.dart'; import 'package:mohem_flutter_app/widgets/app_bar_widget.dart'; import 'package:mohem_flutter_app/widgets/circular_step_progress_bar.dart'; -import 'package:month_picker_dialog_2/month_picker_dialog_2.dart'; +import 'package:month_picker_dialog/month_picker_dialog.dart'; import 'package:pie_chart/pie_chart.dart'; import 'package:syncfusion_flutter_calendar/calendar.dart'; @@ -169,8 +169,8 @@ class _ViewAttendanceState extends State { initialDate: formattedDate, firstDate: DateTime(searchYear - 2), lastDate: DateTime.now(), - confirmText: Text(LocaleKeys.confirm.tr()), - cancelText: Text(LocaleKeys.cancel.tr()), + confirmWidget: Text(LocaleKeys.confirm.tr()), + cancelWidget: Text(LocaleKeys.cancel.tr()), ).then( (selectedDate) { if (selectedDate != null) { diff --git a/lib/ui/profile/delete_family_member.dart b/lib/ui/profile/delete_family_member.dart index 3b73512..d2c8c94 100644 --- a/lib/ui/profile/delete_family_member.dart +++ b/lib/ui/profile/delete_family_member.dart @@ -115,9 +115,8 @@ class _DeleteFamilyMemberState extends State { padding: EdgeInsets.only(left: 50, right: 50), child: TextButton( style: TextButton.styleFrom( - primary: MyColors.white, - onSurface: MyColors.white, - backgroundColor: MyColors.gradiantEndColor, + backgroundColor: MyColors.white, + foregroundColor: MyColors.white, ), onPressed: () { deleteFamilyMember(datePar); diff --git a/lib/ui/screens/offers_and_discounts/offers_and_discounts_details.dart b/lib/ui/screens/offers_and_discounts/offers_and_discounts_details.dart index b4cb242..30a9fa2 100644 --- a/lib/ui/screens/offers_and_discounts/offers_and_discounts_details.dart +++ b/lib/ui/screens/offers_and_discounts/offers_and_discounts_details.dart @@ -76,7 +76,7 @@ class _OffersAndDiscountsDetailsState extends State { : getOffersList[0].titleEn!.toText22(isBold: true, color: const Color(0xff2B353E)).center, Html( data: AppState().isArabic(context) ? getOffersList[0].descriptionAr! : getOffersList[0].descriptionEn ?? "", - onLinkTap: (String? url, RenderContext context, Map attributes, _) { + onLinkTap: (String? url, Map attributes, _) { launchUrl(Uri.parse(url!)); }, ), diff --git a/lib/widgets/app_bar_widget.dart b/lib/widgets/app_bar_widget.dart index 6f9898e..6737945 100644 --- a/lib/widgets/app_bar_widget.dart +++ b/lib/widgets/app_bar_widget.dart @@ -15,6 +15,8 @@ AppBar AppBarWidget(BuildContext context, void Function()? onBackTapped}) { return AppBar( leadingWidth: 0, + automaticallyImplyLeading: false, + surfaceTintColor: Colors.transparent, title: Row( children: [ GestureDetector( diff --git a/lib/widgets/chat_app_bar_widge.dart b/lib/widgets/chat_app_bar_widge.dart index cc252ec..1291f9f 100644 --- a/lib/widgets/chat_app_bar_widge.dart +++ b/lib/widgets/chat_app_bar_widge.dart @@ -13,6 +13,8 @@ AppBar ChatAppBarWidget(BuildContext context, {required String title, bool showHomeButton = true, ChatUser? chatUser, bool showTyping = false, List? actions, void Function()? onHomeTapped, void Function()? onBackTapped}) { return AppBar( leadingWidth: 0, + automaticallyImplyLeading: false, + surfaceTintColor: Colors.transparent, title: Consumer(builder: (BuildContext cxt, ChatProviderModel data, Widget? child) { return Row( children: [ diff --git a/lib/widgets/nfc/nfc_reader_sheet.dart b/lib/widgets/nfc/nfc_reader_sheet.dart index b7b97a7..5e0b62d 100644 --- a/lib/widgets/nfc/nfc_reader_sheet.dart +++ b/lib/widgets/nfc/nfc_reader_sheet.dart @@ -80,6 +80,7 @@ class _NfcLayoutState extends State { Widget scanNfc() { return Container( key: ValueKey(1), + width: double.infinity, child: Column( mainAxisSize: MainAxisSize.min, children: [ diff --git a/pubspec.yaml b/pubspec.yaml index 20ed5c2..fb73b69 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -20,7 +20,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev version: 3.4.4+300054 environment: - sdk: ">=2.16.0 <3.0.0" + sdk: ">=2.16.0 <3.5.0" # Dependencies specify other packages that your package needs in order to work. # To automatically upgrade your package dependencies to the latest versions @@ -44,9 +44,9 @@ dependencies: permission_handler: ^10.2.0 flutter_svg: any sizer: ^2.0.15 - local_auth: ^1.1.9 + local_auth: ^2.2.0 fluttertoast: ^8.0.8 - syncfusion_flutter_calendar: ^19.4.48 + syncfusion_flutter_calendar: 21.2.9 # flutter_calendar_carousel: ^2.1.0 pie_chart: ^5.1.0 shared_preferences: ^2.0.12 @@ -62,8 +62,8 @@ dependencies: image_picker: ^0.8.5+3 file_picker: 5.2.5 geolocator: ^9.0.2 - month_year_picker: ^0.2.0+1 - month_picker_dialog_2: ^0.5.5 + month_year_picker: ^0.3.0+1 + month_picker_dialog: ^2.12.0 # open_file: ^3.2.1 open_filex: ^4.4.0 wifi_iot: ^0.3.18 @@ -91,7 +91,7 @@ dependencies: swipe_to: ^1.0.2 flutter_webrtc: ^0.9.17 camera: ^0.10.3 - flutter_local_notifications: ^10.0.0 + flutter_local_notifications: ^17.2.1+2 #firebase_analytics: any #Chat Voice Message Recoding & Play @@ -119,7 +119,7 @@ dependencies: #Huawei Specified # store_checker: ^1.1.0 google_api_availability: ^3.0.1 - + google_maps_flutter_web: ^0.5.4 in_app_update: 3.0.0 #todo its for temporary purpose, later will remove this. From 2e3abed42efd0c18d0fb472a89068fdda10cbcc1 Mon Sep 17 00:00:00 2001 From: "taha.alam" Date: Sun, 4 Aug 2024 11:17:39 +0300 Subject: [PATCH 02/26] WD: dialog color changes. --- lib/theme/app_theme.dart | 3 ++- lib/ui/dialogs/id/business_card_dialog.dart | 1 - lib/ui/login/verify_last_login_screen.dart | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/theme/app_theme.dart b/lib/theme/app_theme.dart index e46ee34..f3f756f 100644 --- a/lib/theme/app_theme.dart +++ b/lib/theme/app_theme.dart @@ -16,9 +16,10 @@ class AppTheme { }, ), hintColor: Colors.grey[400], - colorScheme: ColorScheme.fromSwatch(accentColor: MyColors.backgroundColor), + colorScheme: ColorScheme.fromSwatch(accentColor: MyColors.backgroundColor).copyWith(surfaceTint : Colors.transparent), disabledColor: Colors.grey[300], errorColor: const Color.fromRGBO(235, 80, 60, 1.0), + applyElevationOverlayColor: false, scaffoldBackgroundColor: MyColors.backgroundColor, textSelectionTheme: const TextSelectionThemeData(cursorColor: Colors.grey, selectionColor: Color.fromRGBO(80, 100, 253, 0.5), selectionHandleColor: Colors.grey), canvasColor: Colors.white, diff --git a/lib/ui/dialogs/id/business_card_dialog.dart b/lib/ui/dialogs/id/business_card_dialog.dart index ed9f260..a405ccf 100644 --- a/lib/ui/dialogs/id/business_card_dialog.dart +++ b/lib/ui/dialogs/id/business_card_dialog.dart @@ -21,7 +21,6 @@ class BusinessCardDialog extends StatelessWidget { mainAxisSize: MainAxisSize.min, crossAxisAlignment: CrossAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start, - children: [ Row( crossAxisAlignment: CrossAxisAlignment.start, diff --git a/lib/ui/login/verify_last_login_screen.dart b/lib/ui/login/verify_last_login_screen.dart index b63fb84..8f6751c 100644 --- a/lib/ui/login/verify_last_login_screen.dart +++ b/lib/ui/login/verify_last_login_screen.dart @@ -69,13 +69,13 @@ class _VerifyLastLoginScreenState extends State { automaticallyImplyLeading: false, title: (mobileLoginInfoListModel?.businessCardPrivilege ?? false) ? LocaleKeys.viewBusinessCard.tr().toText12(color: MyColors.textMixColor, isUnderLine: true).onPress(() { - showMDialog(context, child: BusinessCardDialog()); + showMDialog(context, child: BusinessCardDialog(),backgroundColor: Colors.white); }) : Container(), actions: [ Center( child: LocaleKeys.employeeDigitalID.tr().toText12(color: MyColors.textMixColor, isUnderLine: true).onPress(() { - showMDialog(context, child: EmployeeDigitialIdDialog()); + showMDialog(context, child: EmployeeDigitialIdDialog(),backgroundColor: Colors.white); })), 21.width ], From c72189bb6b1680783e78bf028e38fe20fa3ee044 Mon Sep 17 00:00:00 2001 From: "taha.alam" Date: Tue, 17 Sep 2024 15:21:10 +0300 Subject: [PATCH 03/26] version number changed --- lib/app_state/app_state.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/app_state/app_state.dart b/lib/app_state/app_state.dart index 2e8e2ad..568dfaf 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: 9.0, mobileType: Platform.isAndroid ? "android" : "ios"); void setPostParamsInitConfig() { isAuthenticated = false; From ea7467502fcb225eef3792e0a6b348221639a219 Mon Sep 17 00:00:00 2001 From: Sultan khan <> Date: Tue, 24 Sep 2024 17:02:50 +0300 Subject: [PATCH 04/26] updated changes for payment worklist. --- assets/langs/ar-SA.json | 16 ++++- assets/langs/en-US.json | 16 ++++- lib/generated/codegen_loader.g.dart | 19 ++++- lib/generated/locale_keys.g.dart | 15 +++- .../worklist_fragments/info_fragments.dart | 72 +++++++++++++++++-- 5 files changed, 129 insertions(+), 9 deletions(-) diff --git a/assets/langs/ar-SA.json b/assets/langs/ar-SA.json index c59641b..5a27f0b 100644 --- a/assets/langs/ar-SA.json +++ b/assets/langs/ar-SA.json @@ -544,5 +544,19 @@ "addAtLeastOneAttachment": "الرجاء إضافة مرفق واحد على الأقل.", "pleaseClickButtonToJoinMarathon": "الرجاء الضغط على الزر أدناه للانضمام إلى الماراثون", "youCannotJoinTheMarathon": "لا يمكنك الانضمام إلى الماراثون لأنك تجاوزت الحد الزمني", - "open": "يفتح" + "open": "يفتح", + "requesterOperatingUnit":"وحدة تشغيل مقدم الطلب", + "prepareEmpNum":"إعداد رقم الموظف", + "supplierInfo" : "معلومات المورد", + "supplierAcNo": "رقم حساب المورد", + "supplierAcName": "اسم حساب المورد", + "supplierIBAN" : "رقم IBAN للمورد", + "supplierCRNo" :"رقم السجل التجاري", + "suppliedAcNo" : "رقم الحساب المقدم", + "patientRefundInvoice" : "فاتورة استرداد الأموال للمريض", + "patientNumber" : "رقم المريض", + "patientName" : "اسم المريض", + "invoiceDate" : "تاريخ الفاتورة", + "refundInvoice" :"فاتورة الاسترجاع", + "hospitalClinic" : "عيادة المستشفى" } \ No newline at end of file diff --git a/assets/langs/en-US.json b/assets/langs/en-US.json index 275864f..2a9ece6 100644 --- a/assets/langs/en-US.json +++ b/assets/langs/en-US.json @@ -563,5 +563,19 @@ "open": "open", "addAtLeastOneAttachment": "Please add at least one attachment.", "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.", + "requesterOperatingUnit":"Requester Operating Unit", + "prepareEmpNum":"Prepare Employee Num", + "supplierInfo" : "Supplier Information", + "supplierAcNo": "Supplier Account No", + "supplierAcName":"Supplier Account Name", + "supplierIBAN" : "Supplier IBAN", + "supplierCRNo" : "CR Number", + "suppliedAcNo" : "Supplied Account No.", + "patientRefundInvoice" : "Patient Refund Invoice", + "patientNumber" : "Patient Number", + "patientName" : "Patient Name", + "invoiceDate" : "Invoice Date", + "refundInvoice" :"Refund Invoice", + "hospitalClinic" : "Hospital Clinic" } \ No newline at end of file diff --git a/lib/generated/codegen_loader.g.dart b/lib/generated/codegen_loader.g.dart index 15cdb5b..2fb8722 100644 --- a/lib/generated/codegen_loader.g.dart +++ b/lib/generated/codegen_loader.g.dart @@ -558,9 +558,11 @@ class CodegenLoader extends AssetLoader { "requesterEmpNum":"رقم الموظف الذي قدم الطلب", "requesterEmpName":"اسم الموظف مقدم الطلب", "prepareEmpName":"إعداد اسم الموظف", + "prepareEmpNum":"إعداد رقم الموظف", "requesterPositionName":"اسم الوظيفة لمقدم الطلب", "preparePositionName":"إعداد اسم الوظيفة", "requesterPayrollName":"اسم مقدم الطلب", + "requesterOperatingUnit":"وحدة تشغيل مقدم الطلب", "payingORGName":"اسم المنظمة الدافعة", "requestAmount":"مبلغ الطلب", "typeofPayment":"نوع الدفع", @@ -1158,7 +1160,22 @@ class CodegenLoader extends AssetLoader { "pOAmount":"PO Amount", "versionStatus":"Version Status", "supplierNo":"Supplier No", - "general":"General" + "general":"General", + "prepareEmpNum":"Prepare Employee Num", + "requesterOperatingUnit":"Requester Operating Unit", + "supplierInfo" : "Supplier Information", + "supplierNum": "Supplier Number", + "supplierAcNo": "Supplier Account Number", + "supplierAcName" : 'Supplier Account Name', + "supplierIBAN" : 'Supplier IBAN', + "supplierCRNo" : 'CR Number', + "suppliedAcNo" : 'Supplied Account No.', + "patientRefundInvoice" : 'Patient Refund Invoice', + "patientNumber" : 'Patient Number', + "patientName" : 'Patient Name', + "invoiceDate" : 'Invoice Date', + "refundInvoice" : 'Refund Invoice', + "hospitalClinic" : 'Hospital Clinic', }; 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 0ec89e4..72bbfc1 100644 --- a/lib/generated/locale_keys.g.dart +++ b/lib/generated/locale_keys.g.dart @@ -557,9 +557,11 @@ abstract class LocaleKeys { static const requesterEmpNum ='requesterEmpNum'; static const requesterEmpName ='requesterEmpName'; static const prepareEmpName ='prepareEmpName'; + static const prepareEmpNum ='prepareEmpNum'; static const requesterPositionName ='requesterPositionName'; static const preparePositionName ='preparePositionName'; static const requesterPayrollName ='requesterPayrollName'; + static const requesterOperatingUnit ='requesterOperatingUnit'; static const payingORGName ='payingORGName'; static const requestAmount ='requestAmount'; static const typeofPayment ='typeofPayment'; @@ -575,5 +577,16 @@ abstract class LocaleKeys { static const versionStatus ='versionStatus'; static const supplierNo ='supplierNo'; static const general ="general"; - + static const supplierInfo = 'supplierInfo'; + static const supplierAcNo = 'supplierAcNo'; + static const supplierAcName = 'supplierAcName'; + static const supplierIBAN = 'Supplier IBAN'; + static const supplierCRNo = 'CR Number'; + static const suppliedAcNo = 'Supplied Account No.'; + static const patientRefundInvoice = "patientRefundInvoice"; + static const patientNumber = 'Patient Number'; + static const patientName = 'Patient Name'; + static const invoiceDate = 'Invoice Date'; + static const refundInvoice = 'Refund Invoice'; + static const hospitalClinic = 'Hospital Clinic'; } diff --git a/lib/ui/work_list/worklist_fragments/info_fragments.dart b/lib/ui/work_list/worklist_fragments/info_fragments.dart index 1351126..2d0794c 100644 --- a/lib/ui/work_list/worklist_fragments/info_fragments.dart +++ b/lib/ui/work_list/worklist_fragments/info_fragments.dart @@ -739,7 +739,7 @@ class InfoFragment extends StatelessWidget { ItemDetailViewCol( LocaleKeys.requestNumber.tr(), data.paymentDetailsList![0].requestNumber ?? ""), ItemDetailViewCol( LocaleKeys.requesterEmpNum.tr(), - data.paymentDetailsList![0].requesterEmployeeName ?? ""), + data.paymentDetailsList![0].requesterEmployeeNumber ?? ""), ), ItemDetailGrid( ItemDetailViewCol( LocaleKeys.requestDate.tr(), @@ -748,18 +748,25 @@ class InfoFragment extends StatelessWidget { ItemDetailViewCol( LocaleKeys.requesterEmpName.tr(), data.paymentDetailsList![0].requesterEmployeeName ?? ""), ), + ItemDetailGrid( + ItemDetailViewCol( LocaleKeys.prepareEmpNum.tr(), + data.paymentDetailsList![0].prepareEmployeeNumber ?? ""), + ItemDetailViewCol( + LocaleKeys.requesterPositionName.tr(), data.paymentDetailsList![0].requesterPositionName ?? ""), + ), ItemDetailGrid( ItemDetailViewCol( LocaleKeys.prepareEmpName.tr(), data.paymentDetailsList![0].prepareEmployeeName ?? ""), ItemDetailViewCol( - LocaleKeys.requesterPositionName.tr(), data.paymentDetailsList![0].requesterPositionName ?? ""), + LocaleKeys.requesterPayrollName.tr(), data.paymentDetailsList![0].requesterPayrollName ?? ""), ), ItemDetailGrid( ItemDetailViewCol( LocaleKeys.preparePositionName.tr(), data.paymentDetailsList![0].preparePositionName ?? ""), - ItemDetailViewCol( - LocaleKeys.requesterPayrollName.tr(), data.paymentDetailsList![0].requesterPayrollName ?? ""), + ItemDetailViewCol( LocaleKeys.requesterOperatingUnit.tr(), + data.paymentDetailsList![0].requesterOperatingUnits ?? "") ), + ], ).objectContainerView(), if (data!.paymentDetailsList!.isNotEmpty) @@ -843,7 +850,62 @@ class InfoFragment extends StatelessWidget { ), ], ).objectContainerView(), - ], + + if (data!.supplierInformationList!.isNotEmpty && data.supplierInformationList![0].supplierNumber !="") + Column( + children: [ + LocaleKeys.supplierInfo.tr().toText14(color: MyColors.textMixColor), + ItemDetailGrid( + ItemDetailViewCol( + LocaleKeys.supplierNo.tr(), data.supplierInformationList![0].supplierNumber ?? ""), + ItemDetailViewCol(LocaleKeys.supplierName.tr(), + data.supplierInformationList![0].supplierName.toString() ?? ""), + ), + ItemDetailGrid( + ItemDetailViewCol(LocaleKeys.supplierAcNo.tr(), + data.supplierInformationList![0].supplierBankAccountNumber ?? ""), + ItemDetailViewCol( + LocaleKeys.supplierAcName.tr(), data.supplierInformationList![0].supplierBankAccountName ?? + "" ), + ), + ItemDetailGrid( + ItemDetailViewCol(LocaleKeys.supplierCRNo.tr(), + data.supplierInformationList![0].crNumber?? ""), + ItemDetailViewCol( LocaleKeys.supplierIBAN.tr(), data.supplierInformationList![0].supplierBankIban ?? + "" ), + ), + + ], + ).objectContainerView(), + // + if (data!.refundInvoiceList!.isNotEmpty && data.refundInvoiceList![0].patientNumber !="" ) + Column( + children: [ + LocaleKeys.patientRefundInvoice.tr().toText14(color: MyColors.textMixColor), + ItemDetailGrid( + ItemDetailViewCol( + LocaleKeys.patientNumber.tr(), data.refundInvoiceList![0].patientNumber?? ""), + ItemDetailViewCol(LocaleKeys.hospitalClinic.tr(), + data.refundInvoiceList![0].hospitalClinic.toString() ?? ""), + ), + ItemDetailGrid( + ItemDetailViewCol(LocaleKeys.patientName.tr(), + data.refundInvoiceList![0].patientName ?? ""), + ItemDetailViewCol( + LocaleKeys.amount.tr(), data.refundInvoiceList![0].amount.toString() ?? + "" ), + ), + ItemDetailGrid( + ItemDetailViewCol(LocaleKeys.invoiceDate.tr(), + DateUtil.formatDateToDate( + DateUtil.convertStringToDate( data.refundInvoiceList![0].invoicedDate), false)?? ""), + ItemDetailViewCol( LocaleKeys.refundInvoice.tr(), data.refundInvoiceList![0].invoiceNumber ?? + "" ), + ), + + ], + ).objectContainerView(), + ], ); } } From 92a16381aa38f854d699a3efe0c67ae8065aed50 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Thu, 6 Feb 2025 12:13:01 +0300 Subject: [PATCH 05/26] Update to stores VersionID 8.6 --- lib/classes/consts.dart | 4 ++-- pubspec.yaml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/classes/consts.dart b/lib/classes/consts.dart index c2772b8..fea9b75 100644 --- a/lib/classes/consts.dart +++ b/lib/classes/consts.dart @@ -9,9 +9,9 @@ class ApiConsts { // static String baseUrl = "https://webservices.hmg.com"; // PreProd // static String baseUrl = "https://hmgwebservices.com"; // Live server - // static String baseUrl = "https://mohemm.hmg.com"; // New Live server + static String baseUrl = "https://mohemm.hmg.com"; // New Live server // - static String baseUrl = "https://uat.hmgwebservices.com"; // UAT ser343622ver + // static String baseUrl = "https://uat.hmgwebservices.com"; // UAT ser343622ver // static String baseUrl = "http://10.20.200.111:1010/"; // static String baseUrl = "https://webservices.hmg.com"; // PreProd diff --git a/pubspec.yaml b/pubspec.yaml index 9740e7d..e23c069 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -17,7 +17,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev # Read more about iOS versioning at # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html #version: 3.3.01+300040 -version: 3.7.98+3 +version: 3.7.992+1 environment: sdk: ">=2.16.0 <3.0.0" From 7c3f6a508f7acc3619801db200a281bc68964154 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Tue, 25 Feb 2025 10:41:52 +0300 Subject: [PATCH 06/26] updates & fixes --- lib/classes/date_uitl.dart | 8 ++-- .../approval_level_fragment.dart | 39 ++++++++++++++++--- 2 files changed, 38 insertions(+), 9 deletions(-) diff --git a/lib/classes/date_uitl.dart b/lib/classes/date_uitl.dart index 53b6525..8714b40 100644 --- a/lib/classes/date_uitl.dart +++ b/lib/classes/date_uitl.dart @@ -38,12 +38,12 @@ class DateUtil { return DateTime.now(); } - static DateTime convertSimpleStringDateToDate(String date) { + static DateTime convertSimpleStringDateToDate(String date, {bool isITG = false}) { // print(date.toUpperCase()); - return getDateTimeFromString(date.split(" ")[0], date.toUpperCase().split(" ")[1] + " " + date.toUpperCase().split(" ")[2]); + return getDateTimeFromString(date.split(" ")[0], date.toUpperCase().split(" ")[1] + " " + date.toUpperCase().split(" ")[2], isITG: isITG); } - static DateTime getDateTimeFromString(String date, String time) { + static DateTime getDateTimeFromString(String date, String time, {bool isITG = false}) { var hours = num.parse(time.split(":")[0]); var mins = time.split(":")[1]; var secs = time.split(":")[2].split(" ")[0]; @@ -60,7 +60,7 @@ class DateUtil { } } date = date + " $hours:$mins:$secs"; - DateTime returnDate = DateFormat("MM/dd/yyyy HH:mm:ss", "en_US").parse(date); + DateTime returnDate = isITG ? DateFormat("dd/MM/yyyy HH:mm:ss", "en_US").parse(date) : DateFormat("MM/dd/yyyy HH:mm:ss", "en_US").parse(date); return returnDate; } diff --git a/lib/ui/work_list/itg_fragments/approval_level_fragment.dart b/lib/ui/work_list/itg_fragments/approval_level_fragment.dart index 09e44d4..e617511 100644 --- a/lib/ui/work_list/itg_fragments/approval_level_fragment.dart +++ b/lib/ui/work_list/itg_fragments/approval_level_fragment.dart @@ -2,6 +2,7 @@ import 'package:easy_localization/easy_localization.dart'; import 'package:flutter/material.dart'; import 'package:mohem_flutter_app/app_state/app_state.dart'; import 'package:mohem_flutter_app/classes/colors.dart'; +import 'package:mohem_flutter_app/classes/date_uitl.dart'; import 'package:mohem_flutter_app/extensions/int_extensions.dart'; import 'package:mohem_flutter_app/extensions/string_extensions.dart'; import 'package:mohem_flutter_app/extensions/widget_extensions.dart'; @@ -28,7 +29,7 @@ class ApprovalLevelfragment extends StatelessWidget { itemCount: wFHistory.length, padding: const EdgeInsets.all(21), itemBuilder: (context, index) { - return showItem(context, wFHistory[index]); + return showItem(context, wFHistory[index], index); }, separatorBuilder: (BuildContext context, int index) { return 12.height; @@ -37,7 +38,7 @@ class ApprovalLevelfragment extends StatelessWidget { ); } - Widget showItem(BuildContext context, WFHistory history) { + Widget showItem(BuildContext context, WFHistory history, int index) { return Container( width: double.infinity, decoration: BoxDecoration( @@ -89,7 +90,9 @@ class ApprovalLevelfragment extends StatelessWidget { 8.width, if (history.date!.isNotEmpty) history.date!.toText12(color: MyColors.lightTextColor), ], - ) + ), + 10.height, + getActionDuration(index).toText11(maxLine: 1, color: const Color(0xff1FA269)) ], ), ) @@ -143,8 +146,34 @@ class ApprovalLevelfragment extends StatelessWidget { ); } + String getActionDuration(int index) { + if (wFHistory[index].action!.toLowerCase() == "submit" || wFHistory[index].action!.toLowerCase() == "submitted") { + return ""; + // DateTime dateTimeFrom = DateUtil.convertSimpleStringDateToDate(wFHistory[index].date!); + // Duration duration = DateTime.now().difference(dateTimeFrom); + // return "Action duration: " + DateUtil.formatDuration(duration); + } + else if (wFHistory[index].employeeID == AppState().memberInformationList?.eMPLOYEENUMBER) { + // if (wFHistory[index + 1].date!.isEmpty) { + // return ""; + // } + DateTime dateTimeFrom = DateUtil.convertSimpleStringDateToDate(wFHistory[index + 1].date!, isITG: true); + Duration duration = DateTime.now().difference(dateTimeFrom); + return "Action duration: " + DateUtil.formatDuration(duration); + } else { + if (wFHistory[index].date!.isEmpty || wFHistory[index].action!.toLowerCase() == "NO ACTION") { + return ""; + } else { + DateTime dateTimeTo = DateUtil.convertSimpleStringDateToDate(wFHistory[index].date!); + DateTime dateTimeFrom = DateUtil.convertSimpleStringDateToDate(wFHistory[index + 1].date!); + Duration duration = dateTimeTo.difference(dateTimeFrom); + return "Action duration: " + DateUtil.formatDuration(duration); + } + } + } + Color getStatusColor(String code) { - if (code.toLowerCase() == "submit") { + if (code.toLowerCase() == "submit" || code.toLowerCase() == "submitted") { return MyColors.grey3AColor; } else if (code.toLowerCase() == "pending") { return MyColors.yellowColor; @@ -152,7 +181,7 @@ class ApprovalLevelfragment extends StatelessWidget { return MyColors.redColor; } else if (code.toLowerCase() == "approved" || code.toLowerCase() == "auto-approve" || code.toLowerCase() == "auto-approved" || code.toLowerCase() == "doable" || code.toLowerCase() == "answer") { return MyColors.greenColor; - } else if (code.toLowerCase() == "requested information" || code.toLowerCase() == "assign" || code.toLowerCase() == "reassign") { + } else if (code.toLowerCase() == "requested information" || code.toLowerCase() == "request information" || code.toLowerCase() == "assign" || code.toLowerCase() == "reassign") { return MyColors.orange; } else { return MyColors.whiteColor; From 54aa6108566415f06284545d761d037ef24b9580 Mon Sep 17 00:00:00 2001 From: Sikander Saleem Date: Mon, 17 Mar 2025 15:46:17 +0300 Subject: [PATCH 07/26] long text field changed to separate field. --- .../request_detail_fragment.dart | 42 ++++++++++++------- lib/widgets/item_detail_view_widget.dart | 5 ++- 2 files changed, 29 insertions(+), 18 deletions(-) diff --git a/lib/ui/work_list/itg_fragments/request_detail_fragment.dart b/lib/ui/work_list/itg_fragments/request_detail_fragment.dart index ba67ba4..d4d7e07 100644 --- a/lib/ui/work_list/itg_fragments/request_detail_fragment.dart +++ b/lib/ui/work_list/itg_fragments/request_detail_fragment.dart @@ -40,6 +40,7 @@ class RequestDetailFragment extends StatelessWidget { ? LocaleKeys.noDataAvailable.tr().toText16().center : ListView( shrinkWrap: true, + physics: NeverScrollableScrollPhysics(), children: uiList, ), ), @@ -73,26 +74,29 @@ class RequestDetailFragment extends StatelessWidget { List fields = List.from(fieldsF); bool isOdd = false; + + List longValueFields = []; + + longValueFields = fields + .where((Fields element) => (element.value?.length ?? 0) > 120) + .toList() + .map((Fields descriptionFormat) => ItemDetailViewGridItem( + 2, + descriptionFormat.title, + descriptionFormat.value == null ? (descriptionFormat.multipleValue?.join(", ") ?? "") : descriptionFormat.value ?? "", + type: descriptionFormat.type, + showSpaceAfterLine: true, + maxLine: 0, + )) + .toList(); + + fields.removeWhere((element) => (element.value?.length ?? 0) > 120); + if (fields.length % 2 != 0) { isOdd = true; fields.add(new Fields()); } - int descriptionFormatIndex = fields.indexWhere((element) => element.title == "Description Format" || element.title == "Description Format"); // todo add arabic in future - Widget? descriptionFormatView; - if (descriptionFormatIndex >= 0) { - Fields descriptionFormat = fields[descriptionFormatIndex]; - fields.removeAt(descriptionFormatIndex); - - descriptionFormatView = ItemDetailViewGridItem( - 2, - descriptionFormat.title, - descriptionFormat.value == null ? (descriptionFormat.multipleValue?.join(", ") ?? "") : descriptionFormat.value ?? "", - type: descriptionFormat.type, - maxLine: 0, - ); - } - return Column( mainAxisSize: MainAxisSize.min, children: [ @@ -131,7 +135,13 @@ class RequestDetailFragment extends StatelessWidget { childAspectRatio: (itemWidth / itemHeight), ), ), - if (descriptionFormatView != null) descriptionFormatView, + ListView.separated( + shrinkWrap: true, + physics: const NeverScrollableScrollPhysics(), + padding: EdgeInsets.zero, + itemBuilder: (cxt, index) => longValueFields[index], + separatorBuilder: (cxt, index) => 16.height, + itemCount: longValueFields.length), ], ).objectContainerView(); return ListView.separated( diff --git a/lib/widgets/item_detail_view_widget.dart b/lib/widgets/item_detail_view_widget.dart index a98b066..64bbd01 100644 --- a/lib/widgets/item_detail_view_widget.dart +++ b/lib/widgets/item_detail_view_widget.dart @@ -53,8 +53,9 @@ class ItemDetailViewGridItem extends StatelessWidget { final String? type; final bool isNeedToShowEmptyDivider; final int maxLine; + final bool showSpaceAfterLine; - ItemDetailViewGridItem(this.index, this.title, this.value, {Key? key, this.isNeedToShowEmptyDivider = false, this.type = "", this.maxLine = 6}) : super(key: key); + ItemDetailViewGridItem(this.index, this.title, this.value, {Key? key, this.isNeedToShowEmptyDivider = false, this.showSpaceAfterLine = false, this.type = "", this.maxLine = 6}) : super(key: key); @override Widget build(BuildContext context) { @@ -92,7 +93,7 @@ class ItemDetailViewGridItem extends StatelessWidget { : (value!.isEmpty ? "--" : value).toString().toText12Auto(color: MyColors.normalTextColor, maxLine: maxLine) : Container(), ], - ), + ).paddingOnly(top: showSpaceAfterLine ? 16 : 0), ); } } From 49e520ea4b3c630f793378b7e21ae0a6be0c0574 Mon Sep 17 00:00:00 2001 From: Haroon Amjad <> Date: Thu, 1 May 2025 21:41:53 +0300 Subject: [PATCH 08/26] update --- .../offers_and_discounts/offers_and_discounts_details.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ui/screens/offers_and_discounts/offers_and_discounts_details.dart b/lib/ui/screens/offers_and_discounts/offers_and_discounts_details.dart index b4cb242..30a9fa2 100644 --- a/lib/ui/screens/offers_and_discounts/offers_and_discounts_details.dart +++ b/lib/ui/screens/offers_and_discounts/offers_and_discounts_details.dart @@ -76,7 +76,7 @@ class _OffersAndDiscountsDetailsState extends State { : getOffersList[0].titleEn!.toText22(isBold: true, color: const Color(0xff2B353E)).center, Html( data: AppState().isArabic(context) ? getOffersList[0].descriptionAr! : getOffersList[0].descriptionEn ?? "", - onLinkTap: (String? url, RenderContext context, Map attributes, _) { + onLinkTap: (String? url, Map attributes, _) { launchUrl(Uri.parse(url!)); }, ), From e91b33805e06dbdb2cf5199afdb0760a4042b414 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Mon, 5 May 2025 12:00:08 +0300 Subject: [PATCH 09/26] fixes & updates, Time sheet changes, Update to stores VersionID 8.7 --- android/app/src/debug/AndroidManifest.xml | 2 +- android/app/src/main/AndroidManifest.xml | 4 ++-- ios/Runner/Info.plist | 2 +- lib/app_state/app_state.dart | 2 +- lib/provider/dashboard_provider_model.dart | 2 +- lib/ui/landing/dashboard_screen.dart | 2 +- .../offers_and_discounts_details.dart | 2 +- lib/ui/work_list/itg_detail_screen.dart | 6 +++++- lib/widgets/location/Location.dart | 2 +- pubspec.yaml | 14 +++++++------- 10 files changed, 21 insertions(+), 17 deletions(-) diff --git a/android/app/src/debug/AndroidManifest.xml b/android/app/src/debug/AndroidManifest.xml index 11decc3..50ab38d 100644 --- a/android/app/src/debug/AndroidManifest.xml +++ b/android/app/src/debug/AndroidManifest.xml @@ -1,5 +1,5 @@ + package="com.mohem_flutter_app"> diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml index 8edb0f0..d6d528d 100644 --- a/android/app/src/main/AndroidManifest.xml +++ b/android/app/src/main/AndroidManifest.xml @@ -1,8 +1,8 @@ + package="com.mohem_flutter_app"> - + diff --git a/ios/Runner/Info.plist b/ios/Runner/Info.plist index cb62b88..01197de 100644 --- a/ios/Runner/Info.plist +++ b/ios/Runner/Info.plist @@ -13,7 +13,7 @@ CFBundleInfoDictionaryVersion 6.0 CFBundleName - MOHEMM + MoheM CFBundlePackageType APPL CFBundleShortVersionString diff --git a/lib/app_state/app_state.dart b/lib/app_state/app_state.dart index 7269cd5..a2959ec 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: 8.6, mobileType: Platform.isAndroid ? "android" : "ios"); + final PostParamsModel _postParamsInitConfig = PostParamsModel(channel: 31, versionID: 8.7, mobileType: Platform.isAndroid ? "android" : "ios"); void setPostParamsInitConfig() { diff --git a/lib/provider/dashboard_provider_model.dart b/lib/provider/dashboard_provider_model.dart index 36a9f81..e644aa0 100644 --- a/lib/provider/dashboard_provider_model.dart +++ b/lib/provider/dashboard_provider_model.dart @@ -279,7 +279,7 @@ class DashboardProviderModel with ChangeNotifier, DiagnosticableTreeMixin { logger.wtf(ex); isEventLoadingLoading = false; notifyListeners(); - Utils.handleException(ex, null, null); + // Utils.handleException(ex, null, null); } } diff --git a/lib/ui/landing/dashboard_screen.dart b/lib/ui/landing/dashboard_screen.dart index 4640c25..9a7c1ee 100644 --- a/lib/ui/landing/dashboard_screen.dart +++ b/lib/ui/landing/dashboard_screen.dart @@ -712,7 +712,7 @@ class _DashboardScreenState extends State with WidgetsBindingOb Widget eventActivityWidget(BuildContext context) { return (context.watch().isEventLoadingLoading) ? const MarathonBannerShimmer().paddingOnly(left: 21, right: 21, bottom: 21, top: 0) - : (context.watch().eventActivity != null && context.watch().eventActivity!.isActive ==true) + : (context.watch().eventActivity != null && context.watch().eventActivity!.isActive == true) ? const EventActivityBanner().paddingOnly(left: 21, right: 21, bottom: 21, top: 0) : const SizedBox(); } diff --git a/lib/ui/screens/offers_and_discounts/offers_and_discounts_details.dart b/lib/ui/screens/offers_and_discounts/offers_and_discounts_details.dart index 30a9fa2..37680f0 100644 --- a/lib/ui/screens/offers_and_discounts/offers_and_discounts_details.dart +++ b/lib/ui/screens/offers_and_discounts/offers_and_discounts_details.dart @@ -76,7 +76,7 @@ class _OffersAndDiscountsDetailsState extends State { : getOffersList[0].titleEn!.toText22(isBold: true, color: const Color(0xff2B353E)).center, Html( data: AppState().isArabic(context) ? getOffersList[0].descriptionAr! : getOffersList[0].descriptionEn ?? "", - onLinkTap: (String? url, Map attributes, _) { + onLinkTap: (String? url, context, Map attributes, _) { launchUrl(Uri.parse(url!)); }, ), diff --git a/lib/ui/work_list/itg_detail_screen.dart b/lib/ui/work_list/itg_detail_screen.dart index dec413f..930cfe6 100644 --- a/lib/ui/work_list/itg_detail_screen.dart +++ b/lib/ui/work_list/itg_detail_screen.dart @@ -105,7 +105,11 @@ class _ItgDetailScreenState extends State { } catch (ex) { setState(() {}); Utils.hideLoading(context); - Utils.handleException(ex, context, null); + // var decodedDta = jsonDecode( + // "{\"returN_STATUS\":\"S\",\"returN_MSG\":\"null\",\"summeries\":[{\"employeE_NUMBER\":\"410123\",\"assignmenT_NUMBER\":\"410123\",\"employeE_NAME\":\"Samiullah Abdulqadir\",\"hirE_DATE\":\"2024-07-21T00:00:00\",\"actuaL_TERMINATION_DATE\":null,\"perioD_DAYS\":31,\"schedulE_DAYS\":20,\"ofF_DAYS\":9,\"noN_SCHEDULED_DAYS\":0,\"noT_ANALAYZED_DAYS\":0,\"attendeD_DAYS\":20,\"absenT_DAYS\":0,\"missinG_SWIPES_DAYS\":0,\"scheduleD_HRS\":\"120\",\"actuaL_HRS\":\"121.96\",\"excesS_HRS\":\"2.61\",\"comP_OFF_W_HRS\":\"0\",\"comP_OFF_H_HRS\":\"0\",\"comP_OFF_N_HRS\":\"0\",\"timebacK_HRS\":\"2.61\",\"shortagE_HRS\":\".65\",\"latE_IN_HRS\":\".1\",\"earlY_OUT_HRS\":\".65\",\"uncovereD_SHORTAGE_HRS\":0.65,\"halF_DAY_LEAVES\":0,\"sicK_LEAVES\":0,\"publiC_HOLIDAYS\":2,\"worK_FROM_HOME_DAYS\":0,\"businesS_TRIPS\":0,\"unauthorizeD_LEAVES\":0,\"unpaiD_LEAVES\":0,\"paiD_LEAVES\":0}],\"details\":[{\"schedulE_DATE\":\"2025-03-01T00:00:00\",\"shifT_NAME\":\"00:00 - 00:00\",\"shifT_TYPE\":\"Regular\",\"breaK_NAME\":\"00:00 - 00:00\",\"actuaL_WOB_HRS\":\"00:00\",\"shT_ACTUAL_START_DATETIME\":null,\"shT_ACTUAL_END_DATETIME\":null,\"approveD_START_DATETIME\":null,\"approveD_END_DATETIME\":null,\"scheduleD_HRS\":\"00:00\",\"actuaL_HRS\":\"00:00\",\"excesS_HRS\":\"00:00\",\"comP_OFF_N_HRS\":\"00:00\",\"comP_OFF_W_HRS\":\"00:00\",\"comP_OFF_H_HRS\":\"00:00\",\"timebacK_HRS\":null,\"shortagE_HRS\":\"00:00\",\"latE_IN_HRS\":\"00:00\",\"earlY_OUT_HRS\":\"00:00\",\"remarks\":\"Off Shift\",\"excesS_FLAG\":\"N\",\"comP_OFF_FLAG\":\"N\",\"timebacK_FLAG\":\"N\",\"shortagE_FLAG\":\"N\",\"latE_IN_FLAG\":\"N\",\"earlY_OUT_FLAG\":\"N\",\"missinG_SWIPES_FLAG\":\"N\"},{\"schedulE_DATE\":\"2025-03-02T00:00:00\",\"shifT_NAME\":\"10:00 - 16:00\",\"shifT_TYPE\":\"Regular\",\"breaK_NAME\":\"00:00 - 00:00\",\"actuaL_WOB_HRS\":\"00:00\",\"shT_ACTUAL_START_DATETIME\":\"09:58\",\"shT_ACTUAL_END_DATETIME\":\"16:01\",\"approveD_START_DATETIME\":null,\"approveD_END_DATETIME\":null,\"scheduleD_HRS\":\"06:00\",\"actuaL_HRS\":\"06:03\",\"excesS_HRS\":\"00:03\",\"comP_OFF_N_HRS\":\"00:00\",\"comP_OFF_W_HRS\":\"00:00\",\"comP_OFF_H_HRS\":\"00:00\",\"timebacK_HRS\":null,\"shortagE_HRS\":\"00:00\",\"latE_IN_HRS\":\"00:00\",\"earlY_OUT_HRS\":\"00:00\",\"remarks\":null,\"excesS_FLAG\":\"Y\",\"comP_OFF_FLAG\":\"N\",\"timebacK_FLAG\":\"Y\",\"shortagE_FLAG\":\"N\",\"latE_IN_FLAG\":\"N\",\"earlY_OUT_FLAG\":\"N\",\"missinG_SWIPES_FLAG\":\"N\"},{\"schedulE_DATE\":\"2025-03-03T00:00:00\",\"shifT_NAME\":\"10:00 - 16:00\",\"shifT_TYPE\":\"Regular\",\"breaK_NAME\":\"00:00 - 00:00\",\"actuaL_WOB_HRS\":\"00:00\",\"shT_ACTUAL_START_DATETIME\":\"10:11\",\"shT_ACTUAL_END_DATETIME\":\"16:11\",\"approveD_START_DATETIME\":null,\"approveD_END_DATETIME\":null,\"scheduleD_HRS\":\"06:00\",\"actuaL_HRS\":\"06:00\",\"excesS_HRS\":\"00:00\",\"comP_OFF_N_HRS\":\"00:00\",\"comP_OFF_W_HRS\":\"00:00\",\"comP_OFF_H_HRS\":\"00:00\",\"timebacK_HRS\":null,\"shortagE_HRS\":\"00:00\",\"latE_IN_HRS\":\"00:00\",\"earlY_OUT_HRS\":\"00:00\",\"remarks\":null,\"excesS_FLAG\":\"N\",\"comP_OFF_FLAG\":\"N\",\"timebacK_FLAG\":\"N\",\"shortagE_FLAG\":\"N\",\"latE_IN_FLAG\":\"N\",\"earlY_OUT_FLAG\":\"N\",\"missinG_SWIPES_FLAG\":\"N\"},{\"schedulE_DATE\":\"2025-03-04T00:00:00\",\"shifT_NAME\":\"10:00 - 16:00\",\"shifT_TYPE\":\"Regular\",\"breaK_NAME\":\"00:00 - 00:00\",\"actuaL_WOB_HRS\":\"00:00\",\"shT_ACTUAL_START_DATETIME\":\"10:08\",\"shT_ACTUAL_END_DATETIME\":\"16:12\",\"approveD_START_DATETIME\":null,\"approveD_END_DATETIME\":null,\"scheduleD_HRS\":\"06:00\",\"actuaL_HRS\":\"06:04\",\"excesS_HRS\":\"00:04\",\"comP_OFF_N_HRS\":\"00:00\",\"comP_OFF_W_HRS\":\"00:00\",\"comP_OFF_H_HRS\":\"00:00\",\"timebacK_HRS\":null,\"shortagE_HRS\":\"00:00\",\"latE_IN_HRS\":\"00:00\",\"earlY_OUT_HRS\":\"00:00\",\"remarks\":null,\"excesS_FLAG\":\"Y\",\"comP_OFF_FLAG\":\"N\",\"timebacK_FLAG\":\"Y\",\"shortagE_FLAG\":\"N\",\"latE_IN_FLAG\":\"N\",\"earlY_OUT_FLAG\":\"N\",\"missinG_SWIPES_FLAG\":\"N\"},{\"schedulE_DATE\":\"2025-03-05T00:00:00\",\"shifT_NAME\":\"10:00 - 16:00\",\"shifT_TYPE\":\"Regular\",\"breaK_NAME\":\"00:00 - 00:00\",\"actuaL_WOB_HRS\":\"00:00\",\"shT_ACTUAL_START_DATETIME\":\"10:09\",\"shT_ACTUAL_END_DATETIME\":\"16:12\",\"approveD_START_DATETIME\":null,\"approveD_END_DATETIME\":null,\"scheduleD_HRS\":\"06:00\",\"actuaL_HRS\":\"06:03\",\"excesS_HRS\":\"00:03\",\"comP_OFF_N_HRS\":\"00:00\",\"comP_OFF_W_HRS\":\"00:00\",\"comP_OFF_H_HRS\":\"00:00\",\"timebacK_HRS\":null,\"shortagE_HRS\":\"00:00\",\"latE_IN_HRS\":\"00:00\",\"earlY_OUT_HRS\":\"00:00\",\"remarks\":null,\"excesS_FLAG\":\"Y\",\"comP_OFF_FLAG\":\"N\",\"timebacK_FLAG\":\"Y\",\"shortagE_FLAG\":\"N\",\"latE_IN_FLAG\":\"N\",\"earlY_OUT_FLAG\":\"N\",\"missinG_SWIPES_FLAG\":\"N\"},{\"schedulE_DATE\":\"2025-03-06T00:00:00\",\"shifT_NAME\":\"10:00 - 16:00\",\"shifT_TYPE\":\"Regular\",\"breaK_NAME\":\"00:00 - 00:00\",\"actuaL_WOB_HRS\":\"00:00\",\"shT_ACTUAL_START_DATETIME\":\"09:53\",\"shT_ACTUAL_END_DATETIME\":\"15:54\",\"approveD_START_DATETIME\":null,\"approveD_END_DATETIME\":null,\"scheduleD_HRS\":\"06:00\",\"actuaL_HRS\":\"06:01\",\"excesS_HRS\":\"00:01\",\"comP_OFF_N_HRS\":\"00:00\",\"comP_OFF_W_HRS\":\"00:00\",\"comP_OFF_H_HRS\":\"00:00\",\"timebacK_HRS\":null,\"shortagE_HRS\":\"00:00\",\"latE_IN_HRS\":\"00:00\",\"earlY_OUT_HRS\":\"00:00\",\"remarks\":null,\"excesS_FLAG\":\"Y\",\"comP_OFF_FLAG\":\"N\",\"timebacK_FLAG\":\"Y\",\"shortagE_FLAG\":\"N\",\"latE_IN_FLAG\":\"N\",\"earlY_OUT_FLAG\":\"N\",\"missinG_SWIPES_FLAG\":\"N\"},{\"schedulE_DATE\":\"2025-03-07T00:00:00\",\"shifT_NAME\":\"00:00 - 00:00\",\"shifT_TYPE\":\"Regular\",\"breaK_NAME\":\"00:00 - 00:00\",\"actuaL_WOB_HRS\":\"00:00\",\"shT_ACTUAL_START_DATETIME\":null,\"shT_ACTUAL_END_DATETIME\":null,\"approveD_START_DATETIME\":null,\"approveD_END_DATETIME\":null,\"scheduleD_HRS\":\"00:00\",\"actuaL_HRS\":\"00:00\",\"excesS_HRS\":\"00:00\",\"comP_OFF_N_HRS\":\"00:00\",\"comP_OFF_W_HRS\":\"00:00\",\"comP_OFF_H_HRS\":\"00:00\",\"timebacK_HRS\":null,\"shortagE_HRS\":\"00:00\",\"latE_IN_HRS\":\"00:00\",\"earlY_OUT_HRS\":\"00:00\",\"remarks\":\"Off Shift\",\"excesS_FLAG\":\"N\",\"comP_OFF_FLAG\":\"N\",\"timebacK_FLAG\":\"N\",\"shortagE_FLAG\":\"N\",\"latE_IN_FLAG\":\"N\",\"earlY_OUT_FLAG\":\"N\",\"missinG_SWIPES_FLAG\":\"N\"},{\"schedulE_DATE\":\"2025-03-08T00:00:00\",\"shifT_NAME\":\"00:00 - 00:00\",\"shifT_TYPE\":\"Regular\",\"breaK_NAME\":\"00:00 - 00:00\",\"actuaL_WOB_HRS\":\"00:00\",\"shT_ACTUAL_START_DATETIME\":null,\"shT_ACTUAL_END_DATETIME\":null,\"approveD_START_DATETIME\":null,\"approveD_END_DATETIME\":null,\"scheduleD_HRS\":\"00:00\",\"actuaL_HRS\":\"00:00\",\"excesS_HRS\":\"00:00\",\"comP_OFF_N_HRS\":\"00:00\",\"comP_OFF_W_HRS\":\"00:00\",\"comP_OFF_H_HRS\":\"00:00\",\"timebacK_HRS\":null,\"shortagE_HRS\":\"00:00\",\"latE_IN_HRS\":\"00:00\",\"earlY_OUT_HRS\":\"00:00\",\"remarks\":\"Off Shift\",\"excesS_FLAG\":\"N\",\"comP_OFF_FLAG\":\"N\",\"timebacK_FLAG\":\"N\",\"shortagE_FLAG\":\"N\",\"latE_IN_FLAG\":\"N\",\"earlY_OUT_FLAG\":\"N\",\"missinG_SWIPES_FLAG\":\"N\"},{\"schedulE_DATE\":\"2025-03-09T00:00:00\",\"shifT_NAME\":\"10:00 - 16:00\",\"shifT_TYPE\":\"Regular\",\"breaK_NAME\":\"00:00 - 00:00\",\"actuaL_WOB_HRS\":\"00:00\",\"shT_ACTUAL_START_DATETIME\":\"10:06\",\"shT_ACTUAL_END_DATETIME\":\"16:08\",\"approveD_START_DATETIME\":null,\"approveD_END_DATETIME\":null,\"scheduleD_HRS\":\"06:00\",\"actuaL_HRS\":\"06:02\",\"excesS_HRS\":\"00:02\",\"comP_OFF_N_HRS\":\"00:00\",\"comP_OFF_W_HRS\":\"00:00\",\"comP_OFF_H_HRS\":\"00:00\",\"timebacK_HRS\":null,\"shortagE_HRS\":\"00:00\",\"latE_IN_HRS\":\"00:00\",\"earlY_OUT_HRS\":\"00:00\",\"remarks\":null,\"excesS_FLAG\":\"Y\",\"comP_OFF_FLAG\":\"N\",\"timebacK_FLAG\":\"Y\",\"shortagE_FLAG\":\"N\",\"latE_IN_FLAG\":\"N\",\"earlY_OUT_FLAG\":\"N\",\"missinG_SWIPES_FLAG\":\"N\"},{\"schedulE_DATE\":\"2025-03-10T00:00:00\",\"shifT_NAME\":\"10:00 - 16:00\",\"shifT_TYPE\":\"Regular\",\"breaK_NAME\":\"00:00 - 00:00\",\"actuaL_WOB_HRS\":\"00:00\",\"shT_ACTUAL_START_DATETIME\":\"11:06\",\"shT_ACTUAL_END_DATETIME\":\"17:06\",\"approveD_START_DATETIME\":null,\"approveD_END_DATETIME\":null,\"scheduleD_HRS\":\"06:00\",\"actuaL_HRS\":\"06:00\",\"excesS_HRS\":\"00:00\",\"comP_OFF_N_HRS\":\"00:00\",\"comP_OFF_W_HRS\":\"00:00\",\"comP_OFF_H_HRS\":\"00:00\",\"timebacK_HRS\":null,\"shortagE_HRS\":\"00:00\",\"latE_IN_HRS\":\"00:06\",\"earlY_OUT_HRS\":\"00:00\",\"remarks\":null,\"excesS_FLAG\":\"N\",\"comP_OFF_FLAG\":\"N\",\"timebacK_FLAG\":\"N\",\"shortagE_FLAG\":\"N\",\"latE_IN_FLAG\":\"Y\",\"earlY_OUT_FLAG\":\"N\",\"missinG_SWIPES_FLAG\":\"N\"},{\"schedulE_DATE\":\"2025-03-11T00:00:00\",\"shifT_NAME\":\"10:00 - 16:00\",\"shifT_TYPE\":\"Regular\",\"breaK_NAME\":\"00:00 - 00:00\",\"actuaL_WOB_HRS\":\"00:00\",\"shT_ACTUAL_START_DATETIME\":\"10:09\",\"shT_ACTUAL_END_DATETIME\":\"16:12\",\"approveD_START_DATETIME\":null,\"approveD_END_DATETIME\":null,\"scheduleD_HRS\":\"06:00\",\"actuaL_HRS\":\"06:03\",\"excesS_HRS\":\"00:03\",\"comP_OFF_N_HRS\":\"00:00\",\"comP_OFF_W_HRS\":\"00:00\",\"comP_OFF_H_HRS\":\"00:00\",\"timebacK_HRS\":null,\"shortagE_HRS\":\"00:00\",\"latE_IN_HRS\":\"00:00\",\"earlY_OUT_HRS\":\"00:00\",\"remarks\":null,\"excesS_FLAG\":\"Y\",\"comP_OFF_FLAG\":\"N\",\"timebacK_FLAG\":\"Y\",\"shortagE_FLAG\":\"N\",\"latE_IN_FLAG\":\"N\",\"earlY_OUT_FLAG\":\"N\",\"missinG_SWIPES_FLAG\":\"N\"},{\"schedulE_DATE\":\"2025-03-12T00:00:00\",\"shifT_NAME\":\"10:00 - 16:00\",\"shifT_TYPE\":\"Regular\",\"breaK_NAME\":\"00:00 - 00:00\",\"actuaL_WOB_HRS\":\"00:00\",\"shT_ACTUAL_START_DATETIME\":\"10:37\",\"shT_ACTUAL_END_DATETIME\":\"16:38\",\"approveD_START_DATETIME\":null,\"approveD_END_DATETIME\":null,\"scheduleD_HRS\":\"06:00\",\"actuaL_HRS\":\"06:01\",\"excesS_HRS\":\"00:01\",\"comP_OFF_N_HRS\":\"00:00\",\"comP_OFF_W_HRS\":\"00:00\",\"comP_OFF_H_HRS\":\"00:00\",\"timebacK_HRS\":null,\"shortagE_HRS\":\"00:00\",\"latE_IN_HRS\":\"00:00\",\"earlY_OUT_HRS\":\"00:00\",\"remarks\":null,\"excesS_FLAG\":\"Y\",\"comP_OFF_FLAG\":\"N\",\"timebacK_FLAG\":\"Y\",\"shortagE_FLAG\":\"N\",\"latE_IN_FLAG\":\"N\",\"earlY_OUT_FLAG\":\"N\",\"missinG_SWIPES_FLAG\":\"N\"},{\"schedulE_DATE\":\"2025-03-13T00:00:00\",\"shifT_NAME\":\"10:00 - 16:00\",\"shifT_TYPE\":\"Regular\",\"breaK_NAME\":\"00:00 - 00:00\",\"actuaL_WOB_HRS\":\"00:00\",\"shT_ACTUAL_START_DATETIME\":\"09:53\",\"shT_ACTUAL_END_DATETIME\":\"16:08\",\"approveD_START_DATETIME\":null,\"approveD_END_DATETIME\":null,\"scheduleD_HRS\":\"06:00\",\"actuaL_HRS\":\"06:15\",\"excesS_HRS\":\"00:15\",\"comP_OFF_N_HRS\":\"00:00\",\"comP_OFF_W_HRS\":\"00:00\",\"comP_OFF_H_HRS\":\"00:00\",\"timebacK_HRS\":null,\"shortagE_HRS\":\"00:00\",\"latE_IN_HRS\":\"00:00\",\"earlY_OUT_HRS\":\"00:00\",\"remarks\":null,\"excesS_FLAG\":\"Y\",\"comP_OFF_FLAG\":\"N\",\"timebacK_FLAG\":\"Y\",\"shortagE_FLAG\":\"N\",\"latE_IN_FLAG\":\"N\",\"earlY_OUT_FLAG\":\"N\",\"missinG_SWIPES_FLAG\":\"N\"},{\"schedulE_DATE\":\"2025-03-14T00:00:00\",\"shifT_NAME\":\"00:00 - 00:00\",\"shifT_TYPE\":\"Regular\",\"breaK_NAME\":\"00:00 - 00:00\",\"actuaL_WOB_HRS\":\"00:00\",\"shT_ACTUAL_START_DATETIME\":null,\"shT_ACTUAL_END_DATETIME\":null,\"approveD_START_DATETIME\":null,\"approveD_END_DATETIME\":null,\"scheduleD_HRS\":\"00:00\",\"actuaL_HRS\":\"00:00\",\"excesS_HRS\":\"00:00\",\"comP_OFF_N_HRS\":\"00:00\",\"comP_OFF_W_HRS\":\"00:00\",\"comP_OFF_H_HRS\":\"00:00\",\"timebacK_HRS\":null,\"shortagE_HRS\":\"00:00\",\"latE_IN_HRS\":\"00:00\",\"earlY_OUT_HRS\":\"00:00\",\"remarks\":\"Off Shift\",\"excesS_FLAG\":\"N\",\"comP_OFF_FLAG\":\"N\",\"timebacK_FLAG\":\"N\",\"shortagE_FLAG\":\"N\",\"latE_IN_FLAG\":\"N\",\"earlY_OUT_FLAG\":\"N\",\"missinG_SWIPES_FLAG\":\"N\"},{\"schedulE_DATE\":\"2025-03-15T00:00:00\",\"shifT_NAME\":\"00:00 - 00:00\",\"shifT_TYPE\":\"Regular\",\"breaK_NAME\":\"00:00 - 00:00\",\"actuaL_WOB_HRS\":\"00:00\",\"shT_ACTUAL_START_DATETIME\":null,\"shT_ACTUAL_END_DATETIME\":null,\"approveD_START_DATETIME\":null,\"approveD_END_DATETIME\":null,\"scheduleD_HRS\":\"00:00\",\"actuaL_HRS\":\"00:00\",\"excesS_HRS\":\"00:00\",\"comP_OFF_N_HRS\":\"00:00\",\"comP_OFF_W_HRS\":\"00:00\",\"comP_OFF_H_HRS\":\"00:00\",\"timebacK_HRS\":null,\"shortagE_HRS\":\"00:00\",\"latE_IN_HRS\":\"00:00\",\"earlY_OUT_HRS\":\"00:00\",\"remarks\":\"Off Shift\",\"excesS_FLAG\":\"N\",\"comP_OFF_FLAG\":\"N\",\"timebacK_FLAG\":\"N\",\"shortagE_FLAG\":\"N\",\"latE_IN_FLAG\":\"N\",\"earlY_OUT_FLAG\":\"N\",\"missinG_SWIPES_FLAG\":\"N\"},{\"schedulE_DATE\":\"2025-03-16T00:00:00\",\"shifT_NAME\":\"10:00 - 16:00\",\"shifT_TYPE\":\"Regular\",\"breaK_NAME\":\"00:00 - 00:00\",\"actuaL_WOB_HRS\":\"00:00\",\"shT_ACTUAL_START_DATETIME\":\"10:52\",\"shT_ACTUAL_END_DATETIME\":\"16:54\",\"approveD_START_DATETIME\":null,\"approveD_END_DATETIME\":null,\"scheduleD_HRS\":\"06:00\",\"actuaL_HRS\":\"06:02\",\"excesS_HRS\":\"00:02\",\"comP_OFF_N_HRS\":\"00:00\",\"comP_OFF_W_HRS\":\"00:00\",\"comP_OFF_H_HRS\":\"00:00\",\"timebacK_HRS\":null,\"shortagE_HRS\":\"00:00\",\"latE_IN_HRS\":\"00:00\",\"earlY_OUT_HRS\":\"00:00\",\"remarks\":null,\"excesS_FLAG\":\"Y\",\"comP_OFF_FLAG\":\"N\",\"timebacK_FLAG\":\"Y\",\"shortagE_FLAG\":\"N\",\"latE_IN_FLAG\":\"N\",\"earlY_OUT_FLAG\":\"N\",\"missinG_SWIPES_FLAG\":\"N\"},{\"schedulE_DATE\":\"2025-03-17T00:00:00\",\"shifT_NAME\":\"10:00 - 16:00\",\"shifT_TYPE\":\"Regular\",\"breaK_NAME\":\"00:00 - 00:00\",\"actuaL_WOB_HRS\":\"00:00\",\"shT_ACTUAL_START_DATETIME\":\"10:49\",\"shT_ACTUAL_END_DATETIME\":\"17:00\",\"approveD_START_DATETIME\":null,\"approveD_END_DATETIME\":null,\"scheduleD_HRS\":\"06:00\",\"actuaL_HRS\":\"06:11\",\"excesS_HRS\":\"00:11\",\"comP_OFF_N_HRS\":\"00:00\",\"comP_OFF_W_HRS\":\"00:00\",\"comP_OFF_H_HRS\":\"00:00\",\"timebacK_HRS\":null,\"shortagE_HRS\":\"00:00\",\"latE_IN_HRS\":\"00:00\",\"earlY_OUT_HRS\":\"00:00\",\"remarks\":null,\"excesS_FLAG\":\"Y\",\"comP_OFF_FLAG\":\"N\",\"timebacK_FLAG\":\"Y\",\"shortagE_FLAG\":\"N\",\"latE_IN_FLAG\":\"N\",\"earlY_OUT_FLAG\":\"N\",\"missinG_SWIPES_FLAG\":\"N\"},{\"schedulE_DATE\":\"2025-03-18T00:00:00\",\"shifT_NAME\":\"10:00 - 16:00\",\"shifT_TYPE\":\"Regular\",\"breaK_NAME\":\"00:00 - 00:00\",\"actuaL_WOB_HRS\":\"00:00\",\"shT_ACTUAL_START_DATETIME\":\"10:40\",\"shT_ACTUAL_END_DATETIME\":\"16:59\",\"approveD_START_DATETIME\":null,\"approveD_END_DATETIME\":null,\"scheduleD_HRS\":\"06:00\",\"actuaL_HRS\":\"06:19\",\"excesS_HRS\":\"00:19\",\"comP_OFF_N_HRS\":\"00:00\",\"comP_OFF_W_HRS\":\"00:00\",\"comP_OFF_H_HRS\":\"00:00\",\"timebacK_HRS\":null,\"shortagE_HRS\":\"00:00\",\"latE_IN_HRS\":\"00:00\",\"earlY_OUT_HRS\":\"00:00\",\"remarks\":null,\"excesS_FLAG\":\"Y\",\"comP_OFF_FLAG\":\"N\",\"timebacK_FLAG\":\"Y\",\"shortagE_FLAG\":\"N\",\"latE_IN_FLAG\":\"N\",\"earlY_OUT_FLAG\":\"N\",\"missinG_SWIPES_FLAG\":\"N\"},{\"schedulE_DATE\":\"2025-03-19T00:00:00\",\"shifT_NAME\":\"10:00 - 16:00\",\"shifT_TYPE\":\"Regular\",\"breaK_NAME\":\"00:00 - 00:00\",\"actuaL_WOB_HRS\":\"00:00\",\"shT_ACTUAL_START_DATETIME\":\"10:46\",\"shT_ACTUAL_END_DATETIME\":\"17:03\",\"approveD_START_DATETIME\":null,\"approveD_END_DATETIME\":null,\"scheduleD_HRS\":\"06:00\",\"actuaL_HRS\":\"06:17\",\"excesS_HRS\":\"00:17\",\"comP_OFF_N_HRS\":\"00:00\",\"comP_OFF_W_HRS\":\"00:00\",\"comP_OFF_H_HRS\":\"00:00\",\"timebacK_HRS\":null,\"shortagE_HRS\":\"00:00\",\"latE_IN_HRS\":\"00:00\",\"earlY_OUT_HRS\":\"00:00\",\"remarks\":null,\"excesS_FLAG\":\"Y\",\"comP_OFF_FLAG\":\"N\",\"timebacK_FLAG\":\"Y\",\"shortagE_FLAG\":\"N\",\"latE_IN_FLAG\":\"N\",\"earlY_OUT_FLAG\":\"N\",\"missinG_SWIPES_FLAG\":\"N\"},{\"schedulE_DATE\":\"2025-03-20T00:00:00\",\"shifT_NAME\":\"10:00 - 16:00\",\"shifT_TYPE\":\"Regular\",\"breaK_NAME\":\"00:00 - 00:00\",\"actuaL_WOB_HRS\":\"00:00\",\"shT_ACTUAL_START_DATETIME\":\"10:52\",\"shT_ACTUAL_END_DATETIME\":\"16:55\",\"approveD_START_DATETIME\":null,\"approveD_END_DATETIME\":null,\"scheduleD_HRS\":\"06:00\",\"actuaL_HRS\":\"06:03\",\"excesS_HRS\":\"00:03\",\"comP_OFF_N_HRS\":\"00:00\",\"comP_OFF_W_HRS\":\"00:00\",\"comP_OFF_H_HRS\":\"00:00\",\"timebacK_HRS\":null,\"shortagE_HRS\":\"00:00\",\"latE_IN_HRS\":\"00:00\",\"earlY_OUT_HRS\":\"00:00\",\"remarks\":null,\"excesS_FLAG\":\"Y\",\"comP_OFF_FLAG\":\"N\",\"timebacK_FLAG\":\"Y\",\"shortagE_FLAG\":\"N\",\"latE_IN_FLAG\":\"N\",\"earlY_OUT_FLAG\":\"N\",\"missinG_SWIPES_FLAG\":\"N\"},{\"schedulE_DATE\":\"2025-03-21T00:00:00\",\"shifT_NAME\":\"00:00 - 00:00\",\"shifT_TYPE\":\"Regular\",\"breaK_NAME\":\"00:00 - 00:00\",\"actuaL_WOB_HRS\":\"00:00\",\"shT_ACTUAL_START_DATETIME\":null,\"shT_ACTUAL_END_DATETIME\":null,\"approveD_START_DATETIME\":null,\"approveD_END_DATETIME\":null,\"scheduleD_HRS\":\"00:00\",\"actuaL_HRS\":\"00:00\",\"excesS_HRS\":\"00:00\",\"comP_OFF_N_HRS\":\"00:00\",\"comP_OFF_W_HRS\":\"00:00\",\"comP_OFF_H_HRS\":\"00:00\",\"timebacK_HRS\":null,\"shortagE_HRS\":\"00:00\",\"latE_IN_HRS\":\"00:00\",\"earlY_OUT_HRS\":\"00:00\",\"remarks\":\"Off Shift\",\"excesS_FLAG\":\"N\",\"comP_OFF_FLAG\":\"N\",\"timebacK_FLAG\":\"N\",\"shortagE_FLAG\":\"N\",\"latE_IN_FLAG\":\"N\",\"earlY_OUT_FLAG\":\"N\",\"missinG_SWIPES_FLAG\":\"N\"},{\"schedulE_DATE\":\"2025-03-22T00:00:00\",\"shifT_NAME\":\"00:00 - 00:00\",\"shifT_TYPE\":\"Regular\",\"breaK_NAME\":\"00:00 - 00:00\",\"actuaL_WOB_HRS\":\"00:00\",\"shT_ACTUAL_START_DATETIME\":null,\"shT_ACTUAL_END_DATETIME\":null,\"approveD_START_DATETIME\":null,\"approveD_END_DATETIME\":null,\"scheduleD_HRS\":\"00:00\",\"actuaL_HRS\":\"00:00\",\"excesS_HRS\":\"00:00\",\"comP_OFF_N_HRS\":\"00:00\",\"comP_OFF_W_HRS\":\"00:00\",\"comP_OFF_H_HRS\":\"00:00\",\"timebacK_HRS\":null,\"shortagE_HRS\":\"00:00\",\"latE_IN_HRS\":\"00:00\",\"earlY_OUT_HRS\":\"00:00\",\"remarks\":\"Off Shift\",\"excesS_FLAG\":\"N\",\"comP_OFF_FLAG\":\"N\",\"timebacK_FLAG\":\"N\",\"shortagE_FLAG\":\"N\",\"latE_IN_FLAG\":\"N\",\"earlY_OUT_FLAG\":\"N\",\"missinG_SWIPES_FLAG\":\"N\"},{\"schedulE_DATE\":\"2025-03-23T00:00:00\",\"shifT_NAME\":\"10:00 - 16:00\",\"shifT_TYPE\":\"Regular\",\"breaK_NAME\":\"00:00 - 00:00\",\"actuaL_WOB_HRS\":\"00:00\",\"shT_ACTUAL_START_DATETIME\":\"10:54\",\"shT_ACTUAL_END_DATETIME\":\"17:13\",\"approveD_START_DATETIME\":null,\"approveD_END_DATETIME\":null,\"scheduleD_HRS\":\"06:00\",\"actuaL_HRS\":\"06:19\",\"excesS_HRS\":\"00:19\",\"comP_OFF_N_HRS\":\"00:00\",\"comP_OFF_W_HRS\":\"00:00\",\"comP_OFF_H_HRS\":\"00:00\",\"timebacK_HRS\":null,\"shortagE_HRS\":\"00:00\",\"latE_IN_HRS\":\"00:00\",\"earlY_OUT_HRS\":\"00:00\",\"remarks\":null,\"excesS_FLAG\":\"Y\",\"comP_OFF_FLAG\":\"N\",\"timebacK_FLAG\":\"Y\",\"shortagE_FLAG\":\"N\",\"latE_IN_FLAG\":\"N\",\"earlY_OUT_FLAG\":\"N\",\"missinG_SWIPES_FLAG\":\"N\"},{\"schedulE_DATE\":\"2025-03-24T00:00:00\",\"shifT_NAME\":\"10:00 - 16:00\",\"shifT_TYPE\":\"Regular\",\"breaK_NAME\":\"00:00 - 00:00\",\"actuaL_WOB_HRS\":\"00:00\",\"shT_ACTUAL_START_DATETIME\":\"10:40\",\"shT_ACTUAL_END_DATETIME\":\"16:51\",\"approveD_START_DATETIME\":null,\"approveD_END_DATETIME\":null,\"scheduleD_HRS\":\"06:00\",\"actuaL_HRS\":\"06:11\",\"excesS_HRS\":\"00:11\",\"comP_OFF_N_HRS\":\"00:00\",\"comP_OFF_W_HRS\":\"00:00\",\"comP_OFF_H_HRS\":\"00:00\",\"timebacK_HRS\":null,\"shortagE_HRS\":\"00:00\",\"latE_IN_HRS\":\"00:00\",\"earlY_OUT_HRS\":\"00:00\",\"remarks\":null,\"excesS_FLAG\":\"Y\",\"comP_OFF_FLAG\":\"N\",\"timebacK_FLAG\":\"Y\",\"shortagE_FLAG\":\"N\",\"latE_IN_FLAG\":\"N\",\"earlY_OUT_FLAG\":\"N\",\"missinG_SWIPES_FLAG\":\"N\"},{\"schedulE_DATE\":\"2025-03-25T00:00:00\",\"shifT_NAME\":\"10:00 - 16:00\",\"shifT_TYPE\":\"Regular\",\"breaK_NAME\":\"00:00 - 00:00\",\"actuaL_WOB_HRS\":\"00:00\",\"shT_ACTUAL_START_DATETIME\":\"10:49\",\"shT_ACTUAL_END_DATETIME\":\"17:04\",\"approveD_START_DATETIME\":null,\"approveD_END_DATETIME\":null,\"scheduleD_HRS\":\"06:00\",\"actuaL_HRS\":\"06:15\",\"excesS_HRS\":\"00:15\",\"comP_OFF_N_HRS\":\"00:00\",\"comP_OFF_W_HRS\":\"00:00\",\"comP_OFF_H_HRS\":\"00:00\",\"timebacK_HRS\":null,\"shortagE_HRS\":\"00:00\",\"latE_IN_HRS\":\"00:00\",\"earlY_OUT_HRS\":\"00:00\",\"remarks\":null,\"excesS_FLAG\":\"Y\",\"comP_OFF_FLAG\":\"N\",\"timebacK_FLAG\":\"Y\",\"shortagE_FLAG\":\"N\",\"latE_IN_FLAG\":\"N\",\"earlY_OUT_FLAG\":\"N\",\"missinG_SWIPES_FLAG\":\"N\"},{\"schedulE_DATE\":\"2025-03-26T00:00:00\",\"shifT_NAME\":\"10:00 - 16:00\",\"shifT_TYPE\":\"Regular\",\"breaK_NAME\":\"00:00 - 00:00\",\"actuaL_WOB_HRS\":\"00:00\",\"shT_ACTUAL_START_DATETIME\":\"10:55\",\"shT_ACTUAL_END_DATETIME\":\"17:23\",\"approveD_START_DATETIME\":null,\"approveD_END_DATETIME\":null,\"scheduleD_HRS\":\"06:00\",\"actuaL_HRS\":\"06:28\",\"excesS_HRS\":\"00:28\",\"comP_OFF_N_HRS\":\"00:00\",\"comP_OFF_W_HRS\":\"00:00\",\"comP_OFF_H_HRS\":\"00:00\",\"timebacK_HRS\":null,\"shortagE_HRS\":\"00:00\",\"latE_IN_HRS\":\"00:00\",\"earlY_OUT_HRS\":\"00:00\",\"remarks\":null,\"excesS_FLAG\":\"Y\",\"comP_OFF_FLAG\":\"N\",\"timebacK_FLAG\":\"Y\",\"shortagE_FLAG\":\"N\",\"latE_IN_FLAG\":\"N\",\"earlY_OUT_FLAG\":\"N\",\"missinG_SWIPES_FLAG\":\"N\"},{\"schedulE_DATE\":\"2025-03-27T00:00:00\",\"shifT_NAME\":\"10:00 - 16:00\",\"shifT_TYPE\":\"Regular\",\"breaK_NAME\":\"00:00 - 00:00\",\"actuaL_WOB_HRS\":\"00:00\",\"shT_ACTUAL_START_DATETIME\":\"10:56\",\"shT_ACTUAL_END_DATETIME\":\"16:17\",\"approveD_START_DATETIME\":null,\"approveD_END_DATETIME\":null,\"scheduleD_HRS\":\"06:00\",\"actuaL_HRS\":\"05:21\",\"excesS_HRS\":\"00:00\",\"comP_OFF_N_HRS\":\"00:00\",\"comP_OFF_W_HRS\":\"00:00\",\"comP_OFF_H_HRS\":\"00:00\",\"timebacK_HRS\":null,\"shortagE_HRS\":\"00:39\",\"latE_IN_HRS\":\"00:00\",\"earlY_OUT_HRS\":\"00:39\",\"remarks\":null,\"excesS_FLAG\":\"N\",\"comP_OFF_FLAG\":\"N\",\"timebacK_FLAG\":\"N\",\"shortagE_FLAG\":\"Y\",\"latE_IN_FLAG\":\"N\",\"earlY_OUT_FLAG\":\"Y\",\"missinG_SWIPES_FLAG\":\"N\"},{\"schedulE_DATE\":\"2025-03-28T00:00:00\",\"shifT_NAME\":\"00:00 - 00:00\",\"shifT_TYPE\":\"Regular\",\"breaK_NAME\":\"00:00 - 00:00\",\"actuaL_WOB_HRS\":\"00:00\",\"shT_ACTUAL_START_DATETIME\":null,\"shT_ACTUAL_END_DATETIME\":null,\"approveD_START_DATETIME\":null,\"approveD_END_DATETIME\":null,\"scheduleD_HRS\":\"00:00\",\"actuaL_HRS\":\"00:00\",\"excesS_HRS\":\"00:00\",\"comP_OFF_N_HRS\":\"00:00\",\"comP_OFF_W_HRS\":\"00:00\",\"comP_OFF_H_HRS\":\"00:00\",\"timebacK_HRS\":null,\"shortagE_HRS\":\"00:00\",\"latE_IN_HRS\":\"00:00\",\"earlY_OUT_HRS\":\"00:00\",\"remarks\":\"Off Shift\",\"excesS_FLAG\":\"N\",\"comP_OFF_FLAG\":\"N\",\"timebacK_FLAG\":\"N\",\"shortagE_FLAG\":\"N\",\"latE_IN_FLAG\":\"N\",\"earlY_OUT_FLAG\":\"N\",\"missinG_SWIPES_FLAG\":\"N\"},{\"schedulE_DATE\":\"2025-03-29T00:00:00\",\"shifT_NAME\":\"00:00 - 00:00\",\"shifT_TYPE\":\"Regular\",\"breaK_NAME\":\"00:00 - 00:00\",\"actuaL_WOB_HRS\":\"00:00\",\"shT_ACTUAL_START_DATETIME\":null,\"shT_ACTUAL_END_DATETIME\":null,\"approveD_START_DATETIME\":null,\"approveD_END_DATETIME\":null,\"scheduleD_HRS\":\"00:00\",\"actuaL_HRS\":\"00:00\",\"excesS_HRS\":\"00:00\",\"comP_OFF_N_HRS\":\"00:00\",\"comP_OFF_W_HRS\":\"00:00\",\"comP_OFF_H_HRS\":\"00:00\",\"timebacK_HRS\":null,\"shortagE_HRS\":\"00:00\",\"latE_IN_HRS\":\"00:00\",\"earlY_OUT_HRS\":\"00:00\",\"remarks\":\"Off Shift\",\"excesS_FLAG\":\"N\",\"comP_OFF_FLAG\":\"N\",\"timebacK_FLAG\":\"N\",\"shortagE_FLAG\":\"N\",\"latE_IN_FLAG\":\"N\",\"earlY_OUT_FLAG\":\"N\",\"missinG_SWIPES_FLAG\":\"N\"},{\"schedulE_DATE\":\"2025-03-30T00:00:00\",\"shifT_NAME\":\"08:00 - 17:00\",\"shifT_TYPE\":\"Regular\",\"breaK_NAME\":\"13:00 - 14:00\",\"actuaL_WOB_HRS\":\"00:00\",\"shT_ACTUAL_START_DATETIME\":null,\"shT_ACTUAL_END_DATETIME\":null,\"approveD_START_DATETIME\":null,\"approveD_END_DATETIME\":null,\"scheduleD_HRS\":\"00:00\",\"actuaL_HRS\":\"00:00\",\"excesS_HRS\":\"00:00\",\"comP_OFF_N_HRS\":\"00:00\",\"comP_OFF_W_HRS\":\"00:00\",\"comP_OFF_H_HRS\":\"00:00\",\"timebacK_HRS\":null,\"shortagE_HRS\":\"00:00\",\"latE_IN_HRS\":\"00:00\",\"earlY_OUT_HRS\":\"00:00\",\"remarks\":\" From: 30-03-2025 To : 02-04-2025\\n\",\"excesS_FLAG\":\"N\",\"comP_OFF_FLAG\":\"N\",\"timebacK_FLAG\":\"N\",\"shortagE_FLAG\":\"N\",\"latE_IN_FLAG\":\"N\",\"earlY_OUT_FLAG\":\"N\",\"missinG_SWIPES_FLAG\":\"N\"},{\"schedulE_DATE\":\"2025-03-31T00:00:00\",\"shifT_NAME\":\"08:00 - 17:00\",\"shifT_TYPE\":\"Regular\",\"breaK_NAME\":\"13:00 - 14:00\",\"actuaL_WOB_HRS\":\"00:00\",\"shT_ACTUAL_START_DATETIME\":null,\"shT_ACTUAL_END_DATETIME\":null,\"approveD_START_DATETIME\":null,\"approveD_END_DATETIME\":null,\"scheduleD_HRS\":\"00:00\",\"actuaL_HRS\":\"00:00\",\"excesS_HRS\":\"00:00\",\"comP_OFF_N_HRS\":\"00:00\",\"comP_OFF_W_HRS\":\"00:00\",\"comP_OFF_H_HRS\":\"00:00\",\"timebacK_HRS\":null,\"shortagE_HRS\":\"00:00\",\"latE_IN_HRS\":\"00:00\",\"earlY_OUT_HRS\":\"00:00\",\"remarks\":\" From: 30-03-2025 To : 02-04-2025\\n\",\"excesS_FLAG\":\"N\",\"comP_OFF_FLAG\":\"N\",\"timebacK_FLAG\":\"N\",\"shortagE_FLAG\":\"N\",\"latE_IN_FLAG\":\"N\",\"earlY_OUT_FLAG\":\"N\",\"missinG_SWIPES_FLAG\":\"N\"}]}", + // ); + // timeCardSummaryData = ItgTimeCardSummaryData.fromJson(decodedDta); + // Utils.handleException(ex, context, null); } } diff --git a/lib/widgets/location/Location.dart b/lib/widgets/location/Location.dart index 23ad0cc..fe4e976 100644 --- a/lib/widgets/location/Location.dart +++ b/lib/widgets/location/Location.dart @@ -44,7 +44,7 @@ class Location { AppPermissions.location((granted) { if (granted) { - Geolocator.getCurrentPosition(desiredAccuracy: LocationAccuracy.lowest, timeLimit: const Duration(seconds: 10)).then((value) { + Geolocator.getCurrentPosition(desiredAccuracy: LocationAccuracy.medium, timeLimit: const Duration(seconds: 10)).then((value) { done(value); }).catchError((err) { errorCallBack(); diff --git a/pubspec.yaml b/pubspec.yaml index ecaa799..4b1df68 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -17,7 +17,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev # Read more about iOS versioning at # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html #version: 3.3.01+300040 -version: 3.7.992+1 +version: 3.5.9+300069 environment: sdk: ">=2.16.0 <3.0.0" @@ -61,11 +61,11 @@ dependencies: platform_device_id: ^1.0.1 image_picker: ^0.8.5+3 file_picker: 5.2.5 - geolocator: ^9.0.2 + geolocator: ^11.1.0 month_year_picker: ^0.2.0+1 month_picker_dialog_2: ^0.5.5 -# open_file: ^3.2.1 - open_filex: ^4.6.0 + # open_file: ^3.2.1 + open_filex: ^4.4.0 wifi_iot: ^0.3.19+1 flutter_html: ^3.0.0-alpha.6 # flutter_barcode_scanner: ^2.0.0 @@ -110,13 +110,13 @@ dependencies: #Huawei Dependencies # huawei_hmsavailability: ^6.6.0+300 -# huawei_location: 6.0.0+302 + # huawei_location: 6.0.0+302 huawei_location: ^6.11.0+301 huawei_push: ^6.7.0+300 firebase_crashlytics: ^2.9.0 #Items for sale Image Carousel Slider - carousel_slider: ^5.0.0 + carousel_slider: ^4.2.1 #Huawei Specified # store_checker: ^1.1.0 @@ -228,4 +228,4 @@ flutter: # see https://flutter.dev/custom-fonts/#from-packages -# Adding this to test the push from iMac +# Adding this to test the push from iMac \ No newline at end of file From 0e7bac455750976c1c810faf7f22480ea45d0e07 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Thu, 8 May 2025 12:08:32 +0300 Subject: [PATCH 10/26] ITG Timesheet & Approval level fixes --- lib/ui/work_list/itg_detail_screen.dart | 5 ++++- .../itg_fragments/approval_level_fragment.dart | 18 +++++++++--------- .../itg_fragments/request_detail_fragment.dart | 2 +- pubspec.yaml | 2 +- 4 files changed, 15 insertions(+), 12 deletions(-) diff --git a/lib/ui/work_list/itg_detail_screen.dart b/lib/ui/work_list/itg_detail_screen.dart index 930cfe6..bbe4c3e 100644 --- a/lib/ui/work_list/itg_detail_screen.dart +++ b/lib/ui/work_list/itg_detail_screen.dart @@ -88,8 +88,9 @@ class _ItgDetailScreenState extends State { String month = rawDate.split('/').first; String year = rawDate.split('/').last; String formattedString = "${getMonthName(month)}-$year"; + if (requestDetails!.requestType == "Timesheet Request") { - dynamic data = await WorkListApiClient().getITGTimeCardDetails("Timesheet Request", formattedString, AppState().memberInformationList?.eMPLOYEENUMBER ?? ""); + dynamic data = await WorkListApiClient().getITGTimeCardDetails("Timesheet Request", formattedString, itgRequest!.fieldGoups![0].fields![1].value ?? ""); if (data != null) { var decodedDta = jsonDecode(data); // var decodedDta = jsonDecode( @@ -97,6 +98,8 @@ class _ItgDetailScreenState extends State { // ); timeCardSummaryData = ItgTimeCardSummaryData.fromJson(decodedDta); } + } else { + timeCardSummaryData = ItgTimeCardSummaryData(); } Utils.hideLoading(context); setState(() { diff --git a/lib/ui/work_list/itg_fragments/approval_level_fragment.dart b/lib/ui/work_list/itg_fragments/approval_level_fragment.dart index e617511..d7d9c7e 100644 --- a/lib/ui/work_list/itg_fragments/approval_level_fragment.dart +++ b/lib/ui/work_list/itg_fragments/approval_level_fragment.dart @@ -152,16 +152,16 @@ class ApprovalLevelfragment extends StatelessWidget { // DateTime dateTimeFrom = DateUtil.convertSimpleStringDateToDate(wFHistory[index].date!); // Duration duration = DateTime.now().difference(dateTimeFrom); // return "Action duration: " + DateUtil.formatDuration(duration); - } - else if (wFHistory[index].employeeID == AppState().memberInformationList?.eMPLOYEENUMBER) { - // if (wFHistory[index + 1].date!.isEmpty) { - // return ""; - // } - DateTime dateTimeFrom = DateUtil.convertSimpleStringDateToDate(wFHistory[index + 1].date!, isITG: true); - Duration duration = DateTime.now().difference(dateTimeFrom); - return "Action duration: " + DateUtil.formatDuration(duration); + } else if (wFHistory[index].employeeID == AppState().memberInformationList?.eMPLOYEENUMBER) { + if (wFHistory[index + 1].date!.isEmpty || wFHistory[index + 1].date! == "") { + return ""; + } else { + DateTime dateTimeFrom = DateUtil.convertSimpleStringDateToDate(wFHistory[index + 1].date!, isITG: true); + Duration duration = DateTime.now().difference(dateTimeFrom); + return "Action duration: " + DateUtil.formatDuration(duration); + } } else { - if (wFHistory[index].date!.isEmpty || wFHistory[index].action!.toLowerCase() == "NO ACTION") { + if (wFHistory[index].date!.isEmpty || wFHistory[index].action!.toLowerCase() == "NO ACTION" || wFHistory[index + 1].date! == "") { return ""; } else { DateTime dateTimeTo = DateUtil.convertSimpleStringDateToDate(wFHistory[index].date!); diff --git a/lib/ui/work_list/itg_fragments/request_detail_fragment.dart b/lib/ui/work_list/itg_fragments/request_detail_fragment.dart index f16d69c..6cd3ea5 100644 --- a/lib/ui/work_list/itg_fragments/request_detail_fragment.dart +++ b/lib/ui/work_list/itg_fragments/request_detail_fragment.dart @@ -1 +1 @@ -import 'package:easy_localization/easy_localization.dart'; import 'package:flutter/material.dart'; import 'package:flutter_svg/svg.dart'; import 'package:mohem_flutter_app/extensions/int_extensions.dart'; import 'package:mohem_flutter_app/extensions/string_extensions.dart'; import 'package:mohem_flutter_app/extensions/widget_extensions.dart'; import 'package:mohem_flutter_app/generated/locale_keys.g.dart'; import 'package:mohem_flutter_app/models/itg/itg_summary_data.dart'; import 'package:mohem_flutter_app/models/itg_forms_models/field_goups_model.dart'; import 'package:mohem_flutter_app/models/itg_forms_models/fields_model.dart'; import 'package:mohem_flutter_app/widgets/item_detail_view_widget.dart'; class RequestDetailFragment extends StatelessWidget { List fields; List? fieldGoups; String taskID; ItgTimeCardSummaryData? summaryData; RequestDetailFragment({Key? key, this.fields = const [], this.fieldGoups = const [], this.taskID = "", this.summaryData}) : super(key: key); double itemHeight = 0; double itemWidth = 0; @override Widget build(BuildContext context) { var size = MediaQuery.of(context).size; itemHeight = (size.height - kToolbarHeight - 24) / 9; itemWidth = size.width / 2; List uiList = [detailView(fields)]; return Column( mainAxisSize: MainAxisSize.min, children: [ Expanded( child: SingleChildScrollView( child: Padding( padding: const EdgeInsets.all(21), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ SizedBox( width: double.infinity, // height: double.infinity, child: fields.isEmpty ? LocaleKeys.noDataAvailable.tr().toText16().center : ListView(shrinkWrap: true, children: uiList), ), 12.height, if (taskID.toLowerCase().contains("vida")) Column( children: [ fieldGoups![2].title!.toText14(), 6.height, detailView(fieldGoups![2].fields!), 12.height, fieldGoups![3].title!.toText14(), 6.height, detailView(fieldGoups![3].fields!), 12.height, fieldGoups![4].title!.toText14(), 6.height, detailView(fieldGoups![4].fields!), ], ), if (summaryData != null && summaryData!.summeries != null && summaryData!.summeries!.isNotEmpty) buildStatsDashboard(summaryData: summaryData), ], ), ), ), ), ], ); } Widget leaveTypeHorizontalList() { return SizedBox( // height: 120, child: ListView( shrinkWrap: true, scrollDirection: Axis.vertical, physics: const NeverScrollableScrollPhysics(), padding: const EdgeInsets.symmetric(horizontal: 0, vertical: 0), children: [ _buildLeaveTypeChip( title: 'Half-Day Leave', value: summaryData?.summeries?.first.unpaiDLeaves.toString() ?? "0", textColor: const Color(0xFF3B3D4A), topIcon: "assets/icons/itg/calendar-remove.svg", ), const SizedBox(height: 12), _buildLeaveTypeChip( title: 'Unauthorised Leave', value: summaryData?.summeries?.first.unauthorizeDLeaves.toString() ?? "0", textColor: const Color(0xFF3B3D4A), topIcon: "assets/icons/itg/knight-shield.svg", ), const SizedBox(height: 12), _buildLeaveTypeChip(title: 'Sick Leave', value: summaryData?.summeries?.first.sicKLeaves.toString() ?? "0", textColor: const Color(0xFF3B3D4A), topIcon: "assets/icons/itg/stethoscope.svg"), const SizedBox(height: 12), _buildLeaveTypeChip(title: 'Paid Leave', value: summaryData?.summeries?.first.paiDLeaves.toString() ?? "0", textColor: const Color(0xFF3B3D4A), topIcon: "assets/icons/itg/calendar.svg"), const SizedBox(height: 12), _buildLeaveTypeChip( title: 'Unpaid Leave', value: summaryData?.summeries?.first.unpaiDLeaves.toString() ?? "0", textColor: const Color(0xFF3B3D4A), topIcon: "assets/icons/itg/money-not-found.svg", ), const SizedBox(height: 12), _buildLeaveTypeChip( title: 'Public Holidays', value: summaryData?.summeries?.first.publiCHolidays.toString() ?? "0", textColor: const Color(0xFF3B3D4A), topIcon: "assets/icons/itg/finger-print-remove.svg", ), ], ), ); } Widget _buildLeaveTypeChip({required String title, required String value, required Color textColor, Color? valueColor, String? topIcon, String? bottomIcon, Widget? child}) { return Container( padding: const EdgeInsets.all(10), height: 110, decoration: BoxDecoration( color: const Color(0xFFEAF1F4), borderRadius: BorderRadius.circular(8), boxShadow: [BoxShadow(color: Colors.black.withOpacity(0.05), blurRadius: 8, offset: const Offset(0, 4))], ), child: child ?? Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ if (topIcon != null) ...[ Row(children: [Expanded(child: title.toText13(color: textColor)), SvgPicture.asset(topIcon, width: 24)]), const SizedBox(height: 21), ] else ...[ title.toText13(color: textColor), const SizedBox(height: 8), ], Row(children: [value.toText24(color: valueColor ?? textColor, isBold: true), const SizedBox(width: 10), if (bottomIcon != null) SvgPicture.asset(bottomIcon, width: 24)]), ], ), ); } Widget buildStatsDashboard({required ItgTimeCardSummaryData? summaryData}) { return Column( children: [ // First row with 2 boxes Row( children: [ buildStatBox( title: 'Missing Swipes', value: summaryData?.summeries?.first.missinGSwipesDays.toString() ?? "0", textColor: const Color(0xFF3B3D4A), topIcon: "assets/icons/itg/finger-print-remove.svg", ), const SizedBox(width: 15), buildStatBox(title: 'Total Shortage', value: summaryData?.summeries?.first.shortagEHrs ?? "0", textColor: const Color(0xFF3B3D4A), topIcon: "assets/icons/itg/time-quarter-pass.svg"), ], ), const SizedBox(height: 15), // Second row with 2 boxes Row( children: [ buildLateInEarlyOutBox( lateInValue: summaryData?.summeries?.first.latEInHrs ?? "0", earlyOutValue: summaryData?.summeries?.first.earlYOutHrs ?? "0", topIcon: "assets/icons/itg/coming-soon.svg", ), const SizedBox(width: 15), buildStatBox( title: 'Uncovered Shortage', value: summaryData?.summeries?.first.uncovereDShortageHrs.toString() ?? "0", textColor: const Color(0xFF3B3D4A), valueColor: const Color(0xFFEB5757), topIcon: "assets/icons/itg/time-quarter.svg", bottomIcon: "assets/icons/itg/alert.svg", ), ], ), const SizedBox(height: 15), Row( children: [ buildStatBox( title: 'Half-Day Leave', value: summaryData?.summeries?.first.unpaiDLeaves.toString() ?? "0", textColor: const Color(0xFF3B3D4A), topIcon: "assets/icons/itg/calendar-remove.svg", ), const SizedBox(width: 15), buildStatBox( title: 'Unauthorised Leave', value: summaryData?.summeries?.first.unauthorizeDLeaves.toString() ?? "0", textColor: const Color(0xFF3B3D4A), topIcon: "assets/icons/itg/knight-shield.svg", ), ], ), const SizedBox(height: 15), Row( children: [ buildStatBox(title: 'Sick Leave', value: summaryData?.summeries?.first.sicKLeaves.toString() ?? "0", textColor: const Color(0xFF3B3D4A), topIcon: "assets/icons/itg/stethoscope.svg",), const SizedBox(width: 15), buildStatBox(title: 'Paid Leave', value: summaryData?.summeries?.first.paiDLeaves.toString() ?? "0", textColor: const Color(0xFF3B3D4A), topIcon: "assets/icons/itg/calendar.svg",), ], ), const SizedBox(height: 15), Row( children: [ buildStatBox( title: 'Unpaid Leave', value: summaryData?.summeries?.first.unpaiDLeaves.toString() ?? "0", textColor: const Color(0xFF3B3D4A), topIcon: "assets/icons/itg/money-not-found.svg", ), const SizedBox(width: 15), buildStatBox( title: 'Public Holidays', value: summaryData?.summeries?.first.publiCHolidays.toString() ?? "0", textColor: const Color(0xFF3B3D4A), topIcon: "assets/icons/itg/finger-print-remove.svg", ), ], ), const SizedBox(height: 15), ], ); } Widget buildStatBox({required String title, required String value, required Color textColor, Color? valueColor, String? topIcon, String? bottomIcon, Widget? child}) { return Expanded( child: Container( padding: const EdgeInsets.all(10), height: 110, decoration: BoxDecoration( color: const Color(0xFFEAF1F4), borderRadius: BorderRadius.circular(8), boxShadow: [BoxShadow(color: Colors.black.withOpacity(0.05), blurRadius: 8, offset: const Offset(0, 4))], ), child: child ?? Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ if (topIcon != null) ...[ Row(children: [Expanded(child: title.toText13(color: textColor)), SvgPicture.asset(topIcon, width: 24)]), const SizedBox(height: 40), ] else ...[ title.toText13(color: textColor), const SizedBox(height: 8), ], Row(children: [value.toText24(color: valueColor ?? textColor, isBold: true), const SizedBox(width: 10), if (bottomIcon != null) SvgPicture.asset(bottomIcon, width: 20)]), ], ), ), ); } Widget buildLateInEarlyOutBox({required String lateInValue, required String earlyOutValue, required String topIcon}) { return buildStatBox( title: 'Late In / Early Out', textColor: const Color(0xFFEB5757), topIcon: topIcon, child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ Row(children: ["Late In / Early Out".toText13(color: const Color(0xFF3B3D4A)), const Expanded(child: SizedBox()), SvgPicture.asset(topIcon, width: 24)]), const SizedBox(height: 22), RichText( text: TextSpan( style: const TextStyle(fontSize: 13), children: [ const TextSpan(text: 'Late In : ', style: TextStyle(color: Color(0xFF767676), fontSize: 14)), TextSpan(text: lateInValue, style: const TextStyle(color: Color(0xFF3B3D4A), fontSize: 16, fontWeight: FontWeight.w700)), ], ), ), RichText( text: TextSpan( style: const TextStyle(fontSize: 13), children: [ const TextSpan(text: 'Early Out : ', style: TextStyle(color: Color(0xFF767676), fontSize: 14)), TextSpan(text: earlyOutValue, style: const TextStyle(color: Color(0xFF3B3D4A), fontSize: 16, fontWeight: FontWeight.w700)), ], ), ), ], ), value: '', ); } Widget detailView(List fieldsF) { List fields = List.from(fieldsF); bool isOdd = false; if (fields.length % 2 != 0) { isOdd = true; fields.add(new Fields()); } int descriptionFormatIndex = fields.indexWhere((element) => element.title == "Description Format" || element.title == "Description Format"); // todo add arabic in future Widget? descriptionFormatView; if (descriptionFormatIndex >= 0) { Fields descriptionFormat = fields[descriptionFormatIndex]; fields.removeAt(descriptionFormatIndex); descriptionFormatView = ItemDetailViewGridItem( 2, descriptionFormat.title, descriptionFormat.value == null ? (descriptionFormat.multipleValue?.join(", ") ?? "") : descriptionFormat.value ?? "", type: descriptionFormat.type, maxLine: 0, ); } return Column( mainAxisSize: MainAxisSize.min, children: [ GridView.builder( itemCount: fields.length, shrinkWrap: true, physics: const NeverScrollableScrollPhysics(), itemBuilder: (context, index) { if (fields[index].value == null) { return ItemDetailViewGridItem( index, fields[index].title, fields[index].multipleValue?.join(", ") ?? "", isNeedToShowEmptyDivider: (fields.length == index + 1) ? isOdd ? true : false : false, type: fields[index].type, ); } return ItemDetailViewGridItem( index, fields[index].title, fields[index].value ?? "", isNeedToShowEmptyDivider: (fields.length == index + 1) ? isOdd ? true : false : false, type: fields[index].type, ); }, gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(crossAxisCount: 2, childAspectRatio: (itemWidth / itemHeight)), ), if (descriptionFormatView != null) descriptionFormatView, ], ).objectContainerView(); return ListView.separated( shrinkWrap: true, physics: const NeverScrollableScrollPhysics(), itemBuilder: (cxt, index) { if (fields[index].value == null) { return ItemDetailView(fields[index].title!, fields[index].multipleValue?.join(", ") ?? ""); } return ItemDetailView(fields[index].title!, fields[index].value ?? ""); }, separatorBuilder: (cxt, index) => 4.height, itemCount: fields.length, ).objectContainerView(); } } \ No newline at end of file +import 'package:easy_localization/easy_localization.dart'; import 'package:flutter/material.dart'; import 'package:flutter_svg/svg.dart'; import 'package:mohem_flutter_app/extensions/int_extensions.dart'; import 'package:mohem_flutter_app/extensions/string_extensions.dart'; import 'package:mohem_flutter_app/extensions/widget_extensions.dart'; import 'package:mohem_flutter_app/generated/locale_keys.g.dart'; import 'package:mohem_flutter_app/models/itg/itg_summary_data.dart'; import 'package:mohem_flutter_app/models/itg_forms_models/field_goups_model.dart'; import 'package:mohem_flutter_app/models/itg_forms_models/fields_model.dart'; import 'package:mohem_flutter_app/widgets/item_detail_view_widget.dart'; class RequestDetailFragment extends StatelessWidget { List fields; List? fieldGoups; String taskID; ItgTimeCardSummaryData? summaryData; RequestDetailFragment({Key? key, this.fields = const [], this.fieldGoups = const [], this.taskID = "", this.summaryData}) : super(key: key); double itemHeight = 0; double itemWidth = 0; @override Widget build(BuildContext context) { var size = MediaQuery.of(context).size; itemHeight = (size.height - kToolbarHeight - 24) / 9; itemWidth = size.width / 2; List uiList = [detailView(fields)]; return Column( mainAxisSize: MainAxisSize.min, children: [ Expanded( child: SingleChildScrollView( child: Padding( padding: const EdgeInsets.all(21), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ SizedBox( width: double.infinity, // height: double.infinity, child: fields.isEmpty ? LocaleKeys.noDataAvailable.tr().toText16().center : ListView(shrinkWrap: true, children: uiList), ), 12.height, if (taskID.toLowerCase().contains("vida")) Column( children: [ fieldGoups![2].title!.toText14(), 6.height, detailView(fieldGoups![2].fields!), 12.height, fieldGoups![3].title!.toText14(), 6.height, detailView(fieldGoups![3].fields!), 12.height, fieldGoups![4].title!.toText14(), 6.height, detailView(fieldGoups![4].fields!), ], ), if (summaryData != null && summaryData!.summeries != null && summaryData!.summeries!.isNotEmpty) buildStatsDashboard(summaryData: summaryData), ], ), ), ), ), ], ); } Widget leaveTypeHorizontalList() { return SizedBox( // height: 120, child: ListView( shrinkWrap: true, scrollDirection: Axis.vertical, physics: const NeverScrollableScrollPhysics(), padding: const EdgeInsets.symmetric(horizontal: 0, vertical: 0), children: [ _buildLeaveTypeChip( title: 'Half-Day Leave', value: summaryData?.summeries?.first.unpaiDLeaves.toString() ?? "0", textColor: const Color(0xFF3B3D4A), topIcon: "assets/icons/itg/calendar-remove.svg", ), const SizedBox(height: 12), _buildLeaveTypeChip( title: 'Unauthorised Leave', value: summaryData?.summeries?.first.unauthorizeDLeaves.toString() ?? "0", textColor: const Color(0xFF3B3D4A), topIcon: "assets/icons/itg/knight-shield.svg", ), const SizedBox(height: 12), _buildLeaveTypeChip(title: 'Sick Leave', value: summaryData?.summeries?.first.sicKLeaves.toString() ?? "0", textColor: const Color(0xFF3B3D4A), topIcon: "assets/icons/itg/stethoscope.svg"), const SizedBox(height: 12), _buildLeaveTypeChip(title: 'Paid Leave', value: summaryData?.summeries?.first.paiDLeaves.toString() ?? "0", textColor: const Color(0xFF3B3D4A), topIcon: "assets/icons/itg/calendar.svg"), const SizedBox(height: 12), _buildLeaveTypeChip( title: 'Unpaid Leave', value: summaryData?.summeries?.first.unpaiDLeaves.toString() ?? "0", textColor: const Color(0xFF3B3D4A), topIcon: "assets/icons/itg/money-not-found.svg", ), const SizedBox(height: 12), _buildLeaveTypeChip( title: 'Public Holidays', value: summaryData?.summeries?.first.publiCHolidays.toString() ?? "0", textColor: const Color(0xFF3B3D4A), topIcon: "assets/icons/itg/finger-print-remove.svg", ), ], ), ); } Widget _buildLeaveTypeChip({required String title, required String value, required Color textColor, Color? valueColor, String? topIcon, String? bottomIcon, Widget? child}) { return Container( padding: const EdgeInsets.all(10), height: 110, decoration: BoxDecoration( color: const Color(0xFFEAF1F4), borderRadius: BorderRadius.circular(8), boxShadow: [ BoxShadow( color: Colors.black.withOpacity(0.05), blurRadius: 8, offset: const Offset(0, 4), ) ], ), child: child ?? Column( crossAxisAlignment: CrossAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ if (topIcon != null) ...[ Row( children: [ Expanded(child: title.toText13(color: textColor)), SvgPicture.asset(topIcon, width: 24), ], ), const SizedBox(height: 21), ] else ...[ title.toText13(color: textColor), const SizedBox(height: 8), ], Row(children: [value.toText24(color: valueColor ?? textColor, isBold: true), const SizedBox(width: 10), if (bottomIcon != null) SvgPicture.asset(bottomIcon, width: 24)]), ], ), ); } Widget buildStatsDashboard({required ItgTimeCardSummaryData? summaryData}) { return Column( children: [ // First row with 2 boxes Row( children: [ buildStatBox( title: 'Missing Swipes', value: summaryData?.summeries?.first.missinGSwipesDays.toString() ?? "0", textColor: const Color(0xFF3B3D4A), topIcon: "assets/icons/itg/finger-print-remove.svg", ), const SizedBox(width: 15), buildStatBox(title: 'Total Shortage', value: summaryData?.summeries?.first.shortagEHrs ?? "0", textColor: const Color(0xFF3B3D4A), topIcon: "assets/icons/itg/time-quarter-pass.svg"), ], ), const SizedBox(height: 15), // Second row with 2 boxes Row( children: [ buildLateInEarlyOutBox( lateInValue: summaryData?.summeries?.first.latEInHrs ?? "0", earlyOutValue: summaryData?.summeries?.first.earlYOutHrs ?? "0", topIcon: "assets/icons/itg/coming-soon.svg", ), const SizedBox(width: 15), buildStatBox( title: 'Uncovered Shortage', value: summaryData?.summeries?.first.uncovereDShortageHrs.toString() ?? "0", textColor: const Color(0xFF3B3D4A), valueColor: const Color(0xFFEB5757), topIcon: "assets/icons/itg/time-quarter.svg", bottomIcon: "assets/icons/itg/alert.svg", ), ], ), const SizedBox(height: 15), Row( children: [ buildStatBox( title: 'Half-Day Leave', value: summaryData?.summeries?.first.unpaiDLeaves.toString() ?? "0", textColor: const Color(0xFF3B3D4A), topIcon: "assets/icons/itg/calendar-remove.svg", ), const SizedBox(width: 15), buildStatBox( title: 'Unauthorised Leave', value: summaryData?.summeries?.first.unauthorizeDLeaves.toString() ?? "0", textColor: const Color(0xFF3B3D4A), topIcon: "assets/icons/itg/knight-shield.svg", ), ], ), const SizedBox(height: 15), Row( children: [ buildStatBox( title: 'Sick Leave', value: summaryData?.summeries?.first.sicKLeaves.toString() ?? "0", textColor: const Color(0xFF3B3D4A), topIcon: "assets/icons/itg/stethoscope.svg", ), const SizedBox(width: 15), buildStatBox( title: 'Paid Leave', value: summaryData?.summeries?.first.paiDLeaves.toString() ?? "0", textColor: const Color(0xFF3B3D4A), topIcon: "assets/icons/itg/calendar.svg", ), ], ), const SizedBox(height: 15), Row( children: [ buildStatBox( title: 'Unpaid Leave', value: summaryData?.summeries?.first.unpaiDLeaves.toString() ?? "0", textColor: const Color(0xFF3B3D4A), topIcon: "assets/icons/itg/money-not-found.svg", ), const SizedBox(width: 15), buildStatBox( title: 'Public Holidays', value: summaryData?.summeries?.first.publiCHolidays.toString() ?? "0", textColor: const Color(0xFF3B3D4A), topIcon: "assets/icons/itg/finger-print-remove.svg", ), ], ), const SizedBox(height: 15), ], ); } Widget buildStatBox({required String title, required String value, required Color textColor, Color? valueColor, String? topIcon, String? bottomIcon, Widget? child}) { return Expanded( child: Container( padding: const EdgeInsets.all(10), height: 110, decoration: BoxDecoration( color: const Color(0xFFEAF1F4), borderRadius: BorderRadius.circular(8), boxShadow: [BoxShadow(color: Colors.black.withOpacity(0.05), blurRadius: 8, offset: const Offset(0, 4))], ), child: child ?? Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ if (topIcon != null) ...[ Row(children: [Expanded(child: title.toText13(color: textColor)), SvgPicture.asset(topIcon, width: 24)]), Expanded(child: SizedBox(),), ] else ...[ title.toText13(color: textColor), const SizedBox(height: 8), ], Row(children: [value.toText24(color: valueColor ?? textColor, isBold: true), const SizedBox(width: 10), if (bottomIcon != null) SvgPicture.asset(bottomIcon, width: 20)]), ], ), ), ); } Widget buildLateInEarlyOutBox({required String lateInValue, required String earlyOutValue, required String topIcon}) { return buildStatBox( title: 'Late In / Early Out', textColor: const Color(0xFFEB5757), topIcon: topIcon, child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ Row(children: ["Late In / Early Out".toText13(color: const Color(0xFF3B3D4A)), const Expanded(child: SizedBox()), SvgPicture.asset(topIcon, width: 24)]), Expanded(child: SizedBox(),), RichText( text: TextSpan( style: const TextStyle(fontSize: 13), children: [ const TextSpan(text: 'Late In : ', style: TextStyle(color: Color(0xFF767676), fontSize: 14)), TextSpan(text: lateInValue, style: const TextStyle(color: Color(0xFF3B3D4A), fontSize: 16, fontWeight: FontWeight.w700)), ], ), ), RichText( text: TextSpan( style: const TextStyle(fontSize: 13), children: [ const TextSpan(text: 'Early Out : ', style: TextStyle(color: Color(0xFF767676), fontSize: 14)), TextSpan(text: earlyOutValue, style: const TextStyle(color: Color(0xFF3B3D4A), fontSize: 16, fontWeight: FontWeight.w700)), ], ), ), ], ), value: '', ); } Widget detailView(List fieldsF) { List fields = List.from(fieldsF); bool isOdd = false; if (fields.length % 2 != 0) { isOdd = true; fields.add(new Fields()); } int descriptionFormatIndex = fields.indexWhere((element) => element.title == "Description Format" || element.title == "Description Format"); // todo add arabic in future Widget? descriptionFormatView; if (descriptionFormatIndex >= 0) { Fields descriptionFormat = fields[descriptionFormatIndex]; fields.removeAt(descriptionFormatIndex); descriptionFormatView = ItemDetailViewGridItem( 2, descriptionFormat.title, descriptionFormat.value == null ? (descriptionFormat.multipleValue?.join(", ") ?? "") : descriptionFormat.value ?? "", type: descriptionFormat.type, maxLine: 0, ); } return Column( mainAxisSize: MainAxisSize.min, children: [ GridView.builder( itemCount: fields.length, shrinkWrap: true, physics: const NeverScrollableScrollPhysics(), itemBuilder: (context, index) { if (fields[index].value == null) { return ItemDetailViewGridItem( index, fields[index].title, fields[index].multipleValue?.join(", ") ?? "", isNeedToShowEmptyDivider: (fields.length == index + 1) ? isOdd ? true : false : false, type: fields[index].type, ); } return ItemDetailViewGridItem( index, fields[index].title, fields[index].value ?? "", isNeedToShowEmptyDivider: (fields.length == index + 1) ? isOdd ? true : false : false, type: fields[index].type, ); }, gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(crossAxisCount: 2, childAspectRatio: (itemWidth / itemHeight)), ), if (descriptionFormatView != null) descriptionFormatView, ], ).objectContainerView(); return ListView.separated( shrinkWrap: true, physics: const NeverScrollableScrollPhysics(), itemBuilder: (cxt, index) { if (fields[index].value == null) { return ItemDetailView(fields[index].title!, fields[index].multipleValue?.join(", ") ?? ""); } return ItemDetailView(fields[index].title!, fields[index].value ?? ""); }, separatorBuilder: (cxt, index) => 4.height, itemCount: fields.length, ).objectContainerView(); } } \ No newline at end of file diff --git a/pubspec.yaml b/pubspec.yaml index 4b1df68..511ce1a 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -17,7 +17,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev # Read more about iOS versioning at # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html #version: 3.3.01+300040 -version: 3.5.9+300069 +version: 3.6.1+300071 environment: sdk: ">=2.16.0 <3.0.0" From 9b683235c9065ab203b56de666af10e1078a4c4b Mon Sep 17 00:00:00 2001 From: Sikander Saleem Date: Sun, 11 May 2025 12:36:42 +0300 Subject: [PATCH 11/26] request information added, --- lib/api/api_client.dart | 1 + lib/ui/work_list/worklist_detail_screen.dart | 8 +++++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/lib/api/api_client.dart b/lib/api/api_client.dart index e3cbee1..446905f 100644 --- a/lib/api/api_client.dart +++ b/lib/api/api_client.dart @@ -86,6 +86,7 @@ class ApiClient { var response = await postJsonForResponse(url, jsonObject, token: token, queryParameters: queryParameters, headers: _headers, retryTimes: retryTimes, isFormData: isFormData); try { if (!kReleaseMode) { + logger.i("Url: " + url); logger.i("res: " + response.body); } diff --git a/lib/ui/work_list/worklist_detail_screen.dart b/lib/ui/work_list/worklist_detail_screen.dart index 69c669f..35c0078 100644 --- a/lib/ui/work_list/worklist_detail_screen.dart +++ b/lib/ui/work_list/worklist_detail_screen.dart @@ -144,7 +144,7 @@ class _WorkListDetailScreenState extends State { getEitNotificationBody(); } else if (workListData!.rEQUESTTYPE == "CEI") { getCEINotificationBody(); - }else if (workListData!.rEQUESTTYPE == "PHONE_NUMBERS") { + } else if (workListData!.rEQUESTTYPE == "PHONE_NUMBERS") { getPhonesNotificationBody(); } else if (workListData!.rEQUESTTYPE == "BASIC_DETAILS") { getBasicDetNtfBody(); @@ -679,10 +679,12 @@ class _WorkListDetailScreenState extends State { } void performAction(String actionMode, {String? title}) { + GetActionHistoryList? object = actionHistoryList.firstWhere((element) => element.aCTIONCODE == "REQUEST_INFO"); + String question = "${object.aCTION}: ${object.nOTE}"; showDialog( context: context, builder: (BuildContext cxt) => AcceptRejectInputDialog( - message: title != null ? null : LocaleKeys.requestedItems.tr(), + message: question, title: title, notificationGetRespond: notificationNoteInput, actionMode: actionMode, @@ -1102,7 +1104,7 @@ class _WorkListDetailScreenState extends State { try { isAttachmentLoaded = false; getAttachmentList.clear(); - List _getAttachmentList = await WorkListApiClient().getAttachments(workListData!.nOTIFICATIONID!); + List _getAttachmentList = await WorkListApiClient().getAttachments(workListData!.nOTIFICATIONID!); if (!isAttachmentLoaded) { getAttachmentList = _getAttachmentList; } From 4e2a774086204497429332f88598174bba7fe13b Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Mon, 12 May 2025 12:14:44 +0300 Subject: [PATCH 12/26] App update to stores, Version ID 8.8 --- lib/app_state/app_state.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/app_state/app_state.dart b/lib/app_state/app_state.dart index a2959ec..459a8e9 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: 8.7, mobileType: Platform.isAndroid ? "android" : "ios"); + final PostParamsModel _postParamsInitConfig = PostParamsModel(channel: 31, versionID: 8.8, mobileType: Platform.isAndroid ? "android" : "ios"); void setPostParamsInitConfig() { From d4b7550bab843b633ccd930e51d0f6fa1cd12eea Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Sun, 18 May 2025 15:51:35 +0300 Subject: [PATCH 13/26] Worklist actions buttons updates --- lib/api/api_client.dart | 6 ++ lib/ui/work_list/worklist_detail_screen.dart | 97 +++++++++++--------- 2 files changed, 58 insertions(+), 45 deletions(-) diff --git a/lib/api/api_client.dart b/lib/api/api_client.dart index 446905f..fb415d4 100644 --- a/lib/api/api_client.dart +++ b/lib/api/api_client.dart @@ -94,6 +94,12 @@ class ApiClient { if (jsonData["IsAuthenticated"] != null) { AppState().setIsAuthenticated = jsonData["IsAuthenticated"]; } + + // if(url.contains("GetOfferDiscountsConfigData")) { + // jsonData["ErrorMessage"] = "Service Not Available"; + // jsonData["ErrorEndUserMessage"] = "Service Not Available"; + // } + if (jsonData["ErrorMessage"] == null) { return factoryConstructor(jsonData); } else { diff --git a/lib/ui/work_list/worklist_detail_screen.dart b/lib/ui/work_list/worklist_detail_screen.dart index 35c0078..45ecd4d 100644 --- a/lib/ui/work_list/worklist_detail_screen.dart +++ b/lib/ui/work_list/worklist_detail_screen.dart @@ -297,50 +297,52 @@ class _WorkListDetailScreenState extends State { ], ).expanded, if (isApproveAvailable || isRejectAvailable || isCloseAvailable) - Container( - padding: const EdgeInsets.only(top: 14, bottom: 14, left: 21, right: 21), - decoration: const BoxDecoration( - color: Colors.white, - border: Border( - top: BorderSide(color: MyColors.lightGreyEFColor, width: 1.0), + SafeArea( + child: Container( + padding: const EdgeInsets.only(top: 14, bottom: 14, left: 21, right: 21), + decoration: const BoxDecoration( + color: Colors.white, + border: Border( + top: BorderSide(color: MyColors.lightGreyEFColor, width: 1.0), + ), + ), + child: Row( + children: [ + if (isRejectAvailable) + DefaultButton( + LocaleKeys.reject.tr(), + () => performAction(rejectAction), + colors: const [Color(0xffE47A7E), Color(0xffDE6D71)], + ).expanded, + if (isApproveAvailable && isRejectAvailable) 8.width, + if (isApproveAvailable) + DefaultButton( + LocaleKeys.approve.tr(), + () => performAction(approveAction), + colors: const [Color(0xff28C884), Color(0xff1BB271)], + ).expanded, + if (isCloseAvailable) + DefaultButton( + LocaleKeys.ok.tr(), + () => performAction("CLOSE"), + colors: const [Color(0xff32D892), Color(0xff1AB170)], + ).expanded, + 8.width, + Container( + height: 43, + width: 43, + decoration: const BoxDecoration( + shape: BoxShape.circle, + color: MyColors.lightGreyE6Color, + ), + child: Icon(showFabOptions ? Icons.more_vert_rounded : Icons.more_horiz_rounded, color: MyColors.darkIconColor), + ).onPress(() { + setState(() { + showFabOptions = true; + }); + }) + ], ), - ), - child: Row( - children: [ - if (isRejectAvailable) - DefaultButton( - LocaleKeys.reject.tr(), - () => performAction(rejectAction), - colors: const [Color(0xffE47A7E), Color(0xffDE6D71)], - ).expanded, - if (isApproveAvailable && isRejectAvailable) 8.width, - if (isApproveAvailable) - DefaultButton( - LocaleKeys.approve.tr(), - () => performAction(approveAction), - colors: const [Color(0xff28C884), Color(0xff1BB271)], - ).expanded, - if (isCloseAvailable) - DefaultButton( - LocaleKeys.ok.tr(), - () => performAction("CLOSE"), - colors: const [Color(0xff32D892), Color(0xff1AB170)], - ).expanded, - 8.width, - Container( - height: 43, - width: 43, - decoration: const BoxDecoration( - shape: BoxShape.circle, - color: MyColors.lightGreyE6Color, - ), - child: Icon(showFabOptions ? Icons.more_vert_rounded : Icons.more_horiz_rounded, color: MyColors.darkIconColor), - ).onPress(() { - setState(() { - showFabOptions = true; - }); - }) - ], ), ) ], @@ -679,8 +681,13 @@ class _WorkListDetailScreenState extends State { } void performAction(String actionMode, {String? title}) { - GetActionHistoryList? object = actionHistoryList.firstWhere((element) => element.aCTIONCODE == "REQUEST_INFO"); - String question = "${object.aCTION}: ${object.nOTE}"; + String question = ""; + if (actionMode == "ANSWER_INFO") { + List list = actionHistoryList.where((element) => element.aCTIONCODE == "REQUEST_INFO").toList(); + if (list.isNotEmpty) { + question = "${list.first.aCTION}: ${list.first.nOTE}"; + } + } showDialog( context: context, builder: (BuildContext cxt) => AcceptRejectInputDialog( From aaa4f134934821df865fb0ba82fbfe3fbd465ffc Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Sun, 18 May 2025 16:03:23 +0300 Subject: [PATCH 14/26] App update to stores, Version ID 8.9 --- lib/app_state/app_state.dart | 2 +- pubspec.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/app_state/app_state.dart b/lib/app_state/app_state.dart index 459a8e9..f8ee060 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: 8.8, mobileType: Platform.isAndroid ? "android" : "ios"); + final PostParamsModel _postParamsInitConfig = PostParamsModel(channel: 31, versionID: 8.9, mobileType: Platform.isAndroid ? "android" : "ios"); void setPostParamsInitConfig() { diff --git a/pubspec.yaml b/pubspec.yaml index 511ce1a..f4f08b1 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -17,7 +17,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev # Read more about iOS versioning at # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html #version: 3.3.01+300040 -version: 3.6.1+300071 +version: 3.6.3+300073 environment: sdk: ">=2.16.0 <3.0.0" From 3b3046804e8123a0e2b49fb246da936c07f432d8 Mon Sep 17 00:00:00 2001 From: Sultan khan Date: Tue, 17 Jun 2025 11:44:02 +0300 Subject: [PATCH 15/26] upgraded --- lib/api/chat/chat_api_client.dart | 2 +- lib/classes/consts.dart | 4 ++-- lib/dialogs/otp_dialog.dart | 4 ++-- lib/models/chat/get_user_login_token_model.dart | 8 ++++---- lib/provider/chat_provider_model.dart | 14 ++++++++++---- lib/theme/app_theme.dart | 14 +++++++------- lib/ui/attendance/monthly_attendance_screen.dart | 11 ++++++----- lib/ui/chat/chat_home.dart | 10 ++++++---- lib/ui/landing/dashboard_screen.dart | 3 ++- lib/ui/my_team/view_attendance.dart | 4 ++-- lib/widgets/image_picker.dart | 2 +- pubspec.yaml | 6 +++--- 12 files changed, 46 insertions(+), 36 deletions(-) diff --git a/lib/api/chat/chat_api_client.dart b/lib/api/chat/chat_api_client.dart index 510f6fa..a9667ec 100644 --- a/lib/api/chat/chat_api_client.dart +++ b/lib/api/chat/chat_api_client.dart @@ -28,7 +28,7 @@ class ChatApiClient { factory ChatApiClient() => _instance; Future getUserLoginToken() async { - user.UserAutoLoginModel userLoginResponse = user.UserAutoLoginModel(); + user.UserAutoLoginModel userLoginResponse = user.UserAutoLoginModel(); String? deviceToken = AppState().getIsHuawei ? AppState().getHuaweiPushToken : AppState().getDeviceToken; Response response = await ApiClient().postJsonForResponse( "${ApiConsts.chatLoginTokenUrl}externaluserlogin", diff --git a/lib/classes/consts.dart b/lib/classes/consts.dart index bee7a99..5bc445c 100644 --- a/lib/classes/consts.dart +++ b/lib/classes/consts.dart @@ -3,11 +3,11 @@ import 'package:mohem_flutter_app/ui/marathon/widgets/question_card.dart'; class ApiConsts { // static String baseUrl = "http://10.200.204.11"; // Local server // static String baseUrl = "https://erptstapp.srca.org.sa"; // SRCA server - static String baseUrl = "https://uat.hmgwebservices.com"; // UAT ser343622ver + // static String baseUrl = "https://uat.hmgwebservices.com"; // UAT ser343622ver // static String baseUrl = "http://10.20.200.111:1010/"; // static String baseUrl = "https://webservices.hmg.com"; // PreProd - // static String baseUrl = "https://mohemm.hmg.com"; + static String baseUrl = "https://mohemm.hmg.com"; // static String baseUrl = "https://hmgwebservices.com"; // Live server static String baseUrlServices = baseUrl + "/Services/"; // server // static String baseUrlServices = "https://api.cssynapses.com/tangheem/"; // Live server diff --git a/lib/dialogs/otp_dialog.dart b/lib/dialogs/otp_dialog.dart index 1404131..6c7529a 100644 --- a/lib/dialogs/otp_dialog.dart +++ b/lib/dialogs/otp_dialog.dart @@ -203,11 +203,11 @@ class OtpDialog { ), errorBorder: OutlineInputBorder( borderRadius: const BorderRadius.all(Radius.circular(10.0)), - borderSide: BorderSide(color: Theme.of(context).errorColor), + borderSide: BorderSide(color: Colors.red), ), focusedErrorBorder: OutlineInputBorder( borderRadius: const BorderRadius.all(Radius.circular(10.0)), - borderSide: BorderSide(color: Theme.of(context).errorColor), + borderSide: BorderSide(color: Colors.red), ), ); } diff --git a/lib/models/chat/get_user_login_token_model.dart b/lib/models/chat/get_user_login_token_model.dart index 8d55461..f0620c3 100644 --- a/lib/models/chat/get_user_login_token_model.dart +++ b/lib/models/chat/get_user_login_token_model.dart @@ -5,21 +5,21 @@ UserAutoLoginModel userAutoLoginModelFromJson(String str) => UserAutoLoginModel. String userAutoLoginModelToJson(UserAutoLoginModel data) => json.encode(data.toJson()); class UserAutoLoginModel { - UserAutoLoginModel({ - this.response, - this.errorResponses, - }); + UserAutoLoginModel({this.response, this.errorResponses, this.StatusCode}); Response? response; List? errorResponses; + int? StatusCode; factory UserAutoLoginModel.fromJson(Map json) => UserAutoLoginModel( response: json["response"] == null ? null : Response.fromJson(json["response"]), + StatusCode: json["StatusCode"], errorResponses: json["errorResponses"] == null ? null : List.from(json["errorResponses"].map((x) => ErrorResponse.fromJson(x))), ); Map toJson() => { "response": response == null ? null : response!.toJson(), + "StatusCode": StatusCode, "errorResponses": errorResponses == null ? null : List.from(errorResponses!.map((x) => x.toJson())), }; } diff --git a/lib/provider/chat_provider_model.dart b/lib/provider/chat_provider_model.dart index 380278d..1ca52af 100644 --- a/lib/provider/chat_provider_model.dart +++ b/lib/provider/chat_provider_model.dart @@ -93,6 +93,12 @@ class ChatProviderModel with ChangeNotifier, DiagnosticableTreeMixin { Future getUserAutoLoginToken() async { userLoginToken.UserAutoLoginModel userLoginResponse = await ChatApiClient().getUserLoginToken(); + + if (userLoginResponse.StatusCode == 500) { + disbaleChatForThisUser = true; + notifyListeners(); + } + if (userLoginResponse.response != null) { AppState().setchatUserDetails = userLoginResponse; } else { @@ -399,8 +405,8 @@ class ChatProviderModel with ChangeNotifier, DiagnosticableTreeMixin { if (data.first.userChatReplyResponse != null) { if (data.first.fileTypeResponse != null) { if (data.first.userChatReplyResponse!.fileTypeId == 12 || data.first.userChatReplyResponse!.fileTypeId == 4 || data.first.userChatReplyResponse!.fileTypeId == 3) { - data.first.userChatReplyResponse!.image = - await ChatApiClient().downloadURL(fileName: data.first.userChatReplyResponse!.contant!, fileTypeDescription: data.first.fileTypeResponse!.fileTypeDescription ?? "image/jpg", fileSource: 1); + data.first.userChatReplyResponse!.image = await ChatApiClient() + .downloadURL(fileName: data.first.userChatReplyResponse!.contant!, fileTypeDescription: data.first.fileTypeResponse!.fileTypeDescription ?? "image/jpg", fileSource: 1); data.first.userChatReplyResponse!.isImageLoaded = true; } } @@ -476,8 +482,8 @@ class ChatProviderModel with ChangeNotifier, DiagnosticableTreeMixin { if (data.first.groupChatReplyResponse != null) { if (data.first.fileTypeResponse != null) { if (data.first.groupChatReplyResponse!.fileTypeId == 12 || data.first.groupChatReplyResponse!.fileTypeId == 4 || data.first.groupChatReplyResponse!.fileTypeId == 3) { - data.first.groupChatReplyResponse!.image = - await ChatApiClient().downloadURL(fileName: data.first.groupChatReplyResponse!.contant!, fileTypeDescription: data.first.fileTypeResponse!.fileTypeDescription ?? "image/jpg", fileSource: 2); + data.first.groupChatReplyResponse!.image = await ChatApiClient() + .downloadURL(fileName: data.first.groupChatReplyResponse!.contant!, fileTypeDescription: data.first.fileTypeResponse!.fileTypeDescription ?? "image/jpg", fileSource: 2); data.first.groupChatReplyResponse!.isImageLoaded = true; } } diff --git a/lib/theme/app_theme.dart b/lib/theme/app_theme.dart index f3f756f..f228600 100644 --- a/lib/theme/app_theme.dart +++ b/lib/theme/app_theme.dart @@ -18,29 +18,29 @@ class AppTheme { hintColor: Colors.grey[400], colorScheme: ColorScheme.fromSwatch(accentColor: MyColors.backgroundColor).copyWith(surfaceTint : Colors.transparent), disabledColor: Colors.grey[300], - errorColor: const Color.fromRGBO(235, 80, 60, 1.0), + // errorColor: const Color.fromRGBO(235, 80, 60, 1.0), applyElevationOverlayColor: false, scaffoldBackgroundColor: MyColors.backgroundColor, textSelectionTheme: const TextSelectionThemeData(cursorColor: Colors.grey, selectionColor: Color.fromRGBO(80, 100, 253, 0.5), selectionHandleColor: Colors.grey), canvasColor: Colors.white, - backgroundColor: const Color.fromRGBO(255, 255, 255, 1), + // backgroundColor: const Color.fromRGBO(255, 255, 255, 1), highlightColor: Colors.grey[100]!.withOpacity(0.4), splashColor: Colors.transparent, primaryColor: primaryColor, primaryColorDark: primaryColor, - toggleableActiveColor: secondaryColor, + // toggleableActiveColor: secondaryColor, indicatorColor: secondaryColor, bottomSheetTheme: const BottomSheetThemeData( backgroundColor: Color(0xFFE0E0E0), ), primaryTextTheme: const TextTheme( - bodyText2: TextStyle(color: Colors.white), + // bodyText2: TextStyle(color: Colors.white), ), iconTheme: const IconThemeData(color: MyColors.darkIconColor), textTheme: const TextTheme( - bodyText1: TextStyle(color: Colors.black, letterSpacing: 0.6), - headline1: TextStyle(color: Colors.white, letterSpacing: 0.6), - headline2: TextStyle(color: Colors.white, letterSpacing: 0.6), + // bodyText1: TextStyle(color: Colors.black, letterSpacing: 0.6), + // headline1: TextStyle(color: Colors.white, letterSpacing: 0.6), + // headline2: TextStyle(color: Colors.white, letterSpacing: 0.6), ), floatingActionButtonTheme: const FloatingActionButtonThemeData(highlightElevation: 2, disabledElevation: 0, elevation: 2), appBarTheme: AppBarTheme( diff --git a/lib/ui/attendance/monthly_attendance_screen.dart b/lib/ui/attendance/monthly_attendance_screen.dart index 821a4f0..153c999 100644 --- a/lib/ui/attendance/monthly_attendance_screen.dart +++ b/lib/ui/attendance/monthly_attendance_screen.dart @@ -117,8 +117,8 @@ class _MonthlyAttendanceScreenState extends State { initialDate: formattedDate, firstDate: DateTime(searchYear - 2), lastDate: DateTime.now(), - confirmWidget: Text(LocaleKeys.confirm.tr()), - cancelWidget: Text(LocaleKeys.cancel.tr()), + // confirmWidget: Text(LocaleKeys.confirm.tr()), + // cancelWidget: Text(LocaleKeys.cancel.tr()), ).then((selectedDate) { if (selectedDate != null) { searchMonth = getMonth(selectedDate.month); @@ -303,6 +303,7 @@ class _MonthlyAttendanceScreenState extends State { monthCellBuilder: (build, details) { if (details.date.month == formattedDate.month && details.date.year == formattedDate.year) { int val = details.date.day; + int index = val-1; //check day is off // if (getDayHoursTypeDetailsList.isNotEmpty) { // bool isDayIsOff = getDayHoursTypeDetailsList[val - 1].aTTENDEDFLAG == 'N' && getDayHoursTypeDetailsList[val - 1].dAYTYPE == 'OFF'; @@ -312,9 +313,9 @@ class _MonthlyAttendanceScreenState extends State { getDayHoursTypeDetailsList.where((GetDayHoursTypeDetailsList element) => DateFormat("MM/dd/yyyy", "en_US").parse(element.sCHEDULEDATE!).day == details.date.day).toList(); if (getDayHours.isNotEmpty) { - bool isDayIsOff = getDayHoursTypeDetailsList[0].aTTENDEDFLAG == 'N' && getDayHoursTypeDetailsList[0].dAYTYPE == 'OFF'; - bool isDayIsPresent = getDayHoursTypeDetailsList[0].aTTENDEDFLAG == 'Y'; - bool isDayIsAbsent = getDayHoursTypeDetailsList[0].aTTENDEDFLAG == 'N' && getDayHoursTypeDetailsList[0].aBSENTFLAG == 'Y'; + bool isDayIsOff = getDayHoursTypeDetailsList[index].aTTENDEDFLAG == 'N' && getDayHoursTypeDetailsList[index].dAYTYPE == 'OFF'; + bool isDayIsPresent = getDayHoursTypeDetailsList[index].aTTENDEDFLAG == 'Y'; + bool isDayIsAbsent = getDayHoursTypeDetailsList[index].aTTENDEDFLAG == 'N' && getDayHoursTypeDetailsList[index].aBSENTFLAG == 'Y'; if (isDayIsOff) { return Container( diff --git a/lib/ui/chat/chat_home.dart b/lib/ui/chat/chat_home.dart index 426c9a2..c522475 100644 --- a/lib/ui/chat/chat_home.dart +++ b/lib/ui/chat/chat_home.dart @@ -32,8 +32,11 @@ class _ChatHomeState extends State { @override void initState() { super.initState(); - data = Provider.of(context, listen: false); - data.registerEvents(); + + if (chatHubConnection.state == HubConnectionState.Connected) { + data = Provider.of(context, listen: false); + data.registerEvents(); + } } @override @@ -47,7 +50,6 @@ class _ChatHomeState extends State { data.getUserAutoLoginToken().whenComplete(() async { await data.buildHubConnection(); data.getUserRecentChats(); - }); return; } @@ -57,7 +59,7 @@ class _ChatHomeState extends State { // String isAppOpendByChat = await Utils.getStringFromPrefs("isAppOpendByChat"); // String notificationData = await Utils.getStringFromPrefs("notificationData"); // if (isAppOpendByChat != "null" || isAppOpendByChat == "true" && notificationData != "null") { - // data.openChatByNoti(context); + // data.openChatByNoti(context); // } }); } diff --git a/lib/ui/landing/dashboard_screen.dart b/lib/ui/landing/dashboard_screen.dart index 333d271..90e5ef5 100644 --- a/lib/ui/landing/dashboard_screen.dart +++ b/lib/ui/landing/dashboard_screen.dart @@ -60,10 +60,10 @@ class _DashboardScreenState extends State with WidgetsBindingOb void initState() { WidgetsBinding.instance.addObserver(this); super.initState(); + cProvider = Provider.of(context, listen: false); scheduleMicrotask(() { data = Provider.of(context, listen: false); marathonProvider = Provider.of(context, listen: false); - cProvider = Provider.of(context, listen: false); if (checkIfPrivilegedForChat()) { _bHubCon(); } @@ -117,6 +117,7 @@ class _DashboardScreenState extends State with WidgetsBindingOb } Future checkHubCon() async { + // chatHubConnection = await context.read().getHubConnection(); if (chatHubConnection.state == HubConnectionState.Connected) { await chatHubConnection.stop(); await chatHubConnection.start(); diff --git a/lib/ui/my_team/view_attendance.dart b/lib/ui/my_team/view_attendance.dart index 15c4325..cadc11d 100644 --- a/lib/ui/my_team/view_attendance.dart +++ b/lib/ui/my_team/view_attendance.dart @@ -169,8 +169,8 @@ class _ViewAttendanceState extends State { initialDate: formattedDate, firstDate: DateTime(searchYear - 2), lastDate: DateTime.now(), - confirmWidget: Text(LocaleKeys.confirm.tr()), - cancelWidget: Text(LocaleKeys.cancel.tr()), + // confirmWidget: Text(LocaleKeys.confirm.tr()), + // cancelWidget: Text(LocaleKeys.cancel.tr()), ).then( (selectedDate) { if (selectedDate != null) { diff --git a/lib/widgets/image_picker.dart b/lib/widgets/image_picker.dart index 943d68e..a5d346f 100644 --- a/lib/widgets/image_picker.dart +++ b/lib/widgets/image_picker.dart @@ -159,7 +159,7 @@ class _BottomSheet extends StatelessWidget { Widget build(BuildContext context) { return Container( padding: const EdgeInsets.symmetric(vertical: 12.0), - decoration: BoxDecoration(color: Theme.of(context).backgroundColor, borderRadius: const BorderRadius.only(topLeft: Radius.circular(16.0), topRight: Radius.circular(16.0))), + decoration: BoxDecoration( borderRadius: const BorderRadius.only(topLeft: Radius.circular(16.0), topRight: Radius.circular(16.0))), child: SafeArea( top: false, child: Column( diff --git a/pubspec.yaml b/pubspec.yaml index 4194812..bf5ea18 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -46,7 +46,7 @@ dependencies: sizer: ^2.0.15 local_auth: ^2.2.0 fluttertoast: ^8.0.8 - syncfusion_flutter_calendar: 21.2.9 + syncfusion_flutter_calendar: ^27.2.5 # flutter_calendar_carousel: ^2.1.0 pie_chart: ^5.1.0 shared_preferences: ^2.0.12 @@ -62,8 +62,8 @@ dependencies: image_picker: ^0.8.5+3 file_picker: 5.2.5 geolocator: ^9.0.2 - month_year_picker: ^0.3.0+1 - month_picker_dialog: ^2.12.0 + month_year_picker: ^0.4.0+1 + month_picker_dialog: ^3.0.0 # open_file: ^3.2.1 open_filex: ^4.4.0 wifi_iot: ^0.3.18 From c57c22a58c1aecb51c7b666fdb18671e010e0bf8 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Sun, 29 Jun 2025 17:31:56 +0300 Subject: [PATCH 16/26] ERM Channel Text URL implemented --- lib/classes/consts.dart | 4 +- lib/models/itg/advertisement.dart | 4 + .../itg/its_add_screen_video_image.dart | 86 +++++++++++++++---- lib/ui/login/verify_last_login_screen.dart | 2 +- 4 files changed, 77 insertions(+), 19 deletions(-) diff --git a/lib/classes/consts.dart b/lib/classes/consts.dart index fea9b75..c2772b8 100644 --- a/lib/classes/consts.dart +++ b/lib/classes/consts.dart @@ -9,9 +9,9 @@ class ApiConsts { // static String baseUrl = "https://webservices.hmg.com"; // PreProd // static String baseUrl = "https://hmgwebservices.com"; // Live server - static String baseUrl = "https://mohemm.hmg.com"; // New Live server + // static String baseUrl = "https://mohemm.hmg.com"; // New Live server // - // static String baseUrl = "https://uat.hmgwebservices.com"; // UAT ser343622ver + static String baseUrl = "https://uat.hmgwebservices.com"; // UAT ser343622ver // static String baseUrl = "http://10.20.200.111:1010/"; // static String baseUrl = "https://webservices.hmg.com"; // PreProd diff --git a/lib/models/itg/advertisement.dart b/lib/models/itg/advertisement.dart index fb172ad..002f73d 100644 --- a/lib/models/itg/advertisement.dart +++ b/lib/models/itg/advertisement.dart @@ -1,6 +1,7 @@ class Advertisement { int? advertisementId; String? advertisementTitle; + String? advertisementTitleAr; int? durationInSeconds; bool? showDelete; dynamic acknowledgment; @@ -16,6 +17,7 @@ class Advertisement { Advertisement({ this.advertisementId, this.advertisementTitle, + this.advertisementTitleAr, this.durationInSeconds, this.showDelete, this.acknowledgment, @@ -34,6 +36,7 @@ class Advertisement { Advertisement.fromJson(Map json) { advertisementId = json['advertisementId']; advertisementTitle = json['advertisementTitle']; + advertisementTitleAr = json['advertisementTitleAr']; durationInSeconds = json['durationInSeconds']; showDelete = json['showDelete']; acknowledgment = json['acknowledgment']; @@ -63,6 +66,7 @@ class Advertisement { Map data = Map(); data['advertisementId'] = this.advertisementId; data['advertisementTitle'] = this.advertisementTitle; + data['advertisementTitleAr'] = this.advertisementTitleAr; data['durationInSeconds'] = this.durationInSeconds; data['showDelete'] = this.showDelete; data['acknowledgment'] = this.acknowledgment; 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 6e1358c..99911b9 100644 --- a/lib/ui/landing/itg/its_add_screen_video_image.dart +++ b/lib/ui/landing/itg/its_add_screen_video_image.dart @@ -11,8 +11,10 @@ import 'package:mohem_flutter_app/extensions/string_extensions.dart'; 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/app_bar_widget.dart'; import 'package:mohem_flutter_app/widgets/button/default_button.dart'; import 'package:mohem_flutter_app/widgets/my_video_progress_indicator.dart'; +import 'package:url_launcher/url_launcher.dart'; import 'package:video_player/video_player.dart'; class ITGAdsScreen extends StatefulWidget { @@ -31,6 +33,8 @@ class _ITGAdsScreenState extends State { bool isAudio = false; String ext = ''; + bool isTextURL = false; + // late File imageFile; late String imageUrl; ads.Advertisement? advertisementData; @@ -45,23 +49,27 @@ class _ITGAdsScreenState extends State { late CountdownTimerController timerController; 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") { - // await processImage(); - imageUrl = rFile!; - isImage = true; + if (advertisementData!.viewAttachFileColl!.first.contentType!.toLowerCase() == "text") { + isTextURL = true; } else { - if (ext == ".aac") { - isAudio = true; + 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") { + // await processImage(); + imageUrl = rFile!; + isImage = true; + } else { + if (ext == ".aac") { + isAudio = true; + } + isVideo = true; + _futureController = createVideoPlayer(rFile!); } - isVideo = true; - _futureController = createVideoPlayer(rFile!); } // advertisementData?.actionButtonsColl!.forEach((element) { @@ -132,7 +140,17 @@ class _ITGAdsScreenState extends State { timerController = CountdownTimerController(endTime: DateTime.now().millisecondsSinceEpoch + 1000 * videoDuration, onEnd: onTimerEnd); } return Scaffold( - backgroundColor: Colors.black, + backgroundColor: isTextURL ? Colors.white : Colors.black, + appBar: isTextURL + ? AppBar( + centerTitle: true, + automaticallyImplyLeading: false, + backgroundColor: Colors.white, + title: (AppState().isArabic(context) ? advertisementData!.advertisementTitleAr! : advertisementData!.advertisementTitleAr!).toText24(color: MyColors.darkTextColor, isBold: true), + + //advertisementData!.viewAttachFileColl!.first.base64String!.toText24(color: MyColors.darkTextColor, isBold: true), + ) + : null, body: Stack( children: [ if (isVideo) @@ -346,6 +364,42 @@ class _ITGAdsScreenState extends State { ], ), ), + if (isTextURL) + SingleChildScrollView( + padding: const EdgeInsets.all(21), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisSize: MainAxisSize.min, + children: [ + (AppState().isArabic(context) ? advertisementData!.viewAttachFileColl![0].base64String! : advertisementData!.viewAttachFileColl![1].base64String!) + .toText16(color: MyColors.darkTextColor), + 24.height, + ListView.separated( + itemCount: advertisementData!.actionButtonsColl?.length ?? 0, + separatorBuilder: (cxt, index) => 16.height, + shrinkWrap: true, + physics: const NeverScrollableScrollPhysics(), + padding: EdgeInsets.zero, + itemBuilder: (cxt, index) => DefaultButton( + AppState().isArabic(context) ? advertisementData!.actionButtonsColl![index].btnTextAr : advertisementData!.actionButtonsColl![index].btnTextEn, + () async { + if (advertisementData!.actionButtonsColl![index].actionValue.toLowerCase() == "skip") { + Navigator.pop(context); + } else { + Uri uri = Uri.parse(advertisementData!.actionButtonsColl![index].iconOrImage); + if (await canLaunchUrl(uri)) { + await launchUrl(uri); + Navigator.pop(context); + } else { + Utils.showToast('Could not launch'); + } + } + }, + ), + ), + ], + ), + ), ], ), ); diff --git a/lib/ui/login/verify_last_login_screen.dart b/lib/ui/login/verify_last_login_screen.dart index 1cdab8f..05b5c35 100644 --- a/lib/ui/login/verify_last_login_screen.dart +++ b/lib/ui/login/verify_last_login_screen.dart @@ -109,7 +109,7 @@ class _VerifyLastLoginScreenState extends State { Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, crossAxisAlignment: CrossAxisAlignment.center, - children: [LocaleKeys.lastLoginDetails.tr().toText16(), DateUtil.formatDateToDate(DateUtil.convertStringToDate(mobileLoginInfoListModel!.editedOn!), false).toText12()], + children: [LocaleKeys.lastLoginDetails.tr().toText16(), DateUtil.formatDateToDate(DateUtil.convertStringToDate(mobileLoginInfoListModel!.editedOn ?? DateTime.now().toString()), false).toText12()], ), Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, From dcbf7b386a611266bb251e829591ea87ddf85d93 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Mon, 7 Jul 2025 13:00:58 +0300 Subject: [PATCH 17/26] Survey link launch issue fixed, Updated to Stores VersionID 9.1 --- lib/ui/landing/itg/its_add_screen_video_image.dart | 13 ++++++++----- pubspec.yaml | 6 ++++-- 2 files changed, 12 insertions(+), 7 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 99911b9..103fde1 100644 --- a/lib/ui/landing/itg/its_add_screen_video_image.dart +++ b/lib/ui/landing/itg/its_add_screen_video_image.dart @@ -387,12 +387,15 @@ class _ITGAdsScreenState extends State { Navigator.pop(context); } else { Uri uri = Uri.parse(advertisementData!.actionButtonsColl![index].iconOrImage); - if (await canLaunchUrl(uri)) { - await launchUrl(uri); - Navigator.pop(context); - } else { + // if (await canLaunchUrl(uri)) { + await launchUrl(uri, mode: LaunchMode.externalApplication).catchError((err) { + // print(err); Utils.showToast('Could not launch'); - } + }); + Navigator.pop(context); + // } else { + // Utils.showToast('Could not launch'); + // } } }, ), diff --git a/pubspec.yaml b/pubspec.yaml index f4f08b1..9f35f3b 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -16,8 +16,9 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev # In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion. # Read more about iOS versioning at # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html -#version: 3.3.01+300040 -version: 3.6.3+300073 + +version: 3.6.6+300076 +#version: 3.8.999+2 environment: sdk: ">=2.16.0 <3.0.0" @@ -64,6 +65,7 @@ dependencies: geolocator: ^11.1.0 month_year_picker: ^0.2.0+1 month_picker_dialog_2: ^0.5.5 +# month_picker_dialog: ^6.2.3 # open_file: ^3.2.1 open_filex: ^4.4.0 wifi_iot: ^0.3.19+1 From 56b18c493a8cfabd184e72eb1d89f578b4a15f0e Mon Sep 17 00:00:00 2001 From: Aamir Muhammad Date: Sun, 27 Jul 2025 16:12:21 +0300 Subject: [PATCH 18/26] mazaya banner changes --- assets/icons/mazaya_brand.svg | 17 + assets/langs/ar-SA.json | 6 +- assets/langs/en-US.json | 7 +- lib/generated/codegen_loader.g.dart | 32 +- lib/generated/locale_keys.g.dart | 15 +- lib/ui/landing/dashboard_screen.dart | 315 ++++++++++++------ .../offers_and_discounts_home.dart | 2 +- lib/widgets/app_bar_widget.dart | 27 +- 8 files changed, 290 insertions(+), 131 deletions(-) create mode 100755 assets/icons/mazaya_brand.svg diff --git a/assets/icons/mazaya_brand.svg b/assets/icons/mazaya_brand.svg new file mode 100755 index 0000000..52fb265 --- /dev/null +++ b/assets/icons/mazaya_brand.svg @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + diff --git a/assets/langs/ar-SA.json b/assets/langs/ar-SA.json index c4c5f20..d874779 100644 --- a/assets/langs/ar-SA.json +++ b/assets/langs/ar-SA.json @@ -615,5 +615,9 @@ "searchByUserName": "البحث بواسطة اسم المستخدم", "shareScreen": "مشاركة الشاشة", "start":"يبدأ", - "about":"عن" + "about":"عن", + "explore": "يستكشف", + "mazaya": "مازيا", + "benefits": "فوائد", + "mazayaDesc": "اكتشف الخصومات والعروض الخاصة المتاحة للموظفين" } \ No newline at end of file diff --git a/assets/langs/en-US.json b/assets/langs/en-US.json index 559b9c9..ae4dcbc 100644 --- a/assets/langs/en-US.json +++ b/assets/langs/en-US.json @@ -613,5 +613,10 @@ "bonusQty": "Bonus Qty.", "balQty": "Bal. Qty.", "start":"Start", - "about":"About" + "about":"About", + "explore": "Explore", + "mazaya": "MAZAYA", + "benefits": "Benefits", + "mazayaDesc": "Discover special Discounts and offers available to Employees" + } \ No newline at end of file diff --git a/lib/generated/codegen_loader.g.dart b/lib/generated/codegen_loader.g.dart index 0e2cfbf..fac1d05 100644 --- a/lib/generated/codegen_loader.g.dart +++ b/lib/generated/codegen_loader.g.dart @@ -1,6 +1,6 @@ // DO NOT EDIT. This is code generated via package:easy_localization/generate.dart -// ignore_for_file: prefer_single_quotes, avoid_renaming_method_parameters +// ignore_for_file: prefer_single_quotes, avoid_renaming_method_parameters, constant_identifier_names import 'dart:ui'; @@ -14,7 +14,7 @@ class CodegenLoader extends AssetLoader{ return Future.value(mapLocales[locale.toString()]); } - static const Map ar_SA = { + static const Map _ar_SA = { "mohemm": "Mohemm", "english": "English", "arabic": "عربي", @@ -116,6 +116,7 @@ class CodegenLoader extends AssetLoader{ "reject": "يرفض", "approve": "يوافق", "cancel": "إلغاء", + "generate": "يولد", "requestedItems": "العناصر المطلوبة", "request": "طلب", "myRequest": "طلبي", @@ -560,10 +561,9 @@ class CodegenLoader extends AssetLoader{ "missingDocuments": "مستندات مفقودة", "uploadedDocuments": "المستندات التي تم تحميلها", "addAtLeastOneAttachment": "الرجاء إضافة مرفق واحد على الأقل.", - "open": "يفتح", - "youCannotJoinTheMarathon": "لا يمكنك الانضمام إلى الماراثون لأنك تجاوزت الحد الزمني", "pleaseClickButtonToJoinMarathon": "الرجاء الضغط على الزر أدناه للانضمام إلى الماراثون", - "generate": "يولد", + "youCannotJoinTheMarathon": "لا يمكنك الانضمام إلى الماراثون لأنك تجاوزت الحد الزمني", + "open": "يفتح", "paymentRequest": "طلب الدفع", "paymentDetails": "تفاصيل الدفع", "requestNo": "رقم الطلب", @@ -627,10 +627,14 @@ class CodegenLoader extends AssetLoader{ "members": "الأعضاء", "searchByUserName": "البحث بواسطة اسم المستخدم", "shareScreen": "مشاركة الشاشة", - "start":"يبدأ", - "about":"عن" + "start": "يبدأ", + "about": "عن", + "explore": "يستكشف", + "mazaya": "مازيا", + "benefits": "فوائد", + "mazayaDesc": "اكتشف الخصومات والعروض الخاصة المتاحة للموظفين" }; -static const Map en_US = { +static const Map _en_US = { "mohemm": "Mohemm", "english": "English", "arabic": "عربي", @@ -725,6 +729,7 @@ static const Map en_US = { "whatsapp": "Whatsapp", "reject": "Reject", "approve": "Approve", + "generate": "Generate", "cancel": "Cancel", "requestedItems": "Requested Items", "request": "Request", @@ -1197,7 +1202,6 @@ static const Map en_US = { "pleaseClickButtonToJoinMarathon": "Press the button below to join the Marathon.", "youCannotJoinTheMarathon": "You cannot join the Marathon because you have exceeded the time limit.", "requesterOperatingUnit": "Requester Operating Unit", - "generate": "Generate", "paymentRequest": "Pay Request", "paymentDetails": "Payment Details", "requestNo": "Request No", @@ -1243,8 +1247,12 @@ static const Map en_US = { "qtyReceived": "Qty. Received", "bonusQty": "Bonus Qty.", "balQty": "Bal. Qty.", - "start":"Start", - "about":"About" + "start": "Start", + "about": "About", + "explore": "Explore", + "mazaya": "MAZAYA", + "benefits": "Benefits", + "mazayaDesc": "Discover special Discounts and offers available to Employees" }; -static const Map> mapLocales = {"ar_SA": ar_SA, "en_US": en_US}; +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 f8bc858..41023f4 100644 --- a/lib/generated/locale_keys.g.dart +++ b/lib/generated/locale_keys.g.dart @@ -1,5 +1,7 @@ // DO NOT EDIT. This is code generated via package:easy_localization/generate.dart +// ignore_for_file: constant_identifier_names + abstract class LocaleKeys { static const mohemm = 'mohemm'; static const english = 'english'; @@ -101,6 +103,7 @@ abstract class LocaleKeys { static const reject = 'reject'; static const approve = 'approve'; static const cancel = 'cancel'; + static const generate = 'generate'; static const requestedItems = 'requestedItems'; static const request = 'request'; static const myRequest = 'myRequest'; @@ -530,10 +533,9 @@ abstract class LocaleKeys { static const missingDocuments = 'missingDocuments'; static const uploadedDocuments = 'uploadedDocuments'; static const addAtLeastOneAttachment = 'addAtLeastOneAttachment'; - static const open = 'open'; - static const youCannotJoinTheMarathon = 'youCannotJoinTheMarathon'; static const pleaseClickButtonToJoinMarathon = 'pleaseClickButtonToJoinMarathon'; - static const generate = 'generate'; + static const youCannotJoinTheMarathon = 'youCannotJoinTheMarathon'; + static const open = 'open'; static const paymentRequest = 'paymentRequest'; static const paymentDetails = 'paymentDetails'; static const requestNo = 'requestNo'; @@ -598,5 +600,10 @@ abstract class LocaleKeys { static const searchByUserName = 'searchByUserName'; static const shareScreen = 'shareScreen'; static const start = 'start'; - static const about ='about'; + static const about = 'about'; + static const explore = 'explore'; + static const mazaya = 'mazaya'; + static const benefits = 'benefits'; + static const mazayaDesc = 'mazayaDesc'; + } diff --git a/lib/ui/landing/dashboard_screen.dart b/lib/ui/landing/dashboard_screen.dart index 9a7c1ee..b2f819f 100644 --- a/lib/ui/landing/dashboard_screen.dart +++ b/lib/ui/landing/dashboard_screen.dart @@ -415,116 +415,227 @@ class _DashboardScreenState extends State with WidgetsBindingOb ), ), 9.width, - Expanded( - child: MenusWidget(), - ), + Expanded(child: MenusWidget()), ], ), ], ).paddingOnly(left: 21, right: 21, top: 7, bottom: 21), eventActivityWidget(context), - Consumer(builder: (BuildContext context, DashboardProviderModel model, Widget? child) { - if (!model.isOffersLoading && model.getOffersList.isEmpty) { - return const SizedBox(); - } - return Column( - mainAxisSize: MainAxisSize.min, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Row( - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Expanded( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - mainAxisSize: MainAxisSize.min, - children: [ - LocaleKeys.offers.tr().toText12(), - Row( - children: [ - LocaleKeys.discounts.tr().toText24(isBold: true), - 6.width, - Container( - padding: const EdgeInsets.only(left: 8, right: 8), - decoration: BoxDecoration( - color: MyColors.yellowColor, - borderRadius: BorderRadius.circular(10), - ), - child: LocaleKeys.newString.tr().toText10(isBold: true)), - ], - ), - ], + Consumer( + builder: (BuildContext context, DashboardProviderModel model, Widget? child) { + if (!model.isOffersLoading && model.getOffersList.isEmpty) { + return const SizedBox(); + } + return Column( + mainAxisSize: MainAxisSize.min, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Directionality( + textDirection: AppState().isArabic(context) ? ui.TextDirection.rtl : ui.TextDirection.ltr, + child: Container( + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(20), + gradient: const LinearGradient(colors: [Color(0xFF91C481), Color(0xFF7CCED7)], begin: Alignment.centerLeft, end: Alignment.centerRight), ), - ), - LocaleKeys.viewAllOffers.tr().toText12(isUnderLine: true).onPress(() { - Navigator.pushNamed(context, AppRoutes.offersAndDiscounts); - }) - ], - ).paddingOnly(left: 21, right: 21), - Consumer( - builder: (BuildContext context, DashboardProviderModel model, Widget? child) { - return SizedBox( - height: 103 + 33, - child: ListView.separated( - shrinkWrap: true, - physics: const BouncingScrollPhysics(), - padding: const EdgeInsets.only(left: 21, right: 21, top: 13), - scrollDirection: Axis.horizontal, - itemBuilder: (BuildContext cxt, int index) { - return model.isOffersLoading - ? const OffersShimmerWidget() - : InkWell( - onTap: () { - navigateToDetails(data.getOffersList[index]); - }, - child: SizedBox( - width: 73, - child: Column( - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Container( - width: 73, - height: 73, - decoration: BoxDecoration( - color: Colors.white, - borderRadius: const BorderRadius.all( - Radius.circular(100), - ), - border: Border.all(color: MyColors.lightGreyE3Color, width: 1), - ), - child: ClipRRect( - borderRadius: const BorderRadius.all( - Radius.circular(50), - ), - child: Hero( - tag: "ItemImage" + data.getOffersList[index].offersDiscountId.toString()!, - transitionOnUserGestures: true, - child: Image.network( - data.getOffersList[index].logo ?? "", - fit: BoxFit.contain, - ), - ), - ), - ), - 4.height, - Expanded( - child: AppState().isArabic(context) - ? data.getOffersList[index].titleAr!.toText12(isCenter: true, maxLine: 1) - : data.getOffersList[index].titleEn!.toText12(isCenter: true, maxLine: 1), + child: Padding( + padding: const EdgeInsets.all(3.0), // This creates the border width + child: Container( + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(17), // Slightly less than outer radius + ), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Expanded( + flex: 4, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Row( + children: [ + Expanded( + flex: 2, + child: RichText( + text: + AppState().isArabic(context) + ? const TextSpan( + children: [ + TextSpan( + text: 'اطلع على مميزات', + style: TextStyle(fontSize: 16, letterSpacing: -0.2, fontWeight: FontWeight.w700, height: 24 / 16, color: Color(0xFF5D5E5E)), + ), + TextSpan( + text: ' مزايا', + style: TextStyle( + fontSize: 16, + fontWeight: FontWeight.w700, + letterSpacing: -0.2, + height: 24 / 16, + color: Color(0xFFED1C2B), // Use your MAZAYA red color here if defined, e.g. MyColors.mazayaRed + ), + ), + ], + ) + : TextSpan( + children: [ + TextSpan( + text: LocaleKeys.explore.tr() + ' ', + style: const TextStyle(fontSize: 16, letterSpacing: -0.2, fontWeight: FontWeight.w700, height: 24 / 16, color: Color(0xFF5D5E5E)), + ), + TextSpan( + text: LocaleKeys.mazaya.tr(), + style: const TextStyle( + fontSize: 16, + fontWeight: FontWeight.w700, + letterSpacing: -0.2, + height: 24 / 16, + color: Color(0xFFED1C2B), // Use your MAZAYA red color here if defined, e.g. MyColors.mazayaRed + ), + ), + TextSpan( + text: ' ' + LocaleKeys.benefits.tr(), + style: const TextStyle(fontSize: 16, letterSpacing: -0.2, fontWeight: FontWeight.w700, height: 24 / 16, color: Color(0xFF5D5E5E)), + ), + ], + ), ), - ], - ), + ), + const Expanded(flex: 1, child: SizedBox()), + ], ), - ); - }, - separatorBuilder: (BuildContext cxt, int index) => 8.width, - itemCount: 9), - ); - }, - ), - ], - ); - }), + const SizedBox(height: 8), + LocaleKeys.mazayaDesc.tr().toText11(color: const Color(0xFF5D5E5E)), + ], + ), + ), + Expanded( + flex: 2, + child: Column( + crossAxisAlignment: CrossAxisAlignment.end, + mainAxisAlignment: MainAxisAlignment.end, + children: [ + SvgPicture.asset("assets/icons/mazaya_brand.svg", width: 90, height: 47), + const SizedBox(height: 28), + LocaleKeys.viewAllOffers.tr().toText12(isUnderLine: true, color: const Color(0xFF3B3D4A)).onPress(() { + Navigator.pushNamed(context, AppRoutes.offersAndDiscounts); + }), + ], + ), + ), + ], + ).paddingOnly(left: 21, right: 21, top: 14, bottom: 14), + ), + ), + ).paddingOnly(left: 21, right: 21, top: 0, bottom: 21), + ), + + // Container( + // height: 121, + // decoration: BoxDecoration( + // borderRadius: BorderRadius.circular(12), + // border: Border.all(width: 3, color: Colors.red), + // ), + // child: Padding(padding: const EdgeInsets.all(4.0), child: Container(decoration: BoxDecoration(borderRadius: BorderRadius.circular(12), color: Colors.white))), + // ).paddingOnly(left: 21, right: 21, bottom: 21), + + // Row( + // crossAxisAlignment: CrossAxisAlignment.center, + // children: [ + // Expanded( + // child: Column( + // crossAxisAlignment: CrossAxisAlignment.start, + // mainAxisSize: MainAxisSize.min, + // children: [ + // LocaleKeys.offers.tr().toText12(), + // Row( + // children: [ + // LocaleKeys.discounts.tr().toText24(isBold: true), + // 6.width, + // Container( + // padding: const EdgeInsets.only(left: 8, right: 8), + // decoration: BoxDecoration( + // color: MyColors.yellowColor, + // borderRadius: BorderRadius.circular(10), + // ), + // child: LocaleKeys.newString.tr().toText10(isBold: true)), + // ], + // ), + // ], + // ), + // ), + // LocaleKeys.viewAllOffers.tr().toText12(isUnderLine: true).onPress(() { + // Navigator.pushNamed(context, AppRoutes.offersAndDiscounts); + // }) + // ], + // ).paddingOnly(left: 21, right: 21), + // Consumer( + // builder: (BuildContext context, DashboardProviderModel model, Widget? child) { + // return SizedBox( + // height: 103 + 33, + // child: ListView.separated( + // shrinkWrap: true, + // physics: const BouncingScrollPhysics(), + // padding: const EdgeInsets.only(left: 21, right: 21, top: 13), + // scrollDirection: Axis.horizontal, + // itemBuilder: (BuildContext cxt, int index) { + // return model.isOffersLoading + // ? const OffersShimmerWidget() + // : InkWell( + // onTap: () { + // navigateToDetails(data.getOffersList[index]); + // }, + // child: SizedBox( + // width: 73, + // child: Column( + // crossAxisAlignment: CrossAxisAlignment.center, + // children: [ + // Container( + // width: 73, + // height: 73, + // decoration: BoxDecoration( + // color: Colors.white, + // borderRadius: const BorderRadius.all( + // Radius.circular(100), + // ), + // border: Border.all(color: MyColors.lightGreyE3Color, width: 1), + // ), + // child: ClipRRect( + // borderRadius: const BorderRadius.all( + // Radius.circular(50), + // ), + // child: Hero( + // tag: "ItemImage" + data.getOffersList[index].offersDiscountId.toString()!, + // transitionOnUserGestures: true, + // child: Image.network( + // data.getOffersList[index].logo ?? "", + // fit: BoxFit.contain, + // ), + // ), + // ), + // ), + // 4.height, + // Expanded( + // child: AppState().isArabic(context) + // ? data.getOffersList[index].titleAr!.toText12(isCenter: true, maxLine: 1) + // : data.getOffersList[index].titleEn!.toText12(isCenter: true, maxLine: 1), + // ), + // ], + // ), + // ), + // ); + // }, + // separatorBuilder: (BuildContext cxt, int index) => 8.width, + // itemCount: 9), + // ); + // }, + // ), + ], + ); + }, + ), Container( width: double.infinity, padding: const EdgeInsets.only(top: 31), diff --git a/lib/ui/screens/offers_and_discounts/offers_and_discounts_home.dart b/lib/ui/screens/offers_and_discounts/offers_and_discounts_home.dart index fd2c19e..f67a835 100644 --- a/lib/ui/screens/offers_and_discounts/offers_and_discounts_home.dart +++ b/lib/ui/screens/offers_and_discounts/offers_and_discounts_home.dart @@ -39,7 +39,7 @@ class _OffersAndDiscountsHomeState extends State { Widget build(BuildContext context) { return Scaffold( backgroundColor: Colors.white, - appBar: AppBarWidget(context, title: LocaleKeys.offerAndDiscounts.tr(), showHomeButton: true), + appBar: AppBarWidget(context, title: LocaleKeys.offerAndDiscounts.tr(), showHomeButton: true, showLogo: true, logoPath: "assets/icons/mazaya_brand.svg"), body: SingleChildScrollView( child: Column( crossAxisAlignment: CrossAxisAlignment.start, diff --git a/lib/widgets/app_bar_widget.dart b/lib/widgets/app_bar_widget.dart index 744b7eb..d91111d 100644 --- a/lib/widgets/app_bar_widget.dart +++ b/lib/widgets/app_bar_widget.dart @@ -1,18 +1,23 @@ import 'package:flutter/material.dart'; +import 'package:flutter_svg/flutter_svg.dart'; import 'package:mohem_flutter_app/classes/colors.dart'; import 'package:mohem_flutter_app/config/routes.dart'; import 'package:mohem_flutter_app/extensions/int_extensions.dart'; import 'package:mohem_flutter_app/extensions/string_extensions.dart'; import 'package:mohem_flutter_app/extensions/widget_extensions.dart'; -AppBar AppBarWidget(BuildContext context, - {required String title, - bool showHomeButton = true, - bool showWorkListSettingButton = false, - bool showMemberButton = false, - List? actions, - void Function()? onHomeTapped, - void Function()? onBackTapped}) { +AppBar AppBarWidget( + BuildContext context, { + required String title, + bool showHomeButton = true, + bool showLogo = false, + String? logoPath, + bool showWorkListSettingButton = false, + bool showMemberButton = false, + List? actions, + void Function()? onHomeTapped, + void Function()? onBackTapped, +}) { return AppBar( leadingWidth: 0, @@ -26,8 +31,10 @@ AppBar AppBarWidget(BuildContext context, }, context), child: const Icon(Icons.arrow_back_ios, color: MyColors.darkIconColor), ), + if (showLogo) 4.width, + if (showLogo) SvgPicture.asset(logoPath!), 4.width, - title.toText24(color: MyColors.darkTextColor, isBold: true).expanded, + if (!showLogo)title.toText24(color: MyColors.darkTextColor, isBold: true).expanded, ], ), centerTitle: false, @@ -55,7 +62,7 @@ AppBar AppBarWidget(BuildContext context, }, icon: const Icon(Icons.people, color: MyColors.textMixColor), ), - ...actions ?? [] + ...actions ?? [], ], ); } From 8d6c3ddc0bb033e3296e22e18a93dec6e15983b7 Mon Sep 17 00:00:00 2001 From: Aamir Muhammad Date: Sun, 27 Jul 2025 16:35:14 +0300 Subject: [PATCH 19/26] mazaya banner changes --- assets/icons/mazaya_brand.svg | 17 + assets/langs/ar-SA.json | 13 +- assets/langs/en-US.json | 14 +- lib/classes/consts.dart | 4 +- lib/generated/codegen_loader.g.dart | 9 +- lib/generated/locale_keys.g.dart | 13 +- lib/ui/landing/dashboard_screen.dart | 632 ++++++++++-------- lib/ui/landing/widget/services_widget.dart | 159 +++-- .../offers_and_discounts_home.dart | 2 +- lib/widgets/app_bar_widget.dart | 27 +- 10 files changed, 518 insertions(+), 372 deletions(-) create mode 100755 assets/icons/mazaya_brand.svg diff --git a/assets/icons/mazaya_brand.svg b/assets/icons/mazaya_brand.svg new file mode 100755 index 0000000..52fb265 --- /dev/null +++ b/assets/icons/mazaya_brand.svg @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + diff --git a/assets/langs/ar-SA.json b/assets/langs/ar-SA.json index d840a9b..d874779 100644 --- a/assets/langs/ar-SA.json +++ b/assets/langs/ar-SA.json @@ -548,8 +548,6 @@ "pleaseClickButtonToJoinMarathon": "الرجاء الضغط على الزر أدناه للانضمام إلى الماراثون", "youCannotJoinTheMarathon": "لا يمكنك الانضمام إلى الماراثون لأنك تجاوزت الحد الزمني", "open": "يفتح", -<<<<<<< HEAD -======= "youCannotJoinTheMarathon": "لا يمكنك الانضمام إلى الماراثون لأنك تجاوزت الحد الزمني", "pleaseClickButtonToJoinMarathon": "الرجاء الضغط على الزر أدناه للانضمام إلى الماراثون", "generate": "يولد", @@ -577,7 +575,6 @@ "versionStatus": "حالة الإصدار", "supplierNo": "رقم المورد", "general": "عام", ->>>>>>> master "requesterOperatingUnit":"وحدة تشغيل مقدم الطلب", "prepareEmpNum":"إعداد رقم الموظف", "supplierInfo" : "معلومات المورد", @@ -591,9 +588,6 @@ "patientName" : "اسم المريض", "invoiceDate" : "تاريخ الفاتورة", "refundInvoice" :"فاتورة الاسترجاع", -<<<<<<< HEAD - "hospitalClinic" : "عيادة المستشفى" -======= "hospitalClinic" : "عيادة المستشفى", "graphicalAnalysis": "التحليل الرسومي", "itemHistoryAnalysis": "تحليل تاريخ العنصر", @@ -621,6 +615,9 @@ "searchByUserName": "البحث بواسطة اسم المستخدم", "shareScreen": "مشاركة الشاشة", "start":"يبدأ", - "about":"عن" ->>>>>>> master + "about":"عن", + "explore": "يستكشف", + "mazaya": "مازيا", + "benefits": "فوائد", + "mazayaDesc": "اكتشف الخصومات والعروض الخاصة المتاحة للموظفين" } \ No newline at end of file diff --git a/assets/langs/en-US.json b/assets/langs/en-US.json index 2ab3649..ae4dcbc 100644 --- a/assets/langs/en-US.json +++ b/assets/langs/en-US.json @@ -566,8 +566,6 @@ "pleaseClickButtonToJoinMarathon": "Press the button below to join the Marathon.", "youCannotJoinTheMarathon": "You cannot join the Marathon because you have exceeded the time limit.", "requesterOperatingUnit":"Requester Operating Unit", -<<<<<<< HEAD -======= "generate": "Generate", "paymentRequest": "Pay Request", "paymentDetails": "Payment Details", @@ -593,7 +591,6 @@ "versionStatus": "Version Status", "supplierNo": "Supplier No", "general": "General", ->>>>>>> master "prepareEmpNum":"Prepare Employee Num", "supplierInfo" : "Supplier Information", "supplierAcNo": "Supplier Account No", @@ -606,9 +603,6 @@ "patientName" : "Patient Name", "invoiceDate" : "Invoice Date", "refundInvoice" :"Refund Invoice", -<<<<<<< HEAD - "hospitalClinic" : "Hospital Clinic" -======= "hospitalClinic" : "Hospital Clinic", "graphicalAnalysis": "Graphical Analysis", "itemHistoryAnalysis": "Item History Analysis", @@ -619,6 +613,10 @@ "bonusQty": "Bonus Qty.", "balQty": "Bal. Qty.", "start":"Start", - "about":"About" ->>>>>>> master + "about":"About", + "explore": "Explore", + "mazaya": "MAZAYA", + "benefits": "Benefits", + "mazayaDesc": "Discover special Discounts and offers available to Employees" + } \ No newline at end of file diff --git a/lib/classes/consts.dart b/lib/classes/consts.dart index 0545518..9753744 100644 --- a/lib/classes/consts.dart +++ b/lib/classes/consts.dart @@ -10,14 +10,14 @@ class ApiConsts { // static String baseUrl = "https://mohemm.hmg.com"; // static String baseUrl = "https://hmgwebservices.com"; // Live server - // static String baseUrl = "https://uat.hmgwebservices.com"; // UAT ser343622ver + static String baseUrl = "https://uat.hmgwebservices.com"; // UAT ser343622ver // static String baseUrl = "http://10.201.204.101:2024"; // static String baseUrl = "https://webservices.hmg.com"; // PreProd // static String baseUrl = "https://hmgwebservices.com"; // Live server // static String baseUrl = "https://mohemm.hmg.com"; // New Live server // - static String baseUrl = "https://uat.hmgwebservices.com"; // UAT ser343622ver + // static String baseUrl = "https://uat.hmgwebservices.com"; // UAT ser343622ver // static String baseUrl = "http://10.20.200.111:1010/"; // static String baseUrl = "https://webservices.hmg.com"; // PreProd diff --git a/lib/generated/codegen_loader.g.dart b/lib/generated/codegen_loader.g.dart index afdf1a8..918affc 100644 --- a/lib/generated/codegen_loader.g.dart +++ b/lib/generated/codegen_loader.g.dart @@ -1,6 +1,6 @@ // DO NOT EDIT. This is code generated via package:easy_localization/generate.dart -// ignore_for_file: prefer_single_quotes, avoid_renaming_method_parameters +// ignore_for_file: prefer_single_quotes, avoid_renaming_method_parameters, constant_identifier_names import 'dart:ui'; @@ -1798,7 +1798,12 @@ class CodegenLoader extends AssetLoader { "contactDetails": "Contact Details", "familyDetails": "Family Members", "effectiveDate": "Effective Date", - "country": "Country" + "country": "Country", + "explore": "Explore", + "mazaya": "MAZAYA", + "benefits": "Benefits", + "mazayaDesc": "Discover special Discounts and offers available to Employees" + }; diff --git a/lib/generated/locale_keys.g.dart b/lib/generated/locale_keys.g.dart index 01a085a..57de239 100644 --- a/lib/generated/locale_keys.g.dart +++ b/lib/generated/locale_keys.g.dart @@ -1,5 +1,7 @@ // DO NOT EDIT. This is code generated via package:easy_localization/generate.dart +// ignore_for_file: constant_identifier_names + abstract class LocaleKeys { static const mohemm = 'mohemm'; static const english = 'english'; @@ -101,6 +103,7 @@ abstract class LocaleKeys { static const reject = 'reject'; static const approve = 'approve'; static const cancel = 'cancel'; + static const generate = 'generate'; static const requestedItems = 'requestedItems'; static const request = 'request'; static const myRequest = 'myRequest'; @@ -552,7 +555,6 @@ abstract class LocaleKeys { static const pleaseClickButtonToJoinMarathon ='pleaseClickButtonToJoinMarathon'; static const youCannotJoinTheMarathon ='youCannotJoinTheMarathon'; static const open ='open'; - static const generate = 'generate'; static const paymentDetails ='paymentDetails'; static const requestNo ='requestNo'; static const requesterEmpNum ='requesterEmpNum'; @@ -578,6 +580,7 @@ abstract class LocaleKeys { static const versionStatus ='versionStatus'; static const supplierNo ='supplierNo'; static const general ="general"; + static const paymentRequest = 'paymentRequest'; static const supplierInfo = 'supplierInfo'; static const supplierAcNo = 'supplierAcNo'; static const supplierAcName = 'supplierAcName'; @@ -590,7 +593,6 @@ abstract class LocaleKeys { static const invoiceDate = 'Invoice Date'; static const refundInvoice = 'Refund Invoice'; static const hospitalClinic = 'Hospital Clinic'; - static const paymentRequest = 'paymentRequest'; static const graphicalAnalysis = 'graphicalAnalysis'; static const itemHistoryAnalysis = 'itemHistoryAnalysis'; static const pOno = 'pOno'; @@ -599,8 +601,11 @@ abstract class LocaleKeys { static const qtyReceived = 'qtyReceived'; static const bonusQty = 'bonusQty'; static const balQty = 'balQty'; - static const Attendance = 'Attendance'; static const start = 'start'; - static const about ='about'; + static const about = 'about'; + static const explore = 'explore'; + static const mazaya = 'mazaya'; + static const benefits = 'benefits'; + static const mazayaDesc = 'mazayaDesc'; } diff --git a/lib/ui/landing/dashboard_screen.dart b/lib/ui/landing/dashboard_screen.dart index bce1f0e..9131b8e 100644 --- a/lib/ui/landing/dashboard_screen.dart +++ b/lib/ui/landing/dashboard_screen.dart @@ -176,10 +176,11 @@ class _DashboardScreenState extends State with WidgetsBindingOb if (list[ermIndex].notificationType == "Survey") { await Navigator.pushNamed(context, AppRoutes.survey, arguments: response.mohemmItgResponseItem!.result!.data!.first); } else { - await Navigator.pushNamed(context, AppRoutes.advertisement, arguments: { - "masterId": list[ermIndex].notificationMasterId, - "advertisement": response.mohemmItgResponseItem!.result!.data!.first.advertisement, - }); + await Navigator.pushNamed( + context, + AppRoutes.advertisement, + arguments: {"masterId": list[ermIndex].notificationMasterId, "advertisement": response.mohemmItgResponseItem!.result!.data!.first.advertisement}, + ); } } ermIndex++; @@ -242,53 +243,44 @@ class _DashboardScreenState extends State with WidgetsBindingOb children: [ Row( children: [ - Builder(builder: (BuildContext context) { - return Row( - mainAxisSize: MainAxisSize.min, - children: [ - Image.memory( - Utils.dataFromBase64String( - AppState().memberInformationList!.eMPLOYEEIMAGE ?? "", - ), - errorBuilder: (BuildContext context, Object error, StackTrace? stackTrace) { - return SvgPicture.asset( - "assets/images/user.svg", - height: 34, - width: 34, - ); - }, - width: 34, - height: 34, - fit: BoxFit.cover, - ).circle(50), - // CircularAvatar( - // width: 34, - // height: 34, - // url: "https://cdn4.iconfinder.com/data/icons/professions-2-2/151/89-512.png", - // ), - 8.width, - SvgPicture.asset("assets/images/side_nav.svg"), - ], - ).onPress(() { - _scaffoldState.currentState!.openDrawer(); - }); - }), + Builder( + builder: (BuildContext context) { + return Row( + mainAxisSize: MainAxisSize.min, + children: [ + Image.memory( + Utils.dataFromBase64String(AppState().memberInformationList!.eMPLOYEEIMAGE ?? ""), + errorBuilder: (BuildContext context, Object error, StackTrace? stackTrace) { + return SvgPicture.asset("assets/images/user.svg", height: 34, width: 34); + }, + width: 34, + height: 34, + fit: BoxFit.cover, + ).circle(50), + // CircularAvatar( + // width: 34, + // height: 34, + // url: "https://cdn4.iconfinder.com/data/icons/professions-2-2/151/89-512.png", + // ), + 8.width, + SvgPicture.asset("assets/images/side_nav.svg"), + ], + ).onPress(() { + _scaffoldState.currentState!.openDrawer(); + }); + }, + ), Image.asset("assets/images/logos/main_mohemm_logo.png", width: 134, height: 28).expanded, - SvgPicture.asset( - "assets/images/announcements.svg", - matchTextDirection: true, - ).onPress(() async { + SvgPicture.asset("assets/images/announcements.svg", matchTextDirection: true).onPress(() async { await Navigator.pushNamed(context, AppRoutes.announcements); - }) + }), ], ).paddingOnly(left: 21, right: 21, top: 48, bottom: 7), Expanded( child: SmartRefresher( enablePullDown: true, enablePullUp: false, - header: const MaterialClassicHeader( - color: MyColors.gradiantEndColor, - ), + header: const MaterialClassicHeader(color: MyColors.gradiantEndColor), controller: _refreshController, onRefresh: () { _onRefresh(false); @@ -312,220 +304,328 @@ class _DashboardScreenState extends State with WidgetsBindingOb return (model.isAttendanceTrackingLoading ? GetAttendanceTrackingShimmer() : Container( - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(15), - gradient: const LinearGradient(transform: GradientRotation(.46), begin: Alignment.topRight, end: Alignment.bottomLeft, colors: [ - MyColors.gradiantEndColor, - MyColors.gradiantStartColor, - ]), + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(15), + gradient: const LinearGradient( + transform: GradientRotation(.46), + begin: Alignment.topRight, + end: Alignment.bottomLeft, + colors: [MyColors.gradiantEndColor, MyColors.gradiantStartColor], ), - child: Stack( - alignment: Alignment.center, - children: [ - if (model.isTimeRemainingInSeconds == 0) SvgPicture.asset("assets/images/thumb.svg"), - Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Expanded( - child: Column( - mainAxisSize: MainAxisSize.min, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - LocaleKeys.markAttendance.tr().toText14(color: Colors.white, isBold: true), - if (model.isTimeRemainingInSeconds == 0) DateTime.now().toString().split(" ")[0].toText12(color: Colors.white), - if (model.isTimeRemainingInSeconds != 0) - Column( - mainAxisSize: MainAxisSize.min, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - 9.height, - Directionality( - textDirection: ui.TextDirection.ltr, - child: CountdownTimer( - endTime: model.endTime, - onEnd: null, - endWidget: "00:00:00".toText14(color: Colors.white, isBold: true), - textStyle: const TextStyle(color: Colors.white, fontSize: 14, letterSpacing: -0.48, fontWeight: FontWeight.bold), - ), - ), - LocaleKeys.timeLeftToday.tr().toText12(color: Colors.white), - 9.height, - ClipRRect( - borderRadius: const BorderRadius.all(Radius.circular(20)), - child: LinearProgressIndicator( - value: model.progress, - minHeight: 8, - valueColor: const AlwaysStoppedAnimation(Colors.white), - backgroundColor: const Color(0xff196D73), - ), - ), - ], - ), - ], - ).paddingOnly(top: 12, right: 15, left: 12), - ), - Row( + ), + child: Stack( + alignment: Alignment.center, + children: [ + if (model.isTimeRemainingInSeconds == 0) SvgPicture.asset("assets/images/thumb.svg"), + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Expanded( + child: Column( + mainAxisSize: MainAxisSize.min, + crossAxisAlignment: CrossAxisAlignment.start, children: [ - Expanded( - child: Column( + LocaleKeys.markAttendance.tr().toText14(color: Colors.white, isBold: true), + if (model.isTimeRemainingInSeconds == 0) DateTime.now().toString().split(" ")[0].toText12(color: Colors.white), + if (model.isTimeRemainingInSeconds != 0) + Column( mainAxisSize: MainAxisSize.min, crossAxisAlignment: CrossAxisAlignment.start, children: [ - LocaleKeys.checkIn.tr().toText12(color: Colors.white), - (model.attendanceTracking!.pSwipeIn == null ? "--:--" : model.attendanceTracking!.pSwipeIn) - .toString() - .toText14(color: Colors.white, isBold: true), - 4.height, + 9.height, + Directionality( + textDirection: ui.TextDirection.ltr, + child: CountdownTimer( + endTime: model.endTime, + onEnd: null, + endWidget: "00:00:00".toText14(color: Colors.white, isBold: true), + textStyle: const TextStyle(color: Colors.white, fontSize: 14, letterSpacing: -0.48, fontWeight: FontWeight.bold), + ), + ), + LocaleKeys.timeLeftToday.tr().toText12(color: Colors.white), + 9.height, + ClipRRect( + borderRadius: const BorderRadius.all(Radius.circular(20)), + child: LinearProgressIndicator( + value: model.progress, + minHeight: 8, + valueColor: const AlwaysStoppedAnimation(Colors.white), + backgroundColor: const Color(0xff196D73), + ), + ), ], - ).paddingOnly(left: 12, right: 12), - ), - Container( - margin: EdgeInsets.only(top: AppState().isArabic(context) ? 6 : 0), - width: 45, - height: 45, - padding: const EdgeInsets.only(left: 10, right: 10), - decoration: BoxDecoration( - color: Color(0xff259EA4), - borderRadius: BorderRadius.only( - bottomRight: AppState().isArabic(context) ? Radius.circular(0) : Radius.circular(15), - bottomLeft: AppState().isArabic(context) ? Radius.circular(15) : Radius.circular(0), - ), ), - child: SvgPicture.asset(model.isTimeRemainingInSeconds == 0 ? "assets/images/biometrics.svg" : "assets/images/biometrics.svg"), - ).onPress(() { - showMyBottomSheet( - context, - callBackFunc: () {}, - child: MarkAttendanceWidget(model, isFromDashboard: true), - ); - }), ], - ), - ], - ), - ], - ), - ).onPress( - () { - Navigator.pushNamed(context, AppRoutes.todayAttendance); - }, - )) + ).paddingOnly(top: 12, right: 15, left: 12), + ), + Row( + children: [ + Expanded( + child: Column( + mainAxisSize: MainAxisSize.min, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + LocaleKeys.checkIn.tr().toText12(color: Colors.white), + (model.attendanceTracking!.pSwipeIn == null ? "--:--" : model.attendanceTracking!.pSwipeIn).toString().toText14( + color: Colors.white, + isBold: true, + ), + 4.height, + ], + ).paddingOnly(left: 12, right: 12), + ), + Container( + margin: EdgeInsets.only(top: AppState().isArabic(context) ? 6 : 0), + width: 45, + height: 45, + padding: const EdgeInsets.only(left: 10, right: 10), + decoration: BoxDecoration( + color: const Color(0xff259EA4), + borderRadius: BorderRadius.only( + bottomRight: AppState().isArabic(context) ? const Radius.circular(0) : const Radius.circular(15), + bottomLeft: AppState().isArabic(context) ? const Radius.circular(15) : const Radius.circular(0), + ), + ), + child: SvgPicture.asset(model.isTimeRemainingInSeconds == 0 ? "assets/images/biometrics.svg" : "assets/images/biometrics.svg"), + ).onPress(() { + showMyBottomSheet(context, callBackFunc: () {}, child: MarkAttendanceWidget(model, isFromDashboard: true)); + }), + ], + ), + ], + ), + ], + ), + ).onPress(() { + Navigator.pushNamed(context, AppRoutes.todayAttendance); + })) .animatedSwither(); }, ), ), ), 9.width, - Expanded( - child: MenusWidget(), - ), + Expanded(child: MenusWidget()), ], ), ], ).paddingOnly(left: 21, right: 21, top: 7, bottom: 21), eventActivityWidget(context), - Consumer(builder: (BuildContext context, DashboardProviderModel model, Widget? child) { - if (!model.isOffersLoading && model.getOffersList.isEmpty) { - return const SizedBox(); - } - return Column( - mainAxisSize: MainAxisSize.min, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Row( - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Expanded( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - mainAxisSize: MainAxisSize.min, - children: [ - LocaleKeys.offers.tr().toText12(), - Row( - children: [ - LocaleKeys.discounts.tr().toText24(isBold: true), - 6.width, - Container( - padding: const EdgeInsets.only(left: 8, right: 8), - decoration: BoxDecoration( - color: MyColors.yellowColor, - borderRadius: BorderRadius.circular(10), - ), - child: LocaleKeys.newString.tr().toText10(isBold: true)), - ], - ), - ], + Consumer( + builder: (BuildContext context, DashboardProviderModel model, Widget? child) { + if (!model.isOffersLoading && model.getOffersList.isEmpty) { + return const SizedBox(); + } + return Column( + mainAxisSize: MainAxisSize.min, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Directionality( + textDirection: AppState().isArabic(context) ? ui.TextDirection.rtl : ui.TextDirection.ltr, + child: Container( + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(20), + gradient: const LinearGradient(colors: [Color(0xFF91C481), Color(0xFF7CCED7)], begin: Alignment.centerLeft, end: Alignment.centerRight), ), - ), - LocaleKeys.viewAllOffers.tr().toText12(isUnderLine: true).onPress(() { - Navigator.pushNamed(context, AppRoutes.offersAndDiscounts); - }) - ], - ).paddingOnly(left: 21, right: 21), - Consumer( - builder: (BuildContext context, DashboardProviderModel model, Widget? child) { - return SizedBox( - height: 103 + 33, - child: ListView.separated( - shrinkWrap: true, - physics: const BouncingScrollPhysics(), - padding: const EdgeInsets.only(left: 21, right: 21, top: 13), - scrollDirection: Axis.horizontal, - itemBuilder: (BuildContext cxt, int index) { - return model.isOffersLoading - ? const OffersShimmerWidget() - : InkWell( - onTap: () { - navigateToDetails(data.getOffersList[index]); - }, - child: SizedBox( - width: 73, - child: Column( - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Container( - width: 73, - height: 73, - decoration: BoxDecoration( - color: Colors.white, - borderRadius: const BorderRadius.all( - Radius.circular(100), - ), - border: Border.all(color: MyColors.lightGreyE3Color, width: 1), - ), - child: ClipRRect( - borderRadius: const BorderRadius.all( - Radius.circular(50), - ), - child: Hero( - tag: "ItemImage" + data.getOffersList[index].offersDiscountId.toString()!, - transitionOnUserGestures: true, - child: Image.network( - data.getOffersList[index].logo ?? "", - fit: BoxFit.contain, - ), - ), - ), - ), - 4.height, - Expanded( - child: AppState().isArabic(context) - ? data.getOffersList[index].titleAr!.toText12(isCenter: true, maxLine: 1) - : data.getOffersList[index].titleEn!.toText12(isCenter: true, maxLine: 1), + child: Padding( + padding: const EdgeInsets.all(3.0), // This creates the border width + child: Container( + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(17), // Slightly less than outer radius + ), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Expanded( + flex: 4, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Row( + children: [ + Expanded( + flex: 2, + child: RichText( + text: + AppState().isArabic(context) + ? const TextSpan( + children: [ + TextSpan( + text: 'اطلع على مميزات', + style: TextStyle(fontSize: 16, letterSpacing: -0.2, fontWeight: FontWeight.w700, height: 24 / 16, color: Color(0xFF5D5E5E)), + ), + TextSpan( + text: ' مزايا', + style: TextStyle( + fontSize: 16, + fontWeight: FontWeight.w700, + letterSpacing: -0.2, + height: 24 / 16, + color: Color(0xFFED1C2B), // Use your MAZAYA red color here if defined, e.g. MyColors.mazayaRed + ), + ), + ], + ) + : TextSpan( + children: [ + TextSpan( + text: LocaleKeys.explore.tr() + ' ', + style: const TextStyle(fontSize: 16, letterSpacing: -0.2, fontWeight: FontWeight.w700, height: 24 / 16, color: Color(0xFF5D5E5E)), + ), + TextSpan( + text: LocaleKeys.mazaya.tr(), + style: const TextStyle( + fontSize: 16, + fontWeight: FontWeight.w700, + letterSpacing: -0.2, + height: 24 / 16, + color: Color(0xFFED1C2B), // Use your MAZAYA red color here if defined, e.g. MyColors.mazayaRed + ), + ), + TextSpan( + text: ' ' + LocaleKeys.benefits.tr(), + style: const TextStyle(fontSize: 16, letterSpacing: -0.2, fontWeight: FontWeight.w700, height: 24 / 16, color: Color(0xFF5D5E5E)), + ), + ], + ), ), - ], - ), + ), + const Expanded(flex: 1, child: SizedBox()), + ], ), - ); - }, - separatorBuilder: (BuildContext cxt, int index) => 8.width, - itemCount: 9), - ); - }, - ), - ], - ); - }), + const SizedBox(height: 8), + LocaleKeys.mazayaDesc.tr().toText11(color: const Color(0xFF5D5E5E)), + ], + ), + ), + Expanded( + flex: 2, + child: Column( + crossAxisAlignment: CrossAxisAlignment.end, + mainAxisAlignment: MainAxisAlignment.end, + children: [ + SvgPicture.asset("assets/icons/mazaya_brand.svg", width: 90, height: 47), + const SizedBox(height: 28), + LocaleKeys.viewAllOffers.tr().toText12(isUnderLine: true, color: const Color(0xFF3B3D4A)).onPress(() { + Navigator.pushNamed(context, AppRoutes.offersAndDiscounts); + }), + ], + ), + ), + ], + ).paddingOnly(left: 21, right: 21, top: 14, bottom: 14), + ), + ), + ).paddingOnly(left: 21, right: 21, top: 0, bottom: 21), + ), + + // Container( + // height: 121, + // decoration: BoxDecoration( + // borderRadius: BorderRadius.circular(12), + // border: Border.all(width: 3, color: Colors.red), + // ), + // child: Padding(padding: const EdgeInsets.all(4.0), child: Container(decoration: BoxDecoration(borderRadius: BorderRadius.circular(12), color: Colors.white))), + // ).paddingOnly(left: 21, right: 21, bottom: 21), + + // Row( + // crossAxisAlignment: CrossAxisAlignment.center, + // children: [ + // Expanded( + // child: Column( + // crossAxisAlignment: CrossAxisAlignment.start, + // mainAxisSize: MainAxisSize.min, + // children: [ + // LocaleKeys.offers.tr().toText12(), + // Row( + // children: [ + // LocaleKeys.discounts.tr().toText24(isBold: true), + // 6.width, + // Container( + // padding: const EdgeInsets.only(left: 8, right: 8), + // decoration: BoxDecoration( + // color: MyColors.yellowColor, + // borderRadius: BorderRadius.circular(10), + // ), + // child: LocaleKeys.newString.tr().toText10(isBold: true)), + // ], + // ), + // ], + // ), + // ), + // LocaleKeys.viewAllOffers.tr().toText12(isUnderLine: true).onPress(() { + // Navigator.pushNamed(context, AppRoutes.offersAndDiscounts); + // }) + // ], + // ).paddingOnly(left: 21, right: 21), + // Consumer( + // builder: (BuildContext context, DashboardProviderModel model, Widget? child) { + // return SizedBox( + // height: 103 + 33, + // child: ListView.separated( + // shrinkWrap: true, + // physics: const BouncingScrollPhysics(), + // padding: const EdgeInsets.only(left: 21, right: 21, top: 13), + // scrollDirection: Axis.horizontal, + // itemBuilder: (BuildContext cxt, int index) { + // return model.isOffersLoading + // ? const OffersShimmerWidget() + // : InkWell( + // onTap: () { + // navigateToDetails(data.getOffersList[index]); + // }, + // child: SizedBox( + // width: 73, + // child: Column( + // crossAxisAlignment: CrossAxisAlignment.center, + // children: [ + // Container( + // width: 73, + // height: 73, + // decoration: BoxDecoration( + // color: Colors.white, + // borderRadius: const BorderRadius.all( + // Radius.circular(100), + // ), + // border: Border.all(color: MyColors.lightGreyE3Color, width: 1), + // ), + // child: ClipRRect( + // borderRadius: const BorderRadius.all( + // Radius.circular(50), + // ), + // child: Hero( + // tag: "ItemImage" + data.getOffersList[index].offersDiscountId.toString()!, + // transitionOnUserGestures: true, + // child: Image.network( + // data.getOffersList[index].logo ?? "", + // fit: BoxFit.contain, + // ), + // ), + // ), + // ), + // 4.height, + // Expanded( + // child: AppState().isArabic(context) + // ? data.getOffersList[index].titleAr!.toText12(isCenter: true, maxLine: 1) + // : data.getOffersList[index].titleEn!.toText12(isCenter: true, maxLine: 1), + // ), + // ], + // ), + // ), + // ); + // }, + // separatorBuilder: (BuildContext cxt, int index) => 8.width, + // itemCount: 9), + // ); + // }, + // ), + ], + ); + }, + ), Container( width: double.infinity, padding: const EdgeInsets.only(top: 31), @@ -589,38 +689,24 @@ class _DashboardScreenState extends State with WidgetsBindingOb ), ), ), - ) + ), ], ), - drawer: SafeArea( - child: AppDrawer(onLanguageChange: _onRefresh), - ), + drawer: SafeArea(child: AppDrawer(onLanguageChange: _onRefresh)), bottomNavigationBar: SizedBox( height: Platform.isAndroid ? 70 : 100, child: BottomNavigationBar( items: [ + BottomNavigationBarItem(icon: SvgPicture.asset("assets/icons/home.svg", color: currentIndex == 0 ? MyColors.grey3AColor : MyColors.grey98Color).paddingAll(4), label: LocaleKeys.home.tr()), BottomNavigationBarItem( - icon: SvgPicture.asset( - "assets/icons/home.svg", - color: currentIndex == 0 ? MyColors.grey3AColor : MyColors.grey98Color, - ).paddingAll(4), - label: LocaleKeys.home.tr(), - ), - BottomNavigationBarItem( - icon: SvgPicture.asset( - "assets/icons/create_req.svg", - color: currentIndex == 1 ? MyColors.grey3AColor : MyColors.grey98Color, - ).paddingAll(4), + icon: SvgPicture.asset("assets/icons/create_req.svg", color: currentIndex == 1 ? MyColors.grey3AColor : MyColors.grey98Color).paddingAll(4), label: LocaleKeys.mowadhafhiRequest.tr(), ), BottomNavigationBarItem( icon: Stack( alignment: Alignment.centerLeft, children: [ - SvgPicture.asset( - "assets/icons/work_list.svg", - color: currentIndex == 2 ? MyColors.grey3AColor : MyColors.grey98Color, - ).paddingAll(4), + SvgPicture.asset("assets/icons/work_list.svg", color: currentIndex == 2 ? MyColors.grey3AColor : MyColors.grey98Color).paddingAll(4), Consumer( builder: (BuildContext cxt, DashboardProviderModel data, Widget? child) { if (data.workListCounter == 0) { @@ -643,10 +729,7 @@ class _DashboardScreenState extends State with WidgetsBindingOb label: LocaleKeys.workList.tr(), ), BottomNavigationBarItem( - icon: SvgPicture.asset( - "assets/icons/item_for_sale.svg", - color: currentIndex == 3 ? MyColors.grey3AColor : MyColors.grey98Color, - ).paddingAll(4), + icon: SvgPicture.asset("assets/icons/item_for_sale.svg", color: currentIndex == 3 ? MyColors.grey3AColor : MyColors.grey98Color).paddingAll(4), label: LocaleKeys.itemsForSale.tr(), ), BottomNavigationBarItem( @@ -655,28 +738,29 @@ class _DashboardScreenState extends State with WidgetsBindingOb children: [ SvgPicture.asset( "assets/icons/chat/chat.svg", - color: !checkIfPrivilegedForChat() - ? MyColors.lightGreyE3Color - : currentIndex == 4 + color: + !checkIfPrivilegedForChat() + ? MyColors.lightGreyE3Color + : currentIndex == 4 ? MyColors.grey3AColor : cProvider.disbaleChatForThisUser - ? MyColors.lightGreyE3Color - : MyColors.grey98Color, + ? MyColors.lightGreyE3Color + : MyColors.grey98Color, ).paddingAll(4), Consumer( builder: (BuildContext cxt, ChatProviderModel data, Widget? child) { return !checkIfPrivilegedForChat() ? const SizedBox() : Positioned( - right: 0, - top: 0, - child: Container( - padding: const EdgeInsets.only(left: 4, right: 4), - alignment: Alignment.center, - decoration: BoxDecoration(color: cProvider.disbaleChatForThisUser ? MyColors.pinkDarkColor : MyColors.redColor, borderRadius: BorderRadius.circular(17)), - child: data.chatUConvCounter.toString().toText10(color: Colors.white), - ), - ); + right: 0, + top: 0, + child: Container( + padding: const EdgeInsets.only(left: 4, right: 4), + alignment: Alignment.center, + decoration: BoxDecoration(color: cProvider.disbaleChatForThisUser ? MyColors.pinkDarkColor : MyColors.redColor, borderRadius: BorderRadius.circular(17)), + child: data.chatUConvCounter.toString().toText10(color: Colors.white), + ), + ); }, ), ], @@ -714,8 +798,8 @@ class _DashboardScreenState extends State with WidgetsBindingOb return (context.watch().isEventLoadingLoading) ? const MarathonBannerShimmer().paddingOnly(left: 21, right: 21, bottom: 21, top: 0) : (context.watch().eventActivity != null && context.watch().eventActivity!.isActive == true) - ? const EventActivityBanner().paddingOnly(left: 21, right: 21, bottom: 21, top: 0) - : const SizedBox(); + ? const EventActivityBanner().paddingOnly(left: 21, right: 21, bottom: 21, top: 0) + : const SizedBox(); } void navigateToDetails(OffersListModel offersListModelObj) { diff --git a/lib/ui/landing/widget/services_widget.dart b/lib/ui/landing/widget/services_widget.dart index 7c19b58..319c36d 100644 --- a/lib/ui/landing/widget/services_widget.dart +++ b/lib/ui/landing/widget/services_widget.dart @@ -1,20 +1,56 @@ +import 'dart:convert'; +import 'dart:developer'; + import 'package:easy_localization/src/public_ext.dart'; import 'package:flutter/material.dart'; +import 'package:flutter_inappwebview/flutter_inappwebview.dart'; import 'package:flutter_svg/svg.dart'; import 'package:mohem_flutter_app/app_state/app_state.dart'; +import 'package:mohem_flutter_app/classes/inAppWebView.dart'; +import 'package:mohem_flutter_app/classes/utils.dart'; import 'package:mohem_flutter_app/config/routes.dart'; import 'package:mohem_flutter_app/extensions/int_extensions.dart'; import 'package:mohem_flutter_app/extensions/string_extensions.dart'; import 'package:mohem_flutter_app/extensions/widget_extensions.dart'; import 'package:mohem_flutter_app/generated/locale_keys.g.dart'; +import 'package:mohem_flutter_app/main.dart'; import 'package:mohem_flutter_app/models/dashboard/menu_entries.dart'; +import 'package:mohem_flutter_app/models/generic_response_model.dart'; +import 'package:mohem_flutter_app/models/sso_auth_model.dart'; import 'package:mohem_flutter_app/provider/dashboard_provider_model.dart'; import 'package:mohem_flutter_app/ui/my_attendance/dynamic_screens/dynamic_listview_screen.dart'; import 'package:mohem_flutter_app/ui/my_attendance/services_menu_list_screen.dart'; import 'package:mohem_flutter_app/widgets/shimmer/dashboard_shimmer_widget.dart'; +import 'package:mohem_flutter_app/widgets/sso_webview_widget.dart'; import 'package:provider/provider.dart'; +import 'package:url_launcher/url_launcher.dart'; class ServicesWidget extends StatelessWidget { + MyInAppBrowser? myInAppBrowser; + var inAppBrowserOptions = InAppBrowserClassSettings( + webViewSettings: InAppWebViewSettings( + useShouldOverrideUrlLoading: false, + transparentBackground: false, + isInspectable: false, + applePayAPIEnabled: true, + cacheEnabled: false, + allowsBackForwardNavigationGestures: false, + ), + browserSettings: InAppBrowserSettings( + hideUrlBar: true, + hideTitleBar: true, + hideDefaultMenuItems: true, + hideToolbarBottom: true, + hideToolbarTop: false, + hideCloseButton: false, + allowGoBackWithBackButton: false, + toolbarBottomBackgroundColor: Colors.black, + closeButtonColor: Colors.white, + presentationStyle: ModalPresentationStyle.FULL_SCREEN, + // toolbarTopBackgroundColor: Colors.black + ), + ); + @override Widget build(BuildContext context) { List namesT = [LocaleKeys.monthlyAttendance.tr(), LocaleKeys.workFromHome.tr(), LocaleKeys.ticketRequest.tr(), LocaleKeys.monthlyAttendance.tr()]; @@ -26,7 +62,7 @@ class ServicesWidget extends StatelessWidget { "assets/images/vacation_rule.svg", "assets/images/ticket_request.svg", "assets/images/ticket_request.svg", - "assets/images/ticket_request.svg" + "assets/images/ticket_request.svg", ]; return Consumer( @@ -34,72 +70,69 @@ class ServicesWidget extends StatelessWidget { return data.isServicesMenusLoading ? whileLoading() : ListView.separated( - padding: const EdgeInsets.only(top: 0), - itemBuilder: (context, parentIndex) { - return Column( - crossAxisAlignment: CrossAxisAlignment.start, - mainAxisSize: MainAxisSize.min, - children: [ - data.homeMenus![parentIndex].menuEntry.prompt!.toSectionHeading().paddingOnly(left: 21, right: 21), - SizedBox( - height: 105 + 26, - child: ListView.separated( - shrinkWrap: true, - physics: const BouncingScrollPhysics(), - padding: const EdgeInsets.only(left: 21, right: 21, top: 13, bottom: 13), - scrollDirection: Axis.horizontal, - itemBuilder: (cxt, index) { - return AspectRatio( - aspectRatio: 105 / 105, - child: data.isServicesMenusLoading + padding: const EdgeInsets.only(top: 0), + itemBuilder: (context, parentIndex) { + return Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisSize: MainAxisSize.min, + children: [ + data.homeMenus![parentIndex].menuEntry.prompt!.toSectionHeading().paddingOnly(left: 21, right: 21), + SizedBox( + height: 105 + 26, + child: ListView.separated( + shrinkWrap: true, + physics: const BouncingScrollPhysics(), + padding: const EdgeInsets.only(left: 21, right: 21, top: 13, bottom: 13), + scrollDirection: Axis.horizontal, + itemBuilder: (cxt, index) { + return AspectRatio( + aspectRatio: 105 / 105, + child: + data.isServicesMenusLoading ? ServicesMenuShimmer() : Container( - decoration: BoxDecoration( - color: Colors.white, - borderRadius: BorderRadius.circular(15), - boxShadow: [ - BoxShadow( - color: const Color(0xff000000).withOpacity(.05), - blurRadius: 26, - offset: const Offset(0, -3), - ), - ], - ), - child: Column( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - SvgPicture.asset(AppState().isArabic(context) + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(15), + boxShadow: [BoxShadow(color: const Color(0xff000000).withOpacity(.05), blurRadius: 26, offset: const Offset(0, -3))], + ), + child: Column( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + SvgPicture.asset( + AppState().isArabic(context) ? getMenuIconAr(data.homeMenus![parentIndex].menuEntiesList[index].prompt!) - : getMenuIconEn(data.homeMenus![parentIndex].menuEntiesList[index].prompt!)), - Row( - crossAxisAlignment: CrossAxisAlignment.end, - children: [ - Expanded( - child: data.homeMenus![parentIndex].menuEntiesList[index].prompt!.toText11(isBold: true), - ), - RotatedBox(quarterTurns: AppState().isArabic(context) ? 2 : 4, child: SvgPicture.asset("assets/images/arrow_next.svg").paddingOnly(bottom: 4)), - ], - ) - ], - ).paddingOnly(left: 10, right: 10, bottom: 10, top: 12), - ).onPress(() { - handleOnPress(context, data.homeMenus![parentIndex].menuEntiesList[index]); - }), - ); - }, - separatorBuilder: (cxt, index) => 9.width, - itemCount: data.homeMenus![parentIndex].menuEntiesList.length), + : getMenuIconEn(data.homeMenus![parentIndex].menuEntiesList[index].prompt!), + ), + Row( + crossAxisAlignment: CrossAxisAlignment.end, + children: [ + Expanded(child: data.homeMenus![parentIndex].menuEntiesList[index].prompt!.toText11(isBold: true)), + RotatedBox(quarterTurns: AppState().isArabic(context) ? 2 : 4, child: SvgPicture.asset("assets/images/arrow_next.svg").paddingOnly(bottom: 4)), + ], + ), + ], + ).paddingOnly(left: 10, right: 10, bottom: 10, top: 12), + ).onPress(() { + handleOnPress(context, data.homeMenus![parentIndex].menuEntiesList[index]); + }), + ); + }, + separatorBuilder: (cxt, index) => 9.width, + itemCount: data.homeMenus![parentIndex].menuEntiesList.length, ), - ], - ); - }, - separatorBuilder: (context, index) { - return 12.height; - }, - shrinkWrap: true, - physics: const NeverScrollableScrollPhysics(), - itemCount: data.homeMenus!.length); + ), + ], + ); + }, + separatorBuilder: (context, index) { + return 12.height; + }, + shrinkWrap: true, + physics: const NeverScrollableScrollPhysics(), + itemCount: data.homeMenus!.length, + ); }, ); } diff --git a/lib/ui/screens/offers_and_discounts/offers_and_discounts_home.dart b/lib/ui/screens/offers_and_discounts/offers_and_discounts_home.dart index fd2c19e..f67a835 100644 --- a/lib/ui/screens/offers_and_discounts/offers_and_discounts_home.dart +++ b/lib/ui/screens/offers_and_discounts/offers_and_discounts_home.dart @@ -39,7 +39,7 @@ class _OffersAndDiscountsHomeState extends State { Widget build(BuildContext context) { return Scaffold( backgroundColor: Colors.white, - appBar: AppBarWidget(context, title: LocaleKeys.offerAndDiscounts.tr(), showHomeButton: true), + appBar: AppBarWidget(context, title: LocaleKeys.offerAndDiscounts.tr(), showHomeButton: true, showLogo: true, logoPath: "assets/icons/mazaya_brand.svg"), body: SingleChildScrollView( child: Column( crossAxisAlignment: CrossAxisAlignment.start, diff --git a/lib/widgets/app_bar_widget.dart b/lib/widgets/app_bar_widget.dart index 6737945..277a414 100644 --- a/lib/widgets/app_bar_widget.dart +++ b/lib/widgets/app_bar_widget.dart @@ -1,18 +1,23 @@ import 'package:flutter/material.dart'; +import 'package:flutter_svg/flutter_svg.dart'; import 'package:mohem_flutter_app/classes/colors.dart'; import 'package:mohem_flutter_app/config/routes.dart'; import 'package:mohem_flutter_app/extensions/int_extensions.dart'; import 'package:mohem_flutter_app/extensions/string_extensions.dart'; import 'package:mohem_flutter_app/extensions/widget_extensions.dart'; -AppBar AppBarWidget(BuildContext context, - {required String title, - bool showHomeButton = true, - bool showWorkListSettingButton = false, - bool showMemberButton = false, - List? actions, - void Function()? onHomeTapped, - void Function()? onBackTapped}) { +AppBar AppBarWidget( + BuildContext context, { + required String title, + bool showHomeButton = true, + bool showLogo = false, + String? logoPath, + bool showWorkListSettingButton = false, + bool showMemberButton = false, + List? actions, + void Function()? onHomeTapped, + void Function()? onBackTapped, +}) { return AppBar( leadingWidth: 0, automaticallyImplyLeading: false, @@ -26,8 +31,10 @@ AppBar AppBarWidget(BuildContext context, }, context), child: const Icon(Icons.arrow_back_ios, color: MyColors.darkIconColor), ), + if (showLogo) 4.width, + if (showLogo) SvgPicture.asset(logoPath!), 4.width, - title.toText24(color: MyColors.darkTextColor, isBold: true).expanded, + if (!showLogo)title.toText24(color: MyColors.darkTextColor, isBold: true).expanded, ], ), centerTitle: false, @@ -55,7 +62,7 @@ AppBar AppBarWidget(BuildContext context, }, icon: const Icon(Icons.people, color: MyColors.textMixColor), ), - ...actions ?? [] + ...actions ?? [], ], ); } From 5864c772266a0b205e6b1c1a4efa01483be78579 Mon Sep 17 00:00:00 2001 From: Aamir Muhammad Date: Mon, 28 Jul 2025 10:40:37 +0300 Subject: [PATCH 20/26] worklist actions fragment action button changes --- lib/ui/work_list/worklist_detail_screen.dart | 10 +++ .../worklist_fragments/actions_fragment.dart | 70 +++++++++---------- 2 files changed, 45 insertions(+), 35 deletions(-) diff --git a/lib/ui/work_list/worklist_detail_screen.dart b/lib/ui/work_list/worklist_detail_screen.dart index 71a87f8..f1a7a3e 100644 --- a/lib/ui/work_list/worklist_detail_screen.dart +++ b/lib/ui/work_list/worklist_detail_screen.dart @@ -61,6 +61,7 @@ class _WorkListDetailScreenState extends State { int animationIndex = 0; PageController controller = PageController(); bool showFabOptions = false; + bool isShowActions = false; WorkListResponseModel? workListData; MemberInformationListModel? memberInformationListModel; @@ -286,6 +287,7 @@ class _WorkListDetailScreenState extends State { : ActionsFragment( workListData!.nOTIFICATIONID, actionHistoryList, + isShowActions, voidCallback: reloadWorkList, ) : showLoadingAnimation(), @@ -1077,6 +1079,14 @@ class _WorkListDetailScreenState extends State { } return false; }); + + if(notificationButtonsList.any((GetNotificationButtonsList element) => element.bUTTONACTION == "DELEGATE" || element.bUTTONACTION == "REQUEST_INFO" )) { + isShowActions = true; + } else { + isShowActions = false; + } + + } apiCallCount--; if (apiCallCount == 0) { diff --git a/lib/ui/work_list/worklist_fragments/actions_fragment.dart b/lib/ui/work_list/worklist_fragments/actions_fragment.dart index 29d5328..97e540c 100644 --- a/lib/ui/work_list/worklist_fragments/actions_fragment.dart +++ b/lib/ui/work_list/worklist_fragments/actions_fragment.dart @@ -17,8 +17,9 @@ class ActionsFragment extends StatelessWidget { int? notificationID; List actionHistoryList; VoidCallback voidCallback; + bool isShowActions = false; - ActionsFragment(this.notificationID, this.actionHistoryList, {Key? key, required this.voidCallback}) : super(key: key); + ActionsFragment(this.notificationID, this.actionHistoryList, this.isShowActions, {Key? key, required this.voidCallback}) : super(key: key); @override Widget build(BuildContext context) { @@ -113,42 +114,41 @@ class ActionsFragment extends StatelessWidget { ], ).paddingOnly(top: 19, left: 16, right: 16, bottom: 12), Container(width: double.infinity, height: 1, color: MyColors.lightGreyEFColor), - Row( - children: [ - LocaleKeys.request_info.tr().toText12(color: MyColors.grey67Color).center.paddingOnly(top: 6, bottom: 6).onPress(() { - showMyBottomSheet( - context, - callBackFunc: voidCallback, - child: SelectedItemSheet(LocaleKeys.request_info.tr(), apiMode: "REQUEST_INFO", notificationID: notificationID, actionHistoryList: actionHistory), - ); - }).expanded, - Container(width: 1, height: 30, color: MyColors.lightGreyEFColor), - LocaleKeys.delegate.tr().toText12(color: MyColors.gradiantEndColor).center.paddingOnly(top: 6, bottom: 6).onPress(() { - if (actionHistory.uSERNAME == AppState().memberInformationList?.eMPLOYEENUMBER) { - showMyBottomSheet(context, + isShowActions + ? Row( + children: [ + LocaleKeys.request_info.tr().toText12(color: MyColors.grey67Color).center.paddingOnly(top: 6, bottom: 6).onPress(() { + showMyBottomSheet( + context, callBackFunc: voidCallback, - child: DelegateSheet( - title: LocaleKeys.delegate.tr(), - apiMode: "DELEGATE", - notificationID: notificationID, - actionHistoryList: actionHistoryList, + child: SelectedItemSheet(LocaleKeys.request_info.tr(), apiMode: "REQUEST_INFO", notificationID: notificationID, actionHistoryList: actionHistory), + ); + }).expanded, + Container(width: 1, height: 30, color: MyColors.lightGreyEFColor), + LocaleKeys.delegate.tr().toText12(color: MyColors.gradiantEndColor).center.paddingOnly(top: 6, bottom: 6).onPress(() { + if (actionHistory.uSERNAME == AppState().memberInformationList?.eMPLOYEENUMBER) { + showMyBottomSheet( + context, callBackFunc: voidCallback, - )); - return; - } - showMyBottomSheet( - context, - callBackFunc: voidCallback, - child: SelectedItemSheet( - LocaleKeys.comments.tr(), - apiMode: "DELEGATE", - actionHistoryList: actionHistory, - notificationID: notificationID, - ), - ); - }).expanded, - ], - ), + child: DelegateSheet( + title: LocaleKeys.delegate.tr(), + apiMode: "DELEGATE", + notificationID: notificationID, + actionHistoryList: actionHistoryList, + callBackFunc: voidCallback, + ), + ); + return; + } + showMyBottomSheet( + context, + callBackFunc: voidCallback, + child: SelectedItemSheet(LocaleKeys.comments.tr(), apiMode: "DELEGATE", actionHistoryList: actionHistory, notificationID: notificationID), + ); + }).expanded, + ], + ) + : const SizedBox(), ], ), ], From 6400678f95f7d30f4fe3e7ef1e9761db58172089 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Tue, 29 Jul 2025 10:39:35 +0300 Subject: [PATCH 21/26] updates --- lib/app_state/app_state.dart | 2 +- lib/classes/consts.dart | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/app_state/app_state.dart b/lib/app_state/app_state.dart index f8ee060..0cad41a 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: 8.9, mobileType: Platform.isAndroid ? "android" : "ios"); + final PostParamsModel _postParamsInitConfig = PostParamsModel(channel: 31, versionID: 9.1, mobileType: Platform.isAndroid ? "android" : "ios"); void setPostParamsInitConfig() { diff --git a/lib/classes/consts.dart b/lib/classes/consts.dart index c2772b8..fcc34d3 100644 --- a/lib/classes/consts.dart +++ b/lib/classes/consts.dart @@ -6,12 +6,12 @@ class ApiConsts { // static String baseUrl = "https://uat.hmgwebservices.com"; // UAT ser343622ver // static String baseUrl = "http://10.201.204.101:2024"; - // static String baseUrl = "https://webservices.hmg.com"; // PreProd + static String baseUrl = "https://webservices.hmg.com"; // PreProd // static String baseUrl = "https://hmgwebservices.com"; // Live server // static String baseUrl = "https://mohemm.hmg.com"; // New Live server // - static String baseUrl = "https://uat.hmgwebservices.com"; // UAT ser343622ver + // static String baseUrl = "https://uat.hmgwebservices.com"; // UAT ser343622ver // static String baseUrl = "http://10.20.200.111:1010/"; // static String baseUrl = "https://webservices.hmg.com"; // PreProd From 0e54c7dac9a1ce17bd2508250d166c627b64fcf4 Mon Sep 17 00:00:00 2001 From: Aamir Muhammad Date: Tue, 29 Jul 2025 16:46:17 +0300 Subject: [PATCH 22/26] worklist actions fragment action button changes --- .vscode/settings.json | 3 +- android/agconnect-services.json | 57 ++ android/app/build.gradle | 21 +- android/build.gradle | 54 +- android/gradle.properties | 2 + android/settings.gradle | 31 +- assets/langs/ar-SA.json | 3 +- assets/langs/en-US.json | 3 +- lib/classes/colors.dart | 1 + lib/classes/consts.dart | 4 +- lib/generated/codegen_loader.g.dart | 10 +- lib/generated/locale_keys.g.dart | 1 + lib/ui/landing/dashboard_screen.dart | 943 ++++++++++++--------------- pubspec.yaml | 8 +- 14 files changed, 551 insertions(+), 590 deletions(-) create mode 100644 android/agconnect-services.json diff --git a/.vscode/settings.json b/.vscode/settings.json index af7c712..6558ca6 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,5 +1,6 @@ { "cSpell.words": [ "MPLOYEEIMAGE" - ] + ], + "java.configuration.updateBuildConfiguration": "disabled" } \ No newline at end of file diff --git a/android/agconnect-services.json b/android/agconnect-services.json new file mode 100644 index 0000000..20a7546 --- /dev/null +++ b/android/agconnect-services.json @@ -0,0 +1,57 @@ +{ + "agcgw_all":{ + "CN":"connect-drcn.dbankcloud.cn", + "CN_back":"connect-drcn.hispace.hicloud.com", + "DE":"connect-dre.dbankcloud.cn", + "DE_back":"connect-dre.hispace.hicloud.com", + "RU":"connect-drru.hispace.dbankcloud.ru", + "RU_back":"connect-drru.hispace.dbankcloud.cn", + "SG":"connect-dra.dbankcloud.cn", + "SG_back":"connect-dra.hispace.hicloud.com" + }, + "websocketgw_all":{ + "CN":"connect-ws-drcn.hispace.dbankcloud.cn", + "CN_back":"connect-ws-drcn.hispace.dbankcloud.com", + "DE":"connect-ws-dre.hispace.dbankcloud.cn", + "DE_back":"connect-ws-dre.hispace.dbankcloud.com", + "RU":"connect-ws-drru.hispace.dbankcloud.ru", + "RU_back":"connect-ws-drru.hispace.dbankcloud.cn", + "SG":"connect-ws-dra.hispace.dbankcloud.cn", + "SG_back":"connect-ws-dra.hispace.dbankcloud.com" + }, + "client":{ + "cp_id":"2640966000002322881", + "product_id":"737518067793559971", + "client_id":"715996003571874624", + "client_secret":"B5B89A56A53847C6BB9D216A8747E75952760DF9A8232239D8744CD847A8FFDA", + "project_id":"737518067793559971", + "app_id":"104737117", + "api_key":"DAEDACKDrYgyco9mjPV9ZUjCSh1kCr/GBV0nseHH0z2mnxlZ41RksOKmyTi+PUTwmGEPK+VxCup4F9oUf4VbDnCsjB7aNBShYcjR+g==", + "package_name":"hmg.cloudSolutions.mohem" + }, + "oauth_client":{ + "client_id":"104737117", + "client_type":1 + }, + "app_info":{ + "app_id":"104737117", + "package_name":"hmg.cloudSolutions.mohem" + }, + "configuration_version":"3.0", + "appInfos":[ + { + "package_name":"hmg.cloudSolutions.mohem", + "client":{ + "app_id":"104737117" + }, + "app_info":{ + "package_name":"hmg.cloudSolutions.mohem", + "app_id":"104737117" + }, + "oauth_client":{ + "client_type":1, + "client_id":"104737117" + } + } + ] +} \ No newline at end of file diff --git a/android/app/build.gradle b/android/app/build.gradle index 0236a3b..8a1cccd 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -4,7 +4,7 @@ plugins { id "com.google.gms.google-services" id "dev.flutter.flutter-gradle-plugin" id "com.google.firebase.crashlytics" - + id "com.huawei.agconnect" } @@ -18,7 +18,13 @@ if (keystorePropertiesFile.exists()) { android { namespace 'hmg.cloudSolutions.mohem' - compileSdk 36 + compileSdk 36 // Changed from 36 to a supported version + + compileOptions { + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 + coreLibraryDesugaringEnabled true + } kotlinOptions { jvmTarget = '1.8' @@ -31,10 +37,12 @@ android { defaultConfig { // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). applicationId "hmg.cloudSolutions.mohem" - minSdkVersion 30 - targetSdk = flutter.targetSdkVersion + minSdkVersion 28 +// targetSdk = flutter.targetSdkVersion + targetSdk 35 versionCode flutter.versionCode versionName flutter.versionName + multiDexEnabled true } buildFeatures{ @@ -67,6 +75,9 @@ flutter { } dependencies { - coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:1.2.2' implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:2.1.20" + coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:2.1.5' + implementation 'com.huawei.hms:push:6.11.0.300' + + } diff --git a/android/build.gradle b/android/build.gradle index c1b6ff6..8a97f51 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -1,49 +1,23 @@ -//buildscript { -// ext.kotlin_version = '1.9.10' -// repositories { -// google() -// mavenCentral() -// maven { url 'https://developer.huawei.com/repo/' } -// } -// -// dependencies { -// 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' -// classpath "com.android.tools:r8:8.2.33" -// } -//} -// -//allprojects { -// repositories { -// google() -// mavenCentral() -// maven { url 'https://developer.huawei.com/repo/' } -// } -//} -// -//rootProject.buildDir = '../build' -//subprojects { -// project.buildDir = "${rootProject.buildDir}/${project.name}" -// project.evaluationDependsOn(':app') -//} -// -//tasks.register("clean", Delete) { -// delete rootProject.buildDir -//} +buildscript { + repositories { + google() + mavenCentral() + maven { url 'https://developer.huawei.com/repo/' } + } + dependencies { + classpath 'com.android.tools.build:gradle:7.3.0' + classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.7.10" + classpath 'com.google.gms:google-services:4.3.15' + classpath 'com.huawei.agconnect:agcp:1.9.1.304' + } +} allprojects { repositories { google() mavenCentral() - maven { - url 'https://developer.huawei.com/repo/' - } - maven { - url "https://artifactory.ess-dev.com/artifactory/gradle-dev-local" - } + maven { url 'https://developer.huawei.com/repo/' } } // Exclude old BouncyCastle globally to avoid duplicate classes diff --git a/android/gradle.properties b/android/gradle.properties index 8310efa..fbdc0de 100644 --- a/android/gradle.properties +++ b/android/gradle.properties @@ -1,4 +1,6 @@ org.gradle.jvmargs=-Xmx2048M android.useAndroidX=true android.enableJetifier=true +apmsInstrumentationEnabled=false + #org.gradle.java.home=/Users/amirs/Library/Java/JavaVirtualMachines/jbr-17.0.12/Contents/Home/ \ No newline at end of file diff --git a/android/settings.gradle b/android/settings.gradle index f29151d..10a4a8d 100644 --- a/android/settings.gradle +++ b/android/settings.gradle @@ -15,22 +15,19 @@ pluginManagement { mavenCentral() gradlePluginPortal() maven { url 'https://developer.huawei.com/repo/' } - } - dependencyResolutionManagement { - repositories { - google() - mavenCentral() - gradlePluginPortal() - maven { url 'https://developer.huawei.com/repo/' } - maven { - url "https://artifactory.ess-dev.com/artifactory/gradle-dev-local" + resolutionStrategy { + eachPlugin { + if (requested.id.id == "com.huawei.agconnect") { + useModule("com.huawei.agconnect:agcp:1.9.1.304") } } } + } + plugins { id "dev.flutter.flutter-plugin-loader" version "1.0.0" id "com.android.application" version '8.11.0' apply false @@ -38,8 +35,22 @@ plugins { id("com.google.gms.google-services") version "4.4.3" apply false id("com.google.firebase.crashlytics") version "3.0.4" apply false id('org.gradle.toolchains.foojay-resolver-convention') version '0.9.0' apply false - id("com.huawei.agconnect") version "1.9.1.304" apply false + id "com.huawei.agconnect" version "1.9.1.304" apply false +} + +dependencyResolutionManagement { + repositories { + google() + mavenCentral() + gradlePluginPortal() + maven { url 'https://developer.huawei.com/repo/' } + maven { + url "https://artifactory.ess-dev.com/artifactory/gradle-dev-local" + } + } } + + include ":app" diff --git a/assets/langs/ar-SA.json b/assets/langs/ar-SA.json index d874779..08b00da 100644 --- a/assets/langs/ar-SA.json +++ b/assets/langs/ar-SA.json @@ -619,5 +619,6 @@ "explore": "يستكشف", "mazaya": "مازيا", "benefits": "فوائد", - "mazayaDesc": "اكتشف الخصومات والعروض الخاصة المتاحة للموظفين" + "mazayaDesc": "اكتشف الخصومات والعروض الخاصة المتاحة للموظفين", + "viewallofferMazaya" : "أعرض كل المزايا" } \ No newline at end of file diff --git a/assets/langs/en-US.json b/assets/langs/en-US.json index ae4dcbc..ff30994 100644 --- a/assets/langs/en-US.json +++ b/assets/langs/en-US.json @@ -617,6 +617,7 @@ "explore": "Explore", "mazaya": "MAZAYA", "benefits": "Benefits", - "mazayaDesc": "Discover special Discounts and offers available to Employees" + "mazayaDesc": "Discover special Discounts and offers available to Employees", + "viewallofferMazaya" : "View All Offers" } \ No newline at end of file diff --git a/lib/classes/colors.dart b/lib/classes/colors.dart index 915f35d..1b0dd06 100644 --- a/lib/classes/colors.dart +++ b/lib/classes/colors.dart @@ -66,4 +66,5 @@ class MyColors { static const Color darkGrey3BColor = Color(0xff3B3B3B); static const Color lightGreyIconColor = Color(0xff919191); static const Color selectedBorderColor = Color(0xff37A4BE); + static const Color mazayaRedColor = Color(0xffED1C2B); } diff --git a/lib/classes/consts.dart b/lib/classes/consts.dart index be3f840..069a75d 100644 --- a/lib/classes/consts.dart +++ b/lib/classes/consts.dart @@ -6,10 +6,10 @@ class ApiConsts { // static String baseUrl = "https://uat.hmgwebservices.com"; // UAT ser343622ver // static String baseUrl = "http://10.201.204.101:2024"; - static String baseUrl = "https://webservices.hmg.com"; // PreProd + // static String baseUrl = "https://webservices.hmg.com"; // PreProd // static String baseUrl = "https://hmgwebservices.com"; // Live server - // static String baseUrl = "https://mohemm.hmg.com"; // New Live server + static String baseUrl = "https://mohemm.hmg.com"; // New Live server // // static String baseUrl = "https://uat.hmgwebservices.com"; // UAT ser343622ver // static String baseUrl = "http://10.20.200.111:1010/"; diff --git a/lib/generated/codegen_loader.g.dart b/lib/generated/codegen_loader.g.dart index 3da13c4..f3fda6a 100644 --- a/lib/generated/codegen_loader.g.dart +++ b/lib/generated/codegen_loader.g.dart @@ -6,7 +6,7 @@ import 'dart:ui'; import 'package:easy_localization/easy_localization.dart' show AssetLoader; -class CodegenLoader extends AssetLoader { +class CodegenLoader extends AssetLoader{ const CodegenLoader(); @override @@ -632,7 +632,8 @@ class CodegenLoader extends AssetLoader { "explore": "يستكشف", "mazaya": "مازيا", "benefits": "فوائد", - "mazayaDesc": "اكتشف الخصومات والعروض الخاصة المتاحة للموظفين" + "mazayaDesc": "اكتشف الخصومات والعروض الخاصة المتاحة للموظفين", + "viewallofferMazaya": "أعرض كل المزايا" }; static const Map _en_US = { "mohemm": "Mohemm", @@ -1252,7 +1253,8 @@ static const Map _en_US = { "explore": "Explore", "mazaya": "MAZAYA", "benefits": "Benefits", - "mazayaDesc": "Discover special Discounts and offers available to Employees" + "mazayaDesc": "Discover special Discounts and offers available to Employees", + "viewallofferMazaya": "View All Offers" }; static const Map> mapLocales = {"ar_SA": _ar_SA, "en_US": _en_US}; -} \ No newline at end of file +} diff --git a/lib/generated/locale_keys.g.dart b/lib/generated/locale_keys.g.dart index 41023f4..b748380 100644 --- a/lib/generated/locale_keys.g.dart +++ b/lib/generated/locale_keys.g.dart @@ -605,5 +605,6 @@ abstract class LocaleKeys { static const mazaya = 'mazaya'; static const benefits = 'benefits'; static const mazayaDesc = 'mazayaDesc'; + static const viewallofferMazaya = 'viewallofferMazaya'; } diff --git a/lib/ui/landing/dashboard_screen.dart b/lib/ui/landing/dashboard_screen.dart index 9131b8e..d3ecb9f 100644 --- a/lib/ui/landing/dashboard_screen.dart +++ b/lib/ui/landing/dashboard_screen.dart @@ -152,7 +152,7 @@ class _DashboardScreenState extends State with WidgetsBindingOb data.fetchLeaveTicketBalance(context, DateTime.now()); data.fetchMenuEntries(); data.fetchEventActivity(); - data.getCategoryOffersListAPI(context); + // data.getCategoryOffersListAPI(context); marathonProvider.getMarathonDetailsFromApi(); marathonProvider.getMarathonTutorial(); if (isFromInit) { @@ -237,558 +237,457 @@ class _DashboardScreenState extends State with WidgetsBindingOb @override Widget build(BuildContext context) { - return Scaffold( - key: _scaffoldState, - body: Column( - children: [ - Row( - children: [ - Builder( - builder: (BuildContext context) { - return Row( - mainAxisSize: MainAxisSize.min, - children: [ - Image.memory( - Utils.dataFromBase64String(AppState().memberInformationList!.eMPLOYEEIMAGE ?? ""), - errorBuilder: (BuildContext context, Object error, StackTrace? stackTrace) { - return SvgPicture.asset("assets/images/user.svg", height: 34, width: 34); - }, - width: 34, - height: 34, - fit: BoxFit.cover, - ).circle(50), - // CircularAvatar( - // width: 34, - // height: 34, - // url: "https://cdn4.iconfinder.com/data/icons/professions-2-2/151/89-512.png", - // ), - 8.width, - SvgPicture.asset("assets/images/side_nav.svg"), - ], - ).onPress(() { - _scaffoldState.currentState!.openDrawer(); - }); + return SafeArea( + bottom: Platform.isAndroid ? true : false, + top: false, + child: Scaffold( + key: _scaffoldState, + body: Column( + children: [ + Row( + children: [ + Builder( + builder: (BuildContext context) { + return Row( + mainAxisSize: MainAxisSize.min, + children: [ + Image.memory( + Utils.dataFromBase64String(AppState().memberInformationList!.eMPLOYEEIMAGE ?? ""), + errorBuilder: (BuildContext context, Object error, StackTrace? stackTrace) { + return SvgPicture.asset("assets/images/user.svg", height: 34, width: 34); + }, + width: 34, + height: 34, + fit: BoxFit.cover, + ).circle(50), + // CircularAvatar( + // width: 34, + // height: 34, + // url: "https://cdn4.iconfinder.com/data/icons/professions-2-2/151/89-512.png", + // ), + 8.width, + SvgPicture.asset("assets/images/side_nav.svg"), + ], + ).onPress(() { + _scaffoldState.currentState!.openDrawer(); + }); + }, + ), + Image.asset("assets/images/logos/main_mohemm_logo.png", width: 134, height: 28).expanded, + SvgPicture.asset("assets/images/announcements.svg", matchTextDirection: true).onPress(() async { + await Navigator.pushNamed(context, AppRoutes.announcements); + }), + ], + ).paddingOnly(left: 21, right: 21, top: 48, bottom: 7), + Expanded( + child: SmartRefresher( + enablePullDown: true, + enablePullUp: false, + header: const MaterialClassicHeader(color: MyColors.gradiantEndColor), + controller: _refreshController, + onRefresh: () { + _onRefresh(false); }, - ), - Image.asset("assets/images/logos/main_mohemm_logo.png", width: 134, height: 28).expanded, - SvgPicture.asset("assets/images/announcements.svg", matchTextDirection: true).onPress(() async { - await Navigator.pushNamed(context, AppRoutes.announcements); - }), - ], - ).paddingOnly(left: 21, right: 21, top: 48, bottom: 7), - Expanded( - child: SmartRefresher( - enablePullDown: true, - enablePullUp: false, - header: const MaterialClassicHeader(color: MyColors.gradiantEndColor), - controller: _refreshController, - onRefresh: () { - _onRefresh(false); - }, - child: SingleChildScrollView( - child: Column( - children: [ - Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - LocaleKeys.welcomeBack.tr().toText14(color: MyColors.grey77Color), - (AppState().memberInformationList!.eMPLOYEENAME ?? "").toText24(isBold: true), - 16.height, - Row( - children: [ - Expanded( - child: AspectRatio( - aspectRatio: 159 / 159, - child: Consumer( - builder: (BuildContext context, DashboardProviderModel model, Widget? child) { - return (model.isAttendanceTrackingLoading - ? GetAttendanceTrackingShimmer() - : Container( - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(15), - gradient: const LinearGradient( - transform: GradientRotation(.46), - begin: Alignment.topRight, - end: Alignment.bottomLeft, - colors: [MyColors.gradiantEndColor, MyColors.gradiantStartColor], + child: SingleChildScrollView( + child: Column( + children: [ + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + LocaleKeys.welcomeBack.tr().toText14(color: MyColors.grey77Color), + (AppState().memberInformationList!.eMPLOYEENAME ?? "").toText24(isBold: true), + 16.height, + Row( + children: [ + Expanded( + child: AspectRatio( + aspectRatio: 159 / 159, + child: Consumer( + builder: (BuildContext context, DashboardProviderModel model, Widget? child) { + return (model.isAttendanceTrackingLoading + ? GetAttendanceTrackingShimmer() + : Container( + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(15), + gradient: const LinearGradient( + transform: GradientRotation(.46), + begin: Alignment.topRight, + end: Alignment.bottomLeft, + colors: [MyColors.gradiantEndColor, MyColors.gradiantStartColor], + ), ), - ), - child: Stack( - alignment: Alignment.center, - children: [ - if (model.isTimeRemainingInSeconds == 0) SvgPicture.asset("assets/images/thumb.svg"), - Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Expanded( - child: Column( - mainAxisSize: MainAxisSize.min, - crossAxisAlignment: CrossAxisAlignment.start, + child: Stack( + alignment: Alignment.center, + children: [ + if (model.isTimeRemainingInSeconds == 0) SvgPicture.asset("assets/images/thumb.svg"), + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Expanded( + child: Column( + mainAxisSize: MainAxisSize.min, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + LocaleKeys.markAttendance.tr().toText14(color: Colors.white, isBold: true), + if (model.isTimeRemainingInSeconds == 0) DateTime.now().toString().split(" ")[0].toText12(color: Colors.white), + if (model.isTimeRemainingInSeconds != 0) + Column( + mainAxisSize: MainAxisSize.min, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + 9.height, + Directionality( + textDirection: ui.TextDirection.ltr, + child: CountdownTimer( + endTime: model.endTime, + onEnd: null, + endWidget: "00:00:00".toText14(color: Colors.white, isBold: true), + textStyle: const TextStyle(color: Colors.white, fontSize: 14, letterSpacing: -0.48, fontWeight: FontWeight.bold), + ), + ), + LocaleKeys.timeLeftToday.tr().toText12(color: Colors.white), + 9.height, + ClipRRect( + borderRadius: const BorderRadius.all(Radius.circular(20)), + child: LinearProgressIndicator( + value: model.progress, + minHeight: 8, + valueColor: const AlwaysStoppedAnimation(Colors.white), + backgroundColor: const Color(0xff196D73), + ), + ), + ], + ), + ], + ).paddingOnly(top: 12, right: 15, left: 12), + ), + Row( children: [ - LocaleKeys.markAttendance.tr().toText14(color: Colors.white, isBold: true), - if (model.isTimeRemainingInSeconds == 0) DateTime.now().toString().split(" ")[0].toText12(color: Colors.white), - if (model.isTimeRemainingInSeconds != 0) - Column( + Expanded( + child: Column( mainAxisSize: MainAxisSize.min, crossAxisAlignment: CrossAxisAlignment.start, children: [ - 9.height, - Directionality( - textDirection: ui.TextDirection.ltr, - child: CountdownTimer( - endTime: model.endTime, - onEnd: null, - endWidget: "00:00:00".toText14(color: Colors.white, isBold: true), - textStyle: const TextStyle(color: Colors.white, fontSize: 14, letterSpacing: -0.48, fontWeight: FontWeight.bold), - ), - ), - LocaleKeys.timeLeftToday.tr().toText12(color: Colors.white), - 9.height, - ClipRRect( - borderRadius: const BorderRadius.all(Radius.circular(20)), - child: LinearProgressIndicator( - value: model.progress, - minHeight: 8, - valueColor: const AlwaysStoppedAnimation(Colors.white), - backgroundColor: const Color(0xff196D73), - ), + LocaleKeys.checkIn.tr().toText12(color: Colors.white), + (model.attendanceTracking!.pSwipeIn == null ? "--:--" : model.attendanceTracking!.pSwipeIn).toString().toText14( + color: Colors.white, + isBold: true, ), + 4.height, ], + ).paddingOnly(left: 12, right: 12), + ), + Container( + margin: EdgeInsets.only(top: AppState().isArabic(context) ? 6 : 0), + width: 45, + height: 45, + padding: const EdgeInsets.only(left: 10, right: 10), + decoration: BoxDecoration( + color: const Color(0xff259EA4), + borderRadius: BorderRadius.only( + bottomRight: AppState().isArabic(context) ? const Radius.circular(0) : const Radius.circular(15), + bottomLeft: AppState().isArabic(context) ? const Radius.circular(15) : const Radius.circular(0), + ), ), + child: SvgPicture.asset(model.isTimeRemainingInSeconds == 0 ? "assets/images/biometrics.svg" : "assets/images/biometrics.svg"), + ).onPress(() { + showMyBottomSheet(context, callBackFunc: () {}, child: MarkAttendanceWidget(model, isFromDashboard: true)); + }), ], - ).paddingOnly(top: 12, right: 15, left: 12), - ), - Row( - children: [ - Expanded( - child: Column( - mainAxisSize: MainAxisSize.min, - crossAxisAlignment: CrossAxisAlignment.start, + ), + ], + ), + ], + ), + ).onPress(() { + Navigator.pushNamed(context, AppRoutes.todayAttendance); + })) + .animatedSwither(); + }, + ), + ), + ), + 9.width, + Expanded(child: MenusWidget()), + ], + ), + ], + ).paddingOnly(left: 21, right: 21, top: 7, bottom: 21), + eventActivityWidget(context), + Column( + mainAxisSize: MainAxisSize.min, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Directionality( + textDirection: AppState().isArabic(context) ? ui.TextDirection.rtl : ui.TextDirection.ltr, + child: Container( + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(20), + gradient: const LinearGradient(colors: [Color(0xFF91C481), Color(0xFF7CCED7)], begin: Alignment.centerLeft, end: Alignment.centerRight), + ), + child: Padding( + padding: const EdgeInsets.all(3.0), // This creates the border width + child: Container( + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(17), // Slightly less than outer radius + ), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Expanded( + flex: 4, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Row( + children: [ + Expanded( + flex: 2, + child: RichText( + text: + AppState().isArabic(context) + ? TextSpan( children: [ - LocaleKeys.checkIn.tr().toText12(color: Colors.white), - (model.attendanceTracking!.pSwipeIn == null ? "--:--" : model.attendanceTracking!.pSwipeIn).toString().toText14( - color: Colors.white, - isBold: true, + TextSpan( + text: 'اطلع على مميزات', + style: TextStyle(fontSize: 16, letterSpacing: -0.2, fontFamily: AppState().isArabic(context) ? 'Cairo' : 'Poppins', fontWeight: FontWeight.w700, height: 24 / 16, color: Color(0xFF5D5E5E)), + ), + TextSpan( + text: ' مزايا', + style: TextStyle( + fontSize: 16, + fontFamily: AppState().isArabic(context) ? 'Cairo' : 'Poppins', + fontWeight: FontWeight.w700, + letterSpacing: -0.2, + height: 24 / 16, + color: MyColors.mazayaRedColor, // Use your MAZAYA red color here if defined, e.g. MyColors.mazayaRed + ), + ), + ], + ) + : TextSpan( + children: [ + TextSpan( + text: LocaleKeys.explore.tr() + ' ', + style: const TextStyle(fontSize: 16, letterSpacing: -0.2, fontFamily: 'Poppins', fontWeight: FontWeight.w700, height: 24 / 16, color: Color(0xFF5D5E5E)), + ), + TextSpan( + text: LocaleKeys.mazaya.tr(), + style: const TextStyle( + fontSize: 16, + fontWeight: FontWeight.w700, + fontFamily: 'Poppins', + letterSpacing: -0.2, + height: 24 / 16, + color: MyColors.mazayaRedColor, // Use your MAZAYA red color here if defined, e.g. MyColors.mazayaRed + ), + ), + TextSpan( + text: ' ' + LocaleKeys.benefits.tr(), + style: const TextStyle(fontSize: 16, letterSpacing: -0.2, + fontFamily: 'Poppins',fontWeight: FontWeight.w700, height: 24 / 16, color: Color(0xFF5D5E5E)), ), - 4.height, ], - ).paddingOnly(left: 12, right: 12), - ), - Container( - margin: EdgeInsets.only(top: AppState().isArabic(context) ? 6 : 0), - width: 45, - height: 45, - padding: const EdgeInsets.only(left: 10, right: 10), - decoration: BoxDecoration( - color: const Color(0xff259EA4), - borderRadius: BorderRadius.only( - bottomRight: AppState().isArabic(context) ? const Radius.circular(0) : const Radius.circular(15), - bottomLeft: AppState().isArabic(context) ? const Radius.circular(15) : const Radius.circular(0), - ), ), - child: SvgPicture.asset(model.isTimeRemainingInSeconds == 0 ? "assets/images/biometrics.svg" : "assets/images/biometrics.svg"), - ).onPress(() { - showMyBottomSheet(context, callBackFunc: () {}, child: MarkAttendanceWidget(model, isFromDashboard: true)); - }), - ], - ), - ], ), - ], - ), - ).onPress(() { - Navigator.pushNamed(context, AppRoutes.todayAttendance); - })) - .animatedSwither(); - }, + ), + const Expanded(flex: 1, child: SizedBox()), + ], + ), + const SizedBox(height: 8), + LocaleKeys.mazayaDesc.tr().toText11(color: const Color(0xFF5D5E5E)), + ], + ), + ), + Expanded( + flex: 2, + child: Column( + crossAxisAlignment: CrossAxisAlignment.end, + mainAxisAlignment: MainAxisAlignment.end, + children: [ + SvgPicture.asset("assets/icons/mazaya_brand.svg", width: 90, height: 47), + const SizedBox(height: 28), + LocaleKeys.viewallofferMazaya.tr().toText12(isUnderLine: true, color: const Color(0xFF3B3D4A)).onPress(() { + Navigator.pushNamed(context, AppRoutes.offersAndDiscounts); + }), + ], + ), + ), + ], + ).paddingOnly(left: 21, right: 21, top: 14, bottom: 14), ), ), - ), - 9.width, - Expanded(child: MenusWidget()), + ).paddingOnly(left: 21, right: 21, top: 0, bottom: 21), + ), + ], + ), + Container( + width: double.infinity, + padding: const EdgeInsets.only(top: 31), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: const BorderRadius.only(topRight: Radius.circular(50), topLeft: Radius.circular(50)), + border: Border.all(color: MyColors.lightGreyEDColor, width: 1), + ), + child: Column( + mainAxisSize: MainAxisSize.min, + children: [ + ServicesWidget(), + context.watch().isLoading ? const MarathonBannerShimmer().paddingAll(20) : const MarathonBanner().paddingOnly(left: 21, right: 21, bottom: 8, top: 8), + // context.watch().isTutorialLoading + // ? const MarathonBannerShimmer().paddingAll(20) + // : Container( + // padding: EdgeInsets.only(bottom: 12, top: 12), + // margin: EdgeInsets.only(left: 21, right: 21, bottom: 21, top: 8), + // width: double.infinity, + // alignment: Alignment.center, + // decoration: BoxDecoration( + // color: MyColors.backgroundBlackColor, + // borderRadius: BorderRadius.circular(20), + // border: Border.all(color: MyColors.lightGreyEDColor, width: 1), + // ), + // child: Column( + // crossAxisAlignment: CrossAxisAlignment.start, + // mainAxisSize: MainAxisSize.min, + // children: [ + // Text( + // "Tutorial:", + // style: TextStyle( + // fontSize: 11, + // fontStyle: FontStyle.italic, + // fontWeight: FontWeight.w600, + // color: MyColors.white.withOpacity(0.83), + // letterSpacing: -0.4, + // ), + // ), + // Text( + // context.read().tutorial?.tutorialName ?? "", + // overflow: TextOverflow.ellipsis, + // style: TextStyle( + // fontStyle: FontStyle.italic, + // fontSize: 19, + // fontWeight: FontWeight.bold, + // color: MyColors.white, + // height: 32 / 22, + // ), + // ), + // ], + // ), + // ).onPress(() { + // checkERMChannel(); + // // Navigator.pushNamed(context, AppRoutes.marathonTutorialScreen); + // }), ], ), - ], - ).paddingOnly(left: 21, right: 21, top: 7, bottom: 21), - eventActivityWidget(context), + ), + ], + ), + ), + ), + ), + ], + ), + drawer: AppDrawer(onLanguageChange: _onRefresh), + bottomNavigationBar: SizedBox( + height: Platform.isAndroid ? 70 : 100, + child: BottomNavigationBar( + items: [ + BottomNavigationBarItem(icon: SvgPicture.asset("assets/icons/home.svg", color: currentIndex == 0 ? MyColors.grey3AColor : MyColors.grey98Color).paddingAll(4), label: LocaleKeys.home.tr()), + BottomNavigationBarItem( + icon: SvgPicture.asset("assets/icons/create_req.svg", color: currentIndex == 1 ? MyColors.grey3AColor : MyColors.grey98Color).paddingAll(4), + label: LocaleKeys.mowadhafhiRequest.tr(), + ), + BottomNavigationBarItem( + icon: Stack( + alignment: Alignment.centerLeft, + children: [ + SvgPicture.asset("assets/icons/work_list.svg", color: currentIndex == 2 ? MyColors.grey3AColor : MyColors.grey98Color).paddingAll(4), Consumer( - builder: (BuildContext context, DashboardProviderModel model, Widget? child) { - if (!model.isOffersLoading && model.getOffersList.isEmpty) { + builder: (BuildContext cxt, DashboardProviderModel data, Widget? child) { + if (data.workListCounter == 0) { return const SizedBox(); } - return Column( - mainAxisSize: MainAxisSize.min, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Directionality( - textDirection: AppState().isArabic(context) ? ui.TextDirection.rtl : ui.TextDirection.ltr, - child: Container( - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(20), - gradient: const LinearGradient(colors: [Color(0xFF91C481), Color(0xFF7CCED7)], begin: Alignment.centerLeft, end: Alignment.centerRight), - ), - child: Padding( - padding: const EdgeInsets.all(3.0), // This creates the border width - child: Container( - decoration: BoxDecoration( - color: Colors.white, - borderRadius: BorderRadius.circular(17), // Slightly less than outer radius - ), - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Expanded( - flex: 4, - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - mainAxisAlignment: MainAxisAlignment.start, - children: [ - Row( - children: [ - Expanded( - flex: 2, - child: RichText( - text: - AppState().isArabic(context) - ? const TextSpan( - children: [ - TextSpan( - text: 'اطلع على مميزات', - style: TextStyle(fontSize: 16, letterSpacing: -0.2, fontWeight: FontWeight.w700, height: 24 / 16, color: Color(0xFF5D5E5E)), - ), - TextSpan( - text: ' مزايا', - style: TextStyle( - fontSize: 16, - fontWeight: FontWeight.w700, - letterSpacing: -0.2, - height: 24 / 16, - color: Color(0xFFED1C2B), // Use your MAZAYA red color here if defined, e.g. MyColors.mazayaRed - ), - ), - ], - ) - : TextSpan( - children: [ - TextSpan( - text: LocaleKeys.explore.tr() + ' ', - style: const TextStyle(fontSize: 16, letterSpacing: -0.2, fontWeight: FontWeight.w700, height: 24 / 16, color: Color(0xFF5D5E5E)), - ), - TextSpan( - text: LocaleKeys.mazaya.tr(), - style: const TextStyle( - fontSize: 16, - fontWeight: FontWeight.w700, - letterSpacing: -0.2, - height: 24 / 16, - color: Color(0xFFED1C2B), // Use your MAZAYA red color here if defined, e.g. MyColors.mazayaRed - ), - ), - TextSpan( - text: ' ' + LocaleKeys.benefits.tr(), - style: const TextStyle(fontSize: 16, letterSpacing: -0.2, fontWeight: FontWeight.w700, height: 24 / 16, color: Color(0xFF5D5E5E)), - ), - ], - ), - ), - ), - const Expanded(flex: 1, child: SizedBox()), - ], - ), - const SizedBox(height: 8), - LocaleKeys.mazayaDesc.tr().toText11(color: const Color(0xFF5D5E5E)), - ], - ), - ), - Expanded( - flex: 2, - child: Column( - crossAxisAlignment: CrossAxisAlignment.end, - mainAxisAlignment: MainAxisAlignment.end, - children: [ - SvgPicture.asset("assets/icons/mazaya_brand.svg", width: 90, height: 47), - const SizedBox(height: 28), - LocaleKeys.viewAllOffers.tr().toText12(isUnderLine: true, color: const Color(0xFF3B3D4A)).onPress(() { - Navigator.pushNamed(context, AppRoutes.offersAndDiscounts); - }), - ], - ), - ), - ], - ).paddingOnly(left: 21, right: 21, top: 14, bottom: 14), - ), - ), - ).paddingOnly(left: 21, right: 21, top: 0, bottom: 21), - ), - - // Container( - // height: 121, - // decoration: BoxDecoration( - // borderRadius: BorderRadius.circular(12), - // border: Border.all(width: 3, color: Colors.red), - // ), - // child: Padding(padding: const EdgeInsets.all(4.0), child: Container(decoration: BoxDecoration(borderRadius: BorderRadius.circular(12), color: Colors.white))), - // ).paddingOnly(left: 21, right: 21, bottom: 21), - - // Row( - // crossAxisAlignment: CrossAxisAlignment.center, - // children: [ - // Expanded( - // child: Column( - // crossAxisAlignment: CrossAxisAlignment.start, - // mainAxisSize: MainAxisSize.min, - // children: [ - // LocaleKeys.offers.tr().toText12(), - // Row( - // children: [ - // LocaleKeys.discounts.tr().toText24(isBold: true), - // 6.width, - // Container( - // padding: const EdgeInsets.only(left: 8, right: 8), - // decoration: BoxDecoration( - // color: MyColors.yellowColor, - // borderRadius: BorderRadius.circular(10), - // ), - // child: LocaleKeys.newString.tr().toText10(isBold: true)), - // ], - // ), - // ], - // ), - // ), - // LocaleKeys.viewAllOffers.tr().toText12(isUnderLine: true).onPress(() { - // Navigator.pushNamed(context, AppRoutes.offersAndDiscounts); - // }) - // ], - // ).paddingOnly(left: 21, right: 21), - // Consumer( - // builder: (BuildContext context, DashboardProviderModel model, Widget? child) { - // return SizedBox( - // height: 103 + 33, - // child: ListView.separated( - // shrinkWrap: true, - // physics: const BouncingScrollPhysics(), - // padding: const EdgeInsets.only(left: 21, right: 21, top: 13), - // scrollDirection: Axis.horizontal, - // itemBuilder: (BuildContext cxt, int index) { - // return model.isOffersLoading - // ? const OffersShimmerWidget() - // : InkWell( - // onTap: () { - // navigateToDetails(data.getOffersList[index]); - // }, - // child: SizedBox( - // width: 73, - // child: Column( - // crossAxisAlignment: CrossAxisAlignment.center, - // children: [ - // Container( - // width: 73, - // height: 73, - // decoration: BoxDecoration( - // color: Colors.white, - // borderRadius: const BorderRadius.all( - // Radius.circular(100), - // ), - // border: Border.all(color: MyColors.lightGreyE3Color, width: 1), - // ), - // child: ClipRRect( - // borderRadius: const BorderRadius.all( - // Radius.circular(50), - // ), - // child: Hero( - // tag: "ItemImage" + data.getOffersList[index].offersDiscountId.toString()!, - // transitionOnUserGestures: true, - // child: Image.network( - // data.getOffersList[index].logo ?? "", - // fit: BoxFit.contain, - // ), - // ), - // ), - // ), - // 4.height, - // Expanded( - // child: AppState().isArabic(context) - // ? data.getOffersList[index].titleAr!.toText12(isCenter: true, maxLine: 1) - // : data.getOffersList[index].titleEn!.toText12(isCenter: true, maxLine: 1), - // ), - // ], - // ), - // ), - // ); - // }, - // separatorBuilder: (BuildContext cxt, int index) => 8.width, - // itemCount: 9), - // ); - // }, - // ), - ], + return Positioned( + right: 0, + top: 0, + child: Container( + padding: const EdgeInsets.only(left: 4, right: 4), + alignment: Alignment.center, + decoration: BoxDecoration(color: MyColors.redColor, borderRadius: BorderRadius.circular(17)), + child: data.workListCounter.toString().toText10(color: Colors.white), + ), ); }, ), - Container( - width: double.infinity, - padding: const EdgeInsets.only(top: 31), - decoration: BoxDecoration( - color: Colors.white, - borderRadius: const BorderRadius.only(topRight: Radius.circular(50), topLeft: Radius.circular(50)), - border: Border.all(color: MyColors.lightGreyEDColor, width: 1), - ), - child: Column( - mainAxisSize: MainAxisSize.min, - children: [ - ServicesWidget(), - context.watch().isLoading ? const MarathonBannerShimmer().paddingAll(20) : const MarathonBanner().paddingOnly(left: 21, right: 21, bottom: 8, top: 8), - // context.watch().isTutorialLoading - // ? const MarathonBannerShimmer().paddingAll(20) - // : Container( - // padding: EdgeInsets.only(bottom: 12, top: 12), - // margin: EdgeInsets.only(left: 21, right: 21, bottom: 21, top: 8), - // width: double.infinity, - // alignment: Alignment.center, - // decoration: BoxDecoration( - // color: MyColors.backgroundBlackColor, - // borderRadius: BorderRadius.circular(20), - // border: Border.all(color: MyColors.lightGreyEDColor, width: 1), - // ), - // child: Column( - // crossAxisAlignment: CrossAxisAlignment.start, - // mainAxisSize: MainAxisSize.min, - // children: [ - // Text( - // "Tutorial:", - // style: TextStyle( - // fontSize: 11, - // fontStyle: FontStyle.italic, - // fontWeight: FontWeight.w600, - // color: MyColors.white.withOpacity(0.83), - // letterSpacing: -0.4, - // ), - // ), - // Text( - // context.read().tutorial?.tutorialName ?? "", - // overflow: TextOverflow.ellipsis, - // style: TextStyle( - // fontStyle: FontStyle.italic, - // fontSize: 19, - // fontWeight: FontWeight.bold, - // color: MyColors.white, - // height: 32 / 22, - // ), - // ), - // ], - // ), - // ).onPress(() { - // checkERMChannel(); - // // Navigator.pushNamed(context, AppRoutes.marathonTutorialScreen); - // }), - ], - ), - ), ], ), + label: LocaleKeys.workList.tr(), ), - ), - ), - ], - ), - drawer: SafeArea(child: AppDrawer(onLanguageChange: _onRefresh)), - bottomNavigationBar: SizedBox( - height: Platform.isAndroid ? 70 : 100, - child: BottomNavigationBar( - items: [ - BottomNavigationBarItem(icon: SvgPicture.asset("assets/icons/home.svg", color: currentIndex == 0 ? MyColors.grey3AColor : MyColors.grey98Color).paddingAll(4), label: LocaleKeys.home.tr()), - BottomNavigationBarItem( - icon: SvgPicture.asset("assets/icons/create_req.svg", color: currentIndex == 1 ? MyColors.grey3AColor : MyColors.grey98Color).paddingAll(4), - label: LocaleKeys.mowadhafhiRequest.tr(), - ), - BottomNavigationBarItem( - icon: Stack( - alignment: Alignment.centerLeft, - children: [ - SvgPicture.asset("assets/icons/work_list.svg", color: currentIndex == 2 ? MyColors.grey3AColor : MyColors.grey98Color).paddingAll(4), - Consumer( - builder: (BuildContext cxt, DashboardProviderModel data, Widget? child) { - if (data.workListCounter == 0) { - return const SizedBox(); - } - return Positioned( - right: 0, - top: 0, - child: Container( - padding: const EdgeInsets.only(left: 4, right: 4), - alignment: Alignment.center, - decoration: BoxDecoration(color: MyColors.redColor, borderRadius: BorderRadius.circular(17)), - child: data.workListCounter.toString().toText10(color: Colors.white), - ), - ); - }, - ), - ], + BottomNavigationBarItem( + icon: SvgPicture.asset("assets/icons/item_for_sale.svg", color: currentIndex == 3 ? MyColors.grey3AColor : MyColors.grey98Color).paddingAll(4), + label: LocaleKeys.itemsForSale.tr(), ), - label: LocaleKeys.workList.tr(), - ), - BottomNavigationBarItem( - icon: SvgPicture.asset("assets/icons/item_for_sale.svg", color: currentIndex == 3 ? MyColors.grey3AColor : MyColors.grey98Color).paddingAll(4), - label: LocaleKeys.itemsForSale.tr(), - ), - BottomNavigationBarItem( - icon: Stack( - alignment: Alignment.centerLeft, - children: [ - SvgPicture.asset( - "assets/icons/chat/chat.svg", - color: - !checkIfPrivilegedForChat() - ? MyColors.lightGreyE3Color - : currentIndex == 4 - ? MyColors.grey3AColor - : cProvider.disbaleChatForThisUser - ? MyColors.lightGreyE3Color - : MyColors.grey98Color, - ).paddingAll(4), - Consumer( - builder: (BuildContext cxt, ChatProviderModel data, Widget? child) { - return !checkIfPrivilegedForChat() - ? const SizedBox() - : Positioned( - right: 0, - top: 0, - child: Container( - padding: const EdgeInsets.only(left: 4, right: 4), - alignment: Alignment.center, - decoration: BoxDecoration(color: cProvider.disbaleChatForThisUser ? MyColors.pinkDarkColor : MyColors.redColor, borderRadius: BorderRadius.circular(17)), - child: data.chatUConvCounter.toString().toText10(color: Colors.white), - ), - ); - }, - ), - ], + BottomNavigationBarItem( + icon: Stack( + alignment: Alignment.centerLeft, + children: [ + SvgPicture.asset( + "assets/icons/chat/chat.svg", + color: + !checkIfPrivilegedForChat() + ? MyColors.lightGreyE3Color + : currentIndex == 4 + ? MyColors.grey3AColor + : cProvider.disbaleChatForThisUser + ? MyColors.lightGreyE3Color + : MyColors.grey98Color, + ).paddingAll(4), + Consumer( + builder: (BuildContext cxt, ChatProviderModel data, Widget? child) { + return !checkIfPrivilegedForChat() + ? const SizedBox() + : Positioned( + right: 0, + top: 0, + child: Container( + padding: const EdgeInsets.only(left: 4, right: 4), + alignment: Alignment.center, + decoration: BoxDecoration(color: cProvider.disbaleChatForThisUser ? MyColors.pinkDarkColor : MyColors.redColor, borderRadius: BorderRadius.circular(17)), + child: data.chatUConvCounter.toString().toText10(color: Colors.white), + ), + ); + }, + ), + ], + ), + label: LocaleKeys.chat.tr(), ), - label: LocaleKeys.chat.tr(), - ), - ], - currentIndex: currentIndex, - selectedLabelStyle: const TextStyle(fontSize: 10, color: MyColors.grey3AColor, fontWeight: FontWeight.w600), - unselectedLabelStyle: const TextStyle(fontSize: 10, color: MyColors.grey98Color, fontWeight: FontWeight.w600), - type: BottomNavigationBarType.fixed, - selectedItemColor: MyColors.grey3AColor, - backgroundColor: MyColors.backgroundColor, - selectedIconTheme: const IconThemeData(color: MyColors.grey3AColor, size: 28), - unselectedIconTheme: const IconThemeData(color: MyColors.grey98Color, size: 28), - onTap: (int index) { - if (index == 1) { - Navigator.pushNamed(context, AppRoutes.mowadhafhi); - } else if (index == 2) { - Navigator.pushNamed(context, AppRoutes.workList); - } else if (index == 3) { - Navigator.pushNamed(context, AppRoutes.itemsForSale); - } else if (index == 4) { - if (!cProvider.disbaleChatForThisUser && checkIfPrivilegedForChat()) { - Navigator.pushNamed(context, AppRoutes.chat); + ], + currentIndex: currentIndex, + selectedLabelStyle: const TextStyle(fontSize: 10, color: MyColors.grey3AColor, fontWeight: FontWeight.w600), + unselectedLabelStyle: const TextStyle(fontSize: 10, color: MyColors.grey98Color, fontWeight: FontWeight.w600), + type: BottomNavigationBarType.fixed, + selectedItemColor: MyColors.grey3AColor, + backgroundColor: MyColors.backgroundColor, + selectedIconTheme: const IconThemeData(color: MyColors.grey3AColor, size: 28), + unselectedIconTheme: const IconThemeData(color: MyColors.grey98Color, size: 28), + onTap: (int index) { + if (index == 1) { + Navigator.pushNamed(context, AppRoutes.mowadhafhi); + } else if (index == 2) { + Navigator.pushNamed(context, AppRoutes.workList); + } else if (index == 3) { + Navigator.pushNamed(context, AppRoutes.itemsForSale); + } else if (index == 4) { + if (!cProvider.disbaleChatForThisUser && checkIfPrivilegedForChat()) { + Navigator.pushNamed(context, AppRoutes.chat); + } } - } - }, + }, + ), ), ), ); diff --git a/pubspec.yaml b/pubspec.yaml index 084364a..e07bd99 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -56,7 +56,7 @@ dependencies: flutter_countdown_timer: ^4.1.0 platform_device_id_plus: ^1.0.7 - device_info_plus: ^9.0.0 + device_info_plus: ^11.5.0 image_picker: ^0.8.5+3 file_picker: ^8.3.1 geolocator: ^9.0.2 @@ -75,7 +75,7 @@ dependencies: flutter_rating_bar: ^4.0.1 auto_size_text: ^3.0.0 pull_to_refresh: ^2.0.0 - fl_chart: ^0.70.2 + fl_chart: ^0.66.0 # lottie json animations lottie: any # Marathon Card Swipe @@ -96,7 +96,7 @@ dependencies: #firebase_analytics: any #Chat Voice Message Recoding & Play - audio_waveforms: ^0.1.5+1 + audio_waveforms: ^1.3.0 rxdart: ^0.27.7 #Encryption @@ -110,7 +110,7 @@ dependencies: #Huawei Dependencies # huawei_hmsavailability: ^6.6.0+300 # huawei_location: 6.0.0+302 - huawei_location: ^6.11.0+301 + huawei_location: ^6.14.2+301 # huawei_push: ^6.7.0+300 huawei_map: From 7384f22942d5743a615dea3d6342c9fd6867f1da Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Thu, 31 Jul 2025 11:39:24 +0300 Subject: [PATCH 23/26] Update to stores, VersionID 9.2 --- android/app/build.gradle | 1 + lib/app_state/app_state.dart | 2 +- .../offers_and_discounts_details.dart | 50 ++++++------------- pubspec.yaml | 5 +- 4 files changed, 19 insertions(+), 39 deletions(-) diff --git a/android/app/build.gradle b/android/app/build.gradle index 8a1cccd..cd780fb 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -19,6 +19,7 @@ if (keystorePropertiesFile.exists()) { android { namespace 'hmg.cloudSolutions.mohem' compileSdk 36 // Changed from 36 to a supported version + ndkVersion '28.2.13676358' compileOptions { sourceCompatibility JavaVersion.VERSION_1_8 diff --git a/lib/app_state/app_state.dart b/lib/app_state/app_state.dart index 568dfaf..558ed09 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: 9.0, mobileType: Platform.isAndroid ? "android" : "ios"); + final PostParamsModel _postParamsInitConfig = PostParamsModel(channel: 31, versionID: 9.2, mobileType: Platform.isAndroid ? "android" : "ios"); void setPostParamsInitConfig() { isAuthenticated = false; diff --git a/lib/ui/screens/offers_and_discounts/offers_and_discounts_details.dart b/lib/ui/screens/offers_and_discounts/offers_and_discounts_details.dart index 70eecd2..be0582c 100644 --- a/lib/ui/screens/offers_and_discounts/offers_and_discounts_details.dart +++ b/lib/ui/screens/offers_and_discounts/offers_and_discounts_details.dart @@ -61,13 +61,7 @@ class _OffersAndDiscountsDetailsState extends State { // transitionOnUserGestures: true, child: RepaintBoundary( key: _globalKey, - child: ClipRRect( - borderRadius: BorderRadius.circular(6), - child: Image.network( - getOffersList[0].bannerImage ?? "", - fit: BoxFit.contain, - ), - ).paddingAll(12), + child: ClipRRect(borderRadius: BorderRadius.circular(6), child: Image.network(getOffersList[0].bannerImage ?? "", fit: BoxFit.contain)).paddingAll(12), ), ), 8.height, @@ -77,7 +71,6 @@ class _OffersAndDiscountsDetailsState extends State { Html( data: AppState().isArabic(context) ? getOffersList[0].descriptionAr! : getOffersList[0].descriptionEn ?? "", onLinkTap: (String? url, Map attributes, _) { - launchUrl(Uri.parse(url!)); }, ), @@ -88,19 +81,20 @@ class _OffersAndDiscountsDetailsState extends State { children: [ getOffersList[0].discountDescription!.toText16(isBold: true), InkWell( - onTap: () { - _shareOfferAsImage(); - }, - child: const Icon(Icons.share, color: MyColors.darkIconColor).paddingOnly(bottom: 4)) + onTap: () { + _shareOfferAsImage(); + }, + child: const Icon(Icons.share, color: MyColors.darkIconColor).paddingOnly(bottom: 4), + ), ], ).paddingOnly(left: 8, right: 8), getOffersList[0].isHasLocation == "true" ? InkWell( - onTap: () {}, - child: Row( - children: [const Icon(Icons.map_sharp, color: MyColors.darkIconColor).paddingOnly(bottom: 4), "Offer Location".toText16(isUnderLine: true).paddingOnly(left: 8)], - ).paddingOnly(left: 8, right: 8, top: 8), - ) + onTap: () {}, + child: Row( + children: [const Icon(Icons.map_sharp, color: MyColors.darkIconColor).paddingOnly(bottom: 4), "Offer Location".toText16(isUnderLine: true).paddingOnly(left: 8)], + ).paddingOnly(left: 8, right: 8, top: 8), + ) : 12.height, ], ).objectContainerView().paddingOnly(left: 21, right: 21, top: 21), @@ -135,11 +129,7 @@ class _OffersAndDiscountsDetailsState extends State { } void _scrollToTop() { - _scrollController.animateTo( - 0, - duration: const Duration(milliseconds: 500), - curve: Curves.linear, - ); + _scrollController.animateTo(0, duration: const Duration(milliseconds: 500), curve: Curves.linear); } List getItemsForSaleWidgets() { @@ -158,16 +148,7 @@ class _OffersAndDiscountsDetailsState extends State { Hero( tag: "ItemImage" + getOffersList.offersDiscountId.toString(), transitionOnUserGestures: true, - child: AspectRatio( - aspectRatio: 148 / 127, - child: ClipRRect( - borderRadius: BorderRadius.circular(6), - child: Image.network( - getOffersList.bannerImage ?? "", - fit: BoxFit.contain, - ), - ), - ), + child: AspectRatio(aspectRatio: 148 / 127, child: ClipRRect(borderRadius: BorderRadius.circular(6), child: Image.network(getOffersList.bannerImage ?? "", fit: BoxFit.contain))), ), 5.height, getOffersList.titleEn!.toText16(isBold: true, color: const Color(0xff2B353E), maxlines: 1), @@ -181,10 +162,7 @@ class _OffersAndDiscountsDetailsState extends State { // 16.height, getOffersList.discountDescription!.toText14(isBold: true, maxlines: 1), 8.height, - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [checkDate(getOffersList.endDate!), SvgPicture.asset("assets/images/arrow_next.svg").paddingOnly(bottom: 4)], - ), + Row(mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [checkDate(getOffersList.endDate!), SvgPicture.asset("assets/images/arrow_next.svg").paddingOnly(bottom: 4)]), ], ).objectContainerView().onPress(() { this.getOffersList[0] = getOffersList; diff --git a/pubspec.yaml b/pubspec.yaml index e07bd99..a3c0c99 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -16,8 +16,9 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev # In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion. # Read more about iOS versioning at # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html -#version: 3.3.01+300040 -version: 3.7.98+3 + +version: 3.6.7+300077 +#version: 3.9.0+1 environment: sdk: ^3.7.0 From c06c020fb32a5eadc15f12f28bcb5ff39de71973 Mon Sep 17 00:00:00 2001 From: aamir-csol Date: Sun, 12 Oct 2025 15:13:15 +0300 Subject: [PATCH 24/26] favorites search enabled. --- lib/ui/work_list/sheets/delegate_sheet.dart | 618 ++++++++++---------- 1 file changed, 296 insertions(+), 322 deletions(-) diff --git a/lib/ui/work_list/sheets/delegate_sheet.dart b/lib/ui/work_list/sheets/delegate_sheet.dart index d505099..de724a1 100644 --- a/lib/ui/work_list/sheets/delegate_sheet.dart +++ b/lib/ui/work_list/sheets/delegate_sheet.dart @@ -1,4 +1,5 @@ import 'dart:collection'; +import 'dart:convert'; import 'package:easy_localization/easy_localization.dart'; import 'package:flutter/cupertino.dart'; @@ -32,8 +33,16 @@ class DelegateSheet extends StatefulWidget { VoidCallback callBackFunc; List getNotificationRespondAttributes; - DelegateSheet( - {required this.title, required this.apiMode, this.notificationID, this.actionHistoryList, this.wFHistory, required this.callBackFunc, this.getNotificationRespondAttributes = const []}); + DelegateSheet({ + super.key, + required this.title, + required this.apiMode, + this.notificationID, + this.actionHistoryList, + this.wFHistory, + required this.callBackFunc, + this.getNotificationRespondAttributes = const [], + }); @override State createState() => _DelegateSheetState(); @@ -46,8 +55,8 @@ class _DelegateSheetState extends State { String? selectedFavLetter; String selectedType = "Workflow"; String inputRes = ""; - List? favLetters; List? favUsersList; + List? filteredFavUsersList = []; List? replacementList; bool isImageLoaded = false; @@ -57,14 +66,14 @@ class _DelegateSheetState extends State { super.initState(); if (widget.wFHistory != null) { widget.wFHistory = widget.wFHistory!.reversed.toList(); - var ids = widget.wFHistory!.map((e) => e.employeeID).toSet(); - widget.wFHistory!.retainWhere((x) => ids.remove(x.employeeID)); + Set ids = widget.wFHistory!.map((WFHistory e) => e.employeeID).toSet(); + widget.wFHistory!.retainWhere((WFHistory x) => ids.remove(x.employeeID)); } if (widget.actionHistoryList != null) { widget.actionHistoryList = widget.actionHistoryList!.reversed.toList(); - var ids = widget.actionHistoryList!.map((e) => e.uSERNAME).toSet(); - widget.actionHistoryList!.retainWhere((x) => ids.remove(x.uSERNAME)); + Set ids = widget.actionHistoryList!.map((GetActionHistoryList e) => e.uSERNAME).toSet(); + widget.actionHistoryList!.retainWhere((GetActionHistoryList x) => ids.remove(x.uSERNAME)); } } @@ -73,36 +82,96 @@ class _DelegateSheetState extends State { super.dispose(); } - Future fetchFavLetters({bool isNeedLoading = true}) async { - favLetters = []; + Future fetchFavUsers({bool isNeedLoading = true}) async { + favUsersList = []; + filteredFavUsersList = []; + if (isNeedLoading) Utils.showLoading(context); - List? favList = await WorkListApiClient().getFavoriteReplacementWithoutImage(); - List result = []; - favList!.forEach((element) { - result.add(element.employeeDisplayName![0]); - }); - favLetters = LinkedHashSet.from(result).toList(); - if (isNeedLoading) Utils.hideLoading(context); - setState(() { - favLetters!.sort((a, b) { - return a.toLowerCase().compareTo(b.toLowerCase()); - }); - }); - return null; + + try { + List? favList = await WorkListApiClient().getFavoriteReplacementWithoutImage(); + favUsersList = favList; + + if (favUsersList != null && favUsersList!.isNotEmpty) { + favUsersList!.sort((GetFavoriteReplacements a, GetFavoriteReplacements b) => (a.employeeDisplayName ?? '').toLowerCase().compareTo((b.employeeDisplayName ?? '').toLowerCase())); + filteredFavUsersList = favUsersList; + + if (isNeedLoading) Utils.hideLoading(context); + setState(() {}); + _fetchAndAttachUserImages(); + } else { + if (isNeedLoading) Utils.hideLoading(context); + setState(() {}); + } + } catch (e) { + if (isNeedLoading) Utils.hideLoading(context); + setState(() {}); + } } - Future fetchFavUsersList({bool isNeedLoading = true}) async { - if (isNeedLoading) Utils.showLoading(context); - favUsersList = await WorkListApiClient().getFavoriteReplacementWithImage(selectedFavLetter ?? ""); - if (isNeedLoading) Utils.hideLoading(context); - setState(() {}); - fetchFavUsersListNew(isNeedLoading: false); - return null; + Future _fetchAndAttachUserImages() async { + try { + List? tempList = await WorkListApiClient().getFavoriteReplacementWithImageNew(""); + + if (tempList != null && tempList.isNotEmpty && favUsersList != null) { + for (GetFavoriteReplacements element in favUsersList!) { + for (GetFavoriteReplacements element2 in tempList) { + if (element.userName == element2.userName && element2.employeeImage != null && element2.employeeImage!.isNotEmpty) { + element.employeeImage = element2.employeeImage; + } + } + } + filteredFavUsersList = favUsersList; + setState(() {}); + } + } catch (e) {} } + // Future fetchFavUsers({bool isNeedLoading = true}) async { + // favUsersList = []; + // if (isNeedLoading) Utils.showLoading(context); + // + // try { + // List? favList = await WorkListApiClient().getFavoriteReplacementWithoutImage(); + // favUsersList = favList; + // + // if (favUsersList != null && favUsersList!.isNotEmpty) { + // setState(() { + // favUsersList!.sort((GetFavoriteReplacements a, GetFavoriteReplacements b) => (a.employeeDisplayName ?? '').toLowerCase().compareTo((b.employeeDisplayName ?? '').toLowerCase())); + // }); + // if (isNeedLoading) Utils.hideLoading(context); + // + // List? tempList = await WorkListApiClient().getFavoriteReplacementWithImageNew(""); + // if (tempList != null && tempList.isNotEmpty) { + // for (GetFavoriteReplacements element in favUsersList!) { + // for (GetFavoriteReplacements element2 in tempList) { + // if (element.userName == element2.userName) { + // if (element2.employeeImage != null && element2.employeeImage!.isNotEmpty) { + // element.employeeImage = element2.employeeImage; + // } + // } + // } + // } + // setState(() {}); + // } + // } + // } catch (e) { + // // if (isNeedLoading) Utils.hideLoading(context); + // } + // } + + // Future fetchFavUsersList({bool isNeedLoading = true}) async { + // if (isNeedLoading) Utils.showLoading(context); + // favUsersList = await WorkListApiClient().getFavoriteReplacementWithImage(selectedFavLetter ?? ""); + // if (isNeedLoading) Utils.hideLoading(context); + // setState(() {}); + // fetchFavUsersListNew(isNeedLoading: false); + // return null; + // } + Future fetchFavUsersListNew({bool isNeedLoading = true}) async { if (isNeedLoading) Utils.showLoading(context); - favUsersList = await WorkListApiClient().getFavoriteReplacementWithImageNew(selectedFavLetter ?? ""); + filteredFavUsersList = await WorkListApiClient().getFavoriteReplacementWithImageNew(selectedFavLetter ?? ""); if (isNeedLoading) Utils.hideLoading(context); setState(() { isImageLoaded = true; @@ -112,18 +181,10 @@ class _DelegateSheetState extends State { void fetchChangeFav({required String email, required String employeName, required String image, required String userName, bool isFav = false, bool isNeedToRefresh = false}) async { Utils.showLoading(context); - favLetters = null; - selectedFavLetter = null; - GenericResponseModel model = await WorkListApiClient().changeFavoriteReplacements( - email: email, - employeName: employeName, - image: image, - userName: userName, - isFav: isFav, - ); + GenericResponseModel model = await WorkListApiClient().changeFavoriteReplacements(email: email, employeName: employeName, image: image, userName: userName, isFav: isFav); if (isNeedToRefresh) { - await fetchFavLetters(isNeedLoading: false); - if (favLetters != null) await fetchFavUsersList(isNeedLoading: false); + await fetchFavUsers(isNeedLoading: false); + // if (favUsersList != null) await fetchFavUsersList(isNeedLoading: false); } Utils.hideLoading(context); @@ -137,44 +198,58 @@ class _DelegateSheetState extends State { userName: selectedType == "Employee Name" ? inputRes : "", email: selectedType == "Employee Email" ? inputRes : "", ); + if (isNeedLoading) Utils.hideLoading(context); setState(() {}); return null; } + Future searchFavUser() async { + if (favUsersList != null && favUsersList!.isNotEmpty) { + if (inputRes.length > 3) { + filteredFavUsersList = + favUsersList!.where((GetFavoriteReplacements element) { + String query = inputRes.toLowerCase(); + return (element.employeeDisplayName != null && element.employeeDisplayName!.toLowerCase().contains(query)) || + (element.userName != null && element.userName!.toLowerCase().contains(query)) || + (element.emailAddress != null && element.emailAddress!.toLowerCase().contains(query)); + }).toList(); + } else { + filteredFavUsersList = favUsersList; + } + } else { + filteredFavUsersList = []; + } + + setState(() {}); + } + @override Widget build(BuildContext context) { - return Container( + return SizedBox( width: double.infinity, height: MediaQuery.of(context).size.height - 80, child: Column( - children: [ + children: [ Expanded( child: SingleChildScrollView( child: Padding( padding: const EdgeInsets.all(21), child: Column( crossAxisAlignment: CrossAxisAlignment.start, - children: [ + children: [ widget.title.toText24(isBold: true), 21.height, LocaleKeys.search.tr().toText16(), 11.height, Column( crossAxisAlignment: CrossAxisAlignment.end, - children: [ + children: [ Container( - padding: EdgeInsets.only(left: 8, right: 4, top: 6, bottom: 6), - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(15), - color: Colors.transparent, - border: Border.all( - color: Color(0xffefefef), - width: 1, - ), - ), + padding: const EdgeInsets.only(left: 8, right: 4, top: 6, bottom: 6), + decoration: BoxDecoration(borderRadius: BorderRadius.circular(15), color: Colors.transparent, border: Border.all(color: const Color(0xffefefef), width: 1)), child: Row( - children: [ + children: [ Expanded( child: InputWidget( "Search By " + selectedType, @@ -185,29 +260,18 @@ class _DelegateSheetState extends State { verticalPadding: 3, isInputTypeNum: selectedType == "Employee ID" ? true : false, isEnable: isNeedEnableTextField, - onChange: (v) { + onChange: (String v) { inputRes = v; + if (selectedType == "Favorites") { + searchFavUser(); + } }, ), ), + Container(height: 36, width: 1, color: const Color(0xffE5E5E5)), Container( - height: 36, - width: 1, - color: Color(0xffE5E5E5), - ), - Container( - padding: EdgeInsets.all(8), - child: Row( - children: [ - selectedType.toText12(), - 4.width, - const Icon( - Icons.keyboard_arrow_down, - color: Colors.black, - size: 16, - ), - ], - ), + padding: const EdgeInsets.all(8), + child: Row(children: [selectedType.toText12(), 4.width, const Icon(Icons.keyboard_arrow_down, color: Colors.black, size: 16)]), ).onPress(() { showMyBottomSheet( context, @@ -220,18 +284,16 @@ class _DelegateSheetState extends State { setState(() { isNeedEnableTextField = false; selectedFavLetter = null; - favLetters = null; - favUsersList = null; + filteredFavUsersList = null; }); } else if (value == "Favorites") { - isNeedEnableTextField = false; - fetchFavLetters(); + isNeedEnableTextField = true; + fetchFavUsers(); } else { setState(() { isNeedEnableTextField = true; selectedFavLetter = null; - favLetters = null; - favUsersList = null; + filteredFavUsersList = null; }); } }, @@ -241,143 +303,105 @@ class _DelegateSheetState extends State { ], ), ), - if (isNeedEnableTextField) + if (isNeedEnableTextField && selectedType != "Favorites") TextButton( onPressed: () { fetchUserByInput(); }, - child: const Text( - "Search", - style: TextStyle( - color: Colors.blue, - decoration: TextDecoration.underline, - ), - ), - ) + child: const Text("Search", style: TextStyle(color: Colors.blue, decoration: TextDecoration.underline)), + ), ], ), if (!isNeedEnableTextField) 12.height, Row( - children: [ + children: [ Expanded( - child: Container( + child: SizedBox( width: double.infinity, - child: selectedFavLetter == null && favLetters != null - ? Container( - width: double.infinity, - alignment: Alignment.center, - child: "Please select letter to see Fav results".toText12(), - ) - : favUsersList != null + child: + // selectedFavLetter == null && favLetters != null + // ? Container(width: double.infinity, alignment: Alignment.center, child: "Please select letter to see Fav results".toText12()) + // : + filteredFavUsersList != null ? ListView.separated( - itemBuilder: (context, index) { - return showFavUserItem(favUsersList![index]); - }, - separatorBuilder: (context, index) { - return Container( - color: MyColors.borderColor, - width: double.infinity, - height: 1, - margin: EdgeInsets.only(top: 8, bottom: 8), - ).onPress(() {}); - }, - physics: NeverScrollableScrollPhysics(), - shrinkWrap: true, - itemCount: favUsersList!.length, - padding: EdgeInsets.only(top: 8, bottom: 8), - ) + itemBuilder: (BuildContext context, int index) { + return showFavUserItem(filteredFavUsersList![index]); + }, + separatorBuilder: (BuildContext context, int index) { + return Container(color: MyColors.borderColor, width: double.infinity, height: 1, margin: const EdgeInsets.only(top: 8, bottom: 8)).onPress(() {}); + }, + physics: const NeverScrollableScrollPhysics(), + shrinkWrap: true, + itemCount: filteredFavUsersList!.length, + padding: const EdgeInsets.only(top: 8, bottom: 8), + ) : isNeedEnableTextField && replacementList == null - ? Container( - width: double.infinity, - alignment: Alignment.center, - child: "Search User".toText12(), - ) - : isNeedEnableTextField && replacementList!.length == 0 - ? Container( - width: double.infinity, - alignment: Alignment.center, - child: "No Data Found".toText12(), - ) - : isNeedEnableTextField - ? ListView.separated( - itemBuilder: (context, index) { - return showInputUserItem(replacementList![index]); - }, - separatorBuilder: (context, index) { - return Container( - color: MyColors.borderE3Color, - width: double.infinity, - height: 1, - margin: EdgeInsets.only(top: 8, bottom: 8), - ); - }, - physics: NeverScrollableScrollPhysics(), - shrinkWrap: true, - itemCount: replacementList!.length, - padding: EdgeInsets.only(top: 8, bottom: 8), - ) - : (widget.wFHistory != null - ? ListView.separated( - itemBuilder: (context, index) { - return showItgItem(widget.wFHistory![index]); - }, - separatorBuilder: (context, index) { - return Container( - color: MyColors.borderE3Color, - width: double.infinity, - height: 1, - margin: EdgeInsets.only(top: 8, bottom: 8), - ); - }, - physics: NeverScrollableScrollPhysics(), - shrinkWrap: true, - itemCount: widget.wFHistory!.length, - padding: EdgeInsets.only(top: 8, bottom: 8), - ) - : ListView.separated( - itemBuilder: (context, index) { - return showItem(widget.actionHistoryList![index]); - }, - separatorBuilder: (context, index) { - return Container( - color: MyColors.borderE3Color, - width: double.infinity, - height: 1, - margin: EdgeInsets.only(top: 8, bottom: 8), - ); - }, - physics: NeverScrollableScrollPhysics(), - shrinkWrap: true, - itemCount: widget.actionHistoryList!.length, - padding: EdgeInsets.only(top: 8, bottom: 8), - )), + ? Container(width: double.infinity, alignment: Alignment.center, child: "Search User".toText12()) + : isNeedEnableTextField && replacementList!.isEmpty + ? Container(width: double.infinity, alignment: Alignment.center, child: "No Data Found".toText12()) + : isNeedEnableTextField + ? ListView.separated( + itemBuilder: (BuildContext context, int index) { + return showInputUserItem(replacementList![index]); + }, + separatorBuilder: (BuildContext context, int index) { + return Container(color: MyColors.borderE3Color, width: double.infinity, height: 1, margin: const EdgeInsets.only(top: 8, bottom: 8)); + }, + physics: const NeverScrollableScrollPhysics(), + shrinkWrap: true, + itemCount: replacementList!.length, + padding: const EdgeInsets.only(top: 8, bottom: 8), + ) + : (widget.wFHistory != null + ? ListView.separated( + itemBuilder: (BuildContext context, int index) { + return showItgItem(widget.wFHistory![index]); + }, + separatorBuilder: (BuildContext context, int index) { + return Container(color: MyColors.borderE3Color, width: double.infinity, height: 1, margin: const EdgeInsets.only(top: 8, bottom: 8)); + }, + physics: const NeverScrollableScrollPhysics(), + shrinkWrap: true, + itemCount: widget.wFHistory!.length, + padding: const EdgeInsets.only(top: 8, bottom: 8), + ) + : ListView.separated( + itemBuilder: (BuildContext context, int index) { + return showItem(widget.actionHistoryList![index]); + }, + separatorBuilder: (BuildContext context, int index) { + return Container(color: MyColors.borderE3Color, width: double.infinity, height: 1, margin: const EdgeInsets.only(top: 8, bottom: 8)); + }, + physics: const NeverScrollableScrollPhysics(), + shrinkWrap: true, + itemCount: widget.actionHistoryList!.length, + padding: const EdgeInsets.only(top: 8, bottom: 8), + )), ), ), - if (favLetters != null) - Container( - width: 30, - // color: Colors.red, - child: ListView.separated( - itemBuilder: (context, index) { - return Container( - padding: EdgeInsets.all(8), - alignment: Alignment.center, - child: favLetters![index].toText14(color: selectedFavLetter == favLetters![index] ? MyColors.gradiantStartColor : Colors.black), - ).onPress(() { - selectedFavLetter = favLetters![index].toUpperCase(); - fetchFavUsersList(); - }); - }, - separatorBuilder: (context, index) { - return SizedBox( - height: 0, - ); - }, - physics: NeverScrollableScrollPhysics(), - shrinkWrap: true, - itemCount: favLetters!.length, - ), - ), + // if (favLetters != null) + // SizedBox( + // width: 30, + // // color: Colors.red, + // child: ListView.separated( + // itemBuilder: (BuildContext context, int index) { + // return Container( + // padding: const EdgeInsets.all(8), + // alignment: Alignment.center, + // child: favLetters![index].toText14(color: selectedFavLetter == favLetters![index] ? MyColors.gradiantStartColor : Colors.black), + // ).onPress(() { + // selectedFavLetter = favLetters![index].toUpperCase(); + // fetchFavUsersList(); + // }); + // }, + // separatorBuilder: (BuildContext context, int index) { + // return const SizedBox(height: 0); + // }, + // physics: const NeverScrollableScrollPhysics(), + // shrinkWrap: true, + // itemCount: favLetters!.length, + // ), + // ), ], ), ], @@ -385,22 +409,15 @@ class _DelegateSheetState extends State { ), ), ), - Container( - width: double.infinity, - height: 1, - color: MyColors.borderColor, - ), + Container(width: double.infinity, height: 1, color: MyColors.borderColor), DefaultButton( "Cancel", () { Navigator.pop(context); }, textColor: Colors.black, - colors: [ - Color(0xffE6E6E6), - Color(0xffE6E6E6), - ], - ).insideContainer + colors: const [Color(0xffE6E6E6), Color(0xffE6E6E6)], + ).insideContainer, ], ), ); @@ -410,25 +427,22 @@ class _DelegateSheetState extends State { return InkWell( onTap: () { Navigator.pop(context); - showMyBottomSheet(context, - callBackFunc: widget.callBackFunc, - child: SelectedItemSheet( - "Comment", - apiMode: widget.apiMode, - actionHistoryList: actionHistory, - notificationID: widget.notificationID, - isITGRequest: widget.wFHistory != null, - getNotificationRespondAttributes: widget.getNotificationRespondAttributes, - )); + showMyBottomSheet( + context, + callBackFunc: widget.callBackFunc, + child: SelectedItemSheet( + "Comment", + apiMode: widget.apiMode, + actionHistoryList: actionHistory, + notificationID: widget.notificationID, + isITGRequest: widget.wFHistory != null, + getNotificationRespondAttributes: widget.getNotificationRespondAttributes, + ), + ); }, child: Row( - children: [ - CircularAvatar( - url: actionHistory.eMPLOYEEIMAGE ?? "", - height: 30, - width: 30, - isImageBase64: true, - ), + children: [ + CircularAvatar(url: actionHistory.eMPLOYEEIMAGE ?? "", height: 30, width: 30, isImageBase64: true), 9.width, (actionHistory.nAME ?? "").toText12().expanded, IconButton( @@ -444,12 +458,8 @@ class _DelegateSheetState extends State { isFav: true, ); }, - icon: Icon( - Icons.star, - size: 16, - color: (actionHistory.isFavorite ?? false) ? MyColors.yellowColor : MyColors.borderColor, - ), - ) + icon: Icon(Icons.star, size: 16, color: (actionHistory.isFavorite ?? false) ? MyColors.yellowColor : MyColors.borderColor), + ), ], ), ); @@ -459,25 +469,18 @@ class _DelegateSheetState extends State { return InkWell( onTap: () { Navigator.pop(context); - showMyBottomSheet(context, - callBackFunc: widget.callBackFunc, - child: SelectedItgItemSheet( - "Comment", - apiMode: widget.apiMode, - wfHistory: wfHistory, - // notificationID: widget.notificationID, - )); - }, - child: Row( - children: [ - CircularAvatar( - height: 30, - width: 30, + showMyBottomSheet( + context, + callBackFunc: widget.callBackFunc, + child: SelectedItgItemSheet( + "Comment", + apiMode: widget.apiMode, + wfHistory: wfHistory, + // notificationID: widget.notificationID, ), - 9.width, - (wfHistory.name ?? "").toText12().expanded, - ], - ), + ); + }, + child: Row(children: [CircularAvatar(height: 30, width: 30), 9.width, (wfHistory.name ?? "").toText12().expanded]), ); } @@ -485,47 +488,31 @@ class _DelegateSheetState extends State { return InkWell( onTap: () { Navigator.pop(context); - showMyBottomSheet(context, - callBackFunc: widget.callBackFunc, - child: SelectedItemSheet( - "Comment", - apiMode: widget.apiMode, - favoriteReplacements: actionHistory, - notificationID: widget.notificationID, - isITGRequest: widget.wFHistory != null, - getNotificationRespondAttributes: widget.getNotificationRespondAttributes, - )); + showMyBottomSheet( + context, + callBackFunc: widget.callBackFunc, + child: SelectedItemSheet( + "Comment", + apiMode: widget.apiMode, + favoriteReplacements: actionHistory, + notificationID: widget.notificationID, + isITGRequest: widget.wFHistory != null, + getNotificationRespondAttributes: widget.getNotificationRespondAttributes, + ), + ); }, child: Row( - children: [ - actionHistory.employeeImage != "" - ? CircularAvatar( - url: actionHistory.employeeImage, - height: 40, - width: 40, - isImageBase64: (actionHistory.employeeImage != null || actionHistory.employeeImage!.isNotEmpty) ? true : false, - ) + children: [ + actionHistory.employeeImage != "" && actionHistory.employeeImage != null + ? CircularAvatar(url: actionHistory.employeeImage, height: 40, width: 40, isImageBase64: (actionHistory.employeeImage != null || actionHistory.employeeImage!.isNotEmpty) ? true : false) : isImageLoaded - ? CircularAvatar( - height: 40, - width: 40, - isImageBase64: false, - ) - : ClipRRect( - borderRadius: const BorderRadius.all( - Radius.circular(50), - ), - child: Image.network( - "https://play-lh.googleusercontent.com/NPo88ojmhah4HDiposucJmfQIop4z4xc8kqJK9ITO9o-yCab2zxIp7PPB_XPj2iUojo", - fit: BoxFit.cover, - height: 40, - width: 40, - ).toShimmer(), - ), + ? CircularAvatar(height: 40, width: 40, isImageBase64: false) + : ClipRRect( + borderRadius: const BorderRadius.all(Radius.circular(50)), + child: Image.network("https://play-lh.googleusercontent.com/NPo88ojmhah4HDiposucJmfQIop4z4xc8kqJK9ITO9o-yCab2zxIp7PPB_XPj2iUojo", fit: BoxFit.cover, height: 40, width: 40).toShimmer(), + ), 16.width, - Expanded( - child: (actionHistory.employeeDisplayName ?? "").toText12(), - ), + Expanded(child: (actionHistory.employeeDisplayName ?? "").toText12()), IconButton( onPressed: () { fetchChangeFav( @@ -537,12 +524,8 @@ class _DelegateSheetState extends State { isNeedToRefresh: true, ); }, - icon: Icon( - Icons.star, - size: 16, - color: MyColors.yellowColor, - ), - ) + icon: const Icon(Icons.star, size: 16, color: MyColors.yellowColor), + ), ], ), ); @@ -552,29 +535,24 @@ class _DelegateSheetState extends State { return InkWell( onTap: () { Navigator.pop(context); - showMyBottomSheet(context, - callBackFunc: widget.callBackFunc, - child: SelectedItemSheet( - LocaleKeys.comments.tr(), - apiMode: widget.apiMode, - replacementList: actionHistory, - notificationID: widget.notificationID, - isITGRequest: widget.wFHistory != null, - getNotificationRespondAttributes: widget.getNotificationRespondAttributes, - )); + showMyBottomSheet( + context, + callBackFunc: widget.callBackFunc, + child: SelectedItemSheet( + LocaleKeys.comments.tr(), + apiMode: widget.apiMode, + replacementList: actionHistory, + notificationID: widget.notificationID, + isITGRequest: widget.wFHistory != null, + getNotificationRespondAttributes: widget.getNotificationRespondAttributes, + ), + ); }, child: Row( - children: [ - CircularAvatar( - url: actionHistory.employeeImage, - height: 30, - width: 30, - isImageBase64: actionHistory.employeeImage != null ? true : false, - ), + children: [ + CircularAvatar(url: actionHistory.employeeImage, height: 30, width: 30, isImageBase64: actionHistory.employeeImage != null ? true : false), 16.width, - Expanded( - child: (actionHistory.employeeDisplayName ?? "").toText12(), - ), + Expanded(child: (actionHistory.employeeDisplayName ?? "").toText12()), IconButton( onPressed: () { actionHistory.isFavorite = !(actionHistory.isFavorite ?? false); @@ -587,12 +565,8 @@ class _DelegateSheetState extends State { isNeedToRefresh: false, ); }, - icon: Icon( - Icons.star, - size: 16, - color: (actionHistory.isFavorite ?? false) ? MyColors.yellowColor : MyColors.borderColor, - ), - ) + icon: Icon(Icons.star, size: 16, color: (actionHistory.isFavorite ?? false) ? MyColors.yellowColor : MyColors.borderColor), + ), ], ), ); From 413db572063f6b3b073dade7410dc45486cb5062 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Sun, 12 Oct 2025 15:39:17 +0300 Subject: [PATCH 25/26] favourites list changes --- lib/ui/work_list/sheets/delegate_sheet.dart | 24 ++++++++++----------- pubspec.yaml | 5 +++-- 2 files changed, 15 insertions(+), 14 deletions(-) diff --git a/lib/ui/work_list/sheets/delegate_sheet.dart b/lib/ui/work_list/sheets/delegate_sheet.dart index de724a1..ef38ce0 100644 --- a/lib/ui/work_list/sheets/delegate_sheet.dart +++ b/lib/ui/work_list/sheets/delegate_sheet.dart @@ -206,17 +206,17 @@ class _DelegateSheetState extends State { Future searchFavUser() async { if (favUsersList != null && favUsersList!.isNotEmpty) { - if (inputRes.length > 3) { - filteredFavUsersList = - favUsersList!.where((GetFavoriteReplacements element) { + // if (inputRes.length > 0) { + filteredFavUsersList = + favUsersList!.where((GetFavoriteReplacements element) { String query = inputRes.toLowerCase(); - return (element.employeeDisplayName != null && element.employeeDisplayName!.toLowerCase().contains(query)) || - (element.userName != null && element.userName!.toLowerCase().contains(query)) || - (element.emailAddress != null && element.emailAddress!.toLowerCase().contains(query)); + return (element.employeeDisplayName != null && element.employeeDisplayName!.toLowerCase().startsWith(query)) || + (element.userName != null && element.userName!.toLowerCase().contains(query)) || + (element.emailAddress != null && element.emailAddress!.toLowerCase().contains(query)); }).toList(); - } else { - filteredFavUsersList = favUsersList; - } + // } else { + // filteredFavUsersList = favUsersList; + // } } else { filteredFavUsersList = []; } @@ -283,7 +283,7 @@ class _DelegateSheetState extends State { if (value == "Workflow") { setState(() { isNeedEnableTextField = false; - selectedFavLetter = null; + // selectedFavLetter = null; filteredFavUsersList = null; }); } else if (value == "Favorites") { @@ -292,7 +292,7 @@ class _DelegateSheetState extends State { } else { setState(() { isNeedEnableTextField = true; - selectedFavLetter = null; + // selectedFavLetter = null; filteredFavUsersList = null; }); } @@ -322,7 +322,7 @@ class _DelegateSheetState extends State { // selectedFavLetter == null && favLetters != null // ? Container(width: double.infinity, alignment: Alignment.center, child: "Please select letter to see Fav results".toText12()) // : - filteredFavUsersList != null + filteredFavUsersList != null && selectedType == "Favorites" ? ListView.separated( itemBuilder: (BuildContext context, int index) { return showFavUserItem(filteredFavUsersList![index]); diff --git a/pubspec.yaml b/pubspec.yaml index a3c0c99..25f3c96 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -58,7 +58,7 @@ dependencies: platform_device_id_plus: ^1.0.7 device_info_plus: ^11.5.0 - image_picker: ^0.8.5+3 + image_picker: ^1.1.2 file_picker: ^8.3.1 geolocator: ^9.0.2 month_year_picker: ^0.5.0+1 @@ -92,7 +92,8 @@ dependencies: logging: ^1.0.1 swipe_to: ^1.0.2 flutter_webrtc: ^0.12.11 - camera: ^0.10.3 +# camera: ^0.10.3 + camera: ^0.11.2 flutter_local_notifications: ^18.0.1 #firebase_analytics: any From 04a2561f7fd99fa702abc2117970bc01501c7582 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Mon, 13 Oct 2025 17:34:43 +0300 Subject: [PATCH 26/26] Update to stores VersionID 9.2 --- lib/app_state/app_state.dart | 2 +- lib/classes/consts.dart | 4 ++-- lib/ui/landing/widget/services_widget.dart | 26 +++++++++++----------- pubspec.yaml | 4 ++-- 4 files changed, 18 insertions(+), 18 deletions(-) diff --git a/lib/app_state/app_state.dart b/lib/app_state/app_state.dart index 558ed09..e68e169 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: 9.2, mobileType: Platform.isAndroid ? "android" : "ios"); + final PostParamsModel _postParamsInitConfig = PostParamsModel(channel: 31, versionID: 9.3, mobileType: Platform.isAndroid ? "android" : "ios"); void setPostParamsInitConfig() { isAuthenticated = false; diff --git a/lib/classes/consts.dart b/lib/classes/consts.dart index 12635a6..6b43bbd 100644 --- a/lib/classes/consts.dart +++ b/lib/classes/consts.dart @@ -9,13 +9,13 @@ class ApiConsts { // static String baseUrl = "https://webservices.hmg.com"; // PreProd // static String baseUrl = "https://hmgwebservices.com"; // Live server - static String baseUrl = "https://mohemm.hmg.com"; // New Live server + // static String baseUrl = "https://mohemm.hmg.com"; // New Live server // // static String baseUrl = "https://uat.hmgwebservices.com"; // UAT ser343622ver // static String baseUrl = "http://10.20.200.111:1010/"; // static String baseUrl = "https://webservices.hmg.com"; // PreProd - // static String baseUrl = "https://mohemm.hmg.com"; + static String baseUrl = "https://mohemm.hmg.com"; // static String baseUrl = "https://hmgwebservices.com"; // Live server static String baseUrlServices = baseUrl + "/Services/"; // server diff --git a/lib/ui/landing/widget/services_widget.dart b/lib/ui/landing/widget/services_widget.dart index 7d2c2b2..426765d 100644 --- a/lib/ui/landing/widget/services_widget.dart +++ b/lib/ui/landing/widget/services_widget.dart @@ -254,22 +254,22 @@ class ServicesWidget extends StatelessWidget { } } else { if (menuEntry.menuName == "HMG_TICKET_REQUESTS") { - Utils.showLoading(context); - TicketBookingResult response = await pro.fetchTicketBooking(); - Utils.hideLoading(context); - if (response.success) { - SSOAuthModel? ssoToken = await pro.fetchSSOAuthRedirection(clientID: response.clientId); - if (ssoToken != null) { - logger.d(ssoToken.data!.toJson()); - logger.d(ssoToken.data!.accessToken); - dynamic url = await pro.fetchURLRedirection(token: ssoToken.data!.accessToken!); - Navigator.push(context, MaterialPageRoute(builder: (context) => SsoLoginWebView(url: url ?? "", jwtToken: ssoToken.data!.accessToken!))); - } - } else { + // Utils.showLoading(context); + // TicketBookingResult response = await pro.fetchTicketBooking(); + // Utils.hideLoading(context); + // if (response.success) { + // SSOAuthModel? ssoToken = await pro.fetchSSOAuthRedirection(clientID: response.clientId); + // if (ssoToken != null) { + // logger.d(ssoToken.data!.toJson()); + // logger.d(ssoToken.data!.accessToken); + // dynamic url = await pro.fetchURLRedirection(token: ssoToken.data!.accessToken!); + // Navigator.push(context, MaterialPageRoute(builder: (context) => SsoLoginWebView(url: url ?? "", jwtToken: ssoToken.data!.accessToken!))); + // } + // } else { List _menuList = pro.getMenuEntriesList?.where((element) => element.parentMenuName == menuEntry.menuName && (element.menuEntryType == "FUNCTION" || element.menuEntryType == "MENU")).toList() ?? []; Navigator.pushNamed(context, AppRoutes.servicesMenuListScreen, arguments: ServicesMenuListScreenParams(menuEntry.prompt!, _menuList.isEmpty ? menuList : _menuList)); - } + // } } else { List _menuList = pro.getMenuEntriesList?.where((element) => element.parentMenuName == menuEntry.menuName && (element.menuEntryType == "FUNCTION" || element.menuEntryType == "MENU")).toList() ?? []; diff --git a/pubspec.yaml b/pubspec.yaml index 25f3c96..7e97774 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -17,8 +17,8 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev # Read more about iOS versioning at # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html -version: 3.6.7+300077 -#version: 3.9.0+1 +version: 3.6.8+300078 +#version: 3.9.1+1 environment: sdk: ^3.7.0