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 c4619f4..1901f3a 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" } @@ -19,6 +19,7 @@ if (keystorePropertiesFile.exists()) { android { namespace 'hmg.cloudSolutions.mohem' compileSdk 36 + ndkVersion '28.2.13676358' kotlinOptions { @@ -33,6 +34,7 @@ android { // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). applicationId "hmg.cloudSolutions.mohem" minSdkVersion 30 + targetSdk 35 targetSdk = flutter.targetSdkVersion versionCode flutter.versionCode versionName flutter.versionName @@ -43,6 +45,10 @@ android { coreLibraryDesugaringEnabled true } + buildFeatures{ + buildConfig true + } + signingConfigs { release { keyAlias keystoreProperties['keyAlias'] @@ -71,5 +77,8 @@ flutter { dependencies { implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:2.1.20" implementation 'androidx.multidex:multidex:2.0.1' - coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:2.0.3' + coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:2.1.5' + implementation 'com.huawei.hms:push:6.11.0.300' + + } diff --git a/android/app/src/debug/AndroidManifest.xml b/android/app/src/debug/AndroidManifest.xml index 11decc3..443c7bf 100644 --- a/android/app/src/debug/AndroidManifest.xml +++ b/android/app/src/debug/AndroidManifest.xml @@ -1,5 +1,5 @@ + > diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml index 8edb0f0..132ad69 100644 --- a/android/app/src/main/AndroidManifest.xml +++ b/android/app/src/main/AndroidManifest.xml @@ -1,8 +1,8 @@ + > - + diff --git a/android/app/src/main/kotlin/com/mohem_flutter_app/MainActivity.kt b/android/app/src/main/kotlin/hmg/cloudSolutions/mohem/MainActivity.kt similarity index 93% rename from android/app/src/main/kotlin/com/mohem_flutter_app/MainActivity.kt rename to android/app/src/main/kotlin/hmg/cloudSolutions/mohem/MainActivity.kt index 0023ec9..15133a2 100644 --- a/android/app/src/main/kotlin/com/mohem_flutter_app/MainActivity.kt +++ b/android/app/src/main/kotlin/hmg/cloudSolutions/mohem/MainActivity.kt @@ -1,4 +1,4 @@ -package com.mohem_flutter_app +package hmg.cloudSolutions.mohem //import io.flutter.embedding.android.FlutterActivity // diff --git a/android/app/src/profile/AndroidManifest.xml b/android/app/src/profile/AndroidManifest.xml index 50ab38d..443c7bf 100644 --- a/android/app/src/profile/AndroidManifest.xml +++ b/android/app/src/profile/AndroidManifest.xml @@ -1,5 +1,5 @@ + > 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 15303ee..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,7 +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 +} + +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/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..08b00da 100644 --- a/assets/langs/ar-SA.json +++ b/assets/langs/ar-SA.json @@ -615,5 +615,10 @@ "searchByUserName": "البحث بواسطة اسم المستخدم", "shareScreen": "مشاركة الشاشة", "start":"يبدأ", - "about":"عن" + "about":"عن", + "explore": "يستكشف", + "mazaya": "مازيا", + "benefits": "فوائد", + "mazayaDesc": "اكتشف الخصومات والعروض الخاصة المتاحة للموظفين", + "viewallofferMazaya" : "أعرض كل المزايا" } \ No newline at end of file diff --git a/assets/langs/en-US.json b/assets/langs/en-US.json index 559b9c9..ff30994 100644 --- a/assets/langs/en-US.json +++ b/assets/langs/en-US.json @@ -613,5 +613,11 @@ "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", + "viewallofferMazaya" : "View All Offers" + } \ No newline at end of file diff --git a/ios/Runner.xcodeproj/project.pbxproj b/ios/Runner.xcodeproj/project.pbxproj index a9aed20..6aac74d 100644 --- a/ios/Runner.xcodeproj/project.pbxproj +++ b/ios/Runner.xcodeproj/project.pbxproj @@ -144,7 +144,7 @@ 9705A1C41CF9048500538489 /* Embed Frameworks */, 3B06AD1E1E4923F5004D2608 /* Thin Binary */, C4CFBC4C5CAC00182015ACD5 /* [CP] Embed Pods Frameworks */, - 6C6E76E4FB19FAF11C24005D /* [CP] Copy Pods Resources */, + EF29CE25BB57F5AA48CE1136 /* [CP] Copy Pods Resources */, ); buildRules = ( ); 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/api/api_client.dart b/lib/api/api_client.dart index e3cbee1..fb415d4 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); } @@ -93,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/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/api/dashboard_api_client.dart b/lib/api/dashboard_api_client.dart index 1d45bbf..ae5fda8 100644 --- a/lib/api/dashboard_api_client.dart +++ b/lib/api/dashboard_api_client.dart @@ -1,8 +1,10 @@ import 'dart:async'; import 'dart:convert'; +import 'dart:io'; import 'package:easy_localization/easy_localization.dart'; import 'package:http/http.dart' as http; +import 'package:device_info_plus/device_info_plus.dart'; import 'package:mohem_flutter_app/api/api_client.dart'; import 'package:mohem_flutter_app/app_state/app_state.dart'; import 'package:mohem_flutter_app/classes/consts.dart'; @@ -17,6 +19,7 @@ import 'package:mohem_flutter_app/models/itg/itg_main_response.dart'; import 'package:mohem_flutter_app/models/itg/itg_response_model.dart'; import 'package:mohem_flutter_app/models/sso_auth_model.dart'; import 'package:platform_device_id_plus/platform_device_id.dart'; +// import 'package:platform_device_id/platform_device_id.dart'; // import 'package:platform_device_id/platform_device_id.dart'; import 'package:uuid/uuid.dart'; @@ -254,10 +257,17 @@ class DashboardApiClient { }) async { String url = "${ApiConsts.swpRest}AuthenticateAndSwipeUserSupportNFC"; var uuid = Uuid(); + String? deviceId = ""; // Generate a v4 (random) id - + if (Platform.isAndroid) { + AndroidDeviceInfo androidInfo = await DeviceInfoPlugin().androidInfo; + deviceId = androidInfo.id; + } else if (Platform.isIOS) { + IosDeviceInfo iosInfo = await DeviceInfoPlugin().iosInfo; + deviceId = iosInfo.identifierForVendor; + } Map postParams = { - "UID": await PlatformDeviceId.getDeviceId, //uuid.v4(), //Mobile Id + "UID": deviceId, //uuid.v4(), //Mobile Id // "UID": uuid.v4(), //Mobile Id "Latitude": lat, "Longitude": long, diff --git a/lib/app_state/app_state.dart b/lib/app_state/app_state.dart index 7269cd5..e68e169 100644 --- a/lib/app_state/app_state.dart +++ b/lib/app_state/app_state.dart @@ -90,8 +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: 9.3, mobileType: Platform.isAndroid ? "android" : "ios"); void setPostParamsInitConfig() { isAuthenticated = false; 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 c7f62d8..6b43bbd 100644 --- a/lib/classes/consts.dart +++ b/lib/classes/consts.dart @@ -6,16 +6,16 @@ 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 - // 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 @@ -68,8 +68,6 @@ class ApiConsts { static String marathonGetMarathonersCount = marathonBaseUrl + "Participant/GetRemainingParticipants"; static String marathonGetTutorial = marathonBaseUrl + "tutorial/GetTutorialNotification"; - - //DummyCards for the UI static int tabletMinLength = 500; 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/classes/notifications.dart b/lib/classes/notifications.dart index 00b732e..058606c 100644 --- a/lib/classes/notifications.dart +++ b/lib/classes/notifications.dart @@ -34,7 +34,7 @@ class AppNotifications { if (Platform.isIOS) { await flutterLocalNotificationsPlugin.resolvePlatformSpecificImplementation()?.requestPermissions(alert: true, badge: true, sound: true); } else if (Platform.isAndroid) { - AndroidFlutterLocalNotificationsPlugin? androidImplementation = flutterLocalNotificationsPlugin.resolvePlatformSpecificImplementation(); + AndroidFlutterLocalNotificationsPlugin? androidImplementation = flutterLocalNotificationsPlugin.resolvePlatformSpecificImplementation(); bool? granted = await androidImplementation?.requestNotificationsPermission(); if (granted == false) { if (kDebugMode) { diff --git a/lib/dialogs/otp_dialog.dart b/lib/dialogs/otp_dialog.dart index 7265d97..da2611e 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) { @@ -202,8 +203,13 @@ class OtpDialog { ), errorBorder: OutlineInputBorder( borderRadius: const BorderRadius.all(Radius.circular(10.0)), - borderSide: BorderSide(color: Theme.of(context).colorScheme.error), + borderSide: BorderSide(color: Colors.red), ), + // focusedErrorBorder: OutlineInputBorder( + // borderRadius: const BorderRadius.all(Radius.circular(10.0)), + // borderSide: BorderSide(color: Colors.red), + // // borderSide: BorderSide(color: Theme.of(context).colorScheme.error), + // ), focusedErrorBorder: OutlineInputBorder( borderRadius: const BorderRadius.all(Radius.circular(10.0)), borderSide: BorderSide(color: Theme.of(context).colorScheme.error), diff --git a/lib/generated/codegen_loader.g.dart b/lib/generated/codegen_loader.g.dart index 0e2cfbf..f3fda6a 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,15 @@ class CodegenLoader extends AssetLoader{ "members": "الأعضاء", "searchByUserName": "البحث بواسطة اسم المستخدم", "shareScreen": "مشاركة الشاشة", - "start":"يبدأ", - "about":"عن" + "start": "يبدأ", + "about": "عن", + "explore": "يستكشف", + "mazaya": "مازيا", + "benefits": "فوائد", + "mazayaDesc": "اكتشف الخصومات والعروض الخاصة المتاحة للموظفين", + "viewallofferMazaya": "أعرض كل المزايا" }; -static const Map en_US = { +static const Map _en_US = { "mohemm": "Mohemm", "english": "English", "arabic": "عربي", @@ -725,6 +730,7 @@ static const Map en_US = { "whatsapp": "Whatsapp", "reject": "Reject", "approve": "Approve", + "generate": "Generate", "cancel": "Cancel", "requestedItems": "Requested Items", "request": "Request", @@ -1197,7 +1203,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 +1248,13 @@ 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", + "viewallofferMazaya": "View All Offers" }; -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..b748380 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,11 @@ 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'; + static const viewallofferMazaya = 'viewallofferMazaya'; + } 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/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/provider/chat_provider_model.dart b/lib/provider/chat_provider_model.dart index 474fb51..4c19817 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; } } @@ -1653,7 +1659,7 @@ class ChatProviderModel with ChangeNotifier, DiagnosticableTreeMixin { void sRecoding() async { isVoiceMsg = true; recorderController.reset(); - await recorderController.record(path); + await recorderController.record(path: path); _recodeDuration = 0; _startTimer(); isRecoding = !isRecoding; @@ -1685,7 +1691,7 @@ class ChatProviderModel with ChangeNotifier, DiagnosticableTreeMixin { File file = File(path!); file.readAsBytesSync(); path = file.path; - await playerController.preparePlayer(file.path, 1.0); + await playerController.preparePlayer(path:file.path, volume: 1.0); _timer?.cancel(); notifyListeners(); } diff --git a/lib/provider/dashboard_provider_model.dart b/lib/provider/dashboard_provider_model.dart index 9e421ab..6e441b3 100644 --- a/lib/provider/dashboard_provider_model.dart +++ b/lib/provider/dashboard_provider_model.dart @@ -300,7 +300,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/theme/app_theme.dart b/lib/theme/app_theme.dart index b1a5570..f228600 100644 --- a/lib/theme/app_theme.dart +++ b/lib/theme/app_theme.dart @@ -16,84 +16,36 @@ class AppTheme { }, ), hintColor: Colors.grey[400], - colorScheme: ColorScheme.fromSwatch( - accentColor: MyColors.backgroundColor, - errorColor: const Color.fromRGBO(235, 80, 60, 1.0), - ), + 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, + // backgroundColor: const Color.fromRGBO(255, 255, 255, 1), highlightColor: Colors.grey[100]!.withOpacity(0.4), splashColor: Colors.transparent, primaryColor: primaryColor, primaryColorDark: primaryColor, - buttonTheme: ButtonThemeData( - buttonColor: Colors.black, - ), - switchTheme: SwitchThemeData( - thumbColor: MaterialStateProperty.resolveWith( - (Set states) { - if (states.contains(MaterialState.disabled)) { - return null; - } - if (states.contains(MaterialState.selected)) { - return secondaryColor; - } - return null; - }), - trackColor: MaterialStateProperty.resolveWith( - (Set states) { - if (states.contains(MaterialState.disabled)) { - return null; - } - if (states.contains(MaterialState.selected)) { - return secondaryColor; - } - return null; - }), - ), - radioTheme: RadioThemeData( - fillColor: MaterialStateProperty.resolveWith( - (Set states) { - if (states.contains(MaterialState.disabled)) { - return null; - } - if (states.contains(MaterialState.selected)) { - return secondaryColor; - } - return null; - }), - ), - checkboxTheme: CheckboxThemeData( - fillColor: MaterialStateProperty.resolveWith( - (Set states) { - if (states.contains(MaterialState.disabled)) { - return null; - } - if (states.contains(MaterialState.selected)) { - return secondaryColor; - } - return null; - }), - ), + // toggleableActiveColor: secondaryColor, indicatorColor: secondaryColor, bottomSheetTheme: const BottomSheetThemeData( backgroundColor: Color(0xFFE0E0E0), ), + primaryTextTheme: const TextTheme( + // bodyText2: TextStyle(color: Colors.white), + ), iconTheme: const IconThemeData(color: MyColors.darkIconColor), textTheme: const TextTheme( - bodyMedium: TextStyle(color: Colors.black, letterSpacing: 0.6), - headlineSmall: TextStyle(color: Colors.white, letterSpacing: 0.6), - headlineMedium: 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( - systemOverlayStyle: const SystemUiOverlayStyle( - statusBarBrightness: Brightness.light, - ), + appBarTheme: AppBarTheme( color: const Color(0xff515A5D), + 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 cb1e784..cce9d3b 100644 --- a/lib/ui/attendance/monthly_attendance_screen.dart +++ b/lib/ui/attendance/monthly_attendance_screen.dart @@ -301,6 +301,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'; @@ -310,9 +311,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/chat/chat_home_screen.dart b/lib/ui/chat/chat_home_screen.dart index 2f392f3..846f19d 100644 --- a/lib/ui/chat/chat_home_screen.dart +++ b/lib/ui/chat/chat_home_screen.dart @@ -214,8 +214,13 @@ class _ChatHomeScreenState extends State { }, ), floatingActionButton: FloatingActionButton( +// <<<<<<< HEAD +// elevation: 0, +// backgroundColor : Colors.transparent, +// ======= backgroundColor: Colors.transparent, elevation: 0, + child: Container( width: 60, height: 60, 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/landing/dashboard_screen.dart b/lib/ui/landing/dashboard_screen.dart index 8c0e415..1422fb2 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(); @@ -152,7 +153,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) { @@ -243,440 +244,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: 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); - })) - .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: [ - 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/lib/ui/landing/itg/its_add_screen_video_image.dart b/lib/ui/landing/itg/its_add_screen_video_image.dart index 6e1358c..103fde1 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,45 @@ 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, mode: LaunchMode.externalApplication).catchError((err) { + // print(err); + Utils.showToast('Could not launch'); + }); + 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 faa25ac..5c76092 100644 --- a/lib/ui/login/verify_last_login_screen.dart +++ b/lib/ui/login/verify_last_login_screen.dart @@ -5,8 +5,8 @@ import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:flutter_svg/svg.dart'; import 'package:local_auth/local_auth.dart'; -import 'package:local_auth_android/local_auth_android.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'; @@ -66,16 +66,17 @@ class _VerifyLastLoginScreenState extends State { return Scaffold( appBar: AppBar( + surfaceTintColor: Colors.transparent, backgroundColor: Colors.transparent, automaticallyImplyLeading: false, - title: - (mobileLoginInfoListModel?.businessCardPrivilege ?? false) - ? LocaleKeys.viewBusinessCard.tr().toText12(color: MyColors.textMixColor, isUnderLine: true).onPress(() { - showMDialog(context, child: const BusinessCardDialog()); - }) - : Container(), + title: (mobileLoginInfoListModel?.businessCardPrivilege ?? false) + ? LocaleKeys.viewBusinessCard.tr().toText12(color: MyColors.textMixColor, isUnderLine: true).onPress(() { + showMDialog(context, child: const BusinessCardDialog()); + }) + : Container(), actions: [ Center( + child: LocaleKeys.employeeDigitalID.tr().toText12(color: MyColors.textMixColor, isUnderLine: true).onPress(() { showMDialog(context, child: EmployeeDigitialIdDialog()); }), @@ -111,7 +112,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, @@ -206,18 +207,25 @@ 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'); + + // 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', - options: const AuthenticationOptions(useErrorDialogs: true, stickyAuth: true, biometricOnly: true), - authMessages: [iosStrings, const AndroidAuthMessages()], + 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); @@ -228,48 +236,60 @@ 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) && _flag == 4 && !checkBiometricIsAvailable(BiometricType.strong)); +// <<<<<<< HEAD + 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); + } +// ======= +// bool isDisable = (_flag == 3 && !checkBiometricIsAvailable(BiometricType.face) || +// _flag == 4 && !checkBiometricIsAvailable(BiometricType.fingerprint) && _flag == 4 && !checkBiometricIsAvailable(BiometricType.face)); +// // >>>>>>> master return InkWell( - onTap: - isDisable - ? null - : () async { - if (_flag == 0) { - setState(() { - // isMoreOption = true; - }); - } else { - if (_flag == 3 || _flag == 4) { - bool authenticateWithFaceAndTouchID = await loginWithFaceIDAndBiometrics(); - if (!authenticateWithFaceAndTouchID) { - return; + onTap: isDisable + ? null + : () async { + if (_flag == 0) { + setState(() { + // isMoreOption = true; + }); + } else { + if (_flag == 3 || _flag == 4) { + bool authenticateWithFaceAndTouchID = await loginWithFaceIDAndBiometrics(); + if (!authenticateWithFaceAndTouchID) { + return; + } else { + if (mobileLoginInfoListModel!.loginType == 3 || mobileLoginInfoListModel!.loginType == 4) { + // bool authenticateWithFaceAndTouchID = await loginWithFaceIDAndBiometrics(); + // if (!authenticateWithFaceAndTouchID) { + // return; + // } else { + // performApiCall(_title, _icon, _flag, isDirectLogin: true); + // } + performApiCall(_title, _icon, _flag, _flag, isDirectLogin: true); } else { - if (mobileLoginInfoListModel!.loginType == 3 || mobileLoginInfoListModel!.loginType == 4) { - // bool authenticateWithFaceAndTouchID = await loginWithFaceIDAndBiometrics(); - // if (!authenticateWithFaceAndTouchID) { - // return; - // } else { - // performApiCall(_title, _icon, _flag, isDirectLogin: true); - // } - performApiCall(_title, _icon, _flag, _flag, isDirectLogin: true); - } else { - isNeedVerifyWithFaceIDAndBiometrics = true; - selectedFlag = _flag; - setState(() { - return; - }); - } + isNeedVerifyWithFaceIDAndBiometrics = true; + selectedFlag = _flag; + setState(() { + return; + }); } - } else { - if (isNeedVerifyWithFaceIDAndBiometrics) - performApiCall(_title, _icon, selectedFlag, _flag); - else - performApiCall(_title, _icon, _flag, _flag); } + } else { + if (isNeedVerifyWithFaceIDAndBiometrics) + performApiCall(_title, _icon, selectedFlag, _flag); + else + performApiCall(_title, _icon, _flag, _flag); } - }, + } + }, child: Container( padding: const EdgeInsets.only(left: 20, right: 20, bottom: 15, top: 28), decoration: BoxDecoration( @@ -393,15 +413,15 @@ class _VerifyLastLoginScreenState extends State { } } - // - // formatDate(date) { - // return date; - // return DateFormat('MMM dd, yyy, kk:mm').format(date); - // } - // - // showLoader(bool isTrue) { - // setState(() { - // // isLoading = isTrue; - // }); - // } +// +// formatDate(date) { +// return date; +// return DateFormat('MMM dd, yyy, kk:mm').format(date); +// } +// +// showLoader(bool isTrue) { +// setState(() { +// // isLoading = isTrue; +// }); +// } } diff --git a/lib/ui/login/verify_login_screen.dart b/lib/ui/login/verify_login_screen.dart index ea8439e..e0015e0 100644 --- a/lib/ui/login/verify_login_screen.dart +++ b/lib/ui/login/verify_login_screen.dart @@ -4,9 +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/local_auth.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'; import 'package:mohem_flutter_app/classes/colors.dart'; @@ -518,14 +518,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', - options: const AuthenticationOptions( - useErrorDialogs: true, - stickyAuth: true, - biometricOnly: true, - ), - authMessages: [iosStrings, const AndroidAuthMessages()]); + 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); @@ -535,25 +532,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) && _flag == 4 && !checkBiometricIsAvailable(BiometricType.strong)); - // bool isDisable = false; - // switch (_flag) { - // case 3: - // isDisable = !(checkBiometricIsAvailable(BiometricType.face) || - // checkBiometricIsAvailable(BiometricType.weak)); - // break; - // case 4: - // isDisable = !(checkBiometricIsAvailable(BiometricType.fingerprint) || - // checkBiometricIsAvailable(BiometricType.strong)); - // break; - // } - // // bool isDisable = ((_flag == 3 && - // // (!checkBiometricIsAvailable(BiometricType.face) || - // // !checkBiometricIsAvailable(BiometricType.weak))) || - // // (_flag == 4 && - // // (!checkBiometricIsAvailable(BiometricType.fingerprint) || - // // !checkBiometricIsAvailable(BiometricType.strong)))); + 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/screens/offers_and_discounts/offers_and_discounts_details.dart b/lib/ui/screens/offers_and_discounts/offers_and_discounts_details.dart index d791a18..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, @@ -87,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), @@ -134,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() { @@ -157,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), @@ -180,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/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/ui/work_list/item_history_screen.dart b/lib/ui/work_list/item_history_screen.dart index 92516e8..4bc6579 100644 --- a/lib/ui/work_list/item_history_screen.dart +++ b/lib/ui/work_list/item_history_screen.dart @@ -211,7 +211,7 @@ class _ItemHistoryScreenState extends State { interval: 1, getTitlesWidget: (double value, TitleMeta meta) { return SideTitleWidget( - meta: meta, + axisSide: meta.axisSide, child: Text(reversedList[int.parse(meta.formattedValue)].cREATIONDATE!, style: TextStyle(fontSize: 10)), ); })), @@ -222,7 +222,7 @@ class _ItemHistoryScreenState extends State { interval: 1, getTitlesWidget: (double value, TitleMeta meta) { return SideTitleWidget( - meta: meta, + axisSide: meta.axisSide, child: Text(meta.formattedValue, style: TextStyle(fontSize: 10)), ); })), @@ -233,7 +233,7 @@ class _ItemHistoryScreenState extends State { reservedSize: 15, getTitlesWidget: (double value, TitleMeta meta) { return SideTitleWidget( - meta: meta, + axisSide: meta.axisSide, child: Text("", style: TextStyle(fontSize: 10)), ); })), diff --git a/lib/ui/work_list/itg_detail_screen.dart b/lib/ui/work_list/itg_detail_screen.dart index dec413f..fdfe19c 100644 --- a/lib/ui/work_list/itg_detail_screen.dart +++ b/lib/ui/work_list/itg_detail_screen.dart @@ -88,24 +88,37 @@ 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( // "{\"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); + Future.delayed(Duration.zero); + setState(() { + controller.jumpToPage(0); + }); + Utils.hideLoading(context); } + } else { + timeCardSummaryData = ItgTimeCardSummaryData(); + Utils.hideLoading(context); + setState(() { + controller.jumpToPage(0); + }); } - Utils.hideLoading(context); - setState(() { - controller.jumpToPage(0); - }); + } 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/ui/work_list/itg_fragments/approval_level_fragment.dart b/lib/ui/work_list/itg_fragments/approval_level_fragment.dart index 09e44d4..d7d9c7e 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 || 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" || wFHistory[index + 1].date! == "") { + 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; 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/lib/ui/work_list/sheets/delegate_sheet.dart b/lib/ui/work_list/sheets/delegate_sheet.dart index d505099..ef38ce0 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 > 0) { + filteredFavUsersList = + favUsersList!.where((GetFavoriteReplacements element) { + String query = inputRes.toLowerCase(); + 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 = []; + } + + 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, @@ -219,19 +283,17 @@ class _DelegateSheetState extends State { if (value == "Workflow") { setState(() { isNeedEnableTextField = false; - selectedFavLetter = null; - favLetters = null; - favUsersList = null; + // selectedFavLetter = null; + filteredFavUsersList = null; }); } else if (value == "Favorites") { - isNeedEnableTextField = false; - fetchFavLetters(); + isNeedEnableTextField = true; + fetchFavUsers(); } else { setState(() { isNeedEnableTextField = true; - selectedFavLetter = null; - favLetters = null; - favUsersList = null; + // selectedFavLetter = 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 && selectedType == "Favorites" ? 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), + ), ], ), ); diff --git a/lib/ui/work_list/worklist_detail_screen.dart b/lib/ui/work_list/worklist_detail_screen.dart index 69c669f..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; @@ -144,7 +145,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(); @@ -286,6 +287,7 @@ class _WorkListDetailScreenState extends State { : ActionsFragment( workListData!.nOTIFICATIONID, actionHistoryList, + isShowActions, voidCallback: reloadWorkList, ) : showLoadingAnimation(), @@ -297,50 +299,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,10 +683,17 @@ class _WorkListDetailScreenState extends State { } void performAction(String actionMode, {String? title}) { + 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( - message: title != null ? null : LocaleKeys.requestedItems.tr(), + message: question, title: title, notificationGetRespond: notificationNoteInput, actionMode: actionMode, @@ -704,7 +715,6 @@ class _WorkListDetailScreenState extends State { "P_NOTIFICATION_ID": workListData!.nOTIFICATIONID, "RespondAttributeList": responseAttribute, }; - if (actionMode == "APPROVED" || actionMode == "APPROVE" || actionMode == "CLOSE" || @@ -1069,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) { @@ -1102,7 +1120,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; } 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(), ], ), ], diff --git a/lib/ui/work_list/worklist_fragments/info_fragments.dart b/lib/ui/work_list/worklist_fragments/info_fragments.dart index 76f2ace..73a87f7 100644 --- a/lib/ui/work_list/worklist_fragments/info_fragments.dart +++ b/lib/ui/work_list/worklist_fragments/info_fragments.dart @@ -760,6 +760,18 @@ class InfoFragment extends StatelessWidget { ItemDetailViewCol( LocaleKeys.requesterPayrollName.tr(), data.paymentDetailsList![0].requesterPayrollName ?? ""), ), + ItemDetailGrid( + ItemDetailViewCol( LocaleKeys.preparePositionName.tr(), + data.paymentDetailsList![0].preparePositionName ?? ""), + ItemDetailViewCol( + LocaleKeys.requesterPositionName.tr(), data.paymentDetailsList![0].requesterPositionName ?? ""), + ), + ItemDetailGrid( + ItemDetailViewCol( LocaleKeys.prepareEmpName.tr(), + data.paymentDetailsList![0].prepareEmployeeName ?? ""), + ItemDetailViewCol( + LocaleKeys.requesterPayrollName.tr(), data.paymentDetailsList![0].requesterPayrollName ?? ""), + ), ItemDetailGrid( ItemDetailViewCol( LocaleKeys.preparePositionName.tr(), data.paymentDetailsList![0].preparePositionName ?? ""), @@ -897,15 +909,18 @@ class InfoFragment extends StatelessWidget { ), ItemDetailGrid( ItemDetailViewCol(LocaleKeys.invoiceDate.tr(), - DateUtil.formatDateToDate( - DateUtil.convertStringToDate( data.refundInvoiceList![0].invoicedDate), false)?? ""), + DateUtil.formatDateToDate( + DateUtil.convertStringToDate( data.refundInvoiceList![0].invoicedDate), false)?? ""), + ItemDetailViewCol( LocaleKeys.refundInvoice.tr(), data.refundInvoiceList![0].invoiceNumber ?? "" ), ), ], ).objectContainerView(), - ], + + ], + ); } } diff --git a/lib/widgets/app_bar_widget.dart b/lib/widgets/app_bar_widget.dart index 744b7eb..277a414 100644 --- a/lib/widgets/app_bar_widget.dart +++ b/lib/widgets/app_bar_widget.dart @@ -1,22 +1,27 @@ 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, + surfaceTintColor: Colors.transparent, title: Row( children: [ GestureDetector( @@ -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 ?? [], ], ); } 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/image_picker.dart b/lib/widgets/image_picker.dart index f808d6e..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).scaffoldBackgroundColor, 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/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), ); } } 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/lib/widgets/nfc/nfc_reader_sheet.dart b/lib/widgets/nfc/nfc_reader_sheet.dart index 0ecc5e8..5e0b62d 100644 --- a/lib/widgets/nfc/nfc_reader_sheet.dart +++ b/lib/widgets/nfc/nfc_reader_sheet.dart @@ -78,11 +78,10 @@ class _NfcLayoutState extends State { } Widget scanNfc() { - return SizedBox( - width: MediaQuery.sizeOf(context).width, + return Container( + key: ValueKey(1), + width: double.infinity, child: Column( - key: ValueKey(1), - mainAxisSize: MainAxisSize.min, children: [ SizedBox( @@ -140,9 +139,8 @@ class _NfcLayoutState extends State { Widget doneNfc() { return Container( - width: MediaQuery.sizeOf(context).width, + key: ValueKey(2), child: Column( - key: ValueKey(2), mainAxisSize: MainAxisSize.min, children: [ SizedBox( diff --git a/lib/widgets/qr_scanner_dialog.dart b/lib/widgets/qr_scanner_dialog.dart index 11e2601..01a92de 100644 --- a/lib/widgets/qr_scanner_dialog.dart +++ b/lib/widgets/qr_scanner_dialog.dart @@ -1,8 +1,8 @@ import 'package:easy_localization/easy_localization.dart'; import 'package:flutter/material.dart'; +import 'package:mobile_scanner/mobile_scanner.dart'; import 'package:mohem_flutter_app/generated/locale_keys.g.dart'; import 'package:mohem_flutter_app/widgets/button/default_button.dart'; -import 'package:qr_code_scanner/qr_code_scanner.dart'; class QrScannerDialog extends StatefulWidget { @override @@ -11,8 +11,9 @@ class QrScannerDialog extends StatefulWidget { class _QrScannerDialogState extends State { final GlobalKey qrKey = GlobalKey(debugLabel: 'QR'); - Barcode? result; - QRViewController? controller; + // Barcode? result; + // QRViewController? controller; + Barcode? _barcode; bool isPicked = false; @override @@ -26,10 +27,7 @@ class _QrScannerDialogState extends State { children: [ Expanded( flex: 1, - child: QRView( - key: qrKey, - onQRViewCreated: _onQRViewCreated, - ), + child: MobileScanner(key : qrKey,onDetect: _handleBarcode), ), // Expanded( // flex: 1, @@ -55,25 +53,25 @@ class _QrScannerDialogState extends State { ); } - void _onQRViewCreated(QRViewController controller) { - this.controller = controller; - - controller.scannedDataStream.listen((scanData) { + void _handleBarcode(BarcodeCapture barcodes) { + // this.controller = controller; + Barcode? data = barcodes.barcodes.firstOrNull; + if(data == null || isPicked) { + return; + } + // controller.scannedDataStream.listen((scanData) { setState(() { - result = scanData; - if (!isPicked) { + // result = scanData; isPicked = true; - Navigator.pop(context, result!.code); - } + Navigator.pop(context, data.displayValue); }); - }); - controller.pauseCamera(); - controller.resumeCamera(); + // }); + // controller.pauseCamera(); + // controller.resumeCamera(); } @override void dispose() { - controller?.dispose(); super.dispose(); } } diff --git a/pubspec.yaml b/pubspec.yaml index 54d313f..7e97774 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.8+300078 +#version: 3.9.1+1 environment: sdk: ^3.7.0 @@ -40,13 +41,13 @@ dependencies: injector: ^2.0.0 provider: ^6.0.1 easy_localization: ^3.0.0 - http: ^1.3.0 + http: ^1.4.0 permission_handler: ^12.0.1 flutter_svg: any sizer: ^2.0.15 local_auth: ^2.3.0 fluttertoast: ^8.0.8 - syncfusion_flutter_calendar: ^28.2.4 + syncfusion_flutter_calendar: ^29.1.38 # flutter_calendar_carousel: ^2.1.0 pie_chart: ^5.1.0 shared_preferences: ^2.0.12 @@ -56,7 +57,8 @@ dependencies: flutter_countdown_timer: ^4.1.0 platform_device_id_plus: ^1.0.7 - image_picker: ^0.8.5+3 + device_info_plus: ^11.5.0 + image_picker: ^1.1.2 file_picker: ^8.3.1 geolocator: ^9.0.2 month_year_picker: ^0.5.0+1 @@ -65,15 +67,16 @@ dependencies: open_filex: ^4.6.0 wifi_iot: ^0.3.19+1 flutter_html: ^3.0.0-alpha.6 + mobile_scanner: ^6.0.10 # flutter_barcode_scanner: ^2.0.0 - qr_code_scanner: ^1.0.1 +# qr_code_scanner: ^1.0.1 # qr_flutter: ^4.0.0 url_launcher: ^6.0.15 share_plus: ^11.0.0 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 @@ -89,12 +92,13 @@ 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 #Chat Voice Message Recoding & Play - audio_waveforms: ^0.1.5+1 + audio_waveforms: ^1.3.0 rxdart: ^0.27.7 #Encryption @@ -108,7 +112,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: @@ -122,14 +126,15 @@ dependencies: firebase_crashlytics: ^4.3.9 #Items for sale Image Carousel Slider - carousel_slider: ^5.0.0 + carousel_slider: ^5.1.1 #Huawei Specified # store_checker: ^1.1.0 google_api_availability: ^5.0.1 - + google_maps_flutter_web: ^0.5.4 in_app_update: 4.1.0 flutter_inappwebview: ^6.1.5 + flutter_blurhash: ^0.8.0 #todo its for temporary purpose, later will remove this. dotted_border: ^2.0.0+3