From 9bbf370aa78ad0f083a45b7099e5e3c071652642 Mon Sep 17 00:00:00 2001 From: SurendarSuri30 Date: Wed, 17 Sep 2025 19:51:46 +0530 Subject: [PATCH] bug fix --- android/app/build.gradle | 10 +- android/app/google-services.json | 43 +- android/app/src/main/AndroidManifest.xml | 1 + .../{frontend => stats}/MainActivity.java | 2 +- ios/Flutter/AppFrameworkInfo.plist | 2 +- ios/Podfile.lock | 20 +- ios/Runner.xcodeproj/project.pbxproj | 208 +++-- .../xcshareddata/xcschemes/Runner.xcscheme | 2 + ios/Runner/Info.plist | 2 - lib/config/api_config.dart | 4 +- lib/config/app_links_helper.dart | 2 +- lib/config/sessionCheckScreen.dart | 2 +- lib/main.dart | 2 +- .../auth_verification/create_new_pw.dart | 20 +- .../auth_verification/forgot_password.dart | 167 ++-- .../Screens/charts/screens/chart_screen.dart | 31 +- .../Screens/charts/widgets/chart_widget.dart | 837 ++++++++++-------- lib/presentation/Screens/profilepage.dart | 34 +- .../routes/auth_routes/login_route.dart | 49 +- .../drawer_routes/Drawer Items/bookmark.dart | 2 +- .../Drawer Items/edit_profile.dart | 16 - .../notification/notification.dart | 19 +- public/.well-known/5-3share complete.txt | 2 +- public/.well-known/assetlinks.json | 2 +- pubspec.lock | 22 +- pubspec.yaml | 7 +- 26 files changed, 803 insertions(+), 705 deletions(-) rename android/app/src/main/java/ae/gov/fcsc/{frontend => stats}/MainActivity.java (78%) diff --git a/android/app/build.gradle b/android/app/build.gradle index 79716a9f..5ef4c760 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -20,12 +20,12 @@ if (project.hasProperty('google-services.json')) { def flutterVersionCode = localProperties.getProperty("flutter.versionCode") if (flutterVersionCode == null) { - flutterVersionCode = "63" + flutterVersionCode = "5" } def flutterVersionName = localProperties.getProperty("flutter.versionName") if (flutterVersionName == null) { - flutterVersionName = "1.0.62" + flutterVersionName = "1.0.5" } def keystorePropertiesFile = rootProject.file("key.properties") @@ -33,7 +33,7 @@ def keystoreProperties = new Properties() keystoreProperties.load(new FileInputStream(keystorePropertiesFile)) android { - namespace = "ae.gov.fcsc.frontend" + namespace = "ae.gov.fcsc.stats" compileSdk = flutter.compileSdkVersion // ndkVersion = flutter.ndkVersion ndkVersion = "25.1.8937393" @@ -48,10 +48,10 @@ android { defaultConfig { // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). - applicationId = "ae.gov.fcsc.frontend" + applicationId = "ae.gov.fcsc.stats" // You can update the following values to match your application needs. // For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration. - minSdk = 23 + minSdkVersion = flutter.minSdkVersion targetSdk = flutter.targetSdkVersion versionCode = flutterVersionCode.toInteger() versionName = flutterVersionName diff --git a/android/app/google-services.json b/android/app/google-services.json index 2dfa060b..d8d13fd2 100644 --- a/android/app/google-services.json +++ b/android/app/google-services.json @@ -12,7 +12,12 @@ "package_name": "ae.gov.fcsc.frontend" } }, - "oauth_client": [], + "oauth_client": [ + { + "client_id": "62132243005-rnqthdakjs2ccs1ri7hnh79eh8t6hojl.apps.googleusercontent.com", + "client_type": 3 + } + ], "api_key": [ { "current_key": "AIzaSyB-QQbnq366f7rrKLVVFJKnSZgR9LcDWFI" @@ -20,7 +25,41 @@ ], "services": { "appinvite_service": { - "other_platform_oauth_client": [] + "other_platform_oauth_client": [ + { + "client_id": "62132243005-rnqthdakjs2ccs1ri7hnh79eh8t6hojl.apps.googleusercontent.com", + "client_type": 3 + } + ] + } + } + }, + { + "client_info": { + "mobilesdk_app_id": "1:62132243005:android:a50184ce50e0407d7c7854", + "android_client_info": { + "package_name": "ae.gov.fcsc.stats" + } + }, + "oauth_client": [ + { + "client_id": "62132243005-rnqthdakjs2ccs1ri7hnh79eh8t6hojl.apps.googleusercontent.com", + "client_type": 3 + } + ], + "api_key": [ + { + "current_key": "AIzaSyB-QQbnq366f7rrKLVVFJKnSZgR9LcDWFI" + } + ], + "services": { + "appinvite_service": { + "other_platform_oauth_client": [ + { + "client_id": "62132243005-rnqthdakjs2ccs1ri7hnh79eh8t6hojl.apps.googleusercontent.com", + "client_type": 3 + } + ] } } } diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml index a4b15385..a26708e9 100644 --- a/android/app/src/main/AndroidManifest.xml +++ b/android/app/src/main/AndroidManifest.xml @@ -2,6 +2,7 @@ + CFBundleVersion 1.0 MinimumOSVersion - 12.0 + 13.0 diff --git a/ios/Podfile.lock b/ios/Podfile.lock index dd052587..b92e9ca2 100644 --- a/ios/Podfile.lock +++ b/ios/Podfile.lock @@ -76,28 +76,28 @@ PODS: - AppCheckCore (~> 11.0) - GTMAppAuth (~> 5.0) - GTMSessionFetcher/Core (~> 3.3) - - GoogleUtilities/AppDelegateSwizzler (8.0.2): + - GoogleUtilities/AppDelegateSwizzler (8.1.0): - GoogleUtilities/Environment - GoogleUtilities/Logger - GoogleUtilities/Network - GoogleUtilities/Privacy - - GoogleUtilities/Environment (8.0.2): + - GoogleUtilities/Environment (8.1.0): - GoogleUtilities/Privacy - - GoogleUtilities/Logger (8.0.2): + - GoogleUtilities/Logger (8.1.0): - GoogleUtilities/Environment - GoogleUtilities/Privacy - - GoogleUtilities/Network (8.0.2): + - GoogleUtilities/Network (8.1.0): - GoogleUtilities/Logger - "GoogleUtilities/NSData+zlib" - GoogleUtilities/Privacy - GoogleUtilities/Reachability - - "GoogleUtilities/NSData+zlib (8.0.2)": + - "GoogleUtilities/NSData+zlib (8.1.0)": - GoogleUtilities/Privacy - - GoogleUtilities/Privacy (8.0.2) - - GoogleUtilities/Reachability (8.0.2): + - GoogleUtilities/Privacy (8.1.0) + - GoogleUtilities/Reachability (8.1.0): - GoogleUtilities/Logger - GoogleUtilities/Privacy - - GoogleUtilities/UserDefaults (8.0.2): + - GoogleUtilities/UserDefaults (8.1.0): - GoogleUtilities/Logger - GoogleUtilities/Privacy - GTMAppAuth (5.0.0): @@ -233,14 +233,14 @@ SPEC CHECKSUMS: FirebaseCoreInternal: ef4505d2afb1d0ebbc33162cb3795382904b5679 FirebaseInstallations: 9980995bdd06ec8081dfb6ab364162bdd64245c3 FirebaseMessaging: 2b9f56aa4ed286e1f0ce2ee1d413aabb8f9f5cb9 - Flutter: e0871f40cf51350855a761d2e70bf5af5b9b5de7 + Flutter: cabc95a1d2626b1b06e7179b784ebcf0c0cde467 flutter_native_splash: 6cad9122ea0fad137d23137dd14b937f3e90b145 flutter_secure_storage_darwin: ce237a8775b39723566dc72571190a3769d70468 fluttertoast: 2c67e14dce98bbdb200df9e1acf610d7a6264ea1 google_sign_in_ios: 205742c688aea0e64db9da03c33121694a365109 GoogleDataTransport: aae35b7ea0c09004c3797d53c8c41f66f219d6a7 GoogleSignIn: c7f09cfbc85a1abf69187be091997c317cc33b77 - GoogleUtilities: 26a3abef001b6533cf678d3eb38fd3f614b7872d + GoogleUtilities: 00c88b9a86066ef77f0da2fab05f65d7768ed8e1 GTMAppAuth: 217a876b249c3c585a54fd6f73e6b58c4f5c4238 GTMSessionFetcher: 5aea5ba6bd522a239e236100971f10cb71b96ab6 image_picker_ios: 7fe1ff8e34c1790d6fff70a32484959f563a928a diff --git a/ios/Runner.xcodeproj/project.pbxproj b/ios/Runner.xcodeproj/project.pbxproj index a737e729..47057df0 100644 --- a/ios/Runner.xcodeproj/project.pbxproj +++ b/ios/Runner.xcodeproj/project.pbxproj @@ -9,14 +9,14 @@ /* Begin PBXBuildFile section */ 0A3628072DBA1754003BB600 /* GoogleService-Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = 0A3628062DBA1754003BB600 /* GoogleService-Info.plist */; }; 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; }; - 24C5313A956552DACC6A2F25 /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 55598A82C8C267A1C98A4CAB /* Pods_Runner.framework */; }; + 240B527598875F1FE339FA22 /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 21E5D4AD0E73EDB191B0D3AB /* Pods_Runner.framework */; }; 331C808B294A63AB00263BE5 /* RunnerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 331C807B294A618700263BE5 /* RunnerTests.swift */; }; 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; }; 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; }; - 8ED4634D514CEE8AAD6C53BF /* Pods_RunnerTests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 5FA41CC2D981AE62980D7CDE /* Pods_RunnerTests.framework */; }; 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 */; }; + C95A12418F9FFCB720BD8393 /* Pods_RunnerTests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4469EAF9D5EEA501A0DFB6F8 /* Pods_RunnerTests.framework */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -43,22 +43,22 @@ /* End PBXCopyFilesBuildPhase section */ /* Begin PBXFileReference section */ - 0444FC1B1408261D7136E027 /* Pods-RunnerTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RunnerTests.debug.xcconfig"; path = "Target Support Files/Pods-RunnerTests/Pods-RunnerTests.debug.xcconfig"; sourceTree = ""; }; 0A3628062DBA1754003BB600 /* GoogleService-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; name = "GoogleService-Info.plist"; path = "Runner/GoogleService-Info.plist"; sourceTree = ""; }; 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 = ""; }; - 1A00CF12F959681F51F0DFF1 /* Pods-RunnerTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RunnerTests.release.xcconfig"; path = "Target Support Files/Pods-RunnerTests/Pods-RunnerTests.release.xcconfig"; sourceTree = ""; }; + 21E5D4AD0E73EDB191B0D3AB /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 22E09441D41F6799CBD1B240 /* 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 = ""; }; + 24B0F467E9CA8104D381B202 /* 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 = ""; }; 331C807B294A618700263BE5 /* RunnerTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RunnerTests.swift; sourceTree = ""; }; 331C8081294A63A400263BE5 /* RunnerTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = RunnerTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; }; + 4469EAF9D5EEA501A0DFB6F8 /* Pods_RunnerTests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_RunnerTests.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 4DE1959C2C14DFF100B07B30 /* Runner.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = Runner.entitlements; sourceTree = ""; }; - 55598A82C8C267A1C98A4CAB /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - 5FA41CC2D981AE62980D7CDE /* Pods_RunnerTests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_RunnerTests.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - 6CDA306B9D63C636C5E386EA /* 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 = ""; }; + 5B2FBD20ED5FAB8AE3E2ADF2 /* Pods-RunnerTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RunnerTests.debug.xcconfig"; path = "Target Support Files/Pods-RunnerTests/Pods-RunnerTests.debug.xcconfig"; sourceTree = ""; }; + 64832D0DB3389F2E98B4DB8B /* Pods-RunnerTests.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RunnerTests.profile.xcconfig"; path = "Target Support Files/Pods-RunnerTests/Pods-RunnerTests.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 = ""; }; 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; }; - 7C6ACEA576E5C2F6C934190C /* Pods-RunnerTests.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RunnerTests.profile.xcconfig"; path = "Target Support Files/Pods-RunnerTests/Pods-RunnerTests.profile.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 = ""; }; 97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; }; @@ -66,8 +66,8 @@ 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 = ""; }; - D3C1C8E1C6847D14747D5CA0 /* 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 = ""; }; - F3C942613F32EA1A640F6253 /* 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 = ""; }; + A017ACC7D044E0AB9F6181D9 /* Pods-RunnerTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RunnerTests.release.xcconfig"; path = "Target Support Files/Pods-RunnerTests/Pods-RunnerTests.release.xcconfig"; sourceTree = ""; }; + DD3A539579E9051D3B376D8C /* 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 = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -75,7 +75,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 24C5313A956552DACC6A2F25 /* Pods_Runner.framework in Frameworks */, + 240B527598875F1FE339FA22 /* Pods_Runner.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -83,13 +83,22 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 8ED4634D514CEE8AAD6C53BF /* Pods_RunnerTests.framework in Frameworks */, + C95A12418F9FFCB720BD8393 /* Pods_RunnerTests.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ + 28284A5C1F887F28AE69A945 /* Frameworks */ = { + isa = PBXGroup; + children = ( + 21E5D4AD0E73EDB191B0D3AB /* Pods_Runner.framework */, + 4469EAF9D5EEA501A0DFB6F8 /* Pods_RunnerTests.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; 331C8082294A63A400263BE5 /* RunnerTests */ = { isa = PBXGroup; children = ( @@ -98,15 +107,6 @@ path = RunnerTests; sourceTree = ""; }; - 749F29DBA04D4F0AC77B3B06 /* Frameworks */ = { - isa = PBXGroup; - children = ( - 55598A82C8C267A1C98A4CAB /* Pods_Runner.framework */, - 5FA41CC2D981AE62980D7CDE /* Pods_RunnerTests.framework */, - ); - name = Frameworks; - sourceTree = ""; - }; 9740EEB11CF90186004384FC /* Flutter */ = { isa = PBXGroup; children = ( @@ -127,7 +127,7 @@ 97C146EF1CF9000F007C117D /* Products */, 331C8082294A63A400263BE5 /* RunnerTests */, F25EA3847C6F2AAFB1DC01FE /* Pods */, - 749F29DBA04D4F0AC77B3B06 /* Frameworks */, + 28284A5C1F887F28AE69A945 /* Frameworks */, ); sourceTree = ""; }; @@ -159,12 +159,12 @@ F25EA3847C6F2AAFB1DC01FE /* Pods */ = { isa = PBXGroup; children = ( - 6CDA306B9D63C636C5E386EA /* Pods-Runner.debug.xcconfig */, - D3C1C8E1C6847D14747D5CA0 /* Pods-Runner.release.xcconfig */, - F3C942613F32EA1A640F6253 /* Pods-Runner.profile.xcconfig */, - 0444FC1B1408261D7136E027 /* Pods-RunnerTests.debug.xcconfig */, - 1A00CF12F959681F51F0DFF1 /* Pods-RunnerTests.release.xcconfig */, - 7C6ACEA576E5C2F6C934190C /* Pods-RunnerTests.profile.xcconfig */, + 24B0F467E9CA8104D381B202 /* Pods-Runner.debug.xcconfig */, + DD3A539579E9051D3B376D8C /* Pods-Runner.release.xcconfig */, + 22E09441D41F6799CBD1B240 /* Pods-Runner.profile.xcconfig */, + 5B2FBD20ED5FAB8AE3E2ADF2 /* Pods-RunnerTests.debug.xcconfig */, + A017ACC7D044E0AB9F6181D9 /* Pods-RunnerTests.release.xcconfig */, + 64832D0DB3389F2E98B4DB8B /* Pods-RunnerTests.profile.xcconfig */, ); path = Pods; sourceTree = ""; @@ -176,7 +176,7 @@ isa = PBXNativeTarget; buildConfigurationList = 331C8087294A63A400263BE5 /* Build configuration list for PBXNativeTarget "RunnerTests" */; buildPhases = ( - 6F0848DEFB39009965C02737 /* [CP] Check Pods Manifest.lock */, + ABF7856C364A999DB2217720 /* [CP] Check Pods Manifest.lock */, 331C807D294A63A400263BE5 /* Sources */, 331C807F294A63A400263BE5 /* Resources */, E02DE8038B90180AEC767AB8 /* Frameworks */, @@ -195,15 +195,15 @@ isa = PBXNativeTarget; buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */; buildPhases = ( - EE784DB7875630E76CDE549A /* [CP] Check Pods Manifest.lock */, + 74896B3972D4DFE648762369 /* [CP] Check Pods Manifest.lock */, 9740EEB61CF901F6004384FC /* Run Script */, 97C146EA1CF9000F007C117D /* Sources */, 97C146EB1CF9000F007C117D /* Frameworks */, 97C146EC1CF9000F007C117D /* Resources */, 9705A1C41CF9048500538489 /* Embed Frameworks */, 3B06AD1E1E4923F5004D2608 /* Thin Binary */, - 81850966CE8A19C86242963D /* [CP] Embed Pods Frameworks */, - BBDC9308AF5C3BFCEC84ACC5 /* [CP] Copy Pods Resources */, + D647B226474A988311A876B7 /* [CP] Embed Pods Frameworks */, + 9DC7C3CC7EB907CC8713FB78 /* [CP] Copy Pods Resources */, ); buildRules = ( ); @@ -292,7 +292,61 @@ shellPath = /bin/sh; shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin"; }; - 6F0848DEFB39009965C02737 /* [CP] Check Pods Manifest.lock */ = { + 74896B3972D4DFE648762369 /* [CP] Check Pods Manifest.lock */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + ); + inputPaths = ( + "${PODS_PODFILE_DIR_PATH}/Podfile.lock", + "${PODS_ROOT}/Manifest.lock", + ); + name = "[CP] Check Pods Manifest.lock"; + outputFileListPaths = ( + ); + outputPaths = ( + "$(DERIVED_FILE_DIR)/Pods-Runner-checkManifestLockResult.txt", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + 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 */ = { + isa = PBXShellScriptBuildPhase; + alwaysOutOfDate = 1; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "Run Script"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build"; + }; + 9DC7C3CC7EB907CC8713FB78 /* [CP] Copy Pods Resources */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources-${CONFIGURATION}-input-files.xcfilelist", + ); + 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 = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources.sh\"\n"; + showEnvVarsInLog = 0; + }; + ABF7856C364A999DB2217720 /* [CP] Check Pods Manifest.lock */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( @@ -314,7 +368,7 @@ 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; }; - 81850966CE8A19C86242963D /* [CP] Embed Pods Frameworks */ = { + D647B226474A988311A876B7 /* [CP] Embed Pods Frameworks */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( @@ -322,77 +376,15 @@ 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", ); - outputPaths = ( - ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n"; showEnvVarsInLog = 0; }; - 9740EEB61CF901F6004384FC /* Run Script */ = { - isa = PBXShellScriptBuildPhase; - alwaysOutOfDate = 1; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - ); - name = "Run Script"; - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build"; - }; - BBDC9308AF5C3BFCEC84ACC5 /* [CP] Copy Pods Resources */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources-${CONFIGURATION}-input-files.xcfilelist", - ); - inputPaths = ( - ); - name = "[CP] Copy Pods Resources"; - outputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources-${CONFIGURATION}-output-files.xcfilelist", - ); - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources.sh\"\n"; - showEnvVarsInLog = 0; - }; - EE784DB7875630E76CDE549A /* [CP] Check Pods Manifest.lock */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputFileListPaths = ( - ); - inputPaths = ( - "${PODS_PODFILE_DIR_PATH}/Podfile.lock", - "${PODS_ROOT}/Manifest.lock", - ); - name = "[CP] Check Pods Manifest.lock"; - outputFileListPaths = ( - ); - outputPaths = ( - "$(DERIVED_FILE_DIR)/Pods-Runner-checkManifestLockResult.txt", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - 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; - }; /* End PBXShellScriptBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ @@ -487,7 +479,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 12.0; + IPHONEOS_DEPLOYMENT_TARGET = 13.0; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; SUPPORTED_PLATFORMS = iphoneos; @@ -506,7 +498,7 @@ CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 9; + CURRENT_PROJECT_VERSION = 13; DEVELOPMENT_ASSET_PATHS = Runner/Assets.xcassets; DEVELOPMENT_TEAM = 9N5SRFUGK2; ENABLE_BITCODE = NO; @@ -517,7 +509,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 1.0.8; + MARKETING_VERSION = 1.0.12; PRODUCT_BUNDLE_IDENTIFIER = ae.gov.fcsc.frontend.ios; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; @@ -534,7 +526,7 @@ }; 331C8088294A63A400263BE5 /* Debug */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 0444FC1B1408261D7136E027 /* Pods-RunnerTests.debug.xcconfig */; + baseConfigurationReference = 5B2FBD20ED5FAB8AE3E2ADF2 /* Pods-RunnerTests.debug.xcconfig */; buildSettings = { BUNDLE_LOADER = "$(TEST_HOST)"; CODE_SIGN_STYLE = Automatic; @@ -552,7 +544,7 @@ }; 331C8089294A63A400263BE5 /* Release */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 1A00CF12F959681F51F0DFF1 /* Pods-RunnerTests.release.xcconfig */; + baseConfigurationReference = A017ACC7D044E0AB9F6181D9 /* Pods-RunnerTests.release.xcconfig */; buildSettings = { BUNDLE_LOADER = "$(TEST_HOST)"; CODE_SIGN_STYLE = Automatic; @@ -568,7 +560,7 @@ }; 331C808A294A63A400263BE5 /* Profile */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 7C6ACEA576E5C2F6C934190C /* Pods-RunnerTests.profile.xcconfig */; + baseConfigurationReference = 64832D0DB3389F2E98B4DB8B /* Pods-RunnerTests.profile.xcconfig */; buildSettings = { BUNDLE_LOADER = "$(TEST_HOST)"; CODE_SIGN_STYLE = Automatic; @@ -632,7 +624,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 12.0; + IPHONEOS_DEPLOYMENT_TARGET = 13.0; MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; SDKROOT = iphoneos; @@ -684,7 +676,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 12.0; + IPHONEOS_DEPLOYMENT_TARGET = 13.0; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; SUPPORTED_PLATFORMS = iphoneos; @@ -705,7 +697,7 @@ CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 9; + CURRENT_PROJECT_VERSION = 13; DEVELOPMENT_ASSET_PATHS = Runner/Assets.xcassets; DEVELOPMENT_TEAM = 9N5SRFUGK2; ENABLE_BITCODE = NO; @@ -716,7 +708,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 1.0.8; + MARKETING_VERSION = 1.0.12; PRODUCT_BUNDLE_IDENTIFIER = ae.gov.fcsc.frontend.ios; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; @@ -742,7 +734,7 @@ CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 9; + CURRENT_PROJECT_VERSION = 13; DEVELOPMENT_ASSET_PATHS = Runner/Assets.xcassets; DEVELOPMENT_TEAM = 9N5SRFUGK2; ENABLE_BITCODE = NO; @@ -753,7 +745,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 1.0.8; + MARKETING_VERSION = 1.0.12; PRODUCT_BUNDLE_IDENTIFIER = ae.gov.fcsc.frontend.ios; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; diff --git a/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme index b7ffc95c..df04d300 100644 --- a/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme +++ b/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme @@ -26,6 +26,7 @@ buildConfiguration = "Debug" selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" + customLLDBInitFile = "$(SRCROOT)/Flutter/ephemeral/flutter_lldbinit" shouldUseLaunchSchemeArgsEnv = "YES"> We need camera access NSLocalNetworkUsageDescription This app uses the local network to debug and connect to the Flutter development service. - NSUserTrackingUsageDescription - This identifier will be used to deliver personalized ads to you. UIApplicationSupportsIndirectInputEvents UIBackgroundModes diff --git a/lib/config/api_config.dart b/lib/config/api_config.dart index 997fb132..c32efc27 100644 --- a/lib/config/api_config.dart +++ b/lib/config/api_config.dart @@ -1,5 +1,5 @@ // api_config.dart // const String apiUrl = 'http://127.0.0.1:8090'; // const String apiUrl = 'https://pbdev.venbait.in/'; -// const String apiUrl = 'https://pb.venbait.in/'; -const String apiUrl = 'https://pocket.fcsc.gov.ae/'; +const String apiUrl = 'https://pb.venbait.in/'; +// const String apiUrl = 'https://pocket.fcsc.gov.ae/'; diff --git a/lib/config/app_links_helper.dart b/lib/config/app_links_helper.dart index e21cdd96..6a8d0b81 100644 --- a/lib/config/app_links_helper.dart +++ b/lib/config/app_links_helper.dart @@ -61,7 +61,7 @@ class AppLinksHelper { } static void _openAppLinkSettingsAndroid() { - const packageName = 'ae.gov.fcsc.frontend'; // 🔁 Replace with your app's package + const packageName = 'ae.gov.fcsc.stats'; // 🔁 Replace with your app's package final intent = AndroidIntent( action: 'android.settings.APP_OPEN_BY_DEFAULT_SETTINGS', data: 'package:$packageName', diff --git a/lib/config/sessionCheckScreen.dart b/lib/config/sessionCheckScreen.dart index 558fb384..12afd8c3 100644 --- a/lib/config/sessionCheckScreen.dart +++ b/lib/config/sessionCheckScreen.dart @@ -24,7 +24,7 @@ class _SessionCheckScreenState extends ConsumerState { bool _isLoading = true; String get playStoreUrl => - "https://play.google.com/store/apps/details?id=ae.gov.fcsc.frontend"; + "https://play.google.com/store/apps/details?id=ae.gov.fcsc.stats"; @override void initState() { diff --git a/lib/main.dart b/lib/main.dart index 6557ef42..c8bdd643 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -188,7 +188,7 @@ class _MainAppState extends ConsumerState { appsflyerSdk=AppsflyerSdk( AppsFlyerOptions( afDevKey: '7TwqHnPoWcAUuiFGpuCVtF', - appId: 'ae.gov.fcsc.frontend', + appId: 'ae.gov.fcsc.stats', showDebug: true, timeToWaitForATTUserAuthorization: 0, ), diff --git a/lib/presentation/Screens/auth_verification/create_new_pw.dart b/lib/presentation/Screens/auth_verification/create_new_pw.dart index a33ef3ff..84823353 100644 --- a/lib/presentation/Screens/auth_verification/create_new_pw.dart +++ b/lib/presentation/Screens/auth_verification/create_new_pw.dart @@ -14,6 +14,7 @@ import 'package:uae_stat/domain/use_cases/language.dart'; import 'package:uae_stat/infrastructure/data/p_auth_repo.dart'; import 'package:uae_stat/infrastructure/services/img_asset_paths/banner_asset_path.dart'; import 'package:uae_stat/infrastructure/services/img_asset_paths/icons/misc_icon_asset_path.dart'; +import 'package:uae_stat/infrastructure/services/pocketbase_service.dart'; import 'package:uae_stat/presentation/Screens/profilepage.dart'; import 'package:uae_stat/presentation/components/indicators/locale_provider.dart'; import 'package:uae_stat/presentation/components/my_toggle.dart'; @@ -148,26 +149,9 @@ class _CreateNewPwState extends ConsumerState { setState(() { isLoading = true; }); - // Authenticate as admin - // final adminAuth = await _pb.admins - // .authWithPassword('pb@venbainfotech.com', 'pb@venbainfotech.com'); - - final auth = ref.watch(authProvider); - - // final adminAuth = await pb.admins.authWithPassword( - // auth.email, - // auth.password, - // ); - // final token = adminAuth.token; - - final themeService = ThemeBaseService(); - final token = await themeService.getAdminToken( - email: auth.email, - password: auth.password, - ); final headers = { - 'Authorization': 'Bearer $token', + 'Authorization': 'Bearer ${PocketBaseService.authStore.token}', }; bool isPasswordValid = diff --git a/lib/presentation/Screens/auth_verification/forgot_password.dart b/lib/presentation/Screens/auth_verification/forgot_password.dart index fd2f5cb9..178b1c55 100644 --- a/lib/presentation/Screens/auth_verification/forgot_password.dart +++ b/lib/presentation/Screens/auth_verification/forgot_password.dart @@ -6,21 +6,20 @@ import 'package:pocketbase/pocketbase.dart'; import 'package:shared_preferences/shared_preferences.dart'; import 'package:uae_stat/config/api_config.dart'; import 'package:uae_stat/config/connectivity_provider.dart'; -import 'package:uae_stat/config/my_router.dart'; -import 'package:uae_stat/config/theme/auth_provider.dart'; -import 'package:uae_stat/config/theme/service.dart'; import 'package:uae_stat/config/theme/theme_provider.dart'; +import 'package:uae_stat/config/my_router.dart'; import 'package:uae_stat/domain/use_cases/language.dart'; import 'package:uae_stat/infrastructure/data/p_auth_repo.dart'; import 'package:uae_stat/infrastructure/services/img_asset_paths/banner_asset_path.dart'; import 'package:uae_stat/infrastructure/services/img_asset_paths/icons/misc_icon_asset_path.dart'; -import 'package:uae_stat/l10n/app_localizations.dart'; +import 'package:uae_stat/infrastructure/services/pocketbase_service.dart'; import 'package:uae_stat/presentation/Screens/profilepage.dart'; import 'package:uae_stat/presentation/components/indicators/locale_provider.dart'; import 'package:uae_stat/presentation/components/my_toggle.dart'; import 'package:uae_stat/presentation/components/space.dart'; +// import 'package:flutter_gen/gen_l10n/app_localizations.dart'; +import 'package:uae_stat/l10n/app_localizations.dart'; import 'package:uae_stat/config/my_theme.dart'; -import 'package:uae_stat/presentation/routes/drawer_routes/Drawer%20Items/notification/notification.dart'; class ForgotPassword extends ConsumerStatefulWidget { final String email; @@ -43,9 +42,12 @@ class _ForgotPasswordState extends ConsumerState { String? _newPassword; String? _confirmPassword; - final fcscBanner = Image.asset( - BannerAssetPath.fcscLogoLight, - height: 40, + final fcscBanner = Padding( + padding: const EdgeInsets.all(30.0), + child: Image.asset( + BannerAssetPath.fcscLogoLight, + height: 40, + ), ); String? _validateNewPassword(String? value) { @@ -179,31 +181,17 @@ class _ForgotPasswordState extends ConsumerState { // Authenticate as admin // final adminAuth = await _pb.admins // .authWithPassword('pb@venbainfotech.com', 'pb@venbainfotech.com'); - - final auth = ref.watch(authProvider); - - // final adminAuth = await pb.admins.authWithPassword( - // auth.email, - // auth.password, - // ); - // // final token = adminAuth.token; - final themeService = ThemeBaseService(); - final token = await themeService.getAdminToken( - email: auth.email, - password: auth.password, - ); - final headers = { - 'Authorization': 'Bearer $token', + 'Authorization': 'Bearer ${PocketBaseService.authStore.token}', }; // Step 1: Find User by Email final result = await _pb.collection('users').getList( - filter: 'email = "$email"', - headers: headers, - ); + filter: 'email = "$email"', + headers: headers, + ); if (result.items.isEmpty) { // throw Exception("User not found"); @@ -213,9 +201,9 @@ class _ForgotPasswordState extends ConsumerState { 'User not found', style: TextStyle( fontFamily: context.translate( - 'Roboto', - 'NotoKufi', - )), + 'Roboto', + 'NotoKufi', + )), ), backgroundColor: Colors.red, ), @@ -226,13 +214,13 @@ class _ForgotPasswordState extends ConsumerState { // Step 3: Update Password await _pb.collection('users').update( - userId, - body: { - 'password': newPassword, - 'passwordConfirm': newPassword, - }, - headers: headers, - ); + userId, + body: { + 'password': newPassword, + 'passwordConfirm': newPassword, + }, + headers: headers, + ); setState(() { isLoading = false; @@ -245,9 +233,9 @@ class _ForgotPasswordState extends ConsumerState { AppLocalizations.of(context)!.password_update_successfully, style: TextStyle( fontFamily: context.translate( - 'Roboto', - 'NotoKufi', - )), + 'Roboto', + 'NotoKufi', + )), ), backgroundColor: Colors.green, ), @@ -265,9 +253,9 @@ class _ForgotPasswordState extends ConsumerState { 'Failed to update password: $e', style: TextStyle( fontFamily: context.translate( - 'Roboto', - 'NotoKufi', - )), + 'Roboto', + 'NotoKufi', + )), ), backgroundColor: Colors.red, ), @@ -295,14 +283,13 @@ class _ForgotPasswordState extends ConsumerState { } }); - // final themeMode = ref.read(themeProvider); - // final themeMode = ThemeMode.dark; - final isDarkTheme = ref.read(themeProvider) == ThemeMode.dark || - (ref.read(themeProvider) == ThemeMode.system && + final themeMode = ref.read(themeProvider); + final isDarkTheme = themeMode == ThemeMode.dark || + (themeMode == ThemeMode.system && MediaQuery.of(context).platformBrightness == Brightness.dark); return Scaffold( - backgroundColor: Colors.white, + backgroundColor: isDarkTheme ? Color(0xFF111111) : Colors.white, body: Stack(children: [ SingleChildScrollView( child: SafeArea( @@ -313,9 +300,7 @@ class _ForgotPasswordState extends ConsumerState { ), if (isLoading) Container( - color: isDarkTheme - ? Colors.black - : Colors.white, // Semi-transparent background + color: Color(0x98FFFCE5), // Semi-transparent background child: Column( mainAxisAlignment: MainAxisAlignment.center, children: [ @@ -325,9 +310,9 @@ class _ForgotPasswordState extends ConsumerState { child: LinearProgressIndicator( minHeight: 5, // Adjust thickness backgroundColor: - Colors.grey[100], // Optional: Background color + Colors.grey[100], // Optional: Background color valueColor: AlwaysStoppedAnimation( - Color(0xFFAA8E83)), // Loader color + Color(0xFFB68A34)), // Loader color ), ), ], @@ -338,6 +323,10 @@ class _ForgotPasswordState extends ConsumerState { Widget _buildPasswordForm( WidgetRef ref, double screenHeight, double screenWidth) { + final themeMode = ref.read(themeProvider); + final isDarkTheme = themeMode == ThemeMode.dark || + (themeMode == ThemeMode.system && + MediaQuery.of(context).platformBrightness == Brightness.dark); final passwordLocale = ref.watch(localeProvider); return Form( key: _formKey, @@ -363,7 +352,7 @@ class _ForgotPasswordState extends ConsumerState { // Icons.close, Icons.arrow_back_ios, size: 24, // Icon size - color: Colors.black, // Icon color + color: isDarkTheme ? Colors.white : Colors.black, // Icon color ), ), ), // Left icon @@ -412,6 +401,7 @@ class _ForgotPasswordState extends ConsumerState { 'NotoKufi', ), fontWeight: FontWeight.w300, + color: isDarkTheme ? Colors.white : Color(0xFF111111), ), ), SizedBox(height: 10), @@ -426,7 +416,7 @@ class _ForgotPasswordState extends ConsumerState { ), style: TextStyle( fontSize: - passwordLocale?.languageCode == 'ar' ? 14 : 15, + passwordLocale?.languageCode == 'ar' ? 14 : 15, fontWeight: FontWeight.w700, color: Color(0xFF898C81), fontFamily: context.translate( @@ -443,7 +433,7 @@ class _ForgotPasswordState extends ConsumerState { 'NotoKufi', ), fontSize: - passwordLocale?.languageCode == 'ar' ? 14 : 15, + passwordLocale?.languageCode == 'ar' ? 14 : 15, color: Color(0xFF898C81), fontWeight: FontWeight.w700), ), @@ -480,10 +470,17 @@ class _ForgotPasswordState extends ConsumerState { fit: BoxFit.fitHeight, height: 25, width: 25, - color: MyTheme.topicColor(IndicatorTopic.economy).shade300, + color: Color(0xFFB68A34), + // color: MyTheme.topicColor(IndicatorTopic.economy).shade300, + ), + ), + errorStyle: TextStyle( + color: Color(0xFFD83731), + fontFamily: context.translate( + 'Roboto', + 'NotoKufi', ), ), - suffixIcon: IconButton( // icon: Icon( // _obscureNewPassword @@ -511,15 +508,12 @@ class _ForgotPasswordState extends ConsumerState { ), enabledBorder: OutlineInputBorder( borderRadius: BorderRadius.circular(10), - borderSide: BorderSide( - color: - MyTheme.topicColor(IndicatorTopic.economy).shade400, - width: 1), + borderSide: BorderSide(color: Color(0xFFB68A34), width: 1), ), focusedBorder: OutlineInputBorder( borderRadius: BorderRadius.circular(10), borderSide: BorderSide( - color: Colors.deepPurple, width: 2), // Focused border + color: Color(0xFFB68A34), width: 2), // Focused border ), errorBorder: OutlineInputBorder( borderRadius: BorderRadius.circular(10), @@ -563,10 +557,16 @@ class _ForgotPasswordState extends ConsumerState { fit: BoxFit.fitHeight, height: 25, width: 25, - color: MyTheme.topicColor(IndicatorTopic.economy).shade300, + color: Color(0xFFB68A34), + ), + ), + errorStyle: TextStyle( + color: Color(0xFFD83731), + fontFamily: context.translate( + 'Roboto', + 'NotoKufi', ), ), - suffixIcon: IconButton( // icon: Icon( // _obscureConfirmPassword @@ -594,15 +594,12 @@ class _ForgotPasswordState extends ConsumerState { // border: OutlineInputBorder(), enabledBorder: OutlineInputBorder( borderRadius: BorderRadius.circular(10), - borderSide: BorderSide( - color: - MyTheme.topicColor(IndicatorTopic.economy).shade400, - width: 1), + borderSide: BorderSide(color: Color(0xFFB68A34), width: 1), ), focusedBorder: OutlineInputBorder( borderRadius: BorderRadius.circular(10), borderSide: BorderSide( - color: Colors.deepPurple, width: 2), // Focused border + color: Color(0xFFB68A34), width: 2), // Focused border ), errorBorder: OutlineInputBorder( borderRadius: BorderRadius.circular(10), @@ -635,7 +632,7 @@ class _ForgotPasswordState extends ConsumerState { } }, style: ElevatedButton.styleFrom( - backgroundColor: Colors.brown[300], + backgroundColor: Color(0xFFB68A34), padding: EdgeInsets.symmetric(horizontal: 80, vertical: 16), shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular(10), @@ -648,7 +645,7 @@ class _ForgotPasswordState extends ConsumerState { AppLocalizations.of(context)!.save, style: TextStyle( fontSize: - passwordLocale?.languageCode == 'ar' ? 14 : 18, + passwordLocale?.languageCode == 'ar' ? 14 : 18, color: Colors.white, fontFamily: context.translate( 'Roboto', @@ -677,7 +674,14 @@ class _ForgotPasswordState extends ConsumerState { // ), // ), // ), - child: fcscBanner, + child: Padding( + padding: EdgeInsets.all(30.0), + child: Image.asset( + isDarkTheme ? BannerAssetPath.fcscLogoDark : + BannerAssetPath.fcscLogoLight, + height: 40, + ), + ), ), ], ), @@ -686,6 +690,12 @@ class _ForgotPasswordState extends ConsumerState { } Widget _buildSuccessContent(double screenHeight, double screenWidth) { + + final themeMode = ref.read(themeProvider); + final isDarkTheme = themeMode == ThemeMode.dark || + (themeMode == ThemeMode.system && + MediaQuery.of(context).platformBrightness == Brightness.dark); + print('IN'); return Padding( padding: EdgeInsets.all(20.0), @@ -732,7 +742,7 @@ class _ForgotPasswordState extends ConsumerState { ), ), backgroundColor: WidgetStatePropertyAll( - MyTheme.topicColor(IndicatorTopic.social), + Color(0xFFB68A34), ), // surfaceTintColor: MaterialStatePropertyAll( // MyTheme.economy[800], @@ -776,10 +786,17 @@ class _ForgotPasswordState extends ConsumerState { // ), // ), // ), - child: fcscBanner, + child: Padding( + padding: EdgeInsets.all(30.0), + child: Image.asset( + isDarkTheme ? BannerAssetPath.fcscLogoDark : + BannerAssetPath.fcscLogoLight, + height: 40, + ), + ), ), ], ), ); } -} +} \ No newline at end of file diff --git a/lib/presentation/Screens/charts/screens/chart_screen.dart b/lib/presentation/Screens/charts/screens/chart_screen.dart index 9451cb10..12204ac2 100644 --- a/lib/presentation/Screens/charts/screens/chart_screen.dart +++ b/lib/presentation/Screens/charts/screens/chart_screen.dart @@ -144,29 +144,11 @@ class _ChartScreen1State extends ConsumerState { final prefs = await SharedPreferences.getInstance(); final userID = prefs.getString('userId'); try { - // final adminAuth = await _pb.admins.authWithPassword( - // 'pb@venbainfotech.com', - // 'pb@venbainfotech.com', - // ); - - final auth = ref.watch(authProvider); - - // final adminAuth = await pb.admins.authWithPassword( - // auth.email, - // auth.password, - // ); - // final adminToken = adminAuth.token; - - final themeService = ThemeBaseService(); - // final adminToken = await themeService.getAdminToken( - // email: auth.email, - // password: auth.password, - // ); final result = await _pb.collection('bookmark').getList( filter: "user_id = '${userID}' && dataset = '${widget.dataSets}'", headers: { - 'Authorization': PocketBaseService.authStore.token, // Pass the admin token + 'Authorization': 'Bearer ${PocketBaseService.authStore.token}' // Pass the admin token }, ); @@ -186,16 +168,7 @@ class _ChartScreen1State extends ConsumerState { final prefs = await SharedPreferences.getInstance(); final userID = prefs.getString('userId'); try { - // final adminAuth = await _pb.admins - // .authWithPassword('pb@venbainfotech.com', 'pb@venbainfotech.com'); - final auth = ref.watch(authProvider); - - // final adminAuth = await pb.admins.authWithPassword( - // auth.email, - // auth.password, - // ); - // final adminToken = adminAuth.token; final response = await _pb.collection('bookmark').create(body: { 'user_id': userID, 'dataset': widget.dataSets, @@ -204,7 +177,7 @@ class _ChartScreen1State extends ConsumerState { 'title': widget.title, 'keyParam': widget.keyParam, }, headers: { - 'Authorization': PocketBaseService.authStore.token + 'Authorization': 'Bearer ${PocketBaseService.authStore.token}' }); setState(() { diff --git a/lib/presentation/Screens/charts/widgets/chart_widget.dart b/lib/presentation/Screens/charts/widgets/chart_widget.dart index 7ee6ea7a..b51db701 100644 --- a/lib/presentation/Screens/charts/widgets/chart_widget.dart +++ b/lib/presentation/Screens/charts/widgets/chart_widget.dart @@ -12,10 +12,10 @@ import 'package:d_chart/d_chart.dart'; class ChartWidget extends StatelessWidget { ChartWidget( {Key? key, - required this.chartData, - required this.bodyColor, - required this.chartHeader, - required this.isDarkTheme}) + required this.chartData, + required this.bodyColor, + required this.chartHeader, + required this.isDarkTheme}) : super(key: key); final dynamic chartData; final Color bodyColor; @@ -28,64 +28,86 @@ class ChartWidget extends StatelessWidget { // Define color lists final Map> colorMap = { "ECONOMY": [ - Color(0xFF648CBA), - Color(0xFF90B0D5), - Color(0xFF98BCE5), - Color(0xFFA7B5C5), - Color(0xFFBED3EC), - Color(0xFFD4E3F4), + Color(0xFF89AFD8), // base + Color(0xFF6D99CC), + Color(0xFF4F82BA), + Color(0xFF3A6FA9), + Color(0xFF255B96), ], "SOCIAL": [ - Color(0xFFD9BB99), - Color(0xFF87766E), - Color(0xFFC6A885), - Color(0xFFA28565), - Color(0xFFBFB29B), - Color(0xFFE8D8BB), + Color(0xFF675863), // base + Color(0xFF7A6B76), + Color(0xFF8C7E8A), + Color(0xFFA0909D), + Color(0xFFB4A3B0), ], "ENVIRONMENT": [ - Color(0xFF376C79), - Color(0xFF578D9C), - Color(0xFF7DAFBC), - Color(0xFF86C7D9), - // Color(0xFF989898), + Color(0xFFB3CF99), // base + Color(0xFF9DC280), + Color(0xFF86B568), + Color(0xFF6FA84F), + Color(0xFF5A9C39), ], + // "ECONOMY": [ + // Color(0xFF648CBA), + // Color(0xFF90B0D5), + // Color(0xFF98BCE5), + // Color(0xFFA7B5C5), + // Color(0xFFBED3EC), + // Color(0xFFD4E3F4), + // ], + // "SOCIAL": [ + // Color(0xFFD9BB99), + // Color(0xFF87766E), + // Color(0xFFC6A885), + // Color(0xFFA28565), + // Color(0xFFBFB29B), + // Color(0xFFE8D8BB), + // ], + // "ENVIRONMENT": [ + // Color(0xFF376C79), + // Color(0xFF578D9C), + // Color(0xFF7DAFBC), + // Color(0xFF86C7D9), + // // Color(0xFF989898), + // ], }; final Map> colorMapForFour = { "ECONOMY": [ - Color(0xFF648CBA), - Color(0xFF90B0D5), - Color(0xFF98BCE5), - Color(0xFFA7B5C5), - Color(0xFFBED3EC), + Color(0xFF89AFD8), // base + Color(0xFF6D99CC), + Color(0xFF4F82BA), + Color(0xFF3A6FA9), + Color(0xFF255B96), ], "SOCIAL": [ - Color(0xFFD9BB99), - Color(0xFF87766E), - Color(0xFFC6A885), - Color(0xFFA28565), - Color(0xFFBFB29B), + Color(0xFF675863), // base + Color(0xFF7A6B76), + Color(0xFF8C7E8A), + Color(0xFFA0909D), + Color(0xFFB4A3B0), ], "ENVIRONMENT": [ - Color(0xFF376C79), - Color(0xFF578D9C), - Color(0xFF7DAFBC), - Color(0xFF86C7D9), + Color(0xFFB3CF99), // base + Color(0xFF9DC280), + Color(0xFF86B568), + Color(0xFF6FA84F), + Color(0xFF5A9C39), ], }; final Map> colorMapForThree = { - "ECONOMY": [Color(0xFF648CBA), Color(0xFF90B0D5), Color(0xFF98BCE5)], - "SOCIAL": [Color(0xFFD9BB99), Color(0xFF87766E), Color(0xFFC6A885)], - "ENVIRONMENT": [Color(0xFF376C79), Color(0xFF578D9C), Color(0xFF7DAFBC)], + "ECONOMY": [Color(0xFF89AFD8), Color(0xFF6D99CC), Color(0xFF4F82BA)], + "SOCIAL": [Color(0xFF675863), Color(0xFF7A6B76), Color(0xFF8C7E8A)], + "ENVIRONMENT": [Color(0xFFB3CF99), Color(0xFF9DC280), Color(0xFF86B568)], }; // Define color lists final Map> colorMapForTwo = { - "ECONOMY": [Color(0xFF648CBA), Color(0xFF90B0D5)], - "SOCIAL": [Color(0xFFD9BB99), Color(0xFF87766E)], - "ENVIRONMENT": [Color(0xFF376C79), Color(0xFF578D9C)], + "ECONOMY": [Color(0xFF89AFD8), Color(0xFF6D99CC)], + "SOCIAL": [Color(0xFF675863), Color(0xFF7A6B76)], + "ENVIRONMENT": [Color(0xFFB3CF99), Color(0xFF9DC280)], }; // List get uniqueColors => colorMap[chartHeader] ?? [Colors.grey]; // Default to grey if header is unknown @@ -175,10 +197,10 @@ class ChartWidget extends StatelessWidget { } String formatNumberConversion( - double value, - String chartConversion, - String numberFormat, - ) { + double value, + String chartConversion, + String numberFormat, + ) { // Convert the input value to base unit (actual value) double baseValue = value; @@ -209,10 +231,10 @@ class ChartWidget extends StatelessWidget { } List parseStackedBarChartData( - dynamic chartData, - String groupByKey, - String groupByValue, - ) { + dynamic chartData, + String groupByKey, + String groupByValue, + ) { return chartData['response'] .where((entry) => entry['ObsKey'][groupByKey] == groupByValue) .map((entry) { @@ -292,8 +314,8 @@ class ChartWidget extends StatelessWidget { } return chartData['response'].asMap().entries.map(( - entry, - ) { + entry, + ) { int index = entry.key; var data = entry.value; @@ -332,12 +354,12 @@ class ChartWidget extends StatelessWidget { // displayTitle = '${title.substring(0, endIndex)}...'; displayTitle = - title.length > 12 ? '${title.substring(0, 12)}...' : title; + title.length > 12 ? '${title.substring(0, 12)}...' : title; } else { print("DPT2"); String part1 = title.substring(0, min(12, title.length)); String part2 = - title.length > 12 ? title.substring(12, min(24, title.length)) : ''; + title.length > 12 ? title.substring(12, min(24, title.length)) : ''; displayTitle = part2.isNotEmpty ? '$part1\n-$part2' : part1; } @@ -447,7 +469,7 @@ class ChartWidget extends StatelessWidget { String title = data['ObsKey'][groupByKeyValue] ?? ''; // String value = data['ObsValue']['Value'].toString(); String shortTitle = - title.length > 10 ? '${title.substring(0, 10)}…' : title; + title.length > 10 ? '${title.substring(0, 10)}…' : title; // Handle different types: int, double, and String double value = 0.0; @@ -506,7 +528,7 @@ class ChartWidget extends StatelessWidget { return Row( crossAxisAlignment: - CrossAxisAlignment.start, // Aligns dot to text start + CrossAxisAlignment.start, // Aligns dot to text start children: [ Container( width: 10, @@ -558,9 +580,9 @@ class ChartWidget extends StatelessWidget { } List generateIndicatorsBar( - Map chartData, - List groupByValues, - ) { + Map chartData, + List groupByValues, + ) { List indicators = []; for (int i = 0; i < groupByValues.length; i++) { @@ -633,80 +655,80 @@ class ChartWidget extends StatelessWidget { print('groupByValues $groupByValues'); switch (chartData['chart_type_json']['chart_type']) { - // case 'stacked_bar': - // String chartTitle = - // capitalizeAndSplit(chartData['chart_heading'] ?? ''); - // // Define a list of colors - // final List uniqueColors = [ - // Color(0xFF648CBA), - // Color(0xFF90B0D5), - // Color(0xFF98BCE5), - // Color(0xFFA7B5C5), - // Color(0xFFBED3EC), - // Color(0xFFD4E3F4), - // ]; - // return SfCartesianChart( - // primaryXAxis: CategoryAxis(), - // title: ChartTitle(text: chartData['chart_heading']), - // legend: Legend( - // isVisible: true, - // position: LegendPosition.bottom, - // overflowMode: LegendItemOverflowMode.scroll, - // ), - // tooltipBehavior: TooltipBehavior( - // enable: true, // Enable tooltips - // format: 'point.x : point.y', // Custom tooltip format - // ), - // series: >[ - // for (int i = 0; i < groupByValues.length; i++) - // StackedBarSeries( - // dataSource: parseStackedBarChartData( - // chartData, groupByKey, groupByValues.elementAt(i)), - // xValueMapper: (ChartData data, _) => data.x ?? '', - // yValueMapper: (ChartData data, _) => data.y, - // name: groupByValues.elementAt(i), - // color: uniqueColors[i % uniqueColors.length], - // enableTooltip: true, - // ), - // ], - // ); - // case 'stacked_column': - // String chartTitle = - // capitalizeAndSplit(chartData['chart_heading'] ?? ''); - // // Define a list of colors - // final List uniqueColors = [ - // Color(0xFF648CBA), - // Color(0xFF90B0D5), - // Color(0xFF98BCE5), - // Color(0xFFA7B5C5), - // Color(0xFFBED3EC), - // Color(0xFFD4E3F4), - // ]; - // return SfCartesianChart( - // primaryXAxis: CategoryAxis(), - // title: ChartTitle(text: chartData['chart_heading']), - // legend: Legend( - // isVisible: true, - // position: LegendPosition.bottom, - // overflowMode: LegendItemOverflowMode.scroll, - // ), - // tooltipBehavior: TooltipBehavior( - // enable: true, // Enable tooltips - // format: 'point.x : point.y', // Custom tooltip format - // ), - // series: >[ - // for (int i = 0; i < groupByValues.length; i++) - // StackedColumnSeries( - // dataSource: parseStackedBarChartData( - // chartData, groupByKey, groupByValues.elementAt(i)), - // xValueMapper: (ChartData data, _) => data.x ?? '', - // yValueMapper: (ChartData data, _) => data.y, - // name: groupByValues.elementAt(i), - // color: uniqueColors[i % uniqueColors.length], - // enableTooltip: true, - // ), - // ], - // ); + // case 'stacked_bar': + // String chartTitle = + // capitalizeAndSplit(chartData['chart_heading'] ?? ''); + // // Define a list of colors + // final List uniqueColors = [ + // Color(0xFF648CBA), + // Color(0xFF90B0D5), + // Color(0xFF98BCE5), + // Color(0xFFA7B5C5), + // Color(0xFFBED3EC), + // Color(0xFFD4E3F4), + // ]; + // return SfCartesianChart( + // primaryXAxis: CategoryAxis(), + // title: ChartTitle(text: chartData['chart_heading']), + // legend: Legend( + // isVisible: true, + // position: LegendPosition.bottom, + // overflowMode: LegendItemOverflowMode.scroll, + // ), + // tooltipBehavior: TooltipBehavior( + // enable: true, // Enable tooltips + // format: 'point.x : point.y', // Custom tooltip format + // ), + // series: >[ + // for (int i = 0; i < groupByValues.length; i++) + // StackedBarSeries( + // dataSource: parseStackedBarChartData( + // chartData, groupByKey, groupByValues.elementAt(i)), + // xValueMapper: (ChartData data, _) => data.x ?? '', + // yValueMapper: (ChartData data, _) => data.y, + // name: groupByValues.elementAt(i), + // color: uniqueColors[i % uniqueColors.length], + // enableTooltip: true, + // ), + // ], + // ); + // case 'stacked_column': + // String chartTitle = + // capitalizeAndSplit(chartData['chart_heading'] ?? ''); + // // Define a list of colors + // final List uniqueColors = [ + // Color(0xFF648CBA), + // Color(0xFF90B0D5), + // Color(0xFF98BCE5), + // Color(0xFFA7B5C5), + // Color(0xFFBED3EC), + // Color(0xFFD4E3F4), + // ]; + // return SfCartesianChart( + // primaryXAxis: CategoryAxis(), + // title: ChartTitle(text: chartData['chart_heading']), + // legend: Legend( + // isVisible: true, + // position: LegendPosition.bottom, + // overflowMode: LegendItemOverflowMode.scroll, + // ), + // tooltipBehavior: TooltipBehavior( + // enable: true, // Enable tooltips + // format: 'point.x : point.y', // Custom tooltip format + // ), + // series: >[ + // for (int i = 0; i < groupByValues.length; i++) + // StackedColumnSeries( + // dataSource: parseStackedBarChartData( + // chartData, groupByKey, groupByValues.elementAt(i)), + // xValueMapper: (ChartData data, _) => data.x ?? '', + // yValueMapper: (ChartData data, _) => data.y, + // name: groupByValues.elementAt(i), + // color: uniqueColors[i % uniqueColors.length], + // enableTooltip: true, + // ), + // ], + // ); case 'column_chart': // Case 3 for fl_chart column chart return BarChart( BarChartData( @@ -723,8 +745,8 @@ class ChartWidget extends StatelessWidget { return (value is num) ? value.toDouble() : value is String - ? double.tryParse(value) ?? 0.0 - : 0.0; + ? double.tryParse(value) ?? 0.0 + : 0.0; }).fold(0.0, (prev, element) => prev + element); ValueNotifier touchedIndex = ValueNotifier(null); @@ -776,7 +798,7 @@ class ChartWidget extends StatelessWidget { .touchedSection!.touchedSectionIndex; } else { touchedIndex.value = - null; // Reset when not touching + null; // Reset when not touching } }, ), @@ -810,7 +832,7 @@ class ChartWidget extends StatelessWidget { // Change Row to Column crossAxisAlignment: CrossAxisAlignment.start, children: - generateIndicators(chartData, totalValue, context), + generateIndicators(chartData, totalValue, context), ), ), ), @@ -820,7 +842,7 @@ class ChartWidget extends StatelessWidget { ], ); case 'fl_stacked_bar': - // Divide groupByValuesList into chunks of 5 items per row + // Divide groupByValuesList into chunks of 5 items per row List groupByValuesList = groupByValues.toList(); int chunkSize = 5; List> chunkedGroupByValues = []; @@ -881,11 +903,11 @@ class ChartWidget extends StatelessWidget { tooltipMargin: 16, getTooltipColor: (colorMap) => Colors.black, getTooltipItem: ( - groupData, - groupIndex, - rodData, - rodIndex, - ) { + groupData, + groupIndex, + rodData, + rodIndex, + ) { // Get the list of group names dynamically List groupNames = []; @@ -1084,8 +1106,8 @@ class ChartWidget extends StatelessWidget { List years = (chartData['response'] as List) .map( (entry) => - int.tryParse(entry['ObsKey']['TIME_PERIOD'] ?? '0') ?? 0, - ) + int.tryParse(entry['ObsKey']['TIME_PERIOD'] ?? '0') ?? 0, + ) .toList(); // Sort in ascending order years.sort(); @@ -1115,7 +1137,7 @@ class ChartWidget extends StatelessWidget { // Filter chart data to only include entries within the last 5 years List filteredData = - (chartData['response'] as List).where((entry) { + (chartData['response'] as List).where((entry) { int year = int.tryParse(entry['ObsKey']['TIME_PERIOD'] ?? '0') ?? 0; return year >= minYear && year <= maxYear; }).toList(); @@ -1128,7 +1150,7 @@ class ChartWidget extends StatelessWidget { Set uniqueXValues = filteredData.map((entry) { String? timePeriod = - entry['ObsKey']['TIME_PERIOD']; // Nullable String + entry['ObsKey']['TIME_PERIOD']; // Nullable String print('TIME_PERIOD- $timePeriod'); if (timePeriod == null) { @@ -1214,9 +1236,9 @@ class ChartWidget extends StatelessWidget { // Now map to Color Map parsedChartBarColors = chartBarColrs.map(( - key, - value, - ) { + key, + value, + ) { return MapEntry(key, _hexToColor(value)); }); @@ -1225,10 +1247,10 @@ class ChartWidget extends StatelessWidget { for (String group in groupByValues) { if (hasBarColors && chartData['dataset'] == 'population') { groupColorMap[group] = - parsedChartBarColors[group]!; // Directly assign as Color + parsedChartBarColors[group]!; // Directly assign as Color } else { groupColorMap[group] = - uniqueColors[colorIndex % uniqueColors.length]; + uniqueColors[colorIndex % uniqueColors.length]; } colorIndex++; } @@ -1343,8 +1365,8 @@ class ChartWidget extends StatelessWidget { List years = (chartData['response'] as List) .map( (entry) => - int.tryParse(entry['ObsKey']['TIME_PERIOD'] ?? '0') ?? 0, - ) + int.tryParse(entry['ObsKey']['TIME_PERIOD'] ?? '0') ?? 0, + ) .toList(); if (years.isEmpty) { @@ -1365,7 +1387,7 @@ class ChartWidget extends StatelessWidget { // Filter chart data to include only the selected years List filteredData = - (chartData['response'] as List).where((entry) { + (chartData['response'] as List).where((entry) { int year = int.tryParse(entry['ObsKey']['TIME_PERIOD'] ?? '0') ?? 0; return selectedYears.contains(year); }).toList(); @@ -1373,7 +1395,7 @@ class ChartWidget extends StatelessWidget { Set uniqueXValues = filteredData .map( (entry) => double.parse(entry['ObsKey']['TIME_PERIOD']), - ) + ) .toSet(); var chartBarColors = chartData['chart_bar_color'] ?? {}; @@ -1402,10 +1424,10 @@ class ChartWidget extends StatelessWidget { for (String group in groupByValues) { if (parsedChartBarColors.containsKey(group)) { groupColorMap[group] = - parsedChartBarColors[group]!; // Directly assign as Color + parsedChartBarColors[group]!; // Directly assign as Color } else { groupColorMap[group] = - uniqueColors[colorIndex % uniqueColors.length]; + uniqueColors[colorIndex % uniqueColors.length]; } colorIndex++; } @@ -1487,7 +1509,7 @@ class ChartWidget extends StatelessWidget { }); return Scaffold( - backgroundColor: isDarkTheme ? Colors.transparent : Colors.white, + backgroundColor: Colors.transparent, body: Padding( padding: const EdgeInsets.all(10), child: LayoutBuilder( @@ -1496,9 +1518,9 @@ class ChartWidget extends StatelessWidget { final chartHeight = constraints.maxHeight; final allSpots = lineBars.expand((line) => line.spots); final minY = - allSpots.map((e) => e.y).reduce((a, b) => a < b ? a : b); + allSpots.map((e) => e.y).reduce((a, b) => a < b ? a : b); final maxY = - allSpots.map((e) => e.y).reduce((a, b) => a > b ? a : b); + allSpots.map((e) => e.y).reduce((a, b) => a > b ? a : b); final xValues = allSpots.map((e) => e.x).toList(); final minX = xValues.reduce((a, b) => a < b ? a : b).toInt(); @@ -1511,7 +1533,7 @@ class ChartWidget extends StatelessWidget { return Column( crossAxisAlignment: - CrossAxisAlignment.center, // ensures center alignment + CrossAxisAlignment.center, // ensures center alignment children: [ Padding( padding: const EdgeInsets.only(top: 0), @@ -1567,7 +1589,7 @@ class ChartWidget extends StatelessWidget { ? Colors.white : Colors.black, margin: - EdgeInsets.only(bottom: 2), + EdgeInsets.only(bottom: 2), ), Text(value.toInt().toString(), style: style), @@ -1637,15 +1659,15 @@ class ChartWidget extends StatelessWidget { final xPos = ((spot.x - minX) / (maxX - minX)) * chartWidth; final yPos = (1 - - (spot.y - chartMinY) / - (chartMaxY - chartMinY)) * + (spot.y - chartMinY) / + (chartMaxY - chartMinY)) * chartHeight; // Prevent label from going outside on the left double adjustedLeft = math.max(0, xPos - 30); return Stack(children: [ Positioned( left: - adjustedLeft, // fine-tune horizontal position + adjustedLeft, // fine-tune horizontal position top: yPos - 60, // fine-tune vertical position child: Text( formatNumber(spot.y), @@ -1685,7 +1707,7 @@ class ChartWidget extends StatelessWidget { style: TextStyle( fontSize: 14, fontFamily: - context.translate('Roboto', 'NotoKufi'), + context.translate('Roboto', 'NotoKufi'), ), ), ], @@ -1711,8 +1733,8 @@ class ChartWidget extends StatelessWidget { List years = (chartData['response'] as List) .map( (entry) => - int.tryParse(entry['ObsKey']['TIME_PERIOD'] ?? '0') ?? 0, - ) + int.tryParse(entry['ObsKey']['TIME_PERIOD'] ?? '0') ?? 0, + ) .toList(); if (years.isEmpty) { @@ -1733,7 +1755,7 @@ class ChartWidget extends StatelessWidget { // Filter chart data to include only the selected years List filteredData = - (chartData['response'] as List).where((entry) { + (chartData['response'] as List).where((entry) { int year = int.tryParse(entry['ObsKey']['TIME_PERIOD'] ?? '0') ?? 0; return selectedYears.contains(year); }).toList(); @@ -1741,7 +1763,7 @@ class ChartWidget extends StatelessWidget { Set uniqueXValues = filteredData .map( (entry) => double.parse(entry['ObsKey']['TIME_PERIOD']), - ) + ) .toSet(); var chartBarColors = chartData['chart_bar_color'] ?? {}; @@ -1770,10 +1792,10 @@ class ChartWidget extends StatelessWidget { for (String group in groupByValues) { if (parsedChartBarColors.containsKey(group)) { groupColorMap[group] = - parsedChartBarColors[group]!; // Directly assign as Color + parsedChartBarColors[group]!; // Directly assign as Color } else { groupColorMap[group] = - uniqueColors[colorIndex % uniqueColors.length]; + uniqueColors[colorIndex % uniqueColors.length]; } colorIndex++; } @@ -1878,7 +1900,7 @@ class ChartWidget extends StatelessWidget { }); return Scaffold( - backgroundColor: isDarkTheme ? Colors.transparent : Colors.white, + backgroundColor: Colors.transparent, body: Padding( padding: const EdgeInsets.all(10), child: LayoutBuilder( @@ -1887,9 +1909,9 @@ class ChartWidget extends StatelessWidget { final chartHeight = constraints.maxHeight; final allSpots = lineBars.expand((line) => line.spots); final minY = - allSpots.map((e) => e.y).reduce((a, b) => a < b ? a : b); + allSpots.map((e) => e.y).reduce((a, b) => a < b ? a : b); final maxY = - allSpots.map((e) => e.y).reduce((a, b) => a > b ? a : b); + allSpots.map((e) => e.y).reduce((a, b) => a > b ? a : b); final xValues = allSpots.map((e) => e.x).toList(); final minX = xValues.reduce((a, b) => a < b ? a : b).toInt(); @@ -1902,7 +1924,7 @@ class ChartWidget extends StatelessWidget { return Column( crossAxisAlignment: - CrossAxisAlignment.center, // ensures center alignment + CrossAxisAlignment.center, // ensures center alignment children: [ Padding( padding: const EdgeInsets.only(top: 0), @@ -1958,7 +1980,7 @@ class ChartWidget extends StatelessWidget { ? Colors.white : Colors.black, margin: - EdgeInsets.only(bottom: 2), + EdgeInsets.only(bottom: 2), ), Text(value.toInt().toString(), style: style), @@ -2014,7 +2036,7 @@ class ChartWidget extends StatelessWidget { // Check the group name (plantType) from your groupedData order final plantType = - groupedData.keys.toList()[barIndex]; + groupedData.keys.toList()[barIndex]; print('plantType $plantType'); if (plantType != "Male" && @@ -2042,15 +2064,15 @@ class ChartWidget extends StatelessWidget { final xPos = ((spot.x - minX) / (maxX - minX)) * chartWidth; final yPos = (1 - - (spot.y - chartMinY) / - (chartMaxY - chartMinY)) * + (spot.y - chartMinY) / + (chartMaxY - chartMinY)) * chartHeight; // Prevent label from going outside on the left double adjustedLeft = math.max(0, xPos - 30); return Stack(children: [ Positioned( left: - adjustedLeft, // fine-tune horizontal position + adjustedLeft, // fine-tune horizontal position top: yPos - 70, // fine-tune vertical position child: Text( formatNumber(spot.y), @@ -2099,7 +2121,7 @@ class ChartWidget extends StatelessWidget { ), ); case 'bar_chart': - // Extract groupBy values and their corresponding y-axis values + // Extract groupBy values and their corresponding y-axis values List xAxisData = []; List yAxisData = []; List yAxisLabels = []; @@ -2116,7 +2138,7 @@ class ChartWidget extends StatelessWidget { var unitMsr = entry['ObsKey']['UNIT_MEASURE']; var yValue = entry['ObsValue']['Value']; var xadditionalgroup = - chartData['chart_type_json']['additional_x_group']; + chartData['chart_type_json']['additional_x_group']; print('chartData response: ${chartData['response']}'); @@ -2139,12 +2161,12 @@ class ChartWidget extends StatelessWidget { // Extract QUARTER and convert "Q1", "Q2", etc. to numeric values int quarterA = int.tryParse( - a['ObsKey']['QUARTER'].toString().replaceAll('Q', ''), - ) ?? + a['ObsKey']['QUARTER'].toString().replaceAll('Q', ''), + ) ?? 0; int quarterB = int.tryParse( - b['ObsKey']['QUARTER'].toString().replaceAll('Q', ''), - ) ?? + b['ObsKey']['QUARTER'].toString().replaceAll('Q', ''), + ) ?? 0; // First, sort by TIME_PERIOD. If equal, sort by QUARTER @@ -2179,7 +2201,7 @@ class ChartWidget extends StatelessWidget { var xTimePeriod = entry['ObsKey']['TIME_PERIOD']; var yValue = entry['ObsValue']['Value']; var xadditionalgroup = - chartData['chart_type_json']['additional_x_group']; + chartData['chart_type_json']['additional_x_group']; if (xValue != null) { String xLabel = xValue.toString(); @@ -2241,7 +2263,7 @@ class ChartWidget extends StatelessWidget { child: ConstrainedBox( constraints: BoxConstraints( minWidth: - screenWidth, // Ensure it at least fills available width + screenWidth, // Ensure it at least fills available width maxWidth: chartWidth > screenWidth ? chartWidth : screenWidth, // Prevent non-normalized constraints @@ -2255,9 +2277,9 @@ class ChartWidget extends StatelessWidget { alignment: BarChartAlignment.spaceAround, maxY: yAxisData.isNotEmpty ? yAxisData.reduce( - (a, b) => a > b ? a : b, - ) * - 1.2 + (a, b) => a > b ? a : b, + ) * + 1.2 : 10, // barTouchData: BarTouchData( // enabled: true, @@ -2284,36 +2306,36 @@ class ChartWidget extends StatelessWidget { handleBuiltInTouches: false, touchTooltipData: BarTouchTooltipData( getTooltipColor: (group) => - Colors.transparent, + Colors.transparent, // fitInsideHorizontally: true, // fitInsideVertically: true, // tooltipPadding: const EdgeInsets.all(8), tooltipMargin: 1, getTooltipItem: ( - group, - groupIndex, - rod, - rodIndex, - ) { + group, + groupIndex, + rod, + rodIndex, + ) { // String unitMsrLabel = yAxisLabels.isNotEmpty && groupIndex < yAxisLabels.length // ? yAxisLabels[groupIndex] // : ''; // if (rod.toY == 0) return null; final originalValue = - rod.toY == 0.1 ? 0.0 : rod.toY; + rod.toY == 0.1 ? 0.0 : rod.toY; String displayValue; if (originalValue == 0.0) { displayValue = '0'; // 🔥 clean and simple } else { displayValue = (chartConversion != null && - chartConversion.isNotEmpty && - number_format != null && - chartConversion.isNotEmpty) + chartConversion.isNotEmpty && + number_format != null && + chartConversion.isNotEmpty) ? formatNumberConversion( - originalValue, - chartConversion, - number_format, - ) + originalValue, + chartConversion, + number_format, + ) : formatNumber(originalValue); } @@ -2340,9 +2362,9 @@ class ChartWidget extends StatelessWidget { showTitles: false, interval: (yAxisData.isNotEmpty ? yAxisData.reduce( - (a, b) => a > b ? a : b, - ) / - 5 + (a, b) => a > b ? a : b, + ) / + 5 : 1), getTitlesWidget: (value, meta) { return Padding( @@ -2353,9 +2375,9 @@ class ChartWidget extends StatelessWidget { '${value.toInt()}', style: TextStyle( fontFamily: context.translate( - 'Roboto', - 'NotoKufi', - )), + 'Roboto', + 'NotoKufi', + )), ), ); }, @@ -2374,7 +2396,7 @@ class ChartWidget extends StatelessWidget { // : title; String displayTitle = title.length > 10 - ? '${title.substring(0, 7)}\n${title.substring(7, 12)}..' + ? '${title.substring(0, 10)}..' : title; print('barChartVALUECHECKTITLE $title'); print( @@ -2387,7 +2409,7 @@ class ChartWidget extends StatelessWidget { ), child: SizedBox( width: - 100, // Limit width to force wrapping + 100, // Limit width to force wrapping child: Transform.rotate( // angle: -0.5, angle: 0, @@ -2401,13 +2423,13 @@ class ChartWidget extends StatelessWidget { .black, // Change background color // color: Colors.blueGrey[800], // Change background color borderRadius: - BorderRadius.circular( + BorderRadius.circular( 8, ), // Optional: rounded corners ), textStyle: TextStyle( fontFamily: - context.translate( + context.translate( 'Roboto', 'NotoKufi', ), @@ -2424,7 +2446,7 @@ class ChartWidget extends StatelessWidget { textAlign: TextAlign.center, style: TextStyle( fontFamily: - context.translate( + context.translate( 'Roboto', 'NotoKufi', ), @@ -2524,7 +2546,7 @@ class ChartWidget extends StatelessWidget { ], ); case 'bar_chart_horizontal': - // Extract groupBy values and their corresponding y-axis values + // Extract groupBy values and their corresponding y-axis values List xAxisData = []; List yAxisData = []; List> sortedData = []; @@ -2623,13 +2645,13 @@ class ChartWidget extends StatelessWidget { return BarTooltipItem( // formatNumber(rod.toY), (chartConversion != null && - chartConversion.isNotEmpty && - number_format != null) + chartConversion.isNotEmpty && + number_format != null) ? formatNumberConversion( - rod.toY, - chartConversion, - number_format, - ) + rod.toY, + chartConversion, + number_format, + ) : formatNumber(rod.toY), TextStyle( fontFamily: context.translate( @@ -2658,9 +2680,9 @@ class ChartWidget extends StatelessWidget { '${value.toInt()}', style: TextStyle( fontFamily: context.translate( - 'Roboto', - 'NotoKufi', - )), + 'Roboto', + 'NotoKufi', + )), ), ); }, @@ -2722,7 +2744,7 @@ class ChartWidget extends StatelessWidget { // groupsSpace: 5, barGroups: List.generate( xAxisData.length, - (index) => BarChartGroupData( + (index) => BarChartGroupData( x: index, barsSpace: 20, barRods: [ @@ -2768,9 +2790,9 @@ class ChartWidget extends StatelessWidget { // Now map to Color Map parsedChartBarColors = chartBarColrs.map(( - key, - value, - ) { + key, + value, + ) { return MapEntry(key, _hexToColor(value)); }); print('parsedChartBarColors1100 $parsedChartBarColors'); @@ -2864,7 +2886,7 @@ class ChartWidget extends StatelessWidget { Expanded( child: SingleChildScrollView( scrollDirection: - Axis.horizontal, // Enable horizontal scrolling + Axis.horizontal, // Enable horizontal scrolling child: SizedBox( width: _calculateChartWidth( chartData, @@ -2878,16 +2900,21 @@ class ChartWidget extends StatelessWidget { ), // Dynamically calculate max Y // barGroups: _buildHorizontalRotateBarGroups( // chartData, groupByValues), // Build bar groups + // barGroups: _buildHorizontalRotateBarGroupsBarColors( + // chartData, + // groupByValues, + // parsedChartBarColors,uniqueColors + // ), barGroups: hasBarColors ? _buildHorizontalRotateBarGroupsBarColors( - chartData, - groupByValues, - parsedChartBarColors, - ) + chartData, + groupByValues, + parsedChartBarColors + ) : _buildHorizontalRotateBarGroups( - chartData, - groupByValues, - ), + chartData, + groupByValues, + ), titlesData: FlTitlesData( leftTitles: AxisTitles( @@ -2897,7 +2924,7 @@ class ChartWidget extends StatelessWidget { sideTitles: SideTitles( showTitles: true, reservedSize: - 130, // Added space for rotated titles + 130, // Added space for rotated titles getTitlesWidget: (value, meta) { if (value < groupByValues.length) { String title = groupByValues.elementAt( @@ -2915,7 +2942,7 @@ class ChartWidget extends StatelessWidget { ), child: SizedBox( width: - 80, // Limit width to force wrapping + 80, // Limit width to force wrapping child: Transform.rotate( angle: -1.5, child: TooltipTheme( @@ -2925,7 +2952,7 @@ class ChartWidget extends StatelessWidget { .black, // Change background color // color: Colors.blueGrey[800], // Change background color borderRadius: - BorderRadius.circular( + BorderRadius.circular( 8, ), // Optional: rounded corners ), @@ -2985,10 +3012,10 @@ class ChartWidget extends StatelessWidget { touchTooltipData: BarTouchTooltipData( getTooltipColor: (group) => Colors.black, tooltipHorizontalAlignment: - FLHorizontalAlignment.center, + FLHorizontalAlignment.center, tooltipRoundedRadius: 8, fitInsideHorizontally: - true, // Ensure it fits within the screen + true, // Ensure it fits within the screen fitInsideVertically: true, tooltipPadding: EdgeInsets.all(8), tooltipMargin: 16, @@ -3048,7 +3075,7 @@ class ChartWidget extends StatelessWidget { children: [ TextSpan( text: - '- ${(chartConversion != null && chartConversion.isNotEmpty && number_format != null) ? formatNumberConversion(rod.toY, chartConversion, number_format) : formatNumber(rod.toY)}', + '- ${(chartConversion != null && chartConversion.isNotEmpty && number_format != null) ? formatNumberConversion(rod.toY, chartConversion, number_format) : formatNumber(rod.toY)}', style: TextStyle( fontFamily: context.translate( 'Roboto', @@ -3085,13 +3112,15 @@ class ChartWidget extends StatelessWidget { ), ), ), + _buildChartLegend( + groupedCrops, parsedChartBarColors, uniqueColors, context), ], ), ); case 'horizontal_rotate': String cropKey = chartData['chart_type_json'] - ['y_sub_group']; // Dynamically get crop key + ['y_sub_group']; // Dynamically get crop key // Group crops by CROP_TYPE Map> groupedCrops = {}; @@ -3326,16 +3355,16 @@ class ChartWidget extends StatelessWidget { getTooltipColor: (group) => Colors .transparent, // Light background for visibility tooltipHorizontalAlignment: - FLHorizontalAlignment.center, + FLHorizontalAlignment.center, tooltipRoundedRadius: - 6, // Softer roundness for tooltips + 6, // Softer roundness for tooltips fitInsideHorizontally: true, fitInsideVertically: true, // tooltipPadding: const EdgeInsets.all(5), tooltipPadding: const EdgeInsets.only( top: 8, bottom: 5, left: 5, right: 5), tooltipMargin: - 20, // Reduce margin for better alignment + 20, // Reduce margin for better alignment getTooltipItem: (group, groupIndex, rod, rodIndex) { // if (rod.toY == 0) return null; // Hide for zero values @@ -3392,7 +3421,7 @@ class ChartWidget extends StatelessWidget { 'NotoKufi', ), color: - isDarkTheme ? Colors.white : Colors.black, + isDarkTheme ? Colors.white : Colors.black, fontSize: 12, ), ); @@ -3427,13 +3456,13 @@ class ChartWidget extends StatelessWidget { sideTitles: SideTitles( showTitles: true, reservedSize: (chartData['chart_label_width'] == - null || - chartData['chart_label_width'] == 0) + null || + chartData['chart_label_width'] == 0) ? 150 : (double.tryParse( - chartData['chart_label_width'] - .toString()) ?? - 150), // Added space for rotated titles + chartData['chart_label_width'] + .toString()) ?? + 150), // Added space for rotated titles getTitlesWidget: (value, meta) { if (value < groupByValues.length) { String title = groupByValues.elementAt( @@ -3441,18 +3470,18 @@ class ChartWidget extends StatelessWidget { ); return Transform.rotate( angle: - -1.58, // Rotation in radians (~ -30 degrees) + -1.58, // Rotation in radians (~ -30 degrees) child: Center( child: SizedBox( width: 120, child: Text( title, textAlign: (chartData[ - 'chart_label_width'] == - null || - chartData[ - 'chart_label_width'] == - 0) + 'chart_label_width'] == + null || + chartData[ + 'chart_label_width'] == + 0) ? TextAlign.right : TextAlign.center, style: TextStyle( @@ -3509,14 +3538,14 @@ class ChartWidget extends StatelessWidget { // chartData, groupByValues), barGroups: hasBarColors ? _buildHorizontalRotateBarGroupsBarColors( - chartData, - groupByValues, - parsedChartBarColors, - ) + chartData, + groupByValues, + parsedChartBarColors, + ) : _buildHorizontalRotateBarGroups( - chartData, - groupByValues, - ), + chartData, + groupByValues, + ), alignment: BarChartAlignment.spaceAround, ), @@ -3554,9 +3583,9 @@ class ChartWidget extends StatelessWidget { // Now map to Color Map parsedChartBarColors = chartBarColrs.map(( - key, - value, - ) { + key, + value, + ) { return MapEntry(key, _hexToColor(value)); }); @@ -3569,7 +3598,7 @@ class ChartWidget extends StatelessWidget { groupColorMap[group] = parsedChartBarColors[group]!; } else { groupColorMap[group] = - uniqueColors[colorIndex % uniqueColors.length]; + uniqueColors[colorIndex % uniqueColors.length]; colorIndex++; } } @@ -3580,7 +3609,7 @@ class ChartWidget extends StatelessWidget { List years = (chartData['response'] as List) .map( (entry) => int.tryParse(entry['ObsKey'][groupByKey] ?? '0') ?? 0, - ) + ) .toList(); years.sort(); print(years); @@ -3604,7 +3633,7 @@ class ChartWidget extends StatelessWidget { // Filter chart data to only include entries within the last 5 years List filteredData = - (chartData['response'] as List).where((entry) { + (chartData['response'] as List).where((entry) { int year = int.tryParse(entry['ObsKey'][groupByKey] ?? '0') ?? 0; return year >= minYear && year <= maxYear; }).toList(); @@ -3696,9 +3725,9 @@ class ChartWidget extends StatelessWidget { final chartHeight = constraints.maxHeight; final allSpots = lineBars.expand((line) => line.spots); final minY = - allSpots.map((e) => e.y).reduce((a, b) => a < b ? a : b); + allSpots.map((e) => e.y).reduce((a, b) => a < b ? a : b); final maxY = - allSpots.map((e) => e.y).reduce((a, b) => a > b ? a : b); + allSpots.map((e) => e.y).reduce((a, b) => a > b ? a : b); final xValues = allSpots.map((e) => e.x).toList(); final minX = xValues.reduce((a, b) => a < b ? a : b).toInt(); @@ -3711,7 +3740,7 @@ class ChartWidget extends StatelessWidget { return Column( crossAxisAlignment: - CrossAxisAlignment.center, // ensures center alignment + CrossAxisAlignment.center, // ensures center alignment children: [ Padding( padding: const EdgeInsets.only(top: 0), @@ -3767,7 +3796,7 @@ class ChartWidget extends StatelessWidget { ? Colors.white : Colors.black, margin: - EdgeInsets.only(bottom: 2), + EdgeInsets.only(bottom: 2), ), Text(value.toInt().toString(), style: style), @@ -3884,15 +3913,15 @@ class ChartWidget extends StatelessWidget { final xPos = ((spot.x - minX) / (maxX - minX)) * chartWidth; final yPos = (1 - - (spot.y - chartMinY) / - (chartMaxY - chartMinY)) * + (spot.y - chartMinY) / + (chartMaxY - chartMinY)) * chartHeight; // Prevent label from going outside on the left double adjustedLeft = math.max(0, xPos - 30); return Stack(children: [ Positioned( left: - adjustedLeft, // fine-tune horizontal position + adjustedLeft, // fine-tune horizontal position top: yPos - 60, // fine-tune vertical position child: Text( formatNumber(spot.y), @@ -3932,7 +3961,7 @@ class ChartWidget extends StatelessWidget { style: TextStyle( fontSize: 14, fontFamily: - context.translate('Roboto', 'NotoKufi'), + context.translate('Roboto', 'NotoKufi'), ), ), ], @@ -3946,48 +3975,48 @@ class ChartWidget extends StatelessWidget { ), ); - // case 'd_chart_grouped_bar_horizantal': - // return DChartBar( - // vertical: false, // <--- Important: rotate the chart - // barGroupingType: BarGroupingType.grouped, - // data: const [ - // { - // 'id': 'Product A', - // 'data': [ - // {'domain': 'Jan', 'measure': 30}, - // {'domain': 'Feb', 'measure': 50}, - // {'domain': 'Mar', 'measure': 40}, - // ], - // }, - // { - // 'id': 'Product B', - // 'data': [ - // {'domain': 'Jan', 'measure': 20}, - // {'domain': 'Feb', 'measure': 20}, - // {'domain': 'Mar', 'measure': 35}, - // ], - // }, - // { - // 'id': 'Product C', - // 'data': [ - // {'domain': 'Jan', 'measure': 0}, - // {'domain': 'Feb', 'measure': 25}, - // {'domain': 'Mar', 'measure': 45}, - // ], - // }, - // ], - // groupList: const [ - // {'id': 'Product A', 'color': Colors.orange}, - // {'id': 'Product B', 'color': Colors.deepOrange}, - // {'id': 'Product C', 'color': Colors.pinkAccent}, - // ], - // barValue: (barData, index) => '${barData['measure']}', - // barLabelPosition: BarLabelPosition.outside, - // domainLabelPaddingToAxisLine: 16, - // measureLabelPaddingToAxisLine: 16, - // groupSeparatorWidth: 14, - // barLabelFontSize: 12, - // ); + // case 'd_chart_grouped_bar_horizantal': + // return DChartBar( + // vertical: false, // <--- Important: rotate the chart + // barGroupingType: BarGroupingType.grouped, + // data: const [ + // { + // 'id': 'Product A', + // 'data': [ + // {'domain': 'Jan', 'measure': 30}, + // {'domain': 'Feb', 'measure': 50}, + // {'domain': 'Mar', 'measure': 40}, + // ], + // }, + // { + // 'id': 'Product B', + // 'data': [ + // {'domain': 'Jan', 'measure': 20}, + // {'domain': 'Feb', 'measure': 20}, + // {'domain': 'Mar', 'measure': 35}, + // ], + // }, + // { + // 'id': 'Product C', + // 'data': [ + // {'domain': 'Jan', 'measure': 0}, + // {'domain': 'Feb', 'measure': 25}, + // {'domain': 'Mar', 'measure': 45}, + // ], + // }, + // ], + // groupList: const [ + // {'id': 'Product A', 'color': Colors.orange}, + // {'id': 'Product B', 'color': Colors.deepOrange}, + // {'id': 'Product C', 'color': Colors.pinkAccent}, + // ], + // barValue: (barData, index) => '${barData['measure']}', + // barLabelPosition: BarLabelPosition.outside, + // domainLabelPaddingToAxisLine: 16, + // measureLabelPaddingToAxisLine: 16, + // groupSeparatorWidth: 14, + // barLabelFontSize: 12, + // ); default: return Center(child: Text('Unknown chart type')); } @@ -4127,11 +4156,11 @@ class ChartWidget extends StatelessWidget { } List lineBarsData( - List filteredData, - Set groupByValues, - String groupByKey, - Map chartBarColors, - ) { + List filteredData, + Set groupByValues, + String groupByKey, + Map chartBarColors, + ) { List lineBars = []; print('LineParsedChartBarColors $chartBarColors'); @@ -4261,13 +4290,13 @@ class ChartWidget extends StatelessWidget { TextSpan( // text: formatNumber(lineBarSpot.y), text: (chartConversion != null && - chartConversion.isNotEmpty && - number_format != null) + chartConversion.isNotEmpty && + number_format != null) ? formatNumberConversion( - lineBarSpot.y, - chartConversion, - number_format, - ) + lineBarSpot.y, + chartConversion, + number_format, + ) : formatNumber(lineBarSpot.y), // text: ' ${lineBarSpot.y}', // Keep the value white style: TextStyle( @@ -4375,7 +4404,7 @@ class ChartWidget extends StatelessWidget { double findClosest(double value, Set values) { return values.reduce( - (a, b) => (value - a).abs() < (value - b).abs() ? a : b, + (a, b) => (value - a).abs() < (value - b).abs() ? a : b, ); } @@ -4438,7 +4467,7 @@ class ChartWidget extends StatelessWidget { if (value % 1000000000000 == 0) { // Only multiples of 1T formattedValue = - '${(value / 1000000000000).toStringAsFixed(0)}T'; + '${(value / 1000000000000).toStringAsFixed(0)}T'; } } else if (value >= 1000000000) { // Billions (B) @@ -4578,10 +4607,10 @@ class ChartWidget extends StatelessWidget { } List _generateBarGroups( - BuildContext context, - dynamic chartData, - String groupByKey, - ) { + BuildContext context, + dynamic chartData, + String groupByKey, + ) { Map> groupedData = {}; print('flStackedBar3'); // Group data by `group_by` and `TIME_PERIOD`, accumulating the values for each group and year @@ -4662,7 +4691,7 @@ class ChartWidget extends StatelessWidget { // width: barWidth, borderRadius: BorderRadius.zero, color: - Colors.black, // This will act as a container for stacked items + Colors.black, // This will act as a container for stacked items ), ], ); @@ -4800,9 +4829,9 @@ class ChartWidget extends StatelessWidget { } List _buildHorizontalRotateBarGroups( - dynamic chartData, - Set groupByValues, - ) { + dynamic chartData, + Set groupByValues, + ) { String groupByKeyValueData; if (chartData['chart_type_json']['chart_type'] == 'bar_chart_horizontal' || @@ -4855,11 +4884,11 @@ class ChartWidget extends StatelessWidget { colorIndex++; } else if (chartData['dataset'] == 'cropsk') { barColor = - uniqueColorsForThree[colorIndex % uniqueColorsForThree.length]; + uniqueColorsForThree[colorIndex % uniqueColorsForThree.length]; colorIndex++; } else if (chartData['dataset'] == 'oil_and_gas') { barColor = - uniqueColorsForFour[colorIndex % uniqueColorsForFour.length]; + uniqueColorsForFour[colorIndex % uniqueColorsForFour.length]; colorIndex++; } else { barColor = uniqueColors[colorIndex % uniqueColors.length]; @@ -4888,7 +4917,7 @@ class ChartWidget extends StatelessWidget { barRods: barRods, showingTooltipIndicators: List.generate( barRods.length, - (index) => index, + (index) => index, ), ), ); @@ -4898,10 +4927,10 @@ class ChartWidget extends StatelessWidget { } List _buildHorizontalRotateBarGroupsBarColors( - dynamic chartData, - Set groupByValues, - Map chartBarColors, - ) { + dynamic chartData, + Set groupByValues, + Map chartBarColors + ) { String groupByKeyValueData1; if (chartData['chart_type_json']['chart_type'] == 'bar_chart_horizontal' || @@ -4966,7 +4995,7 @@ class ChartWidget extends StatelessWidget { Color barColor; if (chartData['dataset'] == 'health_services') { barColor = uniqueColorsForTwo[ - colorIndex % 2]; // Alternate between two colors + colorIndex % 2]; // Alternate between two colors colorIndex++; // Update index for next bar } else { print('check fl chart'); @@ -4990,7 +5019,7 @@ class ChartWidget extends StatelessWidget { barRods: barRods, showingTooltipIndicators: List.generate( barRods.length, - (index) => index, + (index) => index, ), ), ); @@ -4999,6 +5028,96 @@ class ChartWidget extends StatelessWidget { return barGroups; } + // List _buildHorizontalRotateBarGroupsBarColors( + // dynamic chartData, + // Set groupByValues, + // Map chartBarColors, + // List uniqueColors, + // ) { + // String groupByKeyValueData1; + // + // if (chartData['chart_type_json']['chart_type'] == 'bar_chart_horizontal' || + // chartData['chart_type_json']['chart_type'] == 'horizontal_rotate') { + // groupByKeyValueData1 = chartData['chart_type_json']['y_group'] ?? ''; + // } else { + // groupByKeyValueData1 = chartData['chart_type_json']['x_group'] ?? ''; + // } + // + // List responseData = chartData['response']; + // List barGroups = []; + // + // print('chartBarColorsRota- $chartBarColors'); + // + // // Track how many bars we’ve already colored + // int colorIndex = 0; + // + // for (int i = 0; i < groupByValues.length; i++) { + // String groupValue = groupByValues.elementAt(i); + // + // // Filter data for the current group + // List groupData = responseData.where((entry) { + // return entry['ObsKey'][groupByKeyValueData1] == groupValue; + // }).toList(); + // + // Map genderMapping = { + // 'ذكر': 'Male', + // 'أنثى': 'Female', + // }; + // + // // Sort so Male first, Female second + // groupData.sort((a, b) { + // String genderA = + // genderMapping[a['ObsKey']['GENDER']] ?? a['ObsKey']['GENDER'] ?? ""; + // String genderB = + // genderMapping[b['ObsKey']['GENDER']] ?? b['ObsKey']['GENDER'] ?? ""; + // return (genderA == 'Male' ? 0 : 1).compareTo(genderB == 'Male' ? 0 : 1); + // }); + // + // // Create BarChartRodData for each bar + // List barRods = groupData.asMap().entries.map((entry) { + // int barIndex = entry.key; + // var data = entry.value; + // + // double value = + // double.tryParse(data['ObsValue']['Value'].toString()) ?? 0.0; + // + // String gender = data['ObsKey']['GENDER'] ?? ""; + // String normalizedGender = genderMapping[gender] ?? gender; + // + // print('horizontalRotateGender - $gender'); + // + // // Pick colors from uniqueColors sequentially + // Color barColor; + // if (chartData['dataset'] == 'health_services') { + // // Use sequential colors from uniqueColors + // barColor = uniqueColors[ + // (barIndex % uniqueColors.length)]; // rotate if more bars + // } else { + // barColor = uniqueColors[ + // (barIndex % uniqueColors.length)] ?? Colors.grey; + // } + // + // return BarChartRodData( + // toY: value, + // color: barColor, + // width: 20, + // ); + // }).toList(); + // + // barGroups.add( + // BarChartGroupData( + // x: i, + // barRods: barRods, + // showingTooltipIndicators: + // List.generate(barRods.length, (index) => index), + // ), + // ); + // } + // + // return barGroups; + // } + + /// End horizontal rotate and fl_multi_bar bar @override @@ -5014,7 +5133,7 @@ Widget _buildChartLegend( BuildContext context) { // Extract unique crop types Set uniqueCropTypes = - groupedCrops.values.expand((list) => list).toSet(); + groupedCrops.values.expand((list) => list).toSet(); print('HorizontalLegends2 -$uniqueCropTypes'); print('HorizontalLegends -$parsedChartBarColors'); @@ -5026,10 +5145,10 @@ Widget _buildChartLegend( children: uniqueCropTypes.map((cropType) { // Color cropColor = parsedChartBarColors[cropType] ?? Colors.grey; // Fetch color for each crop type int index = uniqueCropTypes.toList().indexOf( - cropType, - ); // Get index for cycling colors + cropType, + ); // Get index for cycling colors Color cropColor = parsedChartBarColors.isNotEmpty && - parsedChartBarColors.containsKey(cropType) + parsedChartBarColors.containsKey(cropType) ? parsedChartBarColors[cropType]! : uniqueColors[index % uniqueColors.length]; @@ -5116,4 +5235,4 @@ class ChartData { final String? x; final double y; final DateTime? xDateTime; -} +} \ No newline at end of file diff --git a/lib/presentation/Screens/profilepage.dart b/lib/presentation/Screens/profilepage.dart index 3fa6b5fc..5e61cb8f 100644 --- a/lib/presentation/Screens/profilepage.dart +++ b/lib/presentation/Screens/profilepage.dart @@ -101,7 +101,9 @@ class _ProfileScreenState extends ConsumerState { void initState() { super.initState(); // print(widget.userId); - + WidgetsBinding.instance.addPostFrameCallback((_) { + _fetchUserData(); + }); _selectedCountry ??= ISOCountry.numeric784; final themeMode = ref.read(themeProvider); @@ -151,7 +153,7 @@ class _ProfileScreenState extends ConsumerState { } } - _fetchUserData(); // Call the function to fetch user data + // Call the function to fetch user data } @override @@ -165,25 +167,8 @@ class _ProfileScreenState extends ConsumerState { } Future _fetchUserData() async { + print('userId: ${widget.userId}'); try { - // final adminAuth = await _pb.admins - // .authWithPassword('pb@venbainfotech.com', 'pb@venbainfotech.com'); - - final auth = ref.watch(authProvider); - - // final adminAuth = await pb.admins.authWithPassword( - // auth.email, - // auth.password, - // ); - // - // final adminToken = adminAuth.token; - - final themeService = ThemeBaseService(); - // final adminToken = await themeService.getAdminToken( - // email: auth.email, - // password: auth.password, - // ); - // print('adminToken- ${adminToken}'); final userDetailsResponse = await _pb.collection('users').getOne( widget.userId, headers: { @@ -191,6 +176,7 @@ class _ProfileScreenState extends ConsumerState { }, ); print('userDetails: $userDetailsResponse'); + print(userDetailsResponse.data['email']); setState(() { _usernameController.text = userDetailsResponse.data['uname'] ?? ''; _emailController.text = userDetailsResponse.data['email'] ?? ''; @@ -395,7 +381,7 @@ class _ProfileScreenState extends ConsumerState { } // Add headers (if required, e.g., authorization) - request.headers['Authorization'] = 'Bearer ${_pb.authStore.token}'; + request.headers['Authorization'] = 'Bearer ${PocketBaseService.authStore.token}'; // Send the request final response = await request.send(); @@ -592,10 +578,10 @@ class _ProfileScreenState extends ConsumerState { child: Scaffold( appBar: AppBar( scrolledUnderElevation: 0, - backgroundColor: Colors.white, + backgroundColor: isDarkTheme ? Colors.black : Colors.white, elevation: 0, leading: IconButton( - icon: Icon(Icons.arrow_back_ios_new, color: Colors.black), + icon: Icon(Icons.arrow_back_ios_new, color: isDarkTheme ? Colors.white : Colors.black), onPressed: () async { final prefs = await SharedPreferences.getInstance(); await _authRepo.logout(); @@ -1450,6 +1436,8 @@ class _ProfileScreenState extends ConsumerState { onTap: () { final userId = widget.userId; final email = _emailController.text; + print(userId); + print(email); context.push('/createNewPw/$userId/$email'); }, diff --git a/lib/presentation/routes/auth_routes/login_route.dart b/lib/presentation/routes/auth_routes/login_route.dart index 3c0463ef..5b465f4e 100644 --- a/lib/presentation/routes/auth_routes/login_route.dart +++ b/lib/presentation/routes/auth_routes/login_route.dart @@ -328,7 +328,7 @@ class LoginRoute extends HookConsumerWidget { void openAppLinkSettings() { const packageName = - 'ae.gov.fcsc.frontend'; // Replace with your app's package + 'ae.gov.fcsc.stats'; // Replace with your app's package final intent = AndroidIntent( action: 'android.settings.APP_OPEN_BY_DEFAULT_SETTINGS', data: 'package:$packageName', @@ -456,7 +456,7 @@ class LoginRoute extends HookConsumerWidget { Future loginCountApi(String userId) async { if (userId.isNotEmpty) { - final url = Uri.parse('$apiUrl/api/login_success?id=$userId'); + final url = Uri.parse('${apiUrl}api/login_success?id=$userId'); try { final response = await http @@ -481,7 +481,7 @@ class LoginRoute extends HookConsumerWidget { Future updateOAuthUserDetails( String userId, metaDetails, WidgetRef ref) async { - final url = "${pb.baseUrl}/api/collections/users/records/$userId"; + // final url = "${pb.baseUrl}api/collections/users/records/$userId"; try { // // Authenticate admin (Persist session globally instead) @@ -489,42 +489,59 @@ class LoginRoute extends HookConsumerWidget { // 'pb@venbainfotech.com', // 'pb@venbainfotech.com', // ); - final auth = ref.watch(authProvider); + // final auth = ref.watch(authProvider); // await pb.admins.authWithPassword( // auth.email, // auth.password, // ); - final themeService = ThemeBaseService(); + // final themeService = ThemeBaseService(); // final adminToken = await themeService.getAdminToken( // email: auth.email, // password: auth.password, // ); final userDetails = metaDetails['rawUser']; print('oauthDetails $userDetails'); - - final response = await http.patch( - Uri.parse(url), + print("Updating user with ID: ${pb.authStore.model.id}"); + final userId = pb.authStore.model.id; + final response = await pb.collection('users').update( + userId, headers: { 'Content-Type': 'application/json', // Add this 'Authorization': PocketBaseService.authStore.token, // Correct way to send auth token }, - body: jsonEncode({ + body: { "user_mail_verify": true, "reviewed": true, "role": 'user', "uname": userDetails['name'], "status": 'Approved', "is_oauth_login": 1, - }), + }, ); +print('User response $response'); + // final response = await http.patch( + // Uri.parse(url), + // headers: { + // 'Content-Type': 'application/json', // Add this + // 'Authorization': PocketBaseService.authStore.token, // Correct way to send auth token + // }, + // body: jsonEncode({ + // "user_mail_verify": true, + // "reviewed": true, + // "role": 'user', + // "uname": userDetails['name'], + // "status": 'Approved', + // "is_oauth_login": 1, + // }), + // ); - if (response.statusCode == 200) { - print("✅ Device token updated successfully!"); - } else { - print("❌ Failed to update device token: ${response.body}"); - } + // if (response.statusCode == 200) { + // print("✅ Device token updated successfully!"); + // } else { + // print("❌ Failed to update device token: ${response.body}"); + // } } catch (e) { print("🚨 Error updating device token: $e"); } @@ -1197,7 +1214,7 @@ class LoginRoute extends HookConsumerWidget { final dontHaveAnAccountRegisterBtn = TextButton( onPressed: () => {context.push('/register')}, // onPressed: () => - // {context.push('/forgot-password/surendar.m@venbainfotech.com')}, + // {context.push('/forgot-password/surendarsuri30@gmail.com')}, child: Text.rich( textAlign: TextAlign.center, TextSpan( diff --git a/lib/presentation/routes/drawer_routes/Drawer Items/bookmark.dart b/lib/presentation/routes/drawer_routes/Drawer Items/bookmark.dart index 3253008a..11179ae5 100644 --- a/lib/presentation/routes/drawer_routes/Drawer Items/bookmark.dart +++ b/lib/presentation/routes/drawer_routes/Drawer Items/bookmark.dart @@ -275,7 +275,7 @@ class _BookMarkState extends ConsumerState { // print('adminTokenETRE- $adminToken'); await _pb.collection('bookmark').delete(bookmarkId!, headers: { - 'Authorization': PocketBaseService.authStore.token, + 'Authorization': 'Bearer ${PocketBaseService.authStore.token}', }); // currentTheme = ref.read(themeProvider); diff --git a/lib/presentation/routes/drawer_routes/Drawer Items/edit_profile.dart b/lib/presentation/routes/drawer_routes/Drawer Items/edit_profile.dart index bafc8322..02702845 100644 --- a/lib/presentation/routes/drawer_routes/Drawer Items/edit_profile.dart +++ b/lib/presentation/routes/drawer_routes/Drawer Items/edit_profile.dart @@ -186,23 +186,7 @@ class _EditProfileState extends ConsumerState { Future _fetchUserData() async { try { print('EDIT PROFILE isPageLoad'); - // final adminAuth = await _pb.admins - // .authWithPassword('pb@venbainfotech.com', 'pb@venbainfotech.com'); - final auth = ref.watch(authProvider); - - // final adminAuth = await pb.admins.authWithPassword( - // auth.email, - // auth.password, - // ); - // final adminToken = adminAuth.token; - - final themeService = ThemeBaseService(); - // final adminToken = await themeService.getAdminToken( - // email: auth.email, - // password: auth.password, - // ); - // print('adminToken- $adminToken'); final userDetailsResponse = await _pb.collection('users').getOne( userId, headers: { diff --git a/lib/presentation/routes/drawer_routes/Drawer Items/notification/notification.dart b/lib/presentation/routes/drawer_routes/Drawer Items/notification/notification.dart index 36a7163c..015e3985 100644 --- a/lib/presentation/routes/drawer_routes/Drawer Items/notification/notification.dart +++ b/lib/presentation/routes/drawer_routes/Drawer Items/notification/notification.dart @@ -134,25 +134,8 @@ class _NotificationPageState extends ConsumerState { try { String? fetchedUserId = await getUserId(); userID = fetchedUserId; - // final adminAuth = await _pb.admins - // .authWithPassword('pb@venbainfotech.com', 'pb@venbainfotech.com'); - - final auth = ref.watch(authProvider); - // - // final adminAuth = await pb.admins.authWithPassword( - // auth.email, - // auth.password, - // ); - // final adminToken = adminAuth.token; - - final themeService = ThemeBaseService(); - // final adminToken = await themeService.getAdminToken( - // email: auth.email, - // password: auth.password, - // ); - // print('adminToken- ${adminToken}'); final userDetailsResponse = await _pb.collection('users').getOne( - fetchedUserId!, + userID, headers: { 'Authorization': 'Bearer ${PocketBaseService.authStore.token}', }, diff --git a/public/.well-known/5-3share complete.txt b/public/.well-known/5-3share complete.txt index 36c0cf5e..989e25ee 100644 --- a/public/.well-known/5-3share complete.txt +++ b/public/.well-known/5-3share complete.txt @@ -13,7 +13,7 @@ class SessionCheckScreen extends StatefulWidget { class _SessionCheckScreenState extends State { final PAuthRepo _authRepo = PAuthRepo(); - String get playStoreUrl => "https://play.google.com/store/apps/details?id=ae.gov.fcsc.frontend"; + String get playStoreUrl => "https://play.google.com/store/apps/details?id=ae.gov.fcsc.stats"; @override void initState() { diff --git a/public/.well-known/assetlinks.json b/public/.well-known/assetlinks.json index 89dce737..fce541e6 100644 --- a/public/.well-known/assetlinks.json +++ b/public/.well-known/assetlinks.json @@ -3,7 +3,7 @@ "relation": ["delegate_permission/common.handle_all_urls"], "target": { "namespace": "android_app", - "package_name": "ae.gov.fcsc.frontend", + "package_name": "ae.gov.fcsc.stats", "sha256_cert_fingerprints": [ "e0:b4:6f:b9:8b:96:66:5b:ec:14:98:53:07:01:d4:df:39:24:e8:1f:cd:a2:9e:e4:77:66:e0:b4:5b:c2:e0:94" ] diff --git a/pubspec.lock b/pubspec.lock index d38a087e..d2081637 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -1072,26 +1072,26 @@ packages: dependency: transitive description: name: leak_tracker - sha256: "6bb818ecbdffe216e81182c2f0714a2e62b593f4a4f13098713ff1685dfb6ab0" + sha256: "8dcda04c3fc16c14f48a7bb586d4be1f0d1572731b6d81d51772ef47c02081e0" url: "https://pub.dev" source: hosted - version: "10.0.9" + version: "11.0.1" leak_tracker_flutter_testing: dependency: transitive description: name: leak_tracker_flutter_testing - sha256: f8b613e7e6a13ec79cfdc0e97638fddb3ab848452eff057653abd3edba760573 + sha256: "1dbc140bb5a23c75ea9c4811222756104fbcd1a27173f0c34ca01e16bea473c1" url: "https://pub.dev" source: hosted - version: "3.0.9" + version: "3.0.10" leak_tracker_testing: dependency: transitive description: name: leak_tracker_testing - sha256: "6ba465d5d76e67ddf503e1161d1f4a6bc42306f9d66ca1e8f079a47290fb06d3" + sha256: "8d5a2d49f4a66b49744b23b018848400d23e54caf9463f4eb20df3eb8acb2eb1" url: "https://pub.dev" source: hosted - version: "3.0.1" + version: "3.0.2" lints: dependency: transitive description: @@ -1603,10 +1603,10 @@ packages: dependency: transitive description: name: test_api - sha256: fb31f383e2ee25fbbfe06b40fe21e1e458d14080e3c67e7ba0acfde4df4e0bbd + sha256: "522f00f556e73044315fa4585ec3270f1808a4b186c936e612cab0b565ff1e00" url: "https://pub.dev" source: hosted - version: "0.7.4" + version: "0.7.6" the_validator: dependency: "direct main" description: @@ -1747,10 +1747,10 @@ packages: dependency: transitive description: name: vector_math - sha256: "80b3257d1492ce4d091729e3a67a60407d227c27241d6927be0130c98e741803" + sha256: d530bd74fea330e6e364cda7a85019c434070188383e1cd8d9777ee586914c5b url: "https://pub.dev" source: hosted - version: "2.1.4" + version: "2.2.0" video_player: dependency: "direct main" description: @@ -1904,5 +1904,5 @@ packages: source: hosted version: "3.1.3" sdks: - dart: ">=3.7.0 <4.0.0" + dart: ">=3.8.0-0 <4.0.0" flutter: ">=3.27.0" diff --git a/pubspec.yaml b/pubspec.yaml index 0d478ee6..704f9ed8 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,8 +1,9 @@ name: uae_stat description: "View statistics about the UAE from the Federal Center for Statistics and Competitiveness." publish_to: "none" -#version: 1.0.62+63 -version: 1.0.8+9 +#version: 1.0.65+66 +version: 1.0.12+13 +#version: 1.0.5+5 environment: sdk: ">=3.2.3 <4.0.0" @@ -268,4 +269,4 @@ flutter: weight: 900 - asset: assets/fonts/Roboto/Roboto-BlackItalic.ttf style: italic - weight: 900 + weight: 900 \ No newline at end of file