diff --git a/android/app/build.gradle b/android/app/build.gradle index 7792554..9cd8b0e 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -44,7 +44,7 @@ android { defaultConfig { // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). - applicationId "hmg.cloudSolutions.mohem" + applicationId "com.cloudSolutions.mohemmtest" minSdkVersion 21 targetSdkVersion 32 versionCode flutterVersionCode.toInteger() diff --git a/android/app/google-services.json b/android/app/google-services.json index 62fbaea..5befc36 100644 --- a/android/app/google-services.json +++ b/android/app/google-services.json @@ -10,7 +10,7 @@ "client_info": { "mobilesdk_app_id": "1:679409052782:android:dba155ac0859d7fea78a7f", "android_client_info": { - "package_name": "hmg.cloudSolutions.mohem" + "package_name": "com.cloudSolutions.mohemmtest" } }, "oauth_client": [ diff --git a/ios/Runner.xcodeproj/project.pbxproj b/ios/Runner.xcodeproj/project.pbxproj index e81acc3..bd3e603 100644 --- a/ios/Runner.xcodeproj/project.pbxproj +++ b/ios/Runner.xcodeproj/project.pbxproj @@ -8,9 +8,10 @@ /* Begin PBXBuildFile section */ 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; }; + 1CCF895CFB3C95DEBB84A05F /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D8F0CC8EAC13AF3E07BEE567 /* Pods_Runner.framework */; }; 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; }; - 6BB994F47479089301AC9232 /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6CBD2B2B1A504A0E0BA52E83 /* Pods_Runner.framework */; }; 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; }; + 76AE113C28E078EA00513112 /* GoogleService-Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = 76AE113B28E078EA00513112 /* GoogleService-Info.plist */; }; 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; }; 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; }; 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; }; @@ -32,13 +33,12 @@ /* Begin PBXFileReference section */ 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = ""; }; 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; }; - 3085328F552329DC897B71DD /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = ""; }; - 3A5ABA8306DCFDB9E71D453A /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = ""; }; 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; }; - 3B4D9CAD3B112CCF7FEE1F91 /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = ""; }; - 6CBD2B2B1A504A0E0BA52E83 /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 704606614DF2810DC48BA72A /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = ""; }; 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = ""; }; 74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; + 7627313328E45A2400F354F7 /* Runner.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = Runner.entitlements; sourceTree = ""; }; + 76AE113B28E078EA00513112 /* GoogleService-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "GoogleService-Info.plist"; sourceTree = ""; }; 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; }; 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = ""; }; 9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = ""; }; @@ -47,6 +47,9 @@ 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 9F5A5EF025608C139860C4F1 /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = ""; }; + A51BF82DB767D6FBE2C19E26 /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = ""; }; + D8F0CC8EAC13AF3E07BEE567 /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -54,31 +57,21 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 6BB994F47479089301AC9232 /* Pods_Runner.framework in Frameworks */, + 1CCF895CFB3C95DEBB84A05F /* Pods_Runner.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ - 6BD33033650F08D3E79761E4 /* Frameworks */ = { + 76443FF31582B5E7DA3B22CB /* Frameworks */ = { isa = PBXGroup; children = ( - 6CBD2B2B1A504A0E0BA52E83 /* Pods_Runner.framework */, + D8F0CC8EAC13AF3E07BEE567 /* Pods_Runner.framework */, ); name = Frameworks; sourceTree = ""; }; - 969F82F1FCE09135D9CB4C64 /* Pods */ = { - isa = PBXGroup; - children = ( - 3085328F552329DC897B71DD /* Pods-Runner.debug.xcconfig */, - 3B4D9CAD3B112CCF7FEE1F91 /* Pods-Runner.release.xcconfig */, - 3A5ABA8306DCFDB9E71D453A /* Pods-Runner.profile.xcconfig */, - ); - path = Pods; - sourceTree = ""; - }; 9740EEB11CF90186004384FC /* Flutter */ = { isa = PBXGroup; children = ( @@ -96,8 +89,8 @@ 9740EEB11CF90186004384FC /* Flutter */, 97C146F01CF9000F007C117D /* Runner */, 97C146EF1CF9000F007C117D /* Products */, - 969F82F1FCE09135D9CB4C64 /* Pods */, - 6BD33033650F08D3E79761E4 /* Frameworks */, + 9E11D7B9A1206344B2A65F43 /* Pods */, + 76443FF31582B5E7DA3B22CB /* Frameworks */, ); sourceTree = ""; }; @@ -112,6 +105,8 @@ 97C146F01CF9000F007C117D /* Runner */ = { isa = PBXGroup; children = ( + 7627313328E45A2400F354F7 /* Runner.entitlements */, + 76AE113B28E078EA00513112 /* GoogleService-Info.plist */, 97C146FA1CF9000F007C117D /* Main.storyboard */, 97C146FD1CF9000F007C117D /* Assets.xcassets */, 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */, @@ -124,6 +119,16 @@ path = Runner; sourceTree = ""; }; + 9E11D7B9A1206344B2A65F43 /* Pods */ = { + isa = PBXGroup; + children = ( + A51BF82DB767D6FBE2C19E26 /* Pods-Runner.debug.xcconfig */, + 9F5A5EF025608C139860C4F1 /* Pods-Runner.release.xcconfig */, + 704606614DF2810DC48BA72A /* Pods-Runner.profile.xcconfig */, + ); + path = Pods; + sourceTree = ""; + }; /* End PBXGroup section */ /* Begin PBXNativeTarget section */ @@ -131,15 +136,15 @@ isa = PBXNativeTarget; buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */; buildPhases = ( - 7D19CFF3DFB977EA83F4C733 /* [CP] Check Pods Manifest.lock */, + 2D06B7AD3B87C9C9059E4168 /* [CP] Check Pods Manifest.lock */, 9740EEB61CF901F6004384FC /* Run Script */, 97C146EA1CF9000F007C117D /* Sources */, 97C146EB1CF9000F007C117D /* Frameworks */, 97C146EC1CF9000F007C117D /* Resources */, 9705A1C41CF9048500538489 /* Embed Frameworks */, 3B06AD1E1E4923F5004D2608 /* Thin Binary */, - AAF25E5FC427CABFCDCC628C /* [CP] Embed Pods Frameworks */, - C4DA18EDC3C1F9369084333D /* [CP] Copy Pods Resources */, + C4CFBC4C5CAC00182015ACD5 /* [CP] Embed Pods Frameworks */, + 1C704830960BB41251F31356 /* [CP] Copy Pods Resources */, ); buildRules = ( ); @@ -190,6 +195,7 @@ files = ( 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */, 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */, + 76AE113C28E078EA00513112 /* GoogleService-Info.plist in Resources */, 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */, 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */, ); @@ -198,21 +204,24 @@ /* End PBXResourcesBuildPhase section */ /* Begin PBXShellScriptBuildPhase section */ - 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = { + 1C704830960BB41251F31356 /* [CP] Copy Pods Resources */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( ); - inputPaths = ( + inputFileListPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources-${CONFIGURATION}-input-files.xcfilelist", ); - name = "Thin Binary"; - outputPaths = ( + name = "[CP] Copy Pods Resources"; + outputFileListPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources-${CONFIGURATION}-output-files.xcfilelist", ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin"; + shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources.sh\"\n"; + showEnvVarsInLog = 0; }; - 7D19CFF3DFB977EA83F4C733 /* [CP] Check Pods Manifest.lock */ = { + 2D06B7AD3B87C9C9059E4168 /* [CP] Check Pods Manifest.lock */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( @@ -234,52 +243,49 @@ shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; showEnvVarsInLog = 0; }; - 9740EEB61CF901F6004384FC /* Run Script */ = { + 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( ); inputPaths = ( ); - name = "Run Script"; + name = "Thin Binary"; outputPaths = ( ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build"; + shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin"; }; - AAF25E5FC427CABFCDCC628C /* [CP] Embed Pods Frameworks */ = { + 9740EEB61CF901F6004384FC /* Run Script */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( ); - inputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-input-files.xcfilelist", + inputPaths = ( ); - name = "[CP] Embed Pods Frameworks"; - outputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-output-files.xcfilelist", + name = "Run Script"; + outputPaths = ( ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n"; - showEnvVarsInLog = 0; + shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build"; }; - C4DA18EDC3C1F9369084333D /* [CP] Copy Pods Resources */ = { + C4CFBC4C5CAC00182015ACD5 /* [CP] Embed Pods Frameworks */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( ); inputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources-${CONFIGURATION}-input-files.xcfilelist", + "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-input-files.xcfilelist", ); - name = "[CP] Copy Pods Resources"; + name = "[CP] Embed Pods Frameworks"; outputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources-${CONFIGURATION}-output-files.xcfilelist", + "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-output-files.xcfilelist", ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources.sh\"\n"; + shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n"; showEnvVarsInLog = 0; }; /* End PBXShellScriptBuildPhase section */ @@ -372,15 +378,18 @@ buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; + CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; DEVELOPMENT_TEAM = 99Z3UD3LJM; ENABLE_BITCODE = NO; INFOPLIST_FILE = Runner/Info.plist; + INFOPLIST_KEY_CFBundleDisplayName = Mohemm; + IPHONEOS_DEPLOYMENT_TARGET = 11.0; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", ); - PRODUCT_BUNDLE_IDENTIFIER = com.cloudsolutions.mohemm; + PRODUCT_BUNDLE_IDENTIFIER = com.cloudsolutions.mohemmtest; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; SWIFT_VERSION = 5.0; @@ -500,15 +509,18 @@ buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; + CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; DEVELOPMENT_TEAM = 99Z3UD3LJM; ENABLE_BITCODE = NO; INFOPLIST_FILE = Runner/Info.plist; + INFOPLIST_KEY_CFBundleDisplayName = Mohemm; + IPHONEOS_DEPLOYMENT_TARGET = 11.0; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", ); - PRODUCT_BUNDLE_IDENTIFIER = com.cloudsolutions.mohemm; + PRODUCT_BUNDLE_IDENTIFIER = com.cloudsolutions.mohemmtest; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; @@ -523,15 +535,18 @@ buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; + CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; DEVELOPMENT_TEAM = 99Z3UD3LJM; ENABLE_BITCODE = NO; INFOPLIST_FILE = Runner/Info.plist; + INFOPLIST_KEY_CFBundleDisplayName = Mohemm; + IPHONEOS_DEPLOYMENT_TARGET = 11.0; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", ); - PRODUCT_BUNDLE_IDENTIFIER = com.cloudsolutions.mohemm; + PRODUCT_BUNDLE_IDENTIFIER = com.cloudsolutions.mohemmtest; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; SWIFT_VERSION = 5.0; diff --git a/ios/Runner/Info.plist b/ios/Runner/Info.plist index 0534f2b..2ac7a44 100644 --- a/ios/Runner/Info.plist +++ b/ios/Runner/Info.plist @@ -30,20 +30,20 @@ LSRequiresIPhoneOS + NFCReaderUsageDescription + This App requires access to NFC to mark your attendance. NSCameraUsageDescription This app requires camera access to capture & upload pictures. NSFaceIDUsageDescription This app requires Face ID to allow biometric authentication for app login. + NSLocationAlwaysAndWhenInUseUsageDescription + This App requires access to your location to mark your attendance. + NSLocationAlwaysUsageDescription + This App requires access to your location to mark your attendance. + NSLocationWhenInUseUsageDescription + This App requires access to your location to mark your attendance. NSPhotoLibraryUsageDescription This app requires photo library access to select image as document & upload it. - NSLocationAlwaysAndWhenInUseUsageDescription - This App requires access to your location to mark your attendance. - NSLocationAlwaysUsageDescription - This App requires access to your location to mark your attendance. - NSLocationWhenInUseUsageDescription - This App requires access to your location to mark your attendance. - NFCReaderUsageDescription - This App requires access to NFC to mark your attendance. UIBackgroundModes remote-notification @@ -68,8 +68,8 @@ UIViewControllerBasedStatusBarAppearance com.apple.developer.nfc.readersession.felica.systemcodes - - 0000 - + + 0000 + diff --git a/lib/api/login_api_client.dart b/lib/api/login_api_client.dart index 3cdda6d..7da7754 100644 --- a/lib/api/login_api_client.dart +++ b/lib/api/login_api_client.dart @@ -91,7 +91,7 @@ class LoginApiClient { AppState().postParamsObject?.pSelectedEmployeeNumber = AppState().getUserName; AppState().postParamsObject?.setPLegislationCode = responseData.basicMemberInformation!.pLEGISLATIONCODE; AppState().postParamsObject?.setPayrollCodeStr = responseData.memberInformationList!.first.pAYROLLCODE; - + AppState().setBusinessCardPrivilege = responseData.businessCardPrivilege ?? false; return responseData; }, url, postParams); } diff --git a/lib/api/my_attendance_api_client.dart b/lib/api/my_attendance_api_client.dart index 9e58b9b..eb66a8b 100644 --- a/lib/api/my_attendance_api_client.dart +++ b/lib/api/my_attendance_api_client.dart @@ -37,7 +37,7 @@ class MyAttendanceApiClient { }, url, postParams); } - Future getValueSetValues(String pSegmentName, String pDescFlexContextCode, String pDescFlexName, List> list) async { + Future> getValueSetValues(String pSegmentName, String pDescFlexContextCode, String pDescFlexName, List> list) async { String url = "${ApiConsts.erpRest}GET_VALUE_SET_VALUES"; Map postParams = { "P_SELECTED_RESP_ID": -999, @@ -53,7 +53,7 @@ class MyAttendanceApiClient { postParams.addAll(AppState().postParamsJson); return await ApiClient().postJsonForObject((json) { GenericResponseModel? responseData = GenericResponseModel.fromJson(json); - return responseData.getValueSetValuesList!.first; + return responseData.getValueSetValuesList ?? []; }, url, postParams); } diff --git a/lib/api/my_team/my_team_api_client.dart b/lib/api/my_team/my_team_api_client.dart index c5a78c6..17a0a90 100644 --- a/lib/api/my_team/my_team_api_client.dart +++ b/lib/api/my_team/my_team_api_client.dart @@ -1,5 +1,3 @@ - - 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'; @@ -19,7 +17,6 @@ class MyTeamApiClient { factory MyTeamApiClient() => _instance; - Future> getEmployeeSubordinates(String searchEmpEmail, String searchEmpName, String searchEmpNo) async { String url = "${ApiConsts.erpRest}GET_EMPLOYEE_SUBORDINATES"; Map postParams = { @@ -72,7 +69,6 @@ class MyTeamApiClient { }, url, postParams); } - Future getAttendanceTracking(String? empID) async { String url = "${ApiConsts.erpRest}GET_Attendance_Tracking"; Map postParams = {}; @@ -104,10 +100,7 @@ class MyTeamApiClient { Future> employeeSubordinatesRequest(String? empID) async { String url = "${ApiConsts.erpRest}GET_MENU_ENTRIES"; - Map postParams = { - "P_MENU_TYPE": "M", - "P_SELECTED_RESP_ID": -999, - }; + Map postParams = {"P_MENU_TYPE": "M", "P_SELECTED_RESP_ID": -999}; postParams.addAll(AppState().postParamsJson); postParams['P_SELECTED_EMPLOYEE_NUMBER'] = empID; return await ApiClient().postJsonForObject((json) { @@ -118,8 +111,7 @@ class MyTeamApiClient { Future?> getFavoriteReplacement() async { String url = "${ApiConsts.erpRest}Mohemm_GetFavoriteReplacements"; - Map postParams = { - }; + Map postParams = {}; postParams.addAll(AppState().postParamsJson); return await ApiClient().postJsonForObject((json) { GenericResponseModel responseData = GenericResponseModel.fromJson(json); @@ -138,7 +130,7 @@ class MyTeamApiClient { }; Map postParams = { "Mohemm_ChangeReplacementsInputList": [postParamsObj], - //postParams["Mohemm_ChangeReplacementsInputList"] = list; + //postParams["Mohemm_ChangeReplacementsInputList"] = list; }; postParams.addAll(AppState().postParamsJson); return await ApiClient().postJsonForObject((json) { @@ -151,7 +143,7 @@ class MyTeamApiClient { String url = "${ApiConsts.erpRest}GET_SUBORDINATES_LEAVES_TOTAL_VACATIONS"; Map postParams = { "P_DATE_FROM": dateFrom, - "P_DATE_TO": dateTo, + "P_DATE_TO": dateTo, }; postParams.addAll(AppState().postParamsJson); return await ApiClient().postJsonForObject((json) { @@ -160,4 +152,3 @@ class MyTeamApiClient { }, url, postParams); } } - diff --git a/lib/app_state/app_state.dart b/lib/app_state/app_state.dart index 9d9dc21..d7f6a9d 100644 --- a/lib/app_state/app_state.dart +++ b/lib/app_state/app_state.dart @@ -25,6 +25,12 @@ class AppState { bool? get getIsLogged => isLogged; + bool businessCardPrivilege = false; + + set setBusinessCardPrivilege(bool v) => businessCardPrivilege = v; + + bool? get getBusinessCardPrivilege => businessCardPrivilege; + String? forgetPasswordTokenID; set setForgetPasswordTokenID(token) => forgetPasswordTokenID = token; diff --git a/lib/classes/consts.dart b/lib/classes/consts.dart index 17bd143..564a61f 100644 --- a/lib/classes/consts.dart +++ b/lib/classes/consts.dart @@ -23,4 +23,4 @@ class SharedPrefsConsts { static String mohemmWifiSSID = "mohemmWifiSSID"; static String mohemmWifiPassword = "mohemmWifiPassword"; static String editItemForSale = "editItemForSale"; -} +} \ No newline at end of file diff --git a/lib/models/dashboard/get_accrual_balances_list_model.dart b/lib/models/dashboard/get_accrual_balances_list_model.dart index a53133e..e69c181 100644 --- a/lib/models/dashboard/get_accrual_balances_list_model.dart +++ b/lib/models/dashboard/get_accrual_balances_list_model.dart @@ -10,7 +10,7 @@ class GetAccrualBalancesList { }); double? accrualNetEntitlement; - int? accrualUsedEntitlement; + num? accrualUsedEntitlement; //Todo: Add function dynamic accrualYearlyEntitlement; String? accuralPlanName; String? endDate; diff --git a/lib/ui/dialogs/id/employee_digital_id_dialog.dart b/lib/ui/dialogs/id/employee_digital_id_dialog.dart index e0e1054..fd4a266 100644 --- a/lib/ui/dialogs/id/employee_digital_id_dialog.dart +++ b/lib/ui/dialogs/id/employee_digital_id_dialog.dart @@ -1,7 +1,9 @@ +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/extensions/int_extensions.dart'; import 'package:mohem_flutter_app/extensions/string_extensions.dart'; +import 'package:mohem_flutter_app/generated/locale_keys.g.dart'; import 'package:mohem_flutter_app/widgets/button/default_button.dart'; import 'package:qr_flutter/qr_flutter.dart'; @@ -64,7 +66,7 @@ class EmployeeDigitialIdDialog extends StatelessWidget { width: 160, height: 160, ), - DefaultButton("Cancel", () { + DefaultButton(LocaleKeys.close.tr(), () { Navigator.pop(context); }) ], diff --git a/lib/ui/landing/dashboard_screen.dart b/lib/ui/landing/dashboard_screen.dart index 70b3ce0..1d8373e 100644 --- a/lib/ui/landing/dashboard_screen.dart +++ b/lib/ui/landing/dashboard_screen.dart @@ -424,9 +424,13 @@ class _DashboardScreenState extends State { selectedIconTheme: const IconThemeData(color: MyColors.grey3AColor, size: 28), unselectedIconTheme: const IconThemeData(color: MyColors.grey98Color, size: 28), onTap: (int index) { - // currentIndex = index; - // setState(() {}); - Navigator.pushNamed(context, AppRoutes.itemsForSale); + 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); + } }, ), ), diff --git a/lib/ui/landing/widget/app_drawer.dart b/lib/ui/landing/widget/app_drawer.dart index 523c1cc..d2203f9 100644 --- a/lib/ui/landing/widget/app_drawer.dart +++ b/lib/ui/landing/widget/app_drawer.dart @@ -16,7 +16,6 @@ import 'package:mohem_flutter_app/ui/dialogs/id/business_card_dialog.dart'; import 'package:mohem_flutter_app/ui/dialogs/id/employee_digital_id_dialog.dart'; import 'package:mohem_flutter_app/widgets/dialogs/dialogs.dart'; import 'package:provider/provider.dart'; -import 'package:shared_preferences/shared_preferences.dart'; class AppDrawer extends StatefulWidget { @override @@ -85,7 +84,8 @@ class _AppDrawerState extends State { }); }), menuItem("assets/images/drawer/employee_id.svg", LocaleKeys.employeeDigitalID.tr(), "", closeDrawer: false, onPress: () => showMDialog(context, child: EmployeeDigitialIdDialog())), - menuItem("assets/images/drawer/view_business_card.svg", LocaleKeys.viewBusinessCard.tr(), "", closeDrawer: false, onPress: () => showMDialog(context, child: BusinessCardDialog())), + if (AppState().businessCardPrivilege) + menuItem("assets/images/drawer/view_business_card.svg", LocaleKeys.viewBusinessCard.tr(), "", closeDrawer: false, onPress: () => showMDialog(context, child: BusinessCardDialog())), menuItem("assets/images/drawer/logout.svg", LocaleKeys.logout.tr(), "", color: MyColors.redA3Color, closeDrawer: false, onPress: performLogout), // menuItem("assets/images/drawer/logout.svg", LocaleKeys.logout.tr(), "", color: MyColors.redA3Color, closeDrawer: false, onPress: () {Navigator.pushNamed(context, AppRoutes.survey,); ], diff --git a/lib/ui/login/login_screen.dart b/lib/ui/login/login_screen.dart index 92a58db..ba90fbf 100644 --- a/lib/ui/login/login_screen.dart +++ b/lib/ui/login/login_screen.dart @@ -113,7 +113,7 @@ class _LoginScreenState extends State { } Utils.hideLoading(context); if (_autoLogin) { - Navigator.pushNamed(context, AppRoutes.verifyLastLogin, arguments: loginInfo); + Navigator.pushReplacementNamed(context, AppRoutes.verifyLastLogin, arguments: loginInfo); } else { Navigator.pushNamed(context, AppRoutes.verifyLogin, arguments: "$firebaseToken"); } diff --git a/lib/ui/login/verify_last_login_screen.dart b/lib/ui/login/verify_last_login_screen.dart index b03c8aa..6dfaaae 100644 --- a/lib/ui/login/verify_last_login_screen.dart +++ b/lib/ui/login/verify_last_login_screen.dart @@ -20,7 +20,10 @@ import 'package:mohem_flutter_app/generated/locale_keys.g.dart'; import 'package:mohem_flutter_app/models/basic_member_information_model.dart'; import 'package:mohem_flutter_app/models/generic_response_model.dart'; import 'package:mohem_flutter_app/models/get_mobile_login_info_list_model.dart'; +import 'package:mohem_flutter_app/ui/dialogs/id/business_card_dialog.dart'; +import 'package:mohem_flutter_app/ui/dialogs/id/employee_digital_id_dialog.dart'; import 'package:mohem_flutter_app/widgets/button/default_button.dart'; +import 'package:mohem_flutter_app/widgets/dialogs/dialogs.dart'; // WhatsApp 4 // SMS 1 @@ -56,15 +59,23 @@ class _VerifyLastLoginScreenState extends State { Widget build(BuildContext context) { mobileLoginInfoListModel ??= ModalRoute.of(context)!.settings.arguments as GetMobileLoginInfoListModel; String empName = AppState().isArabic(context) ? AppState().memberInformationList!.eMPLOYEEDISPLAYNAMEAr! : AppState().memberInformationList!.eMPLOYEEDISPLAYNAMEEn!; - print("selectedFlag1: " + mobileLoginInfoListModel!.loginType.toString()); + return Scaffold( appBar: AppBar( backgroundColor: Colors.transparent, - // leading: IconButton( - // icon: const Icon(Icons.arrow_back_ios, color: MyColors.darkIconColor), - // onPressed: () => Navigator.pop(context), - // ), - actions: [Center(child: "Employee Digital ID".toText12(color: MyColors.textMixColor, isUnderLine: true).onPress(() {})), 21.width], + automaticallyImplyLeading: false, + title: (mobileLoginInfoListModel?.businessCardPrivilege ?? false) + ? LocaleKeys.viewBusinessCard.tr().toText12(color: MyColors.textMixColor, isUnderLine: true).onPress(() { + showMDialog(context, child: BusinessCardDialog()); + }) + : null, + actions: [ + Center( + child: LocaleKeys.employeeDigitalID.tr().toText12(color: MyColors.textMixColor, isUnderLine: true).onPress(() { + showMDialog(context, child: EmployeeDigitialIdDialog()); + })), + 21.width + ], ), body: Column( children: [ @@ -222,7 +233,6 @@ 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))); - print("$_title:$isDisable"); return InkWell( onTap: isDisable ? null diff --git a/lib/ui/my_attendance/dynamic_screens/dynamic_input_screen.dart b/lib/ui/my_attendance/dynamic_screens/dynamic_input_screen.dart index 4f6e527..17c5f7d 100644 --- a/lib/ui/my_attendance/dynamic_screens/dynamic_input_screen.dart +++ b/lib/ui/my_attendance/dynamic_screens/dynamic_input_screen.dart @@ -104,26 +104,26 @@ class _DynamicInputScreenState extends State { Future calGetValueSetValues(GetEITDFFStructureList structureList) async { try { - Utils.showLoading(context); - String segmentId = structureList.cHILDSEGMENTSVS!; - if (dESCFLEXCONTEXTCODE.isEmpty) dESCFLEXCONTEXTCODE = structureList.dESCFLEXCONTEXTCODE!; - - List filteredList = getEitDffStructureList?.where((element) => element.cHILDSEGMENTSVS == segmentId).toList() ?? []; - List> values = filteredList - .map((e) => GetSetValuesRequestModel( - sEGMENTNAME: e.sEGMENTNAME, vALUECOLUMNNAME: e.eSERVICESDV!.pVALUECOLUMNNAME, dESCRIPTION: "", iDCOLUMNNAME: e.eSERVICESDV!.pIDCOLUMNNAME, fLEXVALUESETNAME: e.fLEXVALUESETNAME) - .toJson()) - .toList(); - ESERVICESVS eServicesResponseModel = await MyAttendanceApiClient().getValueSetValues(segmentId, structureList.dESCFLEXCONTEXTCODE!, structureList.dESCFLEXNAME!, values); - List abc = genericResponseModel?.getEITDFFStructureList ?? []; - getEitDffStructureList = abc; - int index = getEitDffStructureList!.indexWhere((element) => element.sEGMENTNAME == structureList.cHILDSEGMENTSVS); - getEitDffStructureList![index].eSERVICESVS!.clear(); - getEitDffStructureList![index].eSERVICESVS!.add(eServicesResponseModel); - // getEitDffStructureList = genericResponseModel?.getEITDFFStructureList ?? []; - //getEitDffStructureList = getEitDffStructureList!.where((element) => element.dISPLAYFLAG != "N").toList(); - Utils.hideLoading(context); - setState(() {}); + Utils.showLoading(context); + String segmentId = structureList.cHILDSEGMENTSVS!; + if (dESCFLEXCONTEXTCODE.isEmpty) dESCFLEXCONTEXTCODE = structureList.dESCFLEXCONTEXTCODE!; + + List filteredList = getEitDffStructureList?.where((element) => element.cHILDSEGMENTSVS == segmentId).toList() ?? []; + List> values = filteredList + .map((e) => GetSetValuesRequestModel( + sEGMENTNAME: e.sEGMENTNAME, vALUECOLUMNNAME: e.eSERVICESDV!.pVALUECOLUMNNAME, dESCRIPTION: "", iDCOLUMNNAME: e.eSERVICESDV!.pIDCOLUMNNAME, fLEXVALUESETNAME: e.fLEXVALUESETNAME) + .toJson()) + .toList(); + List eServicesResponseModel = await MyAttendanceApiClient().getValueSetValues(segmentId, structureList.dESCFLEXCONTEXTCODE!, structureList.dESCFLEXNAME!, values); + List abc = genericResponseModel?.getEITDFFStructureList ?? []; + getEitDffStructureList = abc; + int index = getEitDffStructureList!.indexWhere((element) => element.sEGMENTNAME == structureList.cHILDSEGMENTSVS); + getEitDffStructureList![index].eSERVICESVS!.clear(); + if (eServicesResponseModel.isNotEmpty) getEitDffStructureList![index].eSERVICESVS!.addAll(eServicesResponseModel); + // getEitDffStructureList = genericResponseModel?.getEITDFFStructureList ?? []; + //getEitDffStructureList = getEitDffStructureList!.where((element) => element.dISPLAYFLAG != "N").toList(); + Utils.hideLoading(context); + setState(() {}); } catch (ex) { Utils.hideLoading(context); Utils.handleException(ex, context, null); diff --git a/lib/ui/my_attendance/dynamic_screens/dynamic_listview_screen.dart b/lib/ui/my_attendance/dynamic_screens/dynamic_listview_screen.dart index af22703..648f14d 100644 --- a/lib/ui/my_attendance/dynamic_screens/dynamic_listview_screen.dart +++ b/lib/ui/my_attendance/dynamic_screens/dynamic_listview_screen.dart @@ -70,34 +70,37 @@ class _DynamicListViewScreenState extends State { return Scaffold( backgroundColor: Colors.white, appBar: AppBarWidget(context, title: dynamicParams!.title), - body: ListView( - physics: const BouncingScrollPhysics(), - padding: const EdgeInsets.all(21), - children: [ - // HMG_TKT_NEW_EIT_SS Id used for ticket balance dashboard - if (dynamicParams!.dynamicId == "HMG_TKT_NEW_EIT_SS") ...[const BalancesDashboardWidget("Current Ticket Balance", false), 12.height], - getEITTransactionList == null - ? const SizedBox() - : (getEITTransactionList!.isEmpty - ? Utils.getNoDataWidget(context) - : ListView.separated( - physics: const NeverScrollableScrollPhysics(), - shrinkWrap: true, - itemBuilder: (cxt, int parentIndex) => getEITTransactionList![parentIndex].collectionTransaction!.isEmpty - ? const SizedBox() - : Column( - crossAxisAlignment: CrossAxisAlignment.start, - mainAxisSize: MainAxisSize.min, - children: [ - for (int t = 0; t < (getEITTransactionList![parentIndex].collectionTransaction ?? []).length; t++) - if (getEITTransactionList![parentIndex].collectionTransaction![t].dISPLAYFLAG == "Y") - ItemDetailView(getEITTransactionList![parentIndex].collectionTransaction![t].sEGMENTPROMPT!, - getEITTransactionList![parentIndex].collectionTransaction![t].sEGMENTVALUEDSP ?? ""), - ], - ).objectContainerView(), - separatorBuilder: (cxt, index) => 12.height, - itemCount: getEITTransactionList!.length)), - ], + body: Center( + child: ListView( + physics: const BouncingScrollPhysics(), + shrinkWrap: true, + padding: const EdgeInsets.all(21), + children: [ + // HMG_TKT_NEW_EIT_SS Id used for ticket balance dashboard + if (dynamicParams!.dynamicId == "HMG_TKT_NEW_EIT_SS") ...[const BalancesDashboardWidget("Current Ticket Balance", false), 12.height], + getEITTransactionList == null + ? const SizedBox() + : (getEITTransactionList!.isEmpty + ? Utils.getNoDataWidget(context) + : ListView.separated( + physics: const NeverScrollableScrollPhysics(), + shrinkWrap: true, + itemBuilder: (cxt, int parentIndex) => getEITTransactionList![parentIndex].collectionTransaction!.isEmpty + ? const SizedBox() + : Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisSize: MainAxisSize.min, + children: [ + for (int t = 0; t < (getEITTransactionList![parentIndex].collectionTransaction ?? []).length; t++) + if (getEITTransactionList![parentIndex].collectionTransaction![t].dISPLAYFLAG == "Y") + ItemDetailView(getEITTransactionList![parentIndex].collectionTransaction![t].sEGMENTPROMPT!, + getEITTransactionList![parentIndex].collectionTransaction![t].sEGMENTVALUEDSP ?? ""), + ], + ).objectContainerView(), + separatorBuilder: (cxt, index) => 12.height, + itemCount: getEITTransactionList!.length)), + ], + ), ), floatingActionButton: Container( height: 54, diff --git a/lib/ui/my_attendance/services_menu_list_screen.dart b/lib/ui/my_attendance/services_menu_list_screen.dart index eac127d..4e4745a 100644 --- a/lib/ui/my_attendance/services_menu_list_screen.dart +++ b/lib/ui/my_attendance/services_menu_list_screen.dart @@ -51,8 +51,10 @@ class ServicesMenuListScreen extends StatelessWidget { Navigator.pushNamed(context, AppRoutes.familyMembers); } return; + } else if (servicesMenuData.list[index].requestType == "ABSENCE") { + Navigator.pushNamed(context, AppRoutes.leaveBalance); + return; } - Navigator.pushNamed(context, AppRoutes.dynamicScreen, arguments: DynamicListViewParams(servicesMenuData.list[index].prompt!, servicesMenuData.list[index].functionName!)); }), separatorBuilder: (cxt, index) => 12.height, diff --git a/lib/ui/my_team/create_request.dart b/lib/ui/my_team/create_request.dart index 5044c22..a4c6c83 100644 --- a/lib/ui/my_team/create_request.dart +++ b/lib/ui/my_team/create_request.dart @@ -1,5 +1,3 @@ - -import 'dart:ui'; import 'package:easy_localization/easy_localization.dart'; import 'package:flutter/material.dart'; import 'package:flutter_svg/flutter_svg.dart'; @@ -12,32 +10,34 @@ 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/dashboard/menu_entries.dart'; +import 'package:mohem_flutter_app/models/dashboard/menus.dart'; import 'package:mohem_flutter_app/models/my_team/get_employee_subordinates_list.dart'; -import 'package:mohem_flutter_app/provider/dashboard_provider_model.dart'; import 'package:mohem_flutter_app/ui/my_attendance/dynamic_screens/dynamic_listview_screen.dart'; +import 'package:mohem_flutter_app/ui/my_attendance/services_menu_list_screen.dart'; import 'package:mohem_flutter_app/widgets/app_bar_widget.dart'; class CreateRequest extends StatefulWidget { - const CreateRequest ({Key? key}) : super(key: key); + const CreateRequest({Key? key}) : super(key: key); @override _CreateRequestState createState() => _CreateRequestState(); } class _CreateRequestState extends State { - String searchEmpEmail =""; - String searchEmpName =""; + String searchEmpEmail = ""; + String searchEmpName = ""; String searchEmpNo = ""; String? empId; List getEmployeeSubordinatesList = []; + // late DashboardProviderModel data; List getMenuEntriesList = []; GetEmployeeSubordinatesList? getEmployeeSubordinates; + List? homeMenus; @override void initState() { super.initState(); - // data.fetchMenuEntries(); employeeSubRequest(); } @@ -46,6 +46,7 @@ class _CreateRequestState extends State { Utils.showLoading(context); getEmployeeSubordinatesList = await MyTeamApiClient().getEmployeeSubordinates(searchEmpEmail.toString(), searchEmpName.toString(), searchEmpNo.toString()); getMenuEntriesList = await MyTeamApiClient().employeeSubordinatesRequest(getEmployeeSubordinates?.eMPLOYEENUMBER); + homeMenus = parseMenus(getMenuEntriesList); Utils.hideLoading(context); setState(() {}); } catch (ex) { @@ -54,42 +55,65 @@ class _CreateRequestState extends State { } } + List parseMenus(List getMenuEntriesList) { + List menus = []; + for (int i = 0; i < getMenuEntriesList.length; i++) { + if (getMenuEntriesList[i].parentMenuName!.isEmpty) { + menus.add(Menus(getMenuEntriesList[i], getMenuEntriesList.where((element) => getMenuEntriesList[i].menuName == element.parentMenuName).toList())); + } + } + return menus; + } + + void handleOnPress(context, Menus menu) { + if (menu.menuEntry.menuEntryType == "FUNCTION") { + if (menu.menuEntry.requestType == "EIT") { + Navigator.pushNamed(context, AppRoutes.dynamicScreen, arguments: DynamicListViewParams(menu.menuEntry.prompt!, menu.menuEntry.functionName!)); + } else {} + } else { + Navigator.pushNamed(context, AppRoutes.servicesMenuListScreen, arguments: ServicesMenuListScreenParams(menu.menuEntry.prompt!, menu.menuEntiesList)); + } + return; + } + @override Widget build(BuildContext context) { getEmployeeSubordinates ??= ModalRoute.of(context)?.settings.arguments as GetEmployeeSubordinatesList; - print(getMenuEntriesList.length); + return Scaffold( backgroundColor: Colors.white, appBar: AppBarWidget( context, title: LocaleKeys.createRequest.tr(), ), - body: SizedBox( - width: double.infinity, - height: double.infinity, - child: getMenuEntriesList.isEmpty - ? Utils.getNoDataWidget(context) - : ListView.separated( - padding: const EdgeInsets.all(21), - itemBuilder: (cxt, index) => itemView("assets/images/pdf.svg", getMenuEntriesList[index].prompt!, index).onPress(() { - Navigator.pushNamed(context, AppRoutes.dynamicScreen, arguments: DynamicListViewParams(getMenuEntriesList[index].prompt!, getMenuEntriesList[index].functionName!)); - }), - separatorBuilder: (cxt, index) => 12.height, - itemCount: getMenuEntriesList.length), - ), - + body: SizedBox( + width: double.infinity, + height: double.infinity, + child: homeMenus == null + ? const SizedBox() + : (homeMenus!.isEmpty + ? Utils.getNoDataWidget(context) + : ListView.separated( + padding: const EdgeInsets.all(21), + itemBuilder: (cxt, index) => itemView("assets/images/pdf.svg", homeMenus![index].menuEntry.prompt!, index).onPress(() { + handleOnPress(context, homeMenus![index]); + }), + separatorBuilder: (cxt, index) => 12.height, + itemCount: homeMenus!.length)), + ), ); } Widget itemView(String icon, String title, index) { - return getMenuEntriesList[index].parentMenuName !=""? Row( + return Row( children: [ - (title).toText16().expanded, 12.width, + (title).toText16().expanded, + 12.width, SvgPicture.asset( "assets/images/arrow_next.svg", color: MyColors.darkIconColor, ) ], - ).objectContainerView() : SizedBox(); + ).objectContainerView(); } } diff --git a/lib/ui/profile/dynamic_screens/dynamic_input_address_screen.dart b/lib/ui/profile/dynamic_screens/dynamic_input_address_screen.dart index 815db77..5c54b6d 100644 --- a/lib/ui/profile/dynamic_screens/dynamic_input_address_screen.dart +++ b/lib/ui/profile/dynamic_screens/dynamic_input_address_screen.dart @@ -16,15 +16,10 @@ import 'package:mohem_flutter_app/models/dyanmic_forms/validate_eit_transaction_ import 'package:mohem_flutter_app/models/generic_response_model.dart'; import 'package:mohem_flutter_app/models/get_eit_dff_structure_list_model.dart'; import 'package:mohem_flutter_app/models/get_employee_address_model.dart'; -import 'package:mohem_flutter_app/models/get_employee_basic_details.model.dart'; -import 'package:mohem_flutter_app/models/get_employee_contacts.model.dart'; -import 'package:mohem_flutter_app/models/profile/basic_details_cols_structions.dart'; -import 'package:mohem_flutter_app/models/profile/basic_details_dff_structure.dart'; import 'package:mohem_flutter_app/models/profile/get_address_dff_structure_list.dart'; import 'package:mohem_flutter_app/models/profile/get_countries_list_model.dart'; import 'package:mohem_flutter_app/models/profile/submit_address_transaction.dart'; import 'package:mohem_flutter_app/ui/misc/request_submit_screen.dart'; -import 'package:mohem_flutter_app/ui/my_attendance/dynamic_screens/dynamic_listview_screen.dart'; 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/dynamic_forms/dynamic_textfield_widget.dart'; @@ -60,6 +55,7 @@ class _DynamicInputScreenState extends State { String dESCFLEXCONTEXTCODE = ""; String countryCode = 'SA'; String effectiveDate = ''; + @override void initState() { super.initState(); @@ -116,10 +112,10 @@ class _DynamicInputScreenState extends State { sEGMENTNAME: e.sEGMENTNAME, vALUECOLUMNNAME: e.eSERVICESDV!.pVALUECOLUMNNAME, dESCRIPTION: "", iDCOLUMNNAME: e.eSERVICESDV!.pIDCOLUMNNAME, fLEXVALUESETNAME: e.fLEXVALUESETNAME) .toJson()) .toList(); - ESERVICESVS genericResponseModel = await MyAttendanceApiClient().getValueSetValues(structureList.cHILDSEGMENTSVS!, structureList.dESCFLEXCONTEXTCODE!, structureList.dESCFLEXNAME!, values); + List genericResponseModel = await MyAttendanceApiClient().getValueSetValues(structureList.cHILDSEGMENTSVS!, structureList.dESCFLEXCONTEXTCODE!, structureList.dESCFLEXNAME!, values); int index = getAddressDffStructureList!.indexWhere((element) => element.sEGMENTNAME == structureList.cHILDSEGMENTSVS); - getAddressDffStructureList![index].eSERVICESVS!.add(genericResponseModel); + if (genericResponseModel.isNotEmpty) getAddressDffStructureList![index].eSERVICESVS!.addAll(genericResponseModel); // getEitDffStructureList = genericResponseModel?.getEITDFFStructureList ?? []; //getEitDffStructureList = getEitDffStructureList!.where((element) => element.dISPLAYFLAG != "N").toList(); Utils.hideLoading(context); @@ -325,8 +321,7 @@ class _DynamicInputScreenState extends State { ), ); } else { - DateTime? picked = - await showDatePicker(context: context, initialDate: selectedDate, initialEntryMode: DatePickerEntryMode.calendarOnly, firstDate: DateTime(2015, 8), lastDate: DateTime(2101)); + DateTime? picked = await showDatePicker(context: context, initialDate: selectedDate, initialEntryMode: DatePickerEntryMode.calendarOnly, firstDate: DateTime(2015, 8), lastDate: DateTime(2101)); if (picked != null && picked != selectedDate) { time = picked; } diff --git a/lib/ui/profile/dynamic_screens/dynamic_input_basic_details_screen.dart b/lib/ui/profile/dynamic_screens/dynamic_input_basic_details_screen.dart index 422d67b..923d3a8 100644 --- a/lib/ui/profile/dynamic_screens/dynamic_input_basic_details_screen.dart +++ b/lib/ui/profile/dynamic_screens/dynamic_input_basic_details_screen.dart @@ -8,7 +8,6 @@ import 'package:mohem_flutter_app/api/profile_api_client.dart'; import 'package:mohem_flutter_app/classes/utils.dart'; import 'package:mohem_flutter_app/config/routes.dart'; import 'package:mohem_flutter_app/extensions/int_extensions.dart'; -import 'package:mohem_flutter_app/extensions/string_extensions.dart'; import 'package:mohem_flutter_app/extensions/widget_extensions.dart'; import 'package:mohem_flutter_app/generated/locale_keys.g.dart'; import 'package:mohem_flutter_app/models/dyanmic_forms/get_set_values_request_model.dart'; @@ -16,12 +15,10 @@ import 'package:mohem_flutter_app/models/dyanmic_forms/validate_eit_transaction_ import 'package:mohem_flutter_app/models/generic_response_model.dart'; import 'package:mohem_flutter_app/models/get_eit_dff_structure_list_model.dart'; import 'package:mohem_flutter_app/models/get_employee_basic_details.model.dart'; -import 'package:mohem_flutter_app/models/get_employee_contacts.model.dart'; import 'package:mohem_flutter_app/models/profile/basic_details_cols_structions.dart'; import 'package:mohem_flutter_app/models/profile/basic_details_dff_structure.dart'; import 'package:mohem_flutter_app/models/profile/submit_basic_details_transaction_model.dart'; import 'package:mohem_flutter_app/ui/misc/request_submit_screen.dart'; -import 'package:mohem_flutter_app/ui/my_attendance/dynamic_screens/dynamic_listview_screen.dart'; 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/dynamic_forms/dynamic_textfield_widget.dart'; @@ -55,6 +52,7 @@ class _DynamicInputScreenState extends State { DynamicProfileParams? dynamicParams; String dESCFLEXCONTEXTCODE = ""; + @override void initState() { super.initState(); @@ -102,12 +100,10 @@ class _DynamicInputScreenState extends State { sEGMENTNAME: e.sEGMENTNAME, vALUECOLUMNNAME: e.eSERVICESDV!.pVALUECOLUMNNAME, dESCRIPTION: "", iDCOLUMNNAME: e.eSERVICESDV!.pIDCOLUMNNAME, fLEXVALUESETNAME: e.fLEXVALUESETNAME) .toJson()) .toList(); - ESERVICESVS genericResponseModel = await MyAttendanceApiClient().getValueSetValues(structureList.cHILDSEGMENTSVS!, structureList.dESCFLEXCONTEXTCODE!, structureList.dESCFLEXNAME!, values); + List genericResponseModel = await MyAttendanceApiClient().getValueSetValues(structureList.cHILDSEGMENTSVS!, structureList.dESCFLEXCONTEXTCODE!, structureList.dESCFLEXNAME!, values); int index = getBasicDetDffStructureList!.indexWhere((element) => element.sEGMENTNAME == structureList.cHILDSEGMENTSVS); - getBasicDetDffStructureList![index].eSERVICESVS!.add(genericResponseModel); - // getEitDffStructureList = genericResponseModel?.getEITDFFStructureList ?? []; - //getEitDffStructureList = getEitDffStructureList!.where((element) => element.dISPLAYFLAG != "N").toList(); + if (genericResponseModel.isNotEmpty) getBasicDetDffStructureList![index].eSERVICESVS!.addAll(genericResponseModel); Utils.hideLoading(context); setState(() {}); } catch (ex) { @@ -336,8 +332,7 @@ class _DynamicInputScreenState extends State { ), ); } else { - DateTime? picked = - await showDatePicker(context: context, initialDate: selectedDate, initialEntryMode: DatePickerEntryMode.calendarOnly, firstDate: DateTime(2015, 8), lastDate: DateTime(2101)); + DateTime? picked = await showDatePicker(context: context, initialDate: selectedDate, initialEntryMode: DatePickerEntryMode.calendarOnly, firstDate: DateTime(2015, 8), lastDate: DateTime(2101)); if (picked != null && picked != selectedDate) { time = picked; } diff --git a/lib/ui/screens/items_for_sale/fragments/items_for_sale.dart b/lib/ui/screens/items_for_sale/fragments/items_for_sale.dart index 89bf7ce..9189f0b 100644 --- a/lib/ui/screens/items_for_sale/fragments/items_for_sale.dart +++ b/lib/ui/screens/items_for_sale/fragments/items_for_sale.dart @@ -167,7 +167,7 @@ class _ItemsForSaleFragmentState extends State { ), 10.height, getItemsForSaleList.title!.toText16(maxlines: 1), - getItemsForSaleList.description!.toText12(maxLine: 3, color: MyColors.grey57Color).expanded, + getItemsForSaleList.description!.toText12(maxLine: 2, color: MyColors.grey57Color).expanded, // 8.height, getItemsForSaleList.status!.toText14(color: getItemsForSaleList.status == 'Approved' ? MyColors.greenColor : MyColors.yellowColor), Row( diff --git a/lib/ui/work_list/worklist_detail_screen.dart b/lib/ui/work_list/worklist_detail_screen.dart index d2a0e0b..db96c53 100644 --- a/lib/ui/work_list/worklist_detail_screen.dart +++ b/lib/ui/work_list/worklist_detail_screen.dart @@ -487,10 +487,13 @@ class _WorkListDetailScreenState extends State { "P_FORWARD_TO_USER_NAME": "", "P_NOTIFICATION_ID": workListData!.nOTIFICATIONID, "RespondAttributeList": [ - if (notificationNoteInput != null) {notificationNoteInput!.attributeName: note} + if (notificationNoteInput != null) + { + "ATTRIBUTE_NAME": notificationNoteInput!.attributeName, + if (notificationNoteInput!.attributeType == "number") "ATTRIBUTE_NUMBER_VALUE": note else if (notificationNoteInput!.attributeType == "VARCHAR2") "ATTRIBUTE_TEXT_VALUE": note + } ], }; - performNotificationAction(payload); }, ), diff --git a/lib/widgets/dialogs/accept_reject_input_dialog.dart b/lib/widgets/dialogs/accept_reject_input_dialog.dart index 479a47b..3b644b9 100644 --- a/lib/widgets/dialogs/accept_reject_input_dialog.dart +++ b/lib/widgets/dialogs/accept_reject_input_dialog.dart @@ -66,6 +66,7 @@ class AcceptRejectInputDialog extends StatelessWidget { notificationGetRespond!.attributeDisplayName!, TextEditingController(), isBackgroundEnable: true, + isInputTypeNum: notificationGetRespond!.attributeType == "number", lines: 3, onChange: (String note) { this.note = note;