diff --git a/android/app/.cxx/Debug/4y161to1/arm64-v8a/.cmake/api/v1/reply/index-2025-05-27T06-43-53-0853.json b/android/app/.cxx/Debug/4y161to1/arm64-v8a/.cmake/api/v1/reply/index-2025-06-16T09-40-14-0099.json similarity index 100% rename from android/app/.cxx/Debug/4y161to1/arm64-v8a/.cmake/api/v1/reply/index-2025-05-27T06-43-53-0853.json rename to android/app/.cxx/Debug/4y161to1/arm64-v8a/.cmake/api/v1/reply/index-2025-06-16T09-40-14-0099.json diff --git a/android/app/.cxx/Debug/4y161to1/arm64-v8a/configure_fingerprint.bin b/android/app/.cxx/Debug/4y161to1/arm64-v8a/configure_fingerprint.bin index a8d57fa4..7888f3a4 100644 --- a/android/app/.cxx/Debug/4y161to1/arm64-v8a/configure_fingerprint.bin +++ b/android/app/.cxx/Debug/4y161to1/arm64-v8a/configure_fingerprint.bin @@ -2,27 +2,27 @@ C/C++ Structured Log} { y/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/Debug/4y161to1/arm64-v8a/additional_project_files.txtC A -?com.android.build.gradle.internal.cxx.io.EncodedFileFingerPrint  ބ2  2z +?com.android.build.gradle.internal.cxx.io.EncodedFileFingerPrint  2  2z x -v/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/Debug/4y161to1/arm64-v8a/android_gradle_build.json  ބ2 2 +v/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/Debug/4y161to1/arm64-v8a/android_gradle_build.json  2 2 } -{/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/Debug/4y161to1/arm64-v8a/android_gradle_build_mini.json  ބ2 2l +{/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/Debug/4y161to1/arm64-v8a/android_gradle_build_mini.json  2 2l j -h/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/Debug/4y161to1/arm64-v8a/build.ninja  ބ2 2p +h/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/Debug/4y161to1/arm64-v8a/build.ninja  2 2p n -l/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/Debug/4y161to1/arm64-v8a/build.ninja.txt  ބ2u +l/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/Debug/4y161to1/arm64-v8a/build.ninja.txt  2u s -q/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/Debug/4y161to1/arm64-v8a/build_file_index.txt  ބ2 _ 2v +q/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/Debug/4y161to1/arm64-v8a/build_file_index.txt  2 _ 2v t -r/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/Debug/4y161to1/arm64-v8a/compile_commands.json  ބ2z +r/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/Debug/4y161to1/arm64-v8a/compile_commands.json  2z x -v/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/Debug/4y161to1/arm64-v8a/compile_commands.json.bin  ބ2  +v/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/Debug/4y161to1/arm64-v8a/compile_commands.json.bin  2  ~ -|/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/Debug/4y161to1/arm64-v8a/metadata_generation_command.txt  ބ2 - 2s +|/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/Debug/4y161to1/arm64-v8a/metadata_generation_command.txt  2 + 2s q -o/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/Debug/4y161to1/arm64-v8a/prefab_config.json  ބ2  ( 2x +o/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/Debug/4y161to1/arm64-v8a/prefab_config.json  2  ( 2x v -t/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/Debug/4y161to1/arm64-v8a/symbol_folder_index.txt  ބ2  k 2c +t/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/Debug/4y161to1/arm64-v8a/symbol_folder_index.txt  2  k 2c a -_/Users/venbateam/Documents/flutter/packages/flutter_tools/gradle/src/main/groovy/CMakeLists.txt  ބ2  ހ2 \ No newline at end of file +_/Users/venbateam/Documents/flutter/packages/flutter_tools/gradle/src/main/groovy/CMakeLists.txt  2  ހ2 \ No newline at end of file diff --git a/android/app/.cxx/Debug/4y161to1/armeabi-v7a/.cmake/api/v1/reply/index-2025-05-27T06-44-23-0234.json b/android/app/.cxx/Debug/4y161to1/armeabi-v7a/.cmake/api/v1/reply/index-2025-06-16T09-40-37-0424.json similarity index 100% rename from android/app/.cxx/Debug/4y161to1/armeabi-v7a/.cmake/api/v1/reply/index-2025-05-27T06-44-23-0234.json rename to android/app/.cxx/Debug/4y161to1/armeabi-v7a/.cmake/api/v1/reply/index-2025-06-16T09-40-37-0424.json diff --git a/android/app/.cxx/Debug/4y161to1/armeabi-v7a/configure_fingerprint.bin b/android/app/.cxx/Debug/4y161to1/armeabi-v7a/configure_fingerprint.bin index b1abbfe7..88f59953 100644 --- a/android/app/.cxx/Debug/4y161to1/armeabi-v7a/configure_fingerprint.bin +++ b/android/app/.cxx/Debug/4y161to1/armeabi-v7a/configure_fingerprint.bin @@ -2,27 +2,27 @@ C/C++ Structured Log } {/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/Debug/4y161to1/armeabi-v7a/additional_project_files.txtC A -?com.android.build.gradle.internal.cxx.io.EncodedFileFingerPrint  ބ2  2| +?com.android.build.gradle.internal.cxx.io.EncodedFileFingerPrint  2  2| z -x/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/Debug/4y161to1/armeabi-v7a/android_gradle_build.json  ބ2 2 +x/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/Debug/4y161to1/armeabi-v7a/android_gradle_build.json  2 2  -}/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/Debug/4y161to1/armeabi-v7a/android_gradle_build_mini.json  ބ2 2n +}/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/Debug/4y161to1/armeabi-v7a/android_gradle_build_mini.json  2 2n l -j/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/Debug/4y161to1/armeabi-v7a/build.ninja  ބ2 2r +j/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/Debug/4y161to1/armeabi-v7a/build.ninja  2 2r p -n/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/Debug/4y161to1/armeabi-v7a/build.ninja.txt  ބ2w +n/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/Debug/4y161to1/armeabi-v7a/build.ninja.txt  2w u -s/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/Debug/4y161to1/armeabi-v7a/build_file_index.txt  ބ2 _ 2x +s/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/Debug/4y161to1/armeabi-v7a/build_file_index.txt  2 _ 2x v -t/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/Debug/4y161to1/armeabi-v7a/compile_commands.json  ބ2| +t/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/Debug/4y161to1/armeabi-v7a/compile_commands.json  2| z -x/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/Debug/4y161to1/armeabi-v7a/compile_commands.json.bin  ބ2  +x/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/Debug/4y161to1/armeabi-v7a/compile_commands.json.bin  2   -~/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/Debug/4y161to1/armeabi-v7a/metadata_generation_command.txt  ބ2 - 2u +~/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/Debug/4y161to1/armeabi-v7a/metadata_generation_command.txt  2 + 2u s -q/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/Debug/4y161to1/armeabi-v7a/prefab_config.json  ބ2  ( 2z +q/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/Debug/4y161to1/armeabi-v7a/prefab_config.json  2  ( 2z x -v/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/Debug/4y161to1/armeabi-v7a/symbol_folder_index.txt  ބ2  m 2c +v/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/Debug/4y161to1/armeabi-v7a/symbol_folder_index.txt  2  m 2c a -_/Users/venbateam/Documents/flutter/packages/flutter_tools/gradle/src/main/groovy/CMakeLists.txt  ބ2  ހ2 \ No newline at end of file +_/Users/venbateam/Documents/flutter/packages/flutter_tools/gradle/src/main/groovy/CMakeLists.txt  2  ހ2 \ No newline at end of file diff --git a/android/app/.cxx/Debug/4y161to1/x86/.cmake/api/v1/reply/index-2025-05-27T06-44-23-0626.json b/android/app/.cxx/Debug/4y161to1/x86/.cmake/api/v1/reply/index-2025-06-16T09-40-37-0760.json similarity index 100% rename from android/app/.cxx/Debug/4y161to1/x86/.cmake/api/v1/reply/index-2025-05-27T06-44-23-0626.json rename to android/app/.cxx/Debug/4y161to1/x86/.cmake/api/v1/reply/index-2025-06-16T09-40-37-0760.json diff --git a/android/app/.cxx/Debug/4y161to1/x86/configure_fingerprint.bin b/android/app/.cxx/Debug/4y161to1/x86/configure_fingerprint.bin index 0a209c84..0854c404 100644 --- a/android/app/.cxx/Debug/4y161to1/x86/configure_fingerprint.bin +++ b/android/app/.cxx/Debug/4y161to1/x86/configure_fingerprint.bin @@ -2,27 +2,27 @@ C/C++ Structured Logw u s/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/Debug/4y161to1/x86/additional_project_files.txtC A -?com.android.build.gradle.internal.cxx.io.EncodedFileFingerPrint  ބ2  2t +?com.android.build.gradle.internal.cxx.io.EncodedFileFingerPrint  2  2t r -p/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/Debug/4y161to1/x86/android_gradle_build.json  ބ2 2y +p/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/Debug/4y161to1/x86/android_gradle_build.json  2 2y w -u/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/Debug/4y161to1/x86/android_gradle_build_mini.json  ބ2 2f +u/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/Debug/4y161to1/x86/android_gradle_build_mini.json  2 2f d -b/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/Debug/4y161to1/x86/build.ninja  ބ2 2j +b/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/Debug/4y161to1/x86/build.ninja  2 2j h -f/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/Debug/4y161to1/x86/build.ninja.txt  ބ2o +f/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/Debug/4y161to1/x86/build.ninja.txt  2o m -k/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/Debug/4y161to1/x86/build_file_index.txt  ބ2 _ 2p +k/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/Debug/4y161to1/x86/build_file_index.txt  2 _ 2p n -l/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/Debug/4y161to1/x86/compile_commands.json  ބ2t +l/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/Debug/4y161to1/x86/compile_commands.json  2t r -p/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/Debug/4y161to1/x86/compile_commands.json.bin  ބ2 z +p/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/Debug/4y161to1/x86/compile_commands.json.bin  2 z x -v/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/Debug/4y161to1/x86/metadata_generation_command.txt  ބ2 - 2m +v/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/Debug/4y161to1/x86/metadata_generation_command.txt  2 + 2m k -i/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/Debug/4y161to1/x86/prefab_config.json  ބ2  ( 2r +i/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/Debug/4y161to1/x86/prefab_config.json  2  ( 2r p -n/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/Debug/4y161to1/x86/symbol_folder_index.txt  ބ2  e 2c +n/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/Debug/4y161to1/x86/symbol_folder_index.txt  2  e 2c a -_/Users/venbateam/Documents/flutter/packages/flutter_tools/gradle/src/main/groovy/CMakeLists.txt  ބ2  ހ2 \ No newline at end of file +_/Users/venbateam/Documents/flutter/packages/flutter_tools/gradle/src/main/groovy/CMakeLists.txt  2  ހ2 \ No newline at end of file diff --git a/android/app/.cxx/Debug/4y161to1/x86_64/.cmake/api/v1/reply/index-2025-05-27T06-44-23-0928.json b/android/app/.cxx/Debug/4y161to1/x86_64/.cmake/api/v1/reply/index-2025-06-16T09-40-38-0034.json similarity index 100% rename from android/app/.cxx/Debug/4y161to1/x86_64/.cmake/api/v1/reply/index-2025-05-27T06-44-23-0928.json rename to android/app/.cxx/Debug/4y161to1/x86_64/.cmake/api/v1/reply/index-2025-06-16T09-40-38-0034.json diff --git a/android/app/.cxx/Debug/4y161to1/x86_64/configure_fingerprint.bin b/android/app/.cxx/Debug/4y161to1/x86_64/configure_fingerprint.bin index a60585b5..6967c255 100644 --- a/android/app/.cxx/Debug/4y161to1/x86_64/configure_fingerprint.bin +++ b/android/app/.cxx/Debug/4y161to1/x86_64/configure_fingerprint.bin @@ -2,27 +2,27 @@ C/C++ Structured Logz x v/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/Debug/4y161to1/x86_64/additional_project_files.txtC A -?com.android.build.gradle.internal.cxx.io.EncodedFileFingerPrint  ބ2  2w +?com.android.build.gradle.internal.cxx.io.EncodedFileFingerPrint  2  2w u -s/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/Debug/4y161to1/x86_64/android_gradle_build.json  ބ2 2| +s/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/Debug/4y161to1/x86_64/android_gradle_build.json  2 2| z -x/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/Debug/4y161to1/x86_64/android_gradle_build_mini.json  ބ2 2i +x/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/Debug/4y161to1/x86_64/android_gradle_build_mini.json  2 2i g -e/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/Debug/4y161to1/x86_64/build.ninja  ބ2 2m +e/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/Debug/4y161to1/x86_64/build.ninja  2 2m k -i/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/Debug/4y161to1/x86_64/build.ninja.txt  ބ2r +i/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/Debug/4y161to1/x86_64/build.ninja.txt  2r p -n/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/Debug/4y161to1/x86_64/build_file_index.txt  ބ2 _ 2s +n/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/Debug/4y161to1/x86_64/build_file_index.txt  2 _ 2s q -o/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/Debug/4y161to1/x86_64/compile_commands.json  ބ2w +o/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/Debug/4y161to1/x86_64/compile_commands.json  2w u -s/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/Debug/4y161to1/x86_64/compile_commands.json.bin  ބ2 } +s/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/Debug/4y161to1/x86_64/compile_commands.json.bin  2 } { -y/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/Debug/4y161to1/x86_64/metadata_generation_command.txt  ބ2 - 2p +y/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/Debug/4y161to1/x86_64/metadata_generation_command.txt  2 + 2p n -l/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/Debug/4y161to1/x86_64/prefab_config.json  ބ2  ( 2u +l/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/Debug/4y161to1/x86_64/prefab_config.json  2  ( 2u s -q/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/Debug/4y161to1/x86_64/symbol_folder_index.txt  ބ2  h 2c +q/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/Debug/4y161to1/x86_64/symbol_folder_index.txt  2  h 2c a -_/Users/venbateam/Documents/flutter/packages/flutter_tools/gradle/src/main/groovy/CMakeLists.txt  ބ2  ހ2 \ No newline at end of file +_/Users/venbateam/Documents/flutter/packages/flutter_tools/gradle/src/main/groovy/CMakeLists.txt  2  ހ2 \ No newline at end of file diff --git a/android/app/.cxx/RelWithDebInfo/574gs2w4/arm64-v8a/configure_fingerprint.bin b/android/app/.cxx/RelWithDebInfo/574gs2w4/arm64-v8a/configure_fingerprint.bin index ebf3a42d..60f372c0 100644 --- a/android/app/.cxx/RelWithDebInfo/574gs2w4/arm64-v8a/configure_fingerprint.bin +++ b/android/app/.cxx/RelWithDebInfo/574gs2w4/arm64-v8a/configure_fingerprint.bin @@ -2,27 +2,27 @@ C/C++ Structured Log  /Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/RelWithDebInfo/574gs2w4/arm64-v8a/additional_project_files.txtC A -?com.android.build.gradle.internal.cxx.io.EncodedFileFingerPrint  2  ǟ2 +?com.android.build.gradle.internal.cxx.io.EncodedFileFingerPrint  Ă2  ǟ2  -/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/RelWithDebInfo/574gs2w4/arm64-v8a/android_gradle_build.json  2 ǟ2 +/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/RelWithDebInfo/574gs2w4/arm64-v8a/android_gradle_build.json  Ă2 ǟ2  -/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/RelWithDebInfo/574gs2w4/arm64-v8a/android_gradle_build_mini.json  2 ǟ2u +/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/RelWithDebInfo/574gs2w4/arm64-v8a/android_gradle_build_mini.json  Ă2 ǟ2u s -q/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/RelWithDebInfo/574gs2w4/arm64-v8a/build.ninja  2 ǟ2y +q/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/RelWithDebInfo/574gs2w4/arm64-v8a/build.ninja  Ă2 ǟ2y w -u/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/RelWithDebInfo/574gs2w4/arm64-v8a/build.ninja.txt  2~ +u/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/RelWithDebInfo/574gs2w4/arm64-v8a/build.ninja.txt  Ă2~ | -z/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/RelWithDebInfo/574gs2w4/arm64-v8a/build_file_index.txt  2 _ ǟ2 +z/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/RelWithDebInfo/574gs2w4/arm64-v8a/build_file_index.txt  Ă2 _ ǟ2 } -{/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/RelWithDebInfo/574gs2w4/arm64-v8a/compile_commands.json  2 +{/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/RelWithDebInfo/574gs2w4/arm64-v8a/compile_commands.json  Ă2  -/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/RelWithDebInfo/574gs2w4/arm64-v8a/compile_commands.json.bin  2  +/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/RelWithDebInfo/574gs2w4/arm64-v8a/compile_commands.json.bin  Ă2   -/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/RelWithDebInfo/574gs2w4/arm64-v8a/metadata_generation_command.txt  2 +/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/RelWithDebInfo/574gs2w4/arm64-v8a/metadata_generation_command.txt  Ă2  ǟ2| z -x/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/RelWithDebInfo/574gs2w4/arm64-v8a/prefab_config.json  2  ( ǟ2 +x/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/RelWithDebInfo/574gs2w4/arm64-v8a/prefab_config.json  Ă2  ( ǟ2  -}/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/RelWithDebInfo/574gs2w4/arm64-v8a/symbol_folder_index.txt  2  t ǟ2c +}/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/RelWithDebInfo/574gs2w4/arm64-v8a/symbol_folder_index.txt  Ă2  t ǟ2c a -_/Users/venbateam/Documents/flutter/packages/flutter_tools/gradle/src/main/groovy/CMakeLists.txt  2  ހ2 \ No newline at end of file +_/Users/venbateam/Documents/flutter/packages/flutter_tools/gradle/src/main/groovy/CMakeLists.txt  Ă2  ހ2 \ No newline at end of file diff --git a/android/app/.cxx/RelWithDebInfo/574gs2w4/armeabi-v7a/configure_fingerprint.bin b/android/app/.cxx/RelWithDebInfo/574gs2w4/armeabi-v7a/configure_fingerprint.bin index 5d6f19ad..3ecd5db8 100644 --- a/android/app/.cxx/RelWithDebInfo/574gs2w4/armeabi-v7a/configure_fingerprint.bin +++ b/android/app/.cxx/RelWithDebInfo/574gs2w4/armeabi-v7a/configure_fingerprint.bin @@ -2,27 +2,27 @@ C/C++ Structured Log  /Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/RelWithDebInfo/574gs2w4/armeabi-v7a/additional_project_files.txtC A -?com.android.build.gradle.internal.cxx.io.EncodedFileFingerPrint  2  ǟ2 +?com.android.build.gradle.internal.cxx.io.EncodedFileFingerPrint  էĂ2  ǟ2  -/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/RelWithDebInfo/574gs2w4/armeabi-v7a/android_gradle_build.json  2 ǟ2 +/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/RelWithDebInfo/574gs2w4/armeabi-v7a/android_gradle_build.json  էĂ2 ǟ2  -/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/RelWithDebInfo/574gs2w4/armeabi-v7a/android_gradle_build_mini.json  2 ǟ2w +/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/RelWithDebInfo/574gs2w4/armeabi-v7a/android_gradle_build_mini.json  էĂ2 ǟ2w u -s/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/RelWithDebInfo/574gs2w4/armeabi-v7a/build.ninja  2 ǟ2{ +s/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/RelWithDebInfo/574gs2w4/armeabi-v7a/build.ninja  էĂ2 ǟ2{ y -w/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/RelWithDebInfo/574gs2w4/armeabi-v7a/build.ninja.txt  2 +w/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/RelWithDebInfo/574gs2w4/armeabi-v7a/build.ninja.txt  էĂ2 ~ -|/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/RelWithDebInfo/574gs2w4/armeabi-v7a/build_file_index.txt  2 _ ǟ2 +|/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/RelWithDebInfo/574gs2w4/armeabi-v7a/build_file_index.txt  էĂ2 _ ǟ2  -}/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/RelWithDebInfo/574gs2w4/armeabi-v7a/compile_commands.json  2 +}/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/RelWithDebInfo/574gs2w4/armeabi-v7a/compile_commands.json  էĂ2  -/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/RelWithDebInfo/574gs2w4/armeabi-v7a/compile_commands.json.bin  2  +/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/RelWithDebInfo/574gs2w4/armeabi-v7a/compile_commands.json.bin  էĂ2   -/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/RelWithDebInfo/574gs2w4/armeabi-v7a/metadata_generation_command.txt  2 +/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/RelWithDebInfo/574gs2w4/armeabi-v7a/metadata_generation_command.txt  էĂ2  ǟ2~ | -z/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/RelWithDebInfo/574gs2w4/armeabi-v7a/prefab_config.json  2  ( ǟ2 +z/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/RelWithDebInfo/574gs2w4/armeabi-v7a/prefab_config.json  էĂ2  ( ǟ2  -/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/RelWithDebInfo/574gs2w4/armeabi-v7a/symbol_folder_index.txt  2  v ǟ2c +/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/RelWithDebInfo/574gs2w4/armeabi-v7a/symbol_folder_index.txt  էĂ2  v ǟ2c a -_/Users/venbateam/Documents/flutter/packages/flutter_tools/gradle/src/main/groovy/CMakeLists.txt  2  ހ2 \ No newline at end of file +_/Users/venbateam/Documents/flutter/packages/flutter_tools/gradle/src/main/groovy/CMakeLists.txt  էĂ2  ހ2 \ No newline at end of file diff --git a/android/app/.cxx/RelWithDebInfo/574gs2w4/x86/configure_fingerprint.bin b/android/app/.cxx/RelWithDebInfo/574gs2w4/x86/configure_fingerprint.bin index d676e93c..0630bb48 100644 --- a/android/app/.cxx/RelWithDebInfo/574gs2w4/x86/configure_fingerprint.bin +++ b/android/app/.cxx/RelWithDebInfo/574gs2w4/x86/configure_fingerprint.bin @@ -2,27 +2,27 @@ C/C++ Structured Log ~ |/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/RelWithDebInfo/574gs2w4/x86/additional_project_files.txtC A -?com.android.build.gradle.internal.cxx.io.EncodedFileFingerPrint  2  ǟ2} +?com.android.build.gradle.internal.cxx.io.EncodedFileFingerPrint  ާĂ2  ǟ2} { -y/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/RelWithDebInfo/574gs2w4/x86/android_gradle_build.json  2 ǟ2 +y/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/RelWithDebInfo/574gs2w4/x86/android_gradle_build.json  ާĂ2 ǟ2  -~/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/RelWithDebInfo/574gs2w4/x86/android_gradle_build_mini.json  2 ǟ2o +~/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/RelWithDebInfo/574gs2w4/x86/android_gradle_build_mini.json  ާĂ2 ǟ2o m -k/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/RelWithDebInfo/574gs2w4/x86/build.ninja  2 ǟ2s +k/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/RelWithDebInfo/574gs2w4/x86/build.ninja  ާĂ2 ǟ2s q -o/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/RelWithDebInfo/574gs2w4/x86/build.ninja.txt  2x +o/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/RelWithDebInfo/574gs2w4/x86/build.ninja.txt  ާĂ2x v -t/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/RelWithDebInfo/574gs2w4/x86/build_file_index.txt  2 _ ǟ2y +t/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/RelWithDebInfo/574gs2w4/x86/build_file_index.txt  ާĂ2 _ ǟ2y w -u/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/RelWithDebInfo/574gs2w4/x86/compile_commands.json  2} +u/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/RelWithDebInfo/574gs2w4/x86/compile_commands.json  ާĂ2} { -y/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/RelWithDebInfo/574gs2w4/x86/compile_commands.json.bin  2  +y/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/RelWithDebInfo/574gs2w4/x86/compile_commands.json.bin  ާĂ2   -/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/RelWithDebInfo/574gs2w4/x86/metadata_generation_command.txt  2 +/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/RelWithDebInfo/574gs2w4/x86/metadata_generation_command.txt  ާĂ2  ǟ2v t -r/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/RelWithDebInfo/574gs2w4/x86/prefab_config.json  2  ( ǟ2{ +r/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/RelWithDebInfo/574gs2w4/x86/prefab_config.json  ާĂ2  ( ǟ2{ y -w/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/RelWithDebInfo/574gs2w4/x86/symbol_folder_index.txt  2  n ǟ2c +w/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/RelWithDebInfo/574gs2w4/x86/symbol_folder_index.txt  ާĂ2  n ǟ2c a -_/Users/venbateam/Documents/flutter/packages/flutter_tools/gradle/src/main/groovy/CMakeLists.txt  2  ހ2 \ No newline at end of file +_/Users/venbateam/Documents/flutter/packages/flutter_tools/gradle/src/main/groovy/CMakeLists.txt  ާĂ2  ހ2 \ No newline at end of file diff --git a/android/app/.cxx/RelWithDebInfo/574gs2w4/x86_64/configure_fingerprint.bin b/android/app/.cxx/RelWithDebInfo/574gs2w4/x86_64/configure_fingerprint.bin index 7ef9c856..ad995a25 100644 --- a/android/app/.cxx/RelWithDebInfo/574gs2w4/x86_64/configure_fingerprint.bin +++ b/android/app/.cxx/RelWithDebInfo/574gs2w4/x86_64/configure_fingerprint.bin @@ -2,27 +2,27 @@ C/C++ Structured Log  /Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/RelWithDebInfo/574gs2w4/x86_64/additional_project_files.txtC A -?com.android.build.gradle.internal.cxx.io.EncodedFileFingerPrint  2  ǟ2 +?com.android.build.gradle.internal.cxx.io.EncodedFileFingerPrint  Ă2  ǟ2 ~ -|/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/RelWithDebInfo/574gs2w4/x86_64/android_gradle_build.json  2 ǟ2 +|/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/RelWithDebInfo/574gs2w4/x86_64/android_gradle_build.json  Ă2 ǟ2  -/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/RelWithDebInfo/574gs2w4/x86_64/android_gradle_build_mini.json  2 ǟ2r +/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/RelWithDebInfo/574gs2w4/x86_64/android_gradle_build_mini.json  Ă2 ǟ2r p -n/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/RelWithDebInfo/574gs2w4/x86_64/build.ninja  2 ǟ2v +n/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/RelWithDebInfo/574gs2w4/x86_64/build.ninja  Ă2 ǟ2v t -r/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/RelWithDebInfo/574gs2w4/x86_64/build.ninja.txt  2{ +r/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/RelWithDebInfo/574gs2w4/x86_64/build.ninja.txt  Ă2{ y -w/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/RelWithDebInfo/574gs2w4/x86_64/build_file_index.txt  2 _ ǟ2| +w/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/RelWithDebInfo/574gs2w4/x86_64/build_file_index.txt  Ă2 _ ǟ2| z -x/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/RelWithDebInfo/574gs2w4/x86_64/compile_commands.json  2 +x/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/RelWithDebInfo/574gs2w4/x86_64/compile_commands.json  Ă2 ~ -|/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/RelWithDebInfo/574gs2w4/x86_64/compile_commands.json.bin  2  +|/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/RelWithDebInfo/574gs2w4/x86_64/compile_commands.json.bin  Ă2   -/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/RelWithDebInfo/574gs2w4/x86_64/metadata_generation_command.txt  2 +/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/RelWithDebInfo/574gs2w4/x86_64/metadata_generation_command.txt  Ă2  ǟ2y w -u/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/RelWithDebInfo/574gs2w4/x86_64/prefab_config.json  2  ( ǟ2~ +u/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/RelWithDebInfo/574gs2w4/x86_64/prefab_config.json  Ă2  ( ǟ2~ | -z/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/RelWithDebInfo/574gs2w4/x86_64/symbol_folder_index.txt  2  q ǟ2c +z/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/RelWithDebInfo/574gs2w4/x86_64/symbol_folder_index.txt  Ă2  q ǟ2c a -_/Users/venbateam/Documents/flutter/packages/flutter_tools/gradle/src/main/groovy/CMakeLists.txt  2  ހ2 \ No newline at end of file +_/Users/venbateam/Documents/flutter/packages/flutter_tools/gradle/src/main/groovy/CMakeLists.txt  Ă2  ހ2 \ No newline at end of file diff --git a/android/app/build.gradle b/android/app/build.gradle index abb7fae1..59a83dd5 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 = "60" + flutterVersionCode = "61" } def flutterVersionName = localProperties.getProperty("flutter.versionName") if (flutterVersionName == null) { - flutterVersionName = "1.0.59" + flutterVersionName = "1.0.60" } def keystorePropertiesFile = rootProject.file("key.properties") diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml index a4b15385..58e2264e 100644 --- a/android/app/src/main/AndroidManifest.xml +++ b/android/app/src/main/AndroidManifest.xml @@ -36,7 +36,7 @@ - + diff --git a/assets/banners/FCSCLogo_dark.png b/assets/banners/FCSCLogo_dark.png new file mode 100644 index 00000000..8f693c5e Binary files /dev/null and b/assets/banners/FCSCLogo_dark.png differ diff --git a/assets/banners/fcsc.png b/assets/banners/FCSCLogo_light.png similarity index 100% rename from assets/banners/fcsc.png rename to assets/banners/FCSCLogo_light.png diff --git a/assets/dark_bg.png b/assets/dark_bg.png new file mode 100644 index 00000000..c8892586 Binary files /dev/null and b/assets/dark_bg.png differ diff --git a/assets/icons/misc/lockDark.png b/assets/icons/misc/lockDark.png new file mode 100644 index 00000000..8334474d Binary files /dev/null and b/assets/icons/misc/lockDark.png differ diff --git a/assets/icons/misc/lock.png b/assets/icons/misc/lockLight.png similarity index 100% rename from assets/icons/misc/lock.png rename to assets/icons/misc/lockLight.png diff --git a/assets/icons/misc/personDark.png b/assets/icons/misc/personDark.png new file mode 100644 index 00000000..8f378b94 Binary files /dev/null and b/assets/icons/misc/personDark.png differ diff --git a/assets/icons/misc/person.png b/assets/icons/misc/personLight.png similarity index 100% rename from assets/icons/misc/person.png rename to assets/icons/misc/personLight.png diff --git a/ios/Podfile.lock b/ios/Podfile.lock index e99ecab3..601f0ada 100644 --- a/ios/Podfile.lock +++ b/ios/Podfile.lock @@ -3,6 +3,12 @@ PODS: - Flutter - app_settings (5.1.1): - Flutter + - appsflyer_sdk (6.16.2): + - AppsFlyerFramework (= 6.16.2) + - Flutter + - AppsFlyerFramework (6.16.2): + - AppsFlyerFramework/Main (= 6.16.2) + - AppsFlyerFramework/Main (6.16.2) - connectivity_plus (0.0.1): - Flutter - device_info_plus (0.0.1): @@ -104,6 +110,7 @@ PODS: DEPENDENCIES: - app_links (from `.symlinks/plugins/app_links/ios`) - app_settings (from `.symlinks/plugins/app_settings/ios`) + - appsflyer_sdk (from `.symlinks/plugins/appsflyer_sdk/ios`) - connectivity_plus (from `.symlinks/plugins/connectivity_plus/ios`) - device_info_plus (from `.symlinks/plugins/device_info_plus/ios`) - firebase_core (from `.symlinks/plugins/firebase_core/ios`) @@ -123,6 +130,7 @@ DEPENDENCIES: SPEC REPOS: trunk: + - AppsFlyerFramework - Firebase - FirebaseCore - FirebaseCoreInternal @@ -138,6 +146,8 @@ EXTERNAL SOURCES: :path: ".symlinks/plugins/app_links/ios" app_settings: :path: ".symlinks/plugins/app_settings/ios" + appsflyer_sdk: + :path: ".symlinks/plugins/appsflyer_sdk/ios" connectivity_plus: :path: ".symlinks/plugins/connectivity_plus/ios" device_info_plus: @@ -174,6 +184,8 @@ EXTERNAL SOURCES: SPEC CHECKSUMS: app_links: 76b66b60cc809390ca1ad69bfd66b998d2387ac7 app_settings: 5127ae0678de1dcc19f2293271c51d37c89428b2 + appsflyer_sdk: ebe94dc3f00b07bdd001251dbc87879bda3c494a + AppsFlyerFramework: fe5303bffcdfd941d5f570c2d21eaaea982e7bdc connectivity_plus: cb623214f4e1f6ef8fe7403d580fdad517d2f7dd device_info_plus: 21fcca2080fbcd348be798aa36c3e5ed849eefbe Firebase: 1fe1c0a7d9aaea32efe01fbea5f0ebd8d70e53a2 diff --git a/ios/Runner.xcodeproj/project.pbxproj b/ios/Runner.xcodeproj/project.pbxproj index 0e4a5edc..44733890 100644 --- a/ios/Runner.xcodeproj/project.pbxproj +++ b/ios/Runner.xcodeproj/project.pbxproj @@ -506,7 +506,7 @@ CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 6; + CURRENT_PROJECT_VERSION = 7; DEVELOPMENT_ASSET_PATHS = Runner/Assets.xcassets; DEVELOPMENT_TEAM = 9N5SRFUGK2; ENABLE_BITCODE = NO; @@ -517,7 +517,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 1.0.5; + MARKETING_VERSION = 1.0.6; PRODUCT_BUNDLE_IDENTIFIER = ae.gov.fcsc.frontend.ios; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; @@ -705,7 +705,7 @@ CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 6; + CURRENT_PROJECT_VERSION = 7; DEVELOPMENT_ASSET_PATHS = Runner/Assets.xcassets; DEVELOPMENT_TEAM = 9N5SRFUGK2; ENABLE_BITCODE = NO; @@ -716,7 +716,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 1.0.5; + MARKETING_VERSION = 1.0.6; PRODUCT_BUNDLE_IDENTIFIER = ae.gov.fcsc.frontend.ios; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; @@ -742,7 +742,7 @@ CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 6; + CURRENT_PROJECT_VERSION = 7; DEVELOPMENT_ASSET_PATHS = Runner/Assets.xcassets; DEVELOPMENT_TEAM = 9N5SRFUGK2; ENABLE_BITCODE = NO; @@ -753,7 +753,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 1.0.5; + MARKETING_VERSION = 1.0.6; PRODUCT_BUNDLE_IDENTIFIER = ae.gov.fcsc.frontend.ios; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; diff --git a/lib/config/api_config.dart b/lib/config/api_config.dart index 6ec553f9..4aec2242 100644 --- a/lib/config/api_config.dart +++ b/lib/config/api_config.dart @@ -1,4 +1,4 @@ // api_config.dart -// const String apiUrl = 'http://192.168.1.26:8090'; +// const String apiUrl = 'http://127.0.0.1:8090'; // const String apiUrl = 'https://pbdev.venbait.in/'; const String apiUrl = 'https://pb.venbait.in/'; diff --git a/lib/config/theme/app_theme.dart b/lib/config/theme/app_theme.dart new file mode 100644 index 00000000..f99414a8 --- /dev/null +++ b/lib/config/theme/app_theme.dart @@ -0,0 +1,12 @@ +enum AppTheme { light, dark, system } + +extension AppThemeExtension on AppTheme { + String get name => toString().split('.').last; + + static AppTheme fromString(String value) { + return AppTheme.values.firstWhere( + (e) => e.name == value, + orElse: () => AppTheme.system, + ); + } +} \ No newline at end of file diff --git a/lib/config/theme/service.dart b/lib/config/theme/service.dart new file mode 100644 index 00000000..c115ad31 --- /dev/null +++ b/lib/config/theme/service.dart @@ -0,0 +1,94 @@ +import 'dart:convert'; +import 'package:http/http.dart' as http; +import 'package:pocketbase/pocketbase.dart'; +import 'package:uae_stat/config/api_config.dart'; + +class ThemeBaseService { + final pb = PocketBase(apiUrl); + dynamic themeData; + + + + // Future getUserTheme(String userId) async { + // final prefs = await SharedPreferences.getInstance(); + // final userId = prefs.getString('userId') ?? ''; + // + // // Authenticate admin d + // final adminAuth = await pb.admins.authWithPassword( + // 'pb@venbainfotech.com', + // 'pb@venbainfotech.com', + // ); + // final String adminToken = adminAuth.token; + // print('adminToken: $adminToken'); + // + // // Fetch user details + // final userDetailsResponse = await pb.collection('users').getOne( + // userId, + // headers: { + // 'Authorization': 'Bearer $adminToken', + // }, + // ); + // + // print('userDetailsLogin: $userDetailsResponse'); + // + // + // // if (response.statusCode == 200) { + // return userDetailsResponse.data['theme'] ?? 'system'; + // // } else { + // // return 'system'; + // // } + // } + + Future getUserTheme(String userId) async { + final url = "${pb.baseUrl}/api/collections/users/records/$userId"; + + final adminAuth = await pb.admins.authWithPassword( + 'pb@venbainfotech.com', + 'pb@venbainfotech.com', + ); + final String adminToken = adminAuth.token; + print('adminToken: $adminToken'); + final response = await http.get( + Uri.parse(url), + headers: { + 'Content-Type': 'application/json', + 'Authorization': 'Bearer $adminToken' + }, + ); + + if (response.statusCode == 200) { + return jsonDecode(response.body)['theme'] ?? 'system'; + } else { + return 'system'; + } + } + + Future updateUserTheme(String userId, String theme) async { + // Authenticate admin d + final url = "${pb.baseUrl}/api/collections/users/records/$userId"; + final adminAuth = await pb.admins.authWithPassword( + 'pb@venbainfotech.com', + 'pb@venbainfotech.com', + ); + final String adminToken = adminAuth.token; + print('adminToken: $adminToken'); + + final response = await http.patch( + Uri.parse(url), + headers: { + 'Content-Type': 'application/json', + 'Authorization': 'Bearer $adminToken', + }, + body: jsonEncode({ + 'theme': theme, // light, dark, or system + }), + ); + + if (response.statusCode == 200) { + print("Theme updated successfully"); + } else { + print("Failed to update theme: ${response.body}"); + throw Exception('Failed to update theme'); + } + } +} diff --git a/lib/config/theme/themeDialog.dart b/lib/config/theme/themeDialog.dart new file mode 100644 index 00000000..dcfbbc4b --- /dev/null +++ b/lib/config/theme/themeDialog.dart @@ -0,0 +1,49 @@ +import 'package:flutter/material.dart'; +import 'package:uae_stat/config/theme/app_theme.dart'; + +class ThemeSelectorDialog extends StatefulWidget { + final AppTheme initialTheme; + + const ThemeSelectorDialog({super.key, required this.initialTheme}); + + @override + State createState() => _ThemeSelectorDialogState(); +} + +class _ThemeSelectorDialogState extends State { + late AppTheme _selectedTheme; + + @override + void initState() { + super.initState(); + _selectedTheme = widget.initialTheme; + } + + @override + Widget build(BuildContext context) { + return AlertDialog( + title: const Text("Choose Theme"), + content: Column( + mainAxisSize: MainAxisSize.min, + children: AppTheme.values.map((theme) { + return RadioListTile( + title: Text(theme.name[0].toUpperCase() + theme.name.substring(1)), + value: theme, + groupValue: _selectedTheme, + onChanged: (value) => setState(() => _selectedTheme = value!), + ); + }).toList(), + ), + actions: [ + TextButton( + onPressed: () => Navigator.of(context).pop(null), + child: const Text("Cancel"), + ), + ElevatedButton( + onPressed: () => Navigator.of(context).pop(_selectedTheme), + child: const Text("OK"), + ), + ], + ); + } +} \ No newline at end of file diff --git a/lib/config/theme/theme_provider.dart b/lib/config/theme/theme_provider.dart new file mode 100644 index 00000000..b699bb6e --- /dev/null +++ b/lib/config/theme/theme_provider.dart @@ -0,0 +1,31 @@ +// lib/config/theme/theme_provider.dart + +import 'package:flutter/material.dart'; +import 'package:flutter_riverpod/flutter_riverpod.dart'; +import 'package:uae_stat/config/theme/app_theme.dart'; + +final themeProvider = StateNotifierProvider((ref) { + return ThemeNotifier(); +}); + +class ThemeNotifier extends StateNotifier { + ThemeNotifier() : super(ThemeMode.system); + + void updateTheme(AppTheme theme,Brightness platformBrightness) { + switch (theme) { + case AppTheme.light: + state = ThemeMode.light; + break; + case AppTheme.dark: + state = ThemeMode.dark; + break; + case AppTheme.system: + // Set based on actual system brightness + final systemTheme = platformBrightness == Brightness.dark + ? ThemeMode.dark + : ThemeMode.light; + state = systemTheme; + break; + } + } +} diff --git a/lib/infrastructure/services/img_asset_paths/banner_asset_path.dart b/lib/infrastructure/services/img_asset_paths/banner_asset_path.dart index 2aeda0fc..856c3952 100644 --- a/lib/infrastructure/services/img_asset_paths/banner_asset_path.dart +++ b/lib/infrastructure/services/img_asset_paths/banner_asset_path.dart @@ -1,4 +1,5 @@ abstract class BannerAssetPath { static const _basePath = 'assets/banners'; - static const fcsc = '$_basePath/fcsc.png'; + static const fcscLogoDark = '$_basePath/FCSCLogo_dark.png'; + static const fcscLogoLight = '$_basePath/FCSCLogo_light.png'; } diff --git a/lib/infrastructure/services/img_asset_paths/icons/misc_icon_asset_path.dart b/lib/infrastructure/services/img_asset_paths/icons/misc_icon_asset_path.dart index 3b1a35a7..b81891fc 100644 --- a/lib/infrastructure/services/img_asset_paths/icons/misc_icon_asset_path.dart +++ b/lib/infrastructure/services/img_asset_paths/icons/misc_icon_asset_path.dart @@ -2,9 +2,11 @@ abstract class MiscIconAssetPath { static const _basePath = 'assets/icons/misc'; static const rightChevronInSemiCircle = '$_basePath/right_chevron_in_semicircle.png'; - static const lock = '$_basePath/lock.png'; + static const lockDark = '$_basePath/lockDark.png'; + static const lockLight = '$_basePath/lockLight.png'; static const menu = '$_basePath/menu.png'; - static const person = '$_basePath/person.png'; + static const personDark = '$_basePath/personDark.png'; + static const personLight = '$_basePath/personLight.png'; static const back = '$_basePath/back.png'; static const vector = '$_basePath/vector.png'; static const visibleOn = '$_basePath/visible_on.png'; diff --git a/lib/main.dart b/lib/main.dart index 4908ab6d..5ca01697 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -10,6 +10,7 @@ import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:go_router/go_router.dart'; import 'package:uae_stat/config/injector.dart'; import 'package:uae_stat/config/my_router.dart'; +import 'package:uae_stat/config/theme/theme_provider.dart'; import 'package:uae_stat/presentation/components/indicators/locale_provider.dart'; import 'package:flutter_gen/gen_l10n/app_localizations.dart'; @@ -140,6 +141,10 @@ void main() async { print('User tapped on notification'); }); + // final themeProvider = ThemeProvider(); + // themeProvider.setUserId("USER_ID_FROM_LOGIN"); // set this properly + // await themeProvider.loadThemeFromPocketBase(); + // // Request permission for notifications @@ -224,11 +229,14 @@ class _MainAppState extends ConsumerState { handleConnectivityChange(context, hasInternet); } }); - + final themeMode = ref.watch(themeProvider); return MaterialApp.router( debugShowCheckedModeBanner: false, routerConfig: router, locale: locale, + theme: ThemeData.light(), + darkTheme: ThemeData.dark(), + themeMode: themeMode, localizationsDelegates: AppLocalizations.localizationsDelegates, supportedLocales: AppLocalizations.supportedLocales, ); diff --git a/lib/presentation/Screens/Bottom Navigation Pages/UAE_Numbers/uae_numbers.dart b/lib/presentation/Screens/Bottom Navigation Pages/UAE_Numbers/uae_numbers.dart index 029e0301..28929176 100644 --- a/lib/presentation/Screens/Bottom Navigation Pages/UAE_Numbers/uae_numbers.dart +++ b/lib/presentation/Screens/Bottom Navigation Pages/UAE_Numbers/uae_numbers.dart @@ -7,6 +7,7 @@ import 'package:go_router/go_router.dart'; import 'package:pocketbase/pocketbase.dart'; import 'package:shared_preferences/shared_preferences.dart'; import 'package:uae_stat/config/connectivity_provider.dart'; +import 'package:uae_stat/config/theme/theme_provider.dart'; import 'package:uae_stat/config/toggle_lang_service.dart'; import 'package:uae_stat/domain/use_cases/language.dart'; import 'package:uae_stat/infrastructure/services/img_asset_paths/icons/misc_icon_asset_path.dart'; @@ -18,7 +19,7 @@ import 'package:http/http.dart' as http; import 'package:uae_stat/config/api_config.dart'; import 'package:flutter_gen/gen_l10n/app_localizations.dart'; -class UaeNumbers extends StatelessWidget { +class UaeNumbers extends ConsumerWidget { const UaeNumbers({super.key}); @override @@ -34,7 +35,11 @@ class UaeNumbers extends StatelessWidget { // } @override - Widget build(BuildContext context) { + Widget build(BuildContext context,WidgetRef ref) { + + final isDarkTheme = ref.watch(themeProvider) == ThemeMode.dark || + (ref.watch(themeProvider) == ThemeMode.system && + MediaQuery.of(context).platformBrightness == Brightness.dark); double myheight = MediaQuery.of(context).size.height; double mywidth = MediaQuery.of(context).size.width; @@ -45,6 +50,7 @@ class UaeNumbers extends StatelessWidget { context.go('/myhomepage'); // Show exit confirmation dialog }, child: BaseScaffold( + backgroundColor: isDarkTheme ? Color(0xFF333333) : Color(0xFF414042), title: Text( context.translate( 'UAE Numbers', @@ -54,7 +60,8 @@ class UaeNumbers extends StatelessWidget { fontFamily: context.translate( 'Roboto', 'NotoKufi', - ) + ), + color: isDarkTheme ? Color(0xFFFFFFFF) : Color(0xFF414042), ), ), body: uaenumberWidget(), @@ -78,13 +85,22 @@ class _UaenumberWidgetState extends ConsumerState { int? expandedIndex = 0; final _pb = PocketBase(apiUrl); late UserService _userService; + late ThemeMode currentTheme; @override void initState() { super.initState(); _userService = UserService(); final locale = ref.read(localeProvider); - fetchData(locale?.languageCode ?? 'en'); + currentTheme = ref.read(themeProvider); + print('123456789'); + print(currentTheme); + final isDark = currentTheme == ThemeMode.dark || + (currentTheme == ThemeMode.system && + MediaQuery.of(context).platformBrightness == Brightness.dark); + + final themeMode = (isDark ? 'dark' : 'light'); + fetchData(locale?.languageCode ?? 'en',themeMode); _searchController.addListener(() { setState(() { filterData(_searchController.text); @@ -98,10 +114,10 @@ class _UaenumberWidgetState extends ConsumerState { super.dispose(); } - Future fetchData(locale) async { + Future fetchData(locale,themeMode) async { const baseUrl = '$apiUrl/api/getUAENumbersData'; try { - final response = await http.get(Uri.parse(baseUrl + '?language=$locale')); + final response = await http.get(Uri.parse(baseUrl + '?language=$locale&color_mode=$themeMode')); if (response.statusCode == 200) { setState(() { homePageData = (json.decode(response.body) as List) @@ -193,9 +209,39 @@ class _UaenumberWidgetState extends ConsumerState { isLoading = true; }); await _userService.updateLanguage(localeCode); - fetchData(localeCode); + final currentTheme = ref.read(themeProvider); + final isDark = currentTheme == ThemeMode.dark || + (currentTheme == ThemeMode.system && + MediaQuery.of(context).platformBrightness == Brightness.dark); + + final themeString = isDark ? 'dark' : 'light'; + fetchData(localeCode,themeString); }); + ref.listen(themeProvider, (previous, next) async { + final localeCode = ref.watch(localeProvider)?.languageCode ?? 'en'; + print(localeCode); + + // Default to 'en' if null + setState(() { + isLoading = true; + print('isLoadingref $isLoading'); + }); + + final currentTheme = ref.read(themeProvider); + final isDark = currentTheme == ThemeMode.dark || + (currentTheme == ThemeMode.system && + MediaQuery.of(context).platformBrightness == Brightness.dark); + + final themeString = isDark ? 'dark' : 'light'; + fetchData(localeCode,themeString); + }); + + final themeMode = ref.watch(themeProvider); + final isDarkTheme = themeMode == ThemeMode.dark || + (themeMode == ThemeMode.system && + MediaQuery.of(context).platformBrightness == Brightness.dark); + double myheight = MediaQuery.of(context).size.height; double mywidth = MediaQuery.of(context).size.width; @@ -218,14 +264,16 @@ class _UaenumberWidgetState extends ConsumerState { ); } - return Padding( + return Container( + color: isDarkTheme ? Color(0xFF333333) : Color(0xFFFFFFFF), // Set background here + child: Padding( padding: const EdgeInsets.only(left: 16.0, right: 16.0, top: 5.0, bottom: 5.0), child: Column( children: [ Container( height: 40, decoration: BoxDecoration( - color: Colors.white, + color: isDarkTheme ? Color(0xFF000000) : Colors.white, borderRadius: BorderRadius.circular(30.0), border: Border.all(width: 1, color: Color(0xFFAA8E83)), ), @@ -239,7 +287,7 @@ class _UaenumberWidgetState extends ConsumerState { decoration: InputDecoration( hintText: AppLocalizations.of(context)!.search, hintStyle: TextStyle( - color: Color(0xFFAA8E83), + color: isDarkTheme ? Color(0xFFBBBBBB) : Color(0xFFAA8E83), fontFamily: context.translate('Roboto', 'NotoKufi'), fontSize: 14, // height: 1.8, @@ -272,7 +320,7 @@ class _UaenumberWidgetState extends ConsumerState { }, ) : null, - contentPadding: EdgeInsets.symmetric(vertical: 12, horizontal: 18.0), + contentPadding: EdgeInsets.symmetric(vertical: 15, horizontal: 18.0), border: InputBorder.none, // contentPadding: // EdgeInsets.symmetric(vertical: 9, horizontal: 18.0), @@ -303,6 +351,7 @@ class _UaenumberWidgetState extends ConsumerState { }, title: mainTopic['main_topic'], titleBackgroundColor: backgroundColor, + // currentTheme: currentTheme, children: _buildSubTopics( mainTopic['sub_topics'] ?? [], mywidth, @@ -317,6 +366,7 @@ class _UaenumberWidgetState extends ConsumerState { ), ], ), + ) ); } @@ -431,6 +481,11 @@ class _UaenumberWidgetState extends ConsumerState { : 0.0; bool isPositive = parsedValue >= 0; + final themeMode = ref.watch(themeProvider); + final isDarkTheme = themeMode == ThemeMode.dark || + (themeMode == ThemeMode.system && + MediaQuery.of(context).platformBrightness == Brightness.dark); + return GestureDetector( onTap: () { final encodedMainTopic = Uri.encodeComponent(mainTopic); @@ -444,7 +499,7 @@ class _UaenumberWidgetState extends ConsumerState { child: Container( width: mywidth, decoration: BoxDecoration( - color: Colors.white, + color: isDarkTheme ? Color(0xFF111111) : Colors.white, border: Border.all( color: bordercolor, width: 1, @@ -459,7 +514,7 @@ class _UaenumberWidgetState extends ConsumerState { Text( title, textAlign: TextAlign.center, - style: robotoRegular11(context), + style: robotoRegular11(context,isDarkTheme), ), SizedBox(height: 0.1), Text(subtitle, textAlign: TextAlign.center, style: subtitleStyle(context)), @@ -499,7 +554,7 @@ class _UaenumberWidgetState extends ConsumerState { } } -class CustomExpandableTile extends StatefulWidget { +class CustomExpandableTile extends ConsumerStatefulWidget { final String title; final Color titleBackgroundColor; final List children; @@ -517,21 +572,31 @@ class CustomExpandableTile extends StatefulWidget { }); @override - _CustomExpandableTileState createState() => _CustomExpandableTileState(); + ConsumerState createState() => _CustomExpandableTileState(); } -class _CustomExpandableTileState extends State { +class _CustomExpandableTileState extends ConsumerState { bool isExpanded = false; // late bool isExpanded; + @override void initState() { super.initState(); // Initialize isExpanded based on widget's property + print('123456789'); } @override Widget build(BuildContext context) { double myheight = MediaQuery.of(context).size.height; + final themeMode = ref.watch(themeProvider); + final isDarkTheme = themeMode == ThemeMode.dark || + (themeMode == ThemeMode.system && + MediaQuery.of(context).platformBrightness == Brightness.dark); + print('123456789000'); + print(isDarkTheme); + + return Card( elevation: 0, child: Column( @@ -540,8 +605,7 @@ class _CustomExpandableTileState extends State { onTap: () => widget.onTap(widget.index), child: Container( decoration: BoxDecoration( - color: Colors - .white, // Ensuring the background outside the rounded container is white + color: isDarkTheme ? Color(0xFF333333) : Colors.white, ), child: Container( decoration: BoxDecoration( @@ -581,13 +645,13 @@ class _CustomExpandableTileState extends State { duration: Duration(milliseconds: 300), curve: Curves.easeInOut, width: double.infinity, - color: Colors.white, + color: isDarkTheme ? Color(0xFF333333) : Colors.white, height: widget.isExpanded ? myheight * 0.52 : 0, child: widget.isExpanded ? SingleChildScrollView( child: Container( decoration: BoxDecoration( - color: Colors.white, + color: isDarkTheme ? Color(0xFF333333) : Colors.white, // borderRadius: BorderRadius.all(Radius.circular(20)) ), padding: const EdgeInsets.all(1), diff --git a/lib/presentation/Screens/app_tour/WelcomePage.dart b/lib/presentation/Screens/app_tour/WelcomePage.dart index 34fa76d2..037bc508 100644 --- a/lib/presentation/Screens/app_tour/WelcomePage.dart +++ b/lib/presentation/Screens/app_tour/WelcomePage.dart @@ -12,7 +12,7 @@ class Welcomepage extends StatelessWidget { double myheight = MediaQuery.of(context).size.height; double mywidth = MediaQuery.of(context).size.width; final fcscBanner = Image.asset( - BannerAssetPath.fcsc, + BannerAssetPath.fcscLogoLight, height: 40, ); final uaestat = Image.asset( diff --git a/lib/presentation/Screens/auth_verification/create_new_pw.dart b/lib/presentation/Screens/auth_verification/create_new_pw.dart index 7e817d16..e69213d8 100644 --- a/lib/presentation/Screens/auth_verification/create_new_pw.dart +++ b/lib/presentation/Screens/auth_verification/create_new_pw.dart @@ -48,7 +48,7 @@ class _CreateNewPwState extends ConsumerState { String? _confirmPassword; final fcscBanner = Image.asset( - BannerAssetPath.fcsc, + BannerAssetPath.fcscLogoLight, height: 40, ); @@ -426,7 +426,7 @@ class _CreateNewPwState extends ConsumerState { end: 10, ), child: Image.asset( - MiscIconAssetPath.lock, + MiscIconAssetPath.lockLight, fit: BoxFit.fitHeight, height: 25, width: 25, @@ -510,7 +510,7 @@ class _CreateNewPwState extends ConsumerState { end: 10, ), child: Image.asset( - MiscIconAssetPath.lock, + MiscIconAssetPath.lockLight, fit: BoxFit.fitHeight, height: 25, width: 25, @@ -592,7 +592,7 @@ class _CreateNewPwState extends ConsumerState { end: 10, ), child: Image.asset( - MiscIconAssetPath.lock, + MiscIconAssetPath.lockLight, fit: BoxFit.fitHeight, height: 25, width: 25, diff --git a/lib/presentation/Screens/auth_verification/forgot_password.dart b/lib/presentation/Screens/auth_verification/forgot_password.dart index 82523409..7e5f039d 100644 --- a/lib/presentation/Screens/auth_verification/forgot_password.dart +++ b/lib/presentation/Screens/auth_verification/forgot_password.dart @@ -41,7 +41,7 @@ class _ForgotPasswordState extends ConsumerState { String? _confirmPassword; final fcscBanner = Image.asset( - BannerAssetPath.fcsc, + BannerAssetPath.fcscLogoLight, height: 40, ); @@ -445,7 +445,7 @@ class _ForgotPasswordState extends ConsumerState { end: 10, ), child: Image.asset( - MiscIconAssetPath.lock, + MiscIconAssetPath.lockLight, fit: BoxFit.fitHeight, height: 25, width: 25, @@ -528,7 +528,7 @@ class _ForgotPasswordState extends ConsumerState { end: 10, ), child: Image.asset( - MiscIconAssetPath.lock, + MiscIconAssetPath.lockLight, fit: BoxFit.fitHeight, height: 25, width: 25, diff --git a/lib/presentation/Screens/auth_verification/privacy_policy.dart b/lib/presentation/Screens/auth_verification/privacy_policy.dart index 2a5d0b77..541bc238 100644 --- a/lib/presentation/Screens/auth_verification/privacy_policy.dart +++ b/lib/presentation/Screens/auth_verification/privacy_policy.dart @@ -7,7 +7,7 @@ import 'package:uae_stat/presentation/routes/drawer_routes/custom_drawer_routes. class PrivacyPolicy extends StatelessWidget { PrivacyPolicy({super.key}); final fcscBanner = Image.asset( - BannerAssetPath.fcsc, + BannerAssetPath.fcscLogoLight, height: 40, alignment: Alignment.center, ); diff --git a/lib/presentation/Screens/auth_verification/registration.dart b/lib/presentation/Screens/auth_verification/registration.dart index bc08fc6a..91b6a911 100644 --- a/lib/presentation/Screens/auth_verification/registration.dart +++ b/lib/presentation/Screens/auth_verification/registration.dart @@ -8,6 +8,7 @@ import 'package:pocketbase/pocketbase.dart'; import 'package:uae_stat/config/api_config.dart'; import 'package:uae_stat/config/connectivity_provider.dart'; import 'package:uae_stat/config/my_theme.dart'; +import 'package:uae_stat/config/theme/theme_provider.dart'; import 'package:uae_stat/domain/use_cases/language.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'; @@ -359,10 +360,7 @@ class _RegisterScreenState extends ConsumerState { } } - final fcscBanner = Image.asset( - BannerAssetPath.fcsc, - height: 40, - ); + @override Widget build(BuildContext context) { @@ -376,6 +374,18 @@ class _RegisterScreenState extends ConsumerState { } }); + final themeMode = ref.read(themeProvider); + final isDarkTheme = themeMode == ThemeMode.dark || + (themeMode == ThemeMode.system && + MediaQuery.of(context).platformBrightness == Brightness.dark); + + final fcscBanner = Image.asset( + isDarkTheme + ? BannerAssetPath.fcscLogoDark + : BannerAssetPath.fcscLogoLight, + height: 40, + ); + Widget buildIconContainer(IconData icon, Color iconColor) { return Container( width: 60, @@ -406,7 +416,7 @@ class _RegisterScreenState extends ConsumerState { context.go('/login'); // Show exit confirmation dialog }, child:Scaffold( - backgroundColor: Colors.white, + backgroundColor: isDarkTheme ? Color(0xFF111111) : Colors.white, body: SafeArea( child: Stack(children: [ SingleChildScrollView( @@ -452,7 +462,7 @@ class _RegisterScreenState extends ConsumerState { children: [ SizedBox(height: screenheight / 4), buildIconContainer( - Icons.report, Color(0xFF7DAFBC)), + Icons.check_circle_rounded, Color(0xFF7DAFBC)), SizedBox(height: 20), Text( context.translate( @@ -466,7 +476,8 @@ class _RegisterScreenState extends ConsumerState { ), fontSize: 16, fontWeight: FontWeight.w500, - color: Color(0xFF414042)), + color: isDarkTheme ? Color(0xFFFFFFFF) : Color(0xFF414042) + ), ), SizedBox(height: 10), Text( @@ -480,15 +491,14 @@ class _RegisterScreenState extends ConsumerState { 'NotoKufi', ), fontSize: 14, - color: Color(0xFF898C81), + color: isDarkTheme ? Color(0xFFFFFFFF) : Color(0xFF898C81), ), ), SizedBox(height: 10), ElevatedButton( onPressed: () => {context.go('/login')}, style: ElevatedButton.styleFrom( - backgroundColor: - Color(0xFFAA8E83), // Background color + backgroundColor: isDarkTheme ? Color(0xFF24B4FB) : Color(0xFFAA8E83), // Background color shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular( 12), // Border radius @@ -514,7 +524,9 @@ class _RegisterScreenState extends ConsumerState { decoration: BoxDecoration( image: DecorationImage( image: AssetImage( - "assets/splash_screen/logo.png"), // Background image asset + isDarkTheme + ? BannerAssetPath.fcscLogoDark + : BannerAssetPath.fcscLogoLight), // Background image asset fit: BoxFit.fill, ), ), @@ -544,7 +556,7 @@ class _RegisterScreenState extends ConsumerState { ), fontSize: 16, fontWeight: FontWeight.w500, - color: Color(0xFF414042)), + color: isDarkTheme ? Color(0xFFFFFFFF) : Color(0xFF414042)), ), SizedBox(height: 10), Text( @@ -558,7 +570,7 @@ class _RegisterScreenState extends ConsumerState { 'NotoKufi', ), fontSize: 14, - color: Color(0xFF898C81), + color: isDarkTheme ? Color(0xFFEEEEEE) : Color(0xFF898C81), ), ), SizedBox(height: 10), @@ -581,7 +593,8 @@ class _RegisterScreenState extends ConsumerState { fontFamily: context.translate( 'Roboto', 'NotoKufi', - ) + ), + color: isDarkTheme ? Color(0xFF24B4FB) : Color(0xFFAA8E83), ), ), ), @@ -593,7 +606,9 @@ class _RegisterScreenState extends ConsumerState { decoration: BoxDecoration( image: DecorationImage( image: AssetImage( - "assets/splash_screen/logo.png"), // Background image asset + isDarkTheme + ? BannerAssetPath.fcscLogoDark + : BannerAssetPath.fcscLogoLight), // Background image asset fit: BoxFit.fill, ), ), @@ -619,7 +634,9 @@ class _RegisterScreenState extends ConsumerState { 'NotoKufi', ), fontSize: 32, - fontWeight: FontWeight.w400), + fontWeight: FontWeight.w400, + color: isDarkTheme ? Color(0xFFFFFFFF) : null, + ), ), SizedBox(height: 10), Text( @@ -632,7 +649,7 @@ class _RegisterScreenState extends ConsumerState { ), fontSize: context.translate(18.0, 14.0), - color: const Color(0xff898C81), + color: isDarkTheme ? Color(0xFFFFFFFF) : Color(0xff898C81), fontWeight: FontWeight.w600, ), ), @@ -649,7 +666,10 @@ class _RegisterScreenState extends ConsumerState { controller: _usernameController, // focusNode: _focusNodes[0], decoration: InputDecoration( + filled: true, + fillColor: isDarkTheme ? const Color(0xFF000000) : Colors.white, errorStyle: TextStyle( + color: isDarkTheme ? Color(0xFFFFA200) : Color(0xFFb22222), fontFamily: context.translate( 'Roboto', 'NotoKufi', @@ -674,7 +694,7 @@ class _RegisterScreenState extends ConsumerState { end: 10, ), child: Image.asset( - MiscIconAssetPath.person, + MiscIconAssetPath.personLight, fit: BoxFit.fitHeight, height: 25, width: 25, @@ -695,10 +715,7 @@ class _RegisterScreenState extends ConsumerState { borderRadius: BorderRadius.circular(10), borderSide: BorderSide( - color: MyTheme.topicColor( - IndicatorTopic - .economy) - .shade400, + color: isDarkTheme ? Colors.white : MyTheme.topicColor(IndicatorTopic.economy).shade400, // ✅ border width: 1), // Enabled border ), focusedBorder: OutlineInputBorder( @@ -712,7 +729,7 @@ class _RegisterScreenState extends ConsumerState { borderRadius: BorderRadius.circular(10), borderSide: BorderSide( - color: Color(0xFFb22222), + color: isDarkTheme ? Color(0xFFFFA100) : Color(0xFFb22222), width: 1), // Error border ), focusedErrorBorder: @@ -720,7 +737,7 @@ class _RegisterScreenState extends ConsumerState { borderRadius: BorderRadius.circular(10), borderSide: BorderSide( - color: Color(0xFFb22222), + color: isDarkTheme ? Color(0xFFFFA100) : Color(0xFFb22222), width: 1), // Match the error color ), @@ -730,7 +747,7 @@ class _RegisterScreenState extends ConsumerState { 'Roboto', 'NotoKufi', ), - color: Color(0xFFC3C6CB), + color: isDarkTheme ? const Color(0xFFEEEEEE) : const Color(0xFFC3C6CB), fontSize: registerLocale ?.languageCode == 'ar' @@ -756,7 +773,10 @@ class _RegisterScreenState extends ConsumerState { controller: _emailController, // focusNode: _focusNodes[1], decoration: InputDecoration( + filled: true, + fillColor: isDarkTheme ? const Color(0xFF000000) : Colors.white, errorStyle: TextStyle( + color: isDarkTheme ? Color(0xFFFFA200) : Color(0xFFb22222), fontFamily: context.translate( 'Roboto', 'NotoKufi', @@ -798,10 +818,7 @@ class _RegisterScreenState extends ConsumerState { borderRadius: BorderRadius.circular(10), borderSide: BorderSide( - color: MyTheme.topicColor( - IndicatorTopic - .economy) - .shade400, + color: isDarkTheme ? Colors.white : MyTheme.topicColor(IndicatorTopic.economy).shade400, width: 1), ), focusedBorder: OutlineInputBorder( @@ -815,7 +832,7 @@ class _RegisterScreenState extends ConsumerState { borderRadius: BorderRadius.circular(10), borderSide: BorderSide( - color: Color(0xFFb22222), + color: isDarkTheme ? Color(0xFFFFA100) : Color(0xFFb22222), width: 1), // Error border ), focusedErrorBorder: @@ -823,7 +840,7 @@ class _RegisterScreenState extends ConsumerState { borderRadius: BorderRadius.circular(10), borderSide: BorderSide( - color: Color(0xFFb22222), + color: isDarkTheme ? Color(0xFFFFA100) : Color(0xFFb22222), width: 1), // Match the error color ), @@ -833,7 +850,7 @@ class _RegisterScreenState extends ConsumerState { 'Roboto', 'NotoKufi', ), - color: Color(0xFFC3C6CB), + color: isDarkTheme ? const Color(0xFFEEEEEE) : const Color(0xFFC3C6CB), fontSize: registerLocale ?.languageCode == 'ar' @@ -863,7 +880,10 @@ class _RegisterScreenState extends ConsumerState { // focusNode: _focusNodes[2], obscureText: _obscurePassword, decoration: InputDecoration( + filled: true, + fillColor: isDarkTheme ? const Color(0xFF000000) : Colors.white, errorStyle: TextStyle( + color: isDarkTheme ? Color(0xFFFFA200) : Color(0xFFb22222), fontFamily: context.translate( 'Roboto', 'NotoKufi', @@ -888,7 +908,7 @@ class _RegisterScreenState extends ConsumerState { end: 10, ), child: Image.asset( - MiscIconAssetPath.lock, + MiscIconAssetPath.lockLight, fit: BoxFit.fitHeight, height: 25, width: 25, @@ -936,10 +956,7 @@ class _RegisterScreenState extends ConsumerState { borderRadius: BorderRadius.circular(10), borderSide: BorderSide( - color: MyTheme.topicColor( - IndicatorTopic - .economy) - .shade400, + color: isDarkTheme ? Colors.white : MyTheme.topicColor(IndicatorTopic.economy).shade400, width: 1), ), focusedBorder: OutlineInputBorder( @@ -953,7 +970,7 @@ class _RegisterScreenState extends ConsumerState { borderRadius: BorderRadius.circular(10), borderSide: BorderSide( - color: Color(0xFFb22222), + color: isDarkTheme ? Color(0xFFFFA100) : Color(0xFFb22222), width: 1), // Error border ), focusedErrorBorder: @@ -961,7 +978,7 @@ class _RegisterScreenState extends ConsumerState { borderRadius: BorderRadius.circular(10), borderSide: BorderSide( - color: Color(0xFFb22222), + color: isDarkTheme ? Color(0xFFFFA100) : Color(0xFFb22222), width: 1), // Match the error color ), @@ -972,7 +989,7 @@ class _RegisterScreenState extends ConsumerState { 'Roboto', 'NotoKufi', ), - color: Color(0xFFC3C6CB), + color: isDarkTheme ? const Color(0xFFEEEEEE) : const Color(0xFFC3C6CB), fontSize: registerLocale ?.languageCode == 'ar' @@ -1000,7 +1017,10 @@ class _RegisterScreenState extends ConsumerState { obscureText: _obscureConfirmPassword, decoration: InputDecoration( + filled: true, + fillColor: isDarkTheme ? const Color(0xFF000000) : Colors.white, errorStyle: TextStyle( + color: isDarkTheme ? Color(0xFFFFA200) : Color(0xFFb22222), fontFamily: context.translate( 'Roboto', 'NotoKufi', @@ -1025,7 +1045,7 @@ class _RegisterScreenState extends ConsumerState { end: 10, ), child: Image.asset( - MiscIconAssetPath.lock, + MiscIconAssetPath.lockLight, fit: BoxFit.fitHeight, height: 25, width: 25, @@ -1063,10 +1083,7 @@ class _RegisterScreenState extends ConsumerState { borderRadius: BorderRadius.circular(10), borderSide: BorderSide( - color: MyTheme.topicColor( - IndicatorTopic - .economy) - .shade400, + color: isDarkTheme ? Colors.white : MyTheme.topicColor(IndicatorTopic.economy).shade400, width: 1), ), focusedBorder: OutlineInputBorder( @@ -1080,7 +1097,7 @@ class _RegisterScreenState extends ConsumerState { borderRadius: BorderRadius.circular(10), borderSide: BorderSide( - color: Color(0xFFb22222), + color: isDarkTheme ? Color(0xFFFFA100) : Color(0xFFb22222), width: 1), // Error border ), focusedErrorBorder: @@ -1088,7 +1105,7 @@ class _RegisterScreenState extends ConsumerState { borderRadius: BorderRadius.circular(10), borderSide: BorderSide( - color: Color(0xFFb22222), + color: isDarkTheme ? Color(0xFFFFA100) : Color(0xFFb22222), width: 1), // Match the error color ), @@ -1098,7 +1115,7 @@ class _RegisterScreenState extends ConsumerState { 'Roboto', 'NotoKufi', ), - color: Color(0xFFC3C6CB), + color: isDarkTheme ? const Color(0xFFEEEEEE) : const Color(0xFFC3C6CB), fontSize: registerLocale ?.languageCode == 'ar' @@ -1139,11 +1156,8 @@ class _RegisterScreenState extends ConsumerState { }, side: BorderSide( color: showError - ? Color(0xFFb22222) - : MyTheme.topicColor( - IndicatorTopic - .economy) - .shade400, + ? isDarkTheme ? Color(0xFFFFA200) : Color(0xFFb22222) + : isDarkTheme ? Colors.white : MyTheme.topicColor(IndicatorTopic.economy).shade400, width: 1, ), ), @@ -1172,9 +1186,7 @@ class _RegisterScreenState extends ConsumerState { 'ar' ? 12 : 14, - color: Color( - 0xFF898C81, - ), // Change to your desired color + color: isDarkTheme ? Color(0xFFEEEEEE) : Color(0xFF898C81), // Change to your desired color ), children: [ TextSpan( @@ -1201,8 +1213,7 @@ class _RegisterScreenState extends ConsumerState { fontWeight: FontWeight .bold, - color: Color( - 0xFF985400), + color:isDarkTheme ? Color(0xFF9EB3E4) : Color(0xFF985400), // Makes the text bold // decoration: // TextDecoration.underline, @@ -1221,8 +1232,7 @@ class _RegisterScreenState extends ConsumerState { 'Roboto', 'NotoKufi', ), - color: Color( - 0xFF898C81), // Change to your desired color + color: isDarkTheme ? Color(0xFFEEEEEE) : Color(0xFF898C81), ), ), TextSpan( @@ -1248,8 +1258,7 @@ class _RegisterScreenState extends ConsumerState { 'ar' ? 12 : 14, - color: Color( - 0xFF985400), + color: isDarkTheme ? Color(0xFF9EB3E4) : Color(0xFF985400), // decoration: // TextDecoration.underline, decorationColor: @@ -1274,8 +1283,7 @@ class _RegisterScreenState extends ConsumerState { 'ar' ? 12 : 14, - color: Color( - 0xFF898C81), // Change to your desired color + color: isDarkTheme ? Color(0xFFEEEEEE) : Color( 0xFF898C81), // Change to your desired color ), ), ], @@ -1312,7 +1320,7 @@ class _RegisterScreenState extends ConsumerState { 'Roboto', 'NotoKufi', ), - color: Color(0xFFb22222), + color: isDarkTheme ? Color(0xFFFFA200) : Color(0xFFb22222), fontSize: registerLocale ?.languageCode == 'ar' @@ -1337,8 +1345,7 @@ class _RegisterScreenState extends ConsumerState { ? null : _registerUser, style: ElevatedButton.styleFrom( - backgroundColor: Color( - 0xFFA7887A), // Brownish color for Register + backgroundColor: isDarkTheme ? Color(0xFF9EB3E4) : Color(0xFFA7887A), // Brownish color for Register shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular(10), @@ -1362,14 +1369,14 @@ class _RegisterScreenState extends ConsumerState { 'ar' ? 14 : 16, - color: Colors.white), + color: isDarkTheme ? Color(0xFF000000) : Colors.white + ), ), SizedBox(width: 8), - const Icon( + Icon( Icons .chevron_right_outlined, - color: Colors - .white, // Set your desired color here + color: isDarkTheme ? Color(0xFF000000) : Colors.white, // Set your desired color here ) ], ), @@ -1391,7 +1398,7 @@ class _RegisterScreenState extends ConsumerState { 'ar' ? 12 : 14, - color: Color(0xFF898C81), + color: isDarkTheme ? Color(0xFFEEEEEE) : Color(0xFF898C81), ), ), SizedBox(height: 15), @@ -1408,8 +1415,7 @@ class _RegisterScreenState extends ConsumerState { context.pop(); }, style: ElevatedButton.styleFrom( - backgroundColor: Color( - 0xFF82AFCB), // Blueish color for Login + backgroundColor: isDarkTheme ? Color(0xFF24B4FB) : Color(0xFF82AFCB), // Blueish color for Login shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular(10), @@ -1432,14 +1438,13 @@ class _RegisterScreenState extends ConsumerState { 'ar' ? 14 : 16, - color: Colors.white), + color: isDarkTheme ? Color(0xFF000000) : Colors.white), ), SizedBox(width: 8), - const Icon( + Icon( Icons .chevron_right_outlined, - color: Colors - .white, // Set your desired color here + color: isDarkTheme ? Color(0xFF000000) : Colors.white, // Set your desired color here ) ], ), diff --git a/lib/presentation/Screens/auth_verification/terms&conditions.dart b/lib/presentation/Screens/auth_verification/terms&conditions.dart index 75de14cb..2a50cd1b 100644 --- a/lib/presentation/Screens/auth_verification/terms&conditions.dart +++ b/lib/presentation/Screens/auth_verification/terms&conditions.dart @@ -7,7 +7,7 @@ import 'package:uae_stat/presentation/routes/drawer_routes/custom_drawer_routes. class TermsOfUse extends StatelessWidget { TermsOfUse({super.key}); final fcscBanner = Image.asset( - BannerAssetPath.fcsc, + BannerAssetPath.fcscLogoLight, height: 40, alignment: Alignment.center, ); diff --git a/lib/presentation/Screens/charts/screens/chart_screen.dart b/lib/presentation/Screens/charts/screens/chart_screen.dart index 73b8a011..072b0762 100644 --- a/lib/presentation/Screens/charts/screens/chart_screen.dart +++ b/lib/presentation/Screens/charts/screens/chart_screen.dart @@ -13,6 +13,7 @@ import 'package:shared_preferences/shared_preferences.dart'; import 'package:tutorial_coach_mark/tutorial_coach_mark.dart'; import 'package:uae_stat/config/api_config.dart'; import 'package:uae_stat/config/connectivity_provider.dart'; +import 'package:uae_stat/config/theme/theme_provider.dart'; import 'package:uae_stat/config/toast_util.dart'; import 'package:uae_stat/config/toggle_lang_service.dart'; import 'package:uae_stat/domain/use_cases/language.dart'; @@ -97,9 +98,11 @@ class _ChartScreen1State extends ConsumerState { bool isBookmarked = false; // Track bookmark state String? bookmarkId; // Stores the ID of the bookmark record in PocketBase late final Locale locale; + late ThemeMode currentTheme; late String mainTopic; late UserService _userService; late double tourCard; + late bool isDarkTheme; @override void initState() { @@ -110,9 +113,17 @@ class _ChartScreen1State extends ConsumerState { checkIfBookmarked(); locale = ref.read(localeProvider) ?? const Locale('en'); print('locale-$locale'); + currentTheme = ref.read(themeProvider); + print('123456789'); + print(currentTheme); + final isDark = currentTheme == ThemeMode.dark || + (currentTheme == ThemeMode.system && + MediaQuery.of(context).platformBrightness == Brightness.dark); + + final themeMode = (isDark ? 'dark' : 'light'); fetchChartData(widget.dataSets, locale?.languageCode ?? 'en', widget.kpi, - widget.filter_data) + widget.filter_data,themeMode) .then((_) { if (_tabsData.isNotEmpty) { // Call onTabSelected for the first tab @@ -1399,13 +1410,13 @@ class _ChartScreen1State extends ConsumerState { }); } - Future fetchChartData(String dataSets, locale, kpi, filter_data) async { + Future fetchChartData(String dataSets, locale, kpi, filter_data,themeMode) async { var data = - await apiService.fetchChartData(dataSets, locale, kpi, filter_data); + await apiService.fetchChartData(dataSets, locale, kpi, filter_data,themeMode); tabFilteredKpi = kpi; print('FETCH KPI- $kpi'); - print('FETCH KFilter- $filter_data'); + print('FETCH KFilter- $filter_data'); print('locale1 - $locale'); // print('locale11 - $loacleData'); @@ -1502,12 +1513,19 @@ class _ChartScreen1State extends ConsumerState { print('locale2- $locale'); + final isDark = currentTheme == ThemeMode.dark || + (currentTheme == ThemeMode.system && + MediaQuery.of(context).platformBrightness == Brightness.dark); + + final themeMode = (isDark ? 'dark' : 'light'); + // Call fetchChartData with correct parameters fetchChartData( widget.dataSets, locale, tabWiseKpi, // Ensure you are passing the correct KPI here - formattedFilters // Pass the formatted filter data here + formattedFilters, // Pass the formatted filter data here + themeMode ); // Navigator.pop(context); @@ -1677,7 +1695,7 @@ class _ChartScreen1State extends ConsumerState { child: Container( width: MediaQuery.of(context).size.width * 0.7, height: MediaQuery.of(context).size.height, - color: Colors.white, + color: isDarkTheme ? Color(0xFF111111) : Colors.white, child: Column( children: [ // Header Section @@ -1693,7 +1711,7 @@ class _ChartScreen1State extends ConsumerState { UaeNumbersAssetPath.filterCharts, semanticsLabel: 'Filter', colorFilter: ColorFilter.mode( - Color(0xFF8E8E8E), BlendMode.srcIn), + isDarkTheme ? Color(0xFFFFFFFF) : Color(0xFF8E8E8E), BlendMode.srcIn), width: 25, height: 25, ), @@ -1704,7 +1722,7 @@ class _ChartScreen1State extends ConsumerState { 'المرشحات', ), style: TextStyle( - color: Color(0xFF8E8E8E), + color: isDarkTheme ? Color(0xFFFFFFFF) : Color(0xFF8E8E8E), fontSize: 20, fontWeight: FontWeight.w500, fontFamily: context.translate( @@ -1763,7 +1781,7 @@ class _ChartScreen1State extends ConsumerState { 'Roboto', 'NotoKufi', ), - color: Color(0xFF8E8E8E), + color: isDarkTheme ? Color(0xFFFFFFFF) : Color(0xFF8E8E8E), ), ), InkWell( @@ -1838,7 +1856,9 @@ class _ChartScreen1State extends ConsumerState { fontFamily: context.translate( 'Roboto', 'NotoKufi', - ) + ), + color: isDarkTheme ? Color(0xFFFFFFFF) : null, + ), ), ), @@ -1868,7 +1888,7 @@ class _ChartScreen1State extends ConsumerState { // "${locale == 'ar' ? 'يختار ' : 'Select '}" "${context.translate(filter_text_and_order['en'], filter_text_and_order['ar'])}", style: TextStyle( - color: Colors.grey, + color: isDarkTheme ? Color(0xFFFFFFFF) : Colors.grey, fontFamily: context.translate( 'Roboto', 'NotoKufi', @@ -1931,12 +1951,18 @@ class _ChartScreen1State extends ConsumerState { ref.watch(localeProvider)?.languageCode ?? 'en'; print('locale22- $locale'); + final isDark = currentTheme == ThemeMode.dark || + (currentTheme == ThemeMode.system && + MediaQuery.of(context).platformBrightness == Brightness.dark); + + final themeMode = (isDark ? 'dark' : 'light'); fetchChartData( widget.dataSets, locale, tabWiseKpi, // Ensure you are passing the correct KPI here - formattedFilters // Pass the formatted filter data here + formattedFilters, // Pass the formatted filter data here + themeMode ); Navigator.pop(context); }, @@ -1993,12 +2019,17 @@ class _ChartScreen1State extends ConsumerState { ref.watch(localeProvider)?.languageCode ?? 'en'; print('locale22- $locale'); + final isDark = currentTheme == ThemeMode.dark || + (currentTheme == ThemeMode.system && + MediaQuery.of(context).platformBrightness == Brightness.dark); + final themeMode = (isDark ? 'dark' : 'light'); fetchChartData( widget.dataSets, locale, tabWiseKpi, // Ensure you are passing the correct KPI here - formattedFilters // Pass the formatted filter data here + formattedFilters, // Pass the formatted filter data here + themeMode ); Navigator.pop(context); } else { @@ -2310,6 +2341,7 @@ class _ChartScreen1State extends ConsumerState { // return 1.0; // Default fallback (should never be reached) // } + @override Widget build(BuildContext context) { final locale = ref.watch(localeProvider); @@ -2342,10 +2374,17 @@ class _ChartScreen1State extends ConsumerState { currentTab = tabWiseKpi; print('Saving currentTab: $currentTab After locale change'); + final currentTheme = ref.read(themeProvider); + final isDark = currentTheme == ThemeMode.dark || + (currentTheme == ThemeMode.system && + MediaQuery.of(context).platformBrightness == Brightness.dark); + + final themeString = isDark ? 'dark' : 'light'; + final List> safeFilterData = widget.filter_data ?? []; final String safeKpi = widget.kpi ?? ''; - fetchChartData(widget.dataSets, localeCode, safeKpi, safeFilterData) + fetchChartData(widget.dataSets, localeCode, safeKpi, safeFilterData,themeString) .then((_) { print('DEBUG KPI: $safeKpi'); @@ -2362,6 +2401,55 @@ class _ChartScreen1State extends ConsumerState { } }); }); + + ref.listen(themeProvider, (previous, next) async { + final localeCode = ref.watch(localeProvider)?.languageCode ?? 'en'; + print(localeCode); + + // Default to 'en' if null + setState(() { + isLoading = true; + print('isLoadingref $isLoading'); + }); + + // fetchChartData(widget.dataSets, localeCode); + print('Saving currentTab: $tabWiseKpi before locale change'); + print('localeCodeWgt- $localeCode'); + currentTab = tabWiseKpi; + print('Saving currentTab: $currentTab After locale change'); + + final currentTheme = ref.read(themeProvider); + final isDark = currentTheme == ThemeMode.dark || + (currentTheme == ThemeMode.system && + MediaQuery.of(context).platformBrightness == Brightness.dark); + + final themeString = isDark ? 'dark' : 'light'; + + final List> safeFilterData = + widget.filter_data ?? []; + final String safeKpi = widget.kpi ?? ''; + + /// 🔥 Call your API + fetchChartData(widget.dataSets, localeCode, safeKpi, safeFilterData, themeString) + .then((_) { + print('DEBUG KPI: $safeKpi'); + print('TAB11: $currentTab'); + + if (currentTab.isNotEmpty) { + onTabSelected(currentTab); + print('TAB1: $currentTab'); + } else if (_tabsData.isNotEmpty) { + print('TAB2: $_tabsData'); + onTabSelected(_tabsData[0]['id']); + } + }); + }); + + final themeMode = ref.watch(themeProvider); + isDarkTheme = themeMode == ThemeMode.dark || + (themeMode == ThemeMode.system && + MediaQuery.of(context).platformBrightness == Brightness.dark); + double myheight = MediaQuery.of(context).size.height; double mywidth = MediaQuery.of(context).size.width; mainTopic = chartScreenData['main_topic'] ?? ''; @@ -2763,7 +2851,8 @@ class _ChartScreen1State extends ConsumerState { child: CardWidget( card: card, chartScreenData: - chartScreenData)), + chartScreenData, + themeMode: themeMode)), ], )); } else { @@ -2771,7 +2860,7 @@ class _ChartScreen1State extends ConsumerState { child: CardWidget( card: card, chartScreenData: - chartScreenData))); + chartScreenData,themeMode: themeMode))); if (tempRow.length == 2) { rows.add(Row(children: tempRow)); tempRow = []; @@ -2796,6 +2885,21 @@ class _ChartScreen1State extends ConsumerState { shrinkWrap: true, physics: const NeverScrollableScrollPhysics(), itemBuilder: (context, index) { + final isDarkTheme = themeMode == ThemeMode.dark || + (themeMode == ThemeMode.system && + MediaQuery.of(context).platformBrightness == Brightness.dark); + + final Map mainTopicColors = { + 'ECONOMY': Color(0xFF071F3B), + 'SOCIAL': Color(0xFF4F241B), + 'ENVIRONMENT': Color(0xFF16523C), + }; + + final String mainTopic = chartScreenData['main_topic']; + final Color backgroundColor = isDarkTheme + ? (mainTopicColors[mainTopic] ?? Colors.white) // fallback if key not found + : Colors.white; + return Card( margin: const EdgeInsets.all(10), child: Container( @@ -2811,7 +2915,7 @@ class _ChartScreen1State extends ConsumerState { ), // Border color width: 1, // Border width ), - color: Colors.white, + color: backgroundColor, borderRadius: BorderRadius.circular( 8), // Optional: Rounded corners ), @@ -2858,7 +2962,7 @@ class _ChartScreen1State extends ConsumerState { chartData: chartsData[index], bodyColor: bodyColor, - chartHeader: chartHeader), + chartHeader: chartHeader,isDarkTheme: isDarkTheme), ) ], ), @@ -2876,7 +2980,7 @@ class _ChartScreen1State extends ConsumerState { ), if (isLoading) Container( - color: Color(0x98FFFCE5), // Semi-transparent background + color: isDarkTheme ? Colors.transparent : Color(0x98FFFCE5), // Semi-transparent background child: Column( mainAxisAlignment: MainAxisAlignment.center, children: [ @@ -2885,8 +2989,7 @@ class _ChartScreen1State extends ConsumerState { horizontal: 40), // Left & Right space child: LinearProgressIndicator( minHeight: 5, // Adjust thickness - backgroundColor: - Colors.grey[100], // Optional: Background color + backgroundColor: isDarkTheme ? Colors.transparent : Colors.grey[100], // Optional: Background color valueColor: AlwaysStoppedAnimation( Color(0xFFAA8E83)), // Loader color ), @@ -2972,9 +3075,10 @@ Color _getColorFromHex(String hexColor) { class CardWidget extends StatelessWidget { final Map card; final Map chartScreenData; + final themeMode; const CardWidget( - {Key? key, required this.card, required this.chartScreenData}) + {Key? key, required this.card, required this.chartScreenData,required this.themeMode}) : super(key: key); @override @@ -2995,6 +3099,23 @@ class CardWidget extends StatelessWidget { ), ); + final isDarkTheme = themeMode == ThemeMode.dark || + (themeMode == ThemeMode.system && + MediaQuery.of(context).platformBrightness == Brightness.dark); + + final Map mainTopicColors = { + 'ECONOMY': Color(0xFF071F3B), + 'SOCIAL': Color(0xFF4F241B), + 'ENVIRONMENT': Color(0xFF16523C), + }; + + final String mainTopic = chartScreenData['main_topic']; + final Color backgroundColor = isDarkTheme + ? (mainTopicColors[mainTopic] ?? Colors.white) // fallback if key not found + : Colors.white; + + + if (response.isEmpty) { return SizedBox.shrink(); } else if (response.length == 1) { @@ -3010,6 +3131,7 @@ class CardWidget extends StatelessWidget { // Dynamic border color width: 1, // Adjust border thickness ), + ), child: Card( margin: const EdgeInsets.all(0), @@ -3023,7 +3145,7 @@ class CardWidget extends StatelessWidget { padding: const EdgeInsets.only( left: 16.0, right: 16.0, bottom: 2.0, top: 1.0), decoration: BoxDecoration( - color: Colors.white, // Move color inside BoxDecoration + color: backgroundColor, // Move color inside BoxDecoration borderRadius: BorderRadius.circular( 12), // Ensure border radius is applied ), @@ -3061,7 +3183,9 @@ class CardWidget extends StatelessWidget { ), child: Text( chart_heading ?? 'NA', - style: TextStyle(color: Colors.white, fontFamily: context.translate( + style: TextStyle( + color: Colors.white, + fontFamily: context.translate( 'Roboto', 'NotoKufi', ),), @@ -3087,7 +3211,7 @@ class CardWidget extends StatelessWidget { ), fontSize: 11, fontWeight: FontWeight.w400, - color: Colors.black87, + color: isDarkTheme ? Color(0xFFFFFFFF) : Colors.black87, ), ), ), @@ -3170,7 +3294,7 @@ class CardWidget extends StatelessWidget { // padding: const EdgeInsets.only( // left: 10.0, right: 10.0, bottom: 5.0, top: 1.0), decoration: BoxDecoration( - color: Colors.white, // Move color inside BoxDecoration + color: backgroundColor, // Move color inside BoxDecoration borderRadius: BorderRadius.circular(12), // Ensure border radius is applied ), @@ -3209,7 +3333,10 @@ class CardWidget extends StatelessWidget { child: Text( chart_heading ?? 'NA', style: - TextStyle(color: Colors.white, fontSize: 10, fontFamily: context.translate( + TextStyle( + color: Colors.white, + fontSize: 10, + fontFamily: context.translate( 'Roboto', 'NotoKufi', ),), @@ -3235,7 +3362,7 @@ class CardWidget extends StatelessWidget { ), fontSize: 11, fontWeight: FontWeight.w400, - color: Colors.black87, + color: isDarkTheme ? Color(0xFFFFFFFF) : Colors.black87, ), ), ), diff --git a/lib/presentation/Screens/charts/services/api_service.dart b/lib/presentation/Screens/charts/services/api_service.dart index 634e0793..7bf35b69 100644 --- a/lib/presentation/Screens/charts/services/api_service.dart +++ b/lib/presentation/Screens/charts/services/api_service.dart @@ -17,7 +17,7 @@ class ApiService { static const String baseUrl = '$apiUrl/api/getDataSet'; Future> fetchChartData(String dataSets, locale, kpi, - List> filterData) async { + List> filterData,themeMode) async { List isChartData = []; List nonChartData = []; List originalChartsData = []; @@ -36,11 +36,13 @@ class ApiService { 'kpi': kpi.isNotEmpty ? kpi : null, // Avoid sending empty kpi 'filter_data': filterData.isNotEmpty ? filterData : [], // Avoid empty list + 'color_mode' : themeMode, }; // final url = Uri.https('$baseUrl?dataset=$dataSets&language=$locale'); print('APISErvice - $url'); + print('requestBody: $requestBody'); try { final response = await http.post( diff --git a/lib/presentation/Screens/charts/widgets/chart_widget.dart b/lib/presentation/Screens/charts/widgets/chart_widget.dart index 1e1cb772..5e19098a 100644 --- a/lib/presentation/Screens/charts/widgets/chart_widget.dart +++ b/lib/presentation/Screens/charts/widgets/chart_widget.dart @@ -15,10 +15,12 @@ class ChartWidget extends StatelessWidget { required this.chartData, required this.bodyColor, required this.chartHeader, + required this.isDarkTheme }) : super(key: key); final dynamic chartData; final Color bodyColor; final String chartHeader; + final isDarkTheme; List showingTooltipOnSpots = []; // To store indices of active tooltips late LineChartBarData tooltipsOnBar; // Needs proper initialization @@ -336,7 +338,7 @@ class ChartWidget extends StatelessWidget { ), fontSize: isTouched ? 12 : (percentage < 1 ? 10 : 11), fontWeight: FontWeight.bold, - color: Colors.black, + color: isDarkTheme ? Colors.white : Colors.black, // color: Colors.white, ), // titlePositionPercentageOffset: 1.4, @@ -514,7 +516,7 @@ class ChartWidget extends StatelessWidget { style: TextStyle(fontFamily: context.translate( 'Roboto', 'NotoKufi', - ),fontSize: 12), + ),fontSize: 12,color: isDarkTheme ? Colors.white : null), softWrap: true, maxLines: 2, ), @@ -706,7 +708,7 @@ class ChartWidget extends StatelessWidget { style: TextStyle(fontFamily: context.translate( 'Roboto', 'NotoKufi', - ),fontSize: 14, fontWeight: FontWeight.w400), + ),fontSize: 14, fontWeight: FontWeight.w400,color: isDarkTheme ? Colors.white : Colors.black), textAlign: TextAlign.center, ), SizedBox(height: 15), @@ -807,7 +809,7 @@ class ChartWidget extends StatelessWidget { style: TextStyle(fontFamily: context.translate( 'Roboto', 'NotoKufi', - ),fontSize: 14, fontWeight: FontWeight.w400), + ),fontSize: 14, fontWeight: FontWeight.w400,color: isDarkTheme ? Colors.white : Colors.black), textAlign: TextAlign.center, ), SizedBox(height: 5), @@ -1198,7 +1200,7 @@ class ChartWidget extends StatelessWidget { style: TextStyle(fontFamily: context.translate( 'Roboto', 'NotoKufi', - ),fontSize: 14, fontWeight: FontWeight.w400), + ),fontSize: 14, fontWeight: FontWeight.w400,color: isDarkTheme ? Colors.white : Colors.black), textAlign: TextAlign.center, ), SizedBox(height: 5), @@ -1432,7 +1434,7 @@ class ChartWidget extends StatelessWidget { }); return Scaffold( - backgroundColor: Colors.white, + backgroundColor: isDarkTheme ? Colors.transparent : Colors.white, body: Padding( padding: const EdgeInsets.all(10), child: LayoutBuilder( @@ -1464,7 +1466,7 @@ class ChartWidget extends StatelessWidget { style: TextStyle( fontFamily: context.translate('Roboto', 'NotoKufi'), fontSize: 14, - fontWeight: FontWeight.w400, + fontWeight: FontWeight.w400,color: isDarkTheme ? Colors.white : Colors.black, ), textAlign: TextAlign.center, ), @@ -1487,8 +1489,8 @@ class ChartWidget extends StatelessWidget { sideTitles: SideTitles( showTitles: true, getTitlesWidget: (value, meta) { - const style = TextStyle( - color: Colors.black, + var style = TextStyle( + color: isDarkTheme ? Colors.white : Colors.black, fontSize: 10, ); @@ -1501,7 +1503,7 @@ class ChartWidget extends StatelessWidget { Container( width: 1, height: 8, - color: Colors.black, + color: isDarkTheme ? Colors.white : Colors.black, margin: EdgeInsets.only(bottom: 2), ), Text(value.toInt().toString(), style: style), @@ -1528,9 +1530,9 @@ class ChartWidget extends StatelessWidget { ), borderData: FlBorderData( show: true, - border: const Border( + border: Border( left: BorderSide.none, - bottom: BorderSide(color: Colors.black), + bottom: BorderSide(color: isDarkTheme ? Colors.white : Colors.black), ), ), gridData: FlGridData(show: false), @@ -1546,7 +1548,7 @@ class ChartWidget extends StatelessWidget { // if (x == minX || x == maxX) return null; return LineTooltipItem( formatNumber(spot.y), - const TextStyle(color: Colors.white), + TextStyle(color: isDarkTheme ? Colors.white : Colors.white), ); }).toList(); }, @@ -1576,7 +1578,7 @@ class ChartWidget extends StatelessWidget { fontSize: 9, fontWeight: FontWeight.w500, // color: color, - color: Colors.black, + color: isDarkTheme ? Colors.white : Colors.black, ), ), ) @@ -1804,7 +1806,7 @@ class ChartWidget extends StatelessWidget { }); return Scaffold( - backgroundColor: Colors.white, + backgroundColor: isDarkTheme ? Colors.transparent : Colors.white, body: Padding( padding: const EdgeInsets.all(10), child: LayoutBuilder( @@ -1836,7 +1838,7 @@ class ChartWidget extends StatelessWidget { style: TextStyle( fontFamily: context.translate('Roboto', 'NotoKufi'), fontSize: 14, - fontWeight: FontWeight.w400, + fontWeight: FontWeight.w400,color: isDarkTheme ? Colors.white : Colors.black, ), textAlign: TextAlign.center, ), @@ -1859,8 +1861,8 @@ class ChartWidget extends StatelessWidget { sideTitles: SideTitles( showTitles: true, getTitlesWidget: (value, meta) { - const style = TextStyle( - color: Colors.black, + var style = TextStyle( + color: isDarkTheme ? Colors.white : Colors.black, fontSize: 10, ); @@ -1873,7 +1875,7 @@ class ChartWidget extends StatelessWidget { Container( width: 1, height: 8, - color: Colors.black, + color: isDarkTheme ? Colors.white : Colors.black, margin: EdgeInsets.only(bottom: 2), ), Text(value.toInt().toString(), style: style), @@ -1900,9 +1902,9 @@ class ChartWidget extends StatelessWidget { ), borderData: FlBorderData( show: true, - border: const Border( + border: Border( left: BorderSide.none, - bottom: BorderSide(color: Colors.black), + bottom: BorderSide(color: isDarkTheme ? Colors.white : Colors.black), ), ), gridData: FlGridData(show: false), @@ -1929,7 +1931,7 @@ class ChartWidget extends StatelessWidget { } return LineTooltipItem( formatNumber(spot.y), - const TextStyle(color: Colors.white), + TextStyle(color: isDarkTheme ? Colors.white : Colors.white), ); }).toList(); }, @@ -1959,7 +1961,7 @@ class ChartWidget extends StatelessWidget { fontSize: 9, fontWeight: FontWeight.w500, // color: color, - color: Colors.black, + color: isDarkTheme ? Colors.white : Colors.black, ), ), ) @@ -2105,7 +2107,7 @@ class ChartWidget extends StatelessWidget { style: TextStyle(fontFamily: context.translate( 'Roboto', 'NotoKufi', - ),fontSize: 14, fontWeight: FontWeight.w400), + ),fontSize: 14, fontWeight: FontWeight.w400,color: isDarkTheme ? Colors.white : Colors.black), textAlign: TextAlign.center, ), SizedBox(height: 5), @@ -2219,7 +2221,7 @@ class ChartWidget extends StatelessWidget { 'Roboto', 'NotoKufi', ), - color: Colors.black, + color: isDarkTheme ? Colors.white : Colors.black, fontSize: 12, fontWeight: FontWeight.w400, ), @@ -2460,7 +2462,7 @@ class ChartWidget extends StatelessWidget { style: TextStyle(fontFamily: context.translate( 'Roboto', 'NotoKufi', - ),fontSize: 14, fontWeight: FontWeight.w400), + ),fontSize: 14, fontWeight: FontWeight.w400,color: isDarkTheme ? Colors.white : Colors.black), textAlign: TextAlign.center, ), // SizedBox(height: 5), @@ -2511,7 +2513,7 @@ class ChartWidget extends StatelessWidget { 'Roboto', 'NotoKufi', ), - color: Colors.black, + color: isDarkTheme ? Colors.white : Colors.black, fontSize: 12, fontWeight: FontWeight.w400, ), @@ -2712,7 +2714,7 @@ class ChartWidget extends StatelessWidget { style: TextStyle(fontFamily: context.translate( 'Roboto', 'NotoKufi', - ),fontSize: 14, fontWeight: FontWeight.w400), + ),fontSize: 14, fontWeight: FontWeight.w400,color: isDarkTheme ? Colors.white : Colors.black), textAlign: TextAlign.center, ), SizedBox(height: 5), @@ -3028,7 +3030,7 @@ class ChartWidget extends StatelessWidget { style: TextStyle(fontFamily: context.translate( 'Roboto', 'NotoKufi', - ),fontSize: 14, fontWeight: FontWeight.w400), + ),fontSize: 14, fontWeight: FontWeight.w400,color: isDarkTheme ? Colors.white : Colors.black), textAlign: TextAlign.center, ), SizedBox(height: 5), @@ -3208,7 +3210,7 @@ class ChartWidget extends StatelessWidget { 'Roboto', 'NotoKufi', ), - color: Colors.black, + color: isDarkTheme ? Colors.white : Colors.black, fontSize: 12, ), ); @@ -3240,7 +3242,7 @@ class ChartWidget extends StatelessWidget { 'Roboto', 'NotoKufi', ), - color: Colors.black, + color: isDarkTheme ? Colors.white : Colors.black, fontSize: 12, ), ); @@ -3529,7 +3531,7 @@ class ChartWidget extends StatelessWidget { }); return Scaffold( - backgroundColor: Colors.white, + backgroundColor: isDarkTheme ? Colors.transparent : Colors.white, body: Padding( padding: const EdgeInsets.all(10), child: LayoutBuilder( @@ -3561,7 +3563,7 @@ class ChartWidget extends StatelessWidget { style: TextStyle( fontFamily: context.translate('Roboto', 'NotoKufi'), fontSize: 14, - fontWeight: FontWeight.w400, + fontWeight: FontWeight.w400,color: isDarkTheme ? Colors.white : Colors.black, ), textAlign: TextAlign.center, ), @@ -3584,8 +3586,8 @@ class ChartWidget extends StatelessWidget { sideTitles: SideTitles( showTitles: true, getTitlesWidget: (value, meta) { - const style = TextStyle( - color: Colors.black, + var style = TextStyle( + color: isDarkTheme ? Colors.white : Colors.black, fontSize: 10, ); @@ -3598,7 +3600,7 @@ class ChartWidget extends StatelessWidget { Container( width: 1, height: 8, - color: Colors.black, + color: isDarkTheme ? Colors.white : Colors.black, margin: EdgeInsets.only(bottom: 2), ), Text(value.toInt().toString(), style: style), @@ -3625,9 +3627,9 @@ class ChartWidget extends StatelessWidget { ), borderData: FlBorderData( show: true, - border: const Border( + border: Border( left: BorderSide.none, - bottom: BorderSide(color: Colors.black), + bottom: BorderSide(color: isDarkTheme ? Colors.white : Colors.black), ), ), gridData: FlGridData(show: false), @@ -3643,7 +3645,7 @@ class ChartWidget extends StatelessWidget { // if (x == minX || x == maxX) return null; return LineTooltipItem( formatNumber(spot.y), - const TextStyle(color: Colors.white), + TextStyle(color: isDarkTheme ? Colors.white : Colors.white), ); }).toList(); }, @@ -3719,7 +3721,7 @@ class ChartWidget extends StatelessWidget { fontSize: 9, fontWeight: FontWeight.w500, // color: color, - color: Colors.black, + color: isDarkTheme ? Colors.white : Colors.black, ), ), ) diff --git a/lib/presentation/components/constant/constant.dart b/lib/presentation/components/constant/constant.dart index 6fbc00ab..2b64b8c2 100644 --- a/lib/presentation/components/constant/constant.dart +++ b/lib/presentation/components/constant/constant.dart @@ -13,7 +13,7 @@ TextStyle subtitleStyle(BuildContext context) { color: const Color(0xFF8E8E8E), ); } -TextStyle robotoRegular11(BuildContext context) +TextStyle robotoRegular11(BuildContext context,isDarkTheme) {return TextStyle(fontFamily: context.translate('Roboto', 'NotoKufi'), fontWeight: FontWeight.w400, - fontSize: 12 * 1.1,color: Color(0xFF000000),);} + fontSize: 12 * 1.1,color: isDarkTheme ? Color(0xFFFFFFFF) : Color(0xFF000000),);} diff --git a/lib/presentation/components/dialogs.dart b/lib/presentation/components/dialogs.dart index 88430de5..198466b9 100644 --- a/lib/presentation/components/dialogs.dart +++ b/lib/presentation/components/dialogs.dart @@ -100,7 +100,10 @@ extension Dialogs on BuildContext { final contentText = Text(content); return AlertDialog( title: Text(title, - style: TextStyle(color: Color(0xFF898C81),fontWeight: FontWeight.w700),), + style: TextStyle( + color: Color(0xFF898C81), + fontWeight: FontWeight.w700) + ), content: content.length > 300 ? SingleChildScrollView( child:Text( diff --git a/lib/presentation/components/themed_text_field.dart b/lib/presentation/components/themed_text_field.dart index aa6aa5ae..a6feb982 100644 --- a/lib/presentation/components/themed_text_field.dart +++ b/lib/presentation/components/themed_text_field.dart @@ -13,6 +13,11 @@ class ThemedFormField extends HookWidget { required this.controller, this.validator, this.isObscurable = false, + this.hintColor, + this.backgroundColor, + this.borderColor, + this.errorBorderColor, + this.errorTextColor, }); final String hintText; @@ -20,6 +25,11 @@ class ThemedFormField extends HookWidget { final String? Function(String? text)? validator; final TextEditingController controller; final bool isObscurable; + final Color? hintColor; + final Color? backgroundColor; + final Color? borderColor; + final Color? errorBorderColor; + final Color? errorTextColor; @override Widget build(BuildContext context) { @@ -49,25 +59,40 @@ class ThemedFormField extends HookWidget { 'Roboto', 'NotoKufi', ), + color: errorTextColor ?? const Color(0xFFB22222), + ), + errorBorder: OutlineInputBorder( + borderRadius: BorderRadius.circular(10), + borderSide: BorderSide( + color: errorBorderColor ?? const Color(0xFFB22222), + width: 1, + ), + ), + focusedErrorBorder: OutlineInputBorder( + borderRadius: BorderRadius.circular(10), + borderSide: BorderSide( + color: errorBorderColor ?? const Color(0xFFB22222), + width: 1, + ), ), filled: true, - fillColor: Colors.white, + fillColor: backgroundColor ?? Colors.white, contentPadding: const EdgeInsets.symmetric(vertical: 14, horizontal: 15), border: OutlineInputBorder( borderRadius: BorderRadius.circular(10), borderSide: BorderSide( - color: MyTheme.topicColor(IndicatorTopic.economy).shade300, + color: borderColor ?? MyTheme.topicColor(IndicatorTopic.economy).shade300, ), ), enabledBorder: OutlineInputBorder( borderRadius: BorderRadius.circular(10), borderSide: BorderSide( - color: MyTheme.topicColor(IndicatorTopic.economy).shade300, + color: borderColor ?? MyTheme.topicColor(IndicatorTopic.economy).shade300, ), ), hintText: hintText, - hintStyle: const TextStyle( - color: Color(0xffC3C6CB), + hintStyle: TextStyle( // ✅ dynamic hint color + color: hintColor ?? const Color(0xffC3C6CB), ), prefixIconConstraints: const BoxConstraints( maxWidth: 25 + 16 + 10, diff --git a/lib/presentation/routes/auth_routes/login_route.dart b/lib/presentation/routes/auth_routes/login_route.dart index d879b490..3f549795 100644 --- a/lib/presentation/routes/auth_routes/login_route.dart +++ b/lib/presentation/routes/auth_routes/login_route.dart @@ -15,6 +15,9 @@ import 'package:the_validator/the_validator.dart'; import 'package:uae_stat/config/app_links_helper.dart'; import 'package:uae_stat/config/connectivity_provider.dart'; import 'package:uae_stat/config/my_theme.dart'; +import 'package:uae_stat/config/theme/app_theme.dart'; +import 'package:uae_stat/config/theme/service.dart'; +import 'package:uae_stat/config/theme/theme_provider.dart'; import 'package:uae_stat/domain/use_cases/auth_use_case.dart'; import 'package:uae_stat/domain/use_cases/language.dart'; import 'package:uae_stat/infrastructure/services/img_asset_paths/banner_asset_path.dart'; @@ -312,6 +315,16 @@ class LoginRoute extends HookConsumerWidget { } } + Future initializeTheme(BuildContext context,WidgetRef ref, String userId) async { + final themeService = ThemeBaseService(); + final theme = await themeService.getUserTheme(userId); // e.g., "dark" + final platformBrightness = MediaQuery.of(context).platformBrightness; + ref.read(themeProvider.notifier).updateTheme(AppThemeExtension.fromString(theme),platformBrightness); + final themeMode = ref.watch(themeProvider); + print('themeMode Login'); + print('themeMode $themeMode'); + } + @override Widget build(BuildContext context, WidgetRef ref) { @@ -321,6 +334,11 @@ class LoginRoute extends HookConsumerWidget { } }); + final themeMode = ref.read(themeProvider); + final isDarkTheme = themeMode == ThemeMode.dark || + (themeMode == ThemeMode.system && + MediaQuery.of(context).platformBrightness == Brightness.dark); + // useEffect(() { // // Wait until first frame is rendered // Future.microtask(() { @@ -373,7 +391,7 @@ class LoginRoute extends HookConsumerWidget { 'NotoKufi', ), fontSize: locale?.languageCode == 'ar' ? 18 : 20, - color: Color(0xFF898C81), + color: isDarkTheme ? Color(0xFFFFFFFF) : Color(0xFF898C81), fontWeight: FontWeight.w600), ), content: Form( @@ -387,6 +405,7 @@ class LoginRoute extends HookConsumerWidget { 'Roboto', 'NotoKufi', ), + color: isDarkTheme ? Color(0xFFFFA100) : Colors.red, ), labelText: context.translate( 'Email address', @@ -398,9 +417,42 @@ class LoginRoute extends HookConsumerWidget { 'NotoKufi', ), fontSize: locale?.languageCode == 'ar' ? 13 : 16, - color: Color(0xFF898C81), // For label text color + color: isDarkTheme ? Color(0xFFFFFFFF) : Color(0xFF898C81), // For label text color // fontWeight: FontWeight.w600, ), + // ✅ Default Border + + + + + // ✅ Bottom border (no outline) + enabledBorder: UnderlineInputBorder( + borderSide: BorderSide( + color: isDarkTheme ? Colors.white : const Color(0xFF898C81), + width: 1, + ), + ), + focusedBorder: UnderlineInputBorder( + borderSide: BorderSide( + color: isDarkTheme ? const Color(0xFF24B4FB) : Colors.deepPurple, + width: 2, + ), + ), + errorBorder: UnderlineInputBorder( + borderSide: BorderSide( + color: isDarkTheme ? const Color(0xFFFFA100) : Colors.red, + width: 1, + ), + ), + focusedErrorBorder: UnderlineInputBorder( + borderSide: BorderSide( + color: isDarkTheme ? const Color(0xFFFFA100) : Colors.red, + width: 2, + ), + ), + + + ), ), ), @@ -409,9 +461,10 @@ class LoginRoute extends HookConsumerWidget { onPressed: Navigator.of(dialogCtx, rootNavigator: true).pop, style: TextButton.styleFrom( // backgroundColor: Colors.white, // Background color - foregroundColor: Color(0xFF92722A), // Font (text) color + foregroundColor: isDarkTheme ? Color(0xFF24B4FB) : Color(0xFF92722A), // Font (text) color side: BorderSide( - color: Color(0xFF92722A)), // Border outline color + color: isDarkTheme ? Color(0xFF24B4FB) : Color(0xFF92722A) + ), // Border outline color shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular(8), // Optional: Rounded corners @@ -439,7 +492,7 @@ class LoginRoute extends HookConsumerWidget { ); }, style: ElevatedButton.styleFrom( - backgroundColor: Color(0xFF92722A), + backgroundColor: isDarkTheme ? Color(0xFF24B4FB) : Color(0xFF92722A), foregroundColor: Colors.white, padding: EdgeInsets.symmetric( horizontal: 10 , vertical: 10), // Optional: Adjusts size @@ -500,7 +553,7 @@ class LoginRoute extends HookConsumerWidget { ), fontWeight: FontWeight.bold, fontSize: locale?.languageCode == 'ar' ? 12 : 14, - color: Color(0xFF985400), + color: isDarkTheme ? Color(0xFF9EB3E4) : Color(0xFF985400), ), ), ); @@ -605,6 +658,7 @@ class LoginRoute extends HookConsumerWidget { await saveUserId(userId, loginCount); await getDeviceToken(context, userId); + await initializeTheme(context,ref,userId); } try { final bool isProfileComplete = await profileStatus(userId, ref); @@ -681,7 +735,8 @@ class LoginRoute extends HookConsumerWidget { ), ), backgroundColor: WidgetStatePropertyAll( - MyTheme.topicColor(IndicatorTopic.social), + isDarkTheme ? Color(0xFF24B4FB) : Color(0xFFAA8E83), + // MyTheme.topicColor(IndicatorTopic.social), ), // surfaceTintColor: MaterialStatePropertyAll( // MyTheme.economy[800], @@ -705,12 +760,13 @@ class LoginRoute extends HookConsumerWidget { ), fontSize: locale?.languageCode == 'ar' ? 12 : 18, fontWeight: FontWeight.w500, + color: isDarkTheme ? Color(0xFF000000) : null, ), ), 6.horizontalSpace, - const Icon( + Icon( Icons.chevron_right_outlined, - color: Colors.white, // Set your desired color here + color: isDarkTheme ? Color(0xFF000000) : Colors.white, // Set your desired color here ) ], ), @@ -725,6 +781,11 @@ class LoginRoute extends HookConsumerWidget { 'Email', 'بريد إلكتروني', ), + hintColor: isDarkTheme ? Color(0XFFEEEEEE) : Color(0xFFC3C6CB), + backgroundColor: isDarkTheme ? Color(0xFF000000) : Colors.white, + borderColor: isDarkTheme ? Colors.white : MyTheme.topicColor(IndicatorTopic.economy).shade300, + errorBorderColor: isDarkTheme ? const Color(0xFFFFA100) : const Color(0xFFB22222), + errorTextColor: isDarkTheme ? const Color(0xFFFFA100) : const Color(0xFFB22222), validator: (value) { final emailRegex = r'^[a-zA-Z0-9àèìòùÀÈÌÒÙéàç~!#$%^&*()_+=-{}|;,.?<>]+@[a-zA-Z0-9àèìòùÀÈÌÒÙéàç~!#$%^&*()_+=-{}|;,.?<>]+\.[a-zA-Z]{2,}$'; @@ -735,7 +796,7 @@ class LoginRoute extends HookConsumerWidget { } return null; }, - imgPath: MiscIconAssetPath.person, + imgPath: isDarkTheme ? MiscIconAssetPath.personDark : MiscIconAssetPath.personLight, controller: emailCtl, ), 15.verticalSpace, @@ -752,7 +813,12 @@ class LoginRoute extends HookConsumerWidget { 'Password', 'كلمة المرور', ), - imgPath: MiscIconAssetPath.lock, + hintColor: isDarkTheme ? Color(0XFFEEEEEE) : Color(0xFFC3C6CB), + backgroundColor: isDarkTheme ? Color(0xFF000000) : Colors.white, + borderColor: isDarkTheme ? Colors.white : MyTheme.topicColor(IndicatorTopic.economy).shade300, + errorBorderColor: isDarkTheme ? const Color(0xFFFFA100) : const Color(0xFFB22222), + errorTextColor: isDarkTheme ? const Color(0xFFFFA100) : const Color(0xFFB22222), + imgPath: isDarkTheme ? MiscIconAssetPath.lockDark : MiscIconAssetPath.lockLight, controller: pwCtl, isObscurable: true, ), @@ -783,6 +849,7 @@ class LoginRoute extends HookConsumerWidget { ), fontSize: locale?.languageCode == 'ar' ? 38 : 40, fontWeight: FontWeight.w300, + color: isDarkTheme ? Color(0xFFFFFFFF) : Color(0xFF000000), ), ), 10.verticalSpace, @@ -798,7 +865,7 @@ class LoginRoute extends HookConsumerWidget { 'NotoKufi', ), fontSize: context.translate(18.0, 14.0), - color: const Color(0xff898C81), + color: isDarkTheme ? Color(0xFFEEEEEE) : Color(0xff898C81), fontWeight: FontWeight.w600, ), ), @@ -827,7 +894,7 @@ class LoginRoute extends HookConsumerWidget { ), style: TextStyle( fontSize: locale?.languageCode == 'ar' ? 12 : 14, - color: Color(0xff898C81), + color: isDarkTheme ? Color(0xFFCCCCCC) : Color(0xff898C81), ), ), const TextSpan( @@ -840,7 +907,7 @@ class LoginRoute extends HookConsumerWidget { ), style: TextStyle( fontSize: locale?.languageCode == 'ar' ? 12 : 14, - color: Color(0xFF985400), + color: isDarkTheme ? Color(0xFF9EB3E4) : Color(0xFF985400), ), ), ], @@ -903,7 +970,9 @@ class LoginRoute extends HookConsumerWidget { // ), // ); final fcscBanner = Image.asset( - BannerAssetPath.fcsc, + isDarkTheme + ? BannerAssetPath.fcscLogoDark + : BannerAssetPath.fcscLogoLight, height: 40, ); final screenWidth = MediaQuery.of(context).size.width; @@ -965,7 +1034,7 @@ class LoginRoute extends HookConsumerWidget { // _showExitConfirmation(context); // Show exit confirmation dialog }, child: Scaffold( - backgroundColor: Colors.white, + backgroundColor: isDarkTheme ? Color(0xFF111111) : Colors.white, body: SafeArea(child: scaffoldBody), ), ); diff --git a/lib/presentation/routes/auth_routes/register_route.dart b/lib/presentation/routes/auth_routes/register_route.dart index c8b901bb..dcd7d9fa 100644 --- a/lib/presentation/routes/auth_routes/register_route.dart +++ b/lib/presentation/routes/auth_routes/register_route.dart @@ -156,7 +156,7 @@ class RegisterRoute extends HookConsumerWidget { 'Password', 'كلمة المرور', ), - imgPath: MiscIconAssetPath.lock, + imgPath: MiscIconAssetPath.personLight, controller: pwCtl, isObscurable: true, ); @@ -167,7 +167,7 @@ class RegisterRoute extends HookConsumerWidget { 'Confirm Password', 'كلمة المرور', ), - imgPath: MiscIconAssetPath.lock, + imgPath: MiscIconAssetPath.personLight, controller: cpwCtl, isObscurable: true, ); @@ -177,7 +177,7 @@ class RegisterRoute extends HookConsumerWidget { 'اسم المستخدم', ), validator: FieldValidator.email(), - imgPath: MiscIconAssetPath.person, + imgPath: MiscIconAssetPath.personLight, controller: emailCtl, ); final nameField = ThemedFormField( @@ -187,7 +187,7 @@ class RegisterRoute extends HookConsumerWidget { ), validator: (value) => value!.isEmpty ? 'Name must be at least one character' : null, - imgPath: MiscIconAssetPath.person, + imgPath: MiscIconAssetPath.personLight, controller: nameCtl, ); final form = Form( @@ -328,7 +328,7 @@ class RegisterRoute extends HookConsumerWidget { ), ); final fcscBanner = Image.asset( - BannerAssetPath.fcsc, + BannerAssetPath.fcscLogoLight, height: 56, ); final screenWidth = MediaQuery.of(context).size.width; diff --git a/lib/presentation/routes/bottom_bar_routes/tab_routes/home_route.dart b/lib/presentation/routes/bottom_bar_routes/tab_routes/home_route.dart index f9332ee8..7c62d61c 100644 --- a/lib/presentation/routes/bottom_bar_routes/tab_routes/home_route.dart +++ b/lib/presentation/routes/bottom_bar_routes/tab_routes/home_route.dart @@ -170,6 +170,7 @@ 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/theme/theme_provider.dart'; import 'package:uae_stat/config/toggle_lang_service.dart'; import 'package:uae_stat/domain/use_cases/language.dart'; import 'package:uae_stat/infrastructure/data/p_auth_repo.dart'; @@ -380,6 +381,8 @@ class EconomyStatsState extends ConsumerState { late List homeTargets; late List previousHomeTargets; late final Locale locale; + late ThemeMode currentTheme; + // ThemeMode? _previousTheme; Future handleSkip() async { tutorialCoachMark.skip(); @@ -1084,7 +1087,20 @@ class EconomyStatsState extends ConsumerState { super.initState(); _userService = UserService(); locale = ref.read(localeProvider) ?? const Locale('en'); - fetchData(locale?.languageCode ?? 'en'); + // Listen to theme changes + // Defer the ref.listen to after build is completed + currentTheme = ref.read(themeProvider); + print('123456789'); + print(currentTheme); + final isDark = currentTheme == ThemeMode.dark || + (currentTheme == ThemeMode.system && + MediaQuery.of(context).platformBrightness == Brightness.dark); + + final themeMode = (isDark ? 'dark' : 'light'); + + fetchData(locale?.languageCode ?? 'en', themeMode); + + // _fetchUserData(); _loadLoginCount(); } @@ -1143,11 +1159,11 @@ class EconomyStatsState extends ConsumerState { // } // } - Future fetchData(locale) async { + Future fetchData(locale,themeMode) async { // const baseUrl = 'https://pb.venbait.in/api/getHomePageData'; const baseUrl = '$apiUrl/api/getHomePageData'; try { - final response = await http.get(Uri.parse(baseUrl + '?language=$locale')); + final response = await http.get(Uri.parse(baseUrl + '?language=$locale&color_mode=$themeMode')); if (response.statusCode == 200) { setState(() { data = json.decode(response.body); @@ -1200,7 +1216,13 @@ class EconomyStatsState extends ConsumerState { isLoading = true; }); await _userService.updateLanguage(localeCode); - fetchData(localeCode); + final currentTheme = ref.read(themeProvider); + final isDark = currentTheme == ThemeMode.dark || + (currentTheme == ThemeMode.system && + MediaQuery.of(context).platformBrightness == Brightness.dark); + + final themeString = isDark ? 'dark' : 'light'; + fetchData(localeCode,themeString); }); final isConnected = ref.watch(connectivityProvider); @@ -1212,6 +1234,29 @@ class EconomyStatsState extends ConsumerState { } }); + ref.listen(themeProvider, (previous, next) async { + final localeCode = ref.watch(localeProvider)?.languageCode ?? 'en'; + print(localeCode); + + // Default to 'en' if null + setState(() { + isLoading = true; + print('isLoadingref $isLoading'); + }); + + final currentTheme = ref.read(themeProvider); + final isDark = currentTheme == ThemeMode.dark || + (currentTheme == ThemeMode.system && + MediaQuery.of(context).platformBrightness == Brightness.dark); + + final themeString = isDark ? 'dark' : 'light'; + fetchData(localeCode,themeString); + }); + + final isDarkTheme = ref.watch(themeProvider) == ThemeMode.dark || + (ref.watch(themeProvider) == ThemeMode.system && + MediaQuery.of(context).platformBrightness == Brightness.dark); + double myheight = MediaQuery.of(context).size.height; double mywidth = MediaQuery.of(context).size.width; @@ -1239,6 +1284,14 @@ class EconomyStatsState extends ConsumerState { } String firstMainTopic = data.first['main_topic'] ?? ''; return Container( + decoration: isDarkTheme + ? BoxDecoration( + image: DecorationImage( + image: AssetImage('assets/dark_bg.png'), + fit: BoxFit.cover, + ), + ) + : null, height: myheight, // color: Colors.cyan, child: Padding( @@ -1344,6 +1397,7 @@ class EconomyStatsState extends ConsumerState { borderColor, mainTopic['color_pattern'], mainTopic['main_topic']), + ), ), ], @@ -1526,124 +1580,136 @@ class InfoCard extends StatelessWidget { final encodedTitle = Uri.encodeComponent(title); final encodedKey = Uri.encodeQueryComponent('home'); - return GestureDetector( - onTap: () { - context.push( - '/chartScreen/$dataset?bgColor=$colorPattern&mainTopic=$encodedMainTopic&title=$encodedTitle&key=$encodedKey'); - }, - child: Container( - height: myheight / 10.9, + return Consumer( + builder: (context, ref, _) { + final themeMode = ref.watch(themeProvider); + final isDarkTheme = themeMode == ThemeMode.dark || + (themeMode == ThemeMode.system && + MediaQuery.of(context).platformBrightness == Brightness.dark); - width: mywidth / 4, + return GestureDetector( + onTap: () { + context.push( + '/chartScreen/$dataset?bgColor=$colorPattern&mainTopic=$encodedMainTopic&title=$encodedTitle&key=$encodedKey'); + }, + child: Container( + height: myheight / 10.9, - margin: const EdgeInsets.symmetric(horizontal: 8), - // padding: const EdgeInsets.all(10), - padding: const EdgeInsets.only(bottom: 0.5, top: 1, left: 10, right: 10), - decoration: BoxDecoration( - border: Border.all(color: bordercolor), - borderRadius: BorderRadius.circular(8), + width: mywidth / 4, + + margin: const EdgeInsets.symmetric(horizontal: 8), + // padding: const EdgeInsets.all(10), + padding: const EdgeInsets.only(bottom: 0.5, top: 1, left: 10, right: 10), + decoration: BoxDecoration( + color: isDarkTheme ? Color(0xFF111111) : null, + border: Border.all(color: bordercolor), + borderRadius: BorderRadius.circular(8), + ), + child: Column( + mainAxisSize: MainAxisSize.min, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + // Flexible( + // fit: FlexFit.loose, + // child: FittedBox( + // fit: BoxFit.contain, // Adjust text to fit within the bounds + // child: Padding( + // // padding: const EdgeInsets.all(4.0), + // padding: const EdgeInsets.only(top: 4, bottom: 0), + // child: Text( + // title, + // style: const TextStyle( + // // fontSize: 11, + // fontSize: 12 * 1.1, + // fontWeight: FontWeight.w500, + // // color: Colors.black, + // fontFamily: 'Roboto', + // color: Color(0xFF000000), + // ), + // ), + // ), + // ), + // ), + Text( + title, + style: TextStyle( + fontSize: 13, + fontWeight: FontWeight.w400, + letterSpacing: 0, + // color: Colors.black, + fontFamily: context.translate( + 'Roboto', + 'NotoKufi', + ), + color: isDarkTheme ? Color(0xFFFFFFFF) : Color(0xFF000000), + ), + ), + const SizedBox(height: 0.3), + Text( + subtitle, + textAlign: TextAlign.center, + style: TextStyle( + fontSize: 11, + // fontSize: 12 * 1.1, + fontFamily: context.translate( + 'Roboto', + 'NotoKufi', + ), + fontWeight: FontWeight.w400, + color: Color(0xFF8E8E8E), + ), + ), + + // Flexible( + // fit: FlexFit.loose, + // child: FittedBox( + // fit: BoxFit.contain, + // child: Column( + // children: [ + // Text( + // subtitle, + // textAlign: TextAlign.center, + // style: const TextStyle( + // // fontSize: 11, + // fontSize: 12 * 1.1, + // fontFamily: 'Roboto', + // fontWeight: FontWeight.w400, + // color: Color(0xFF8E8E8E), + // ), + // ), + // ], + // ), + // ), + // ), + // SizedBox(height: Platform.isIOS ? 0 : 1), + SizedBox(height: 1), + + // Flexible( + // fit: FlexFit.loose, + // child: FittedBox( + // fit: BoxFit.scaleDown, + // child: + Text( + value, + style: TextStyle( + fontSize: 26, + fontWeight: FontWeight.w900, + fontFamily: context.translate( + 'Roboto', + 'NotoKufi', + ), + color: textcolor ?? Colors.black, + ), + ), + // ), + // ), + ], + ), ), - child: Column( - mainAxisSize: MainAxisSize.min, - mainAxisAlignment: MainAxisAlignment.center, - children: [ - // Flexible( - // fit: FlexFit.loose, - // child: FittedBox( - // fit: BoxFit.contain, // Adjust text to fit within the bounds - // child: Padding( - // // padding: const EdgeInsets.all(4.0), - // padding: const EdgeInsets.only(top: 4, bottom: 0), - // child: Text( - // title, - // style: const TextStyle( - // // fontSize: 11, - // fontSize: 12 * 1.1, - // fontWeight: FontWeight.w500, - // // color: Colors.black, - // fontFamily: 'Roboto', - // color: Color(0xFF000000), - // ), - // ), - // ), - // ), - // ), - Text( - title, - style: TextStyle( - fontSize: 13, - fontWeight: FontWeight.w400, - letterSpacing: 0, - // color: Colors.black, - fontFamily: context.translate( - 'Roboto', - 'NotoKufi', - ), - color: Color(0xFF000000), - ), - ), - const SizedBox(height: 0.3), - Text( - subtitle, - textAlign: TextAlign.center, - style: TextStyle( - fontSize: 11, - // fontSize: 12 * 1.1, - fontFamily: context.translate( - 'Roboto', - 'NotoKufi', - ), - fontWeight: FontWeight.w400, - color: Color(0xFF8E8E8E), - ), - ), - - // Flexible( - // fit: FlexFit.loose, - // child: FittedBox( - // fit: BoxFit.contain, - // child: Column( - // children: [ - // Text( - // subtitle, - // textAlign: TextAlign.center, - // style: const TextStyle( - // // fontSize: 11, - // fontSize: 12 * 1.1, - // fontFamily: 'Roboto', - // fontWeight: FontWeight.w400, - // color: Color(0xFF8E8E8E), - // ), - // ), - // ], - // ), - // ), - // ), - // SizedBox(height: Platform.isIOS ? 0 : 1), - SizedBox(height: 1), - - // Flexible( - // fit: FlexFit.loose, - // child: FittedBox( - // fit: BoxFit.scaleDown, - // child: - Text( - value, - style: TextStyle( - fontSize: 26, - fontWeight: FontWeight.w900, - fontFamily: context.translate( - 'Roboto', - 'NotoKufi', - ), - color: textcolor ?? Colors.black, - ), - ), - // ), - // ), - ], - ), - ), + ); + } ); + + } } 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 30583157..7fb71013 100644 --- a/lib/presentation/routes/drawer_routes/Drawer Items/edit_profile.dart +++ b/lib/presentation/routes/drawer_routes/Drawer Items/edit_profile.dart @@ -17,6 +17,7 @@ import 'package:flutter_gen/gen_l10n/app_localizations.dart'; import 'package:uae_stat/config/api_config.dart'; import 'package:uae_stat/config/connectivity_provider.dart'; import 'package:uae_stat/config/my_theme.dart'; +import 'package:uae_stat/config/theme/theme_provider.dart'; import 'package:uae_stat/config/toggle_lang_service.dart'; import 'package:uae_stat/domain/use_cases/language.dart'; import 'package:uae_stat/infrastructure/services/img_asset_paths/icons/misc_icon_asset_path.dart'; @@ -534,6 +535,11 @@ class _EditProfileState extends ConsumerState { await _fetchUserData(); }); + final themeMode = ref.read(themeProvider); + final isDarkTheme = themeMode == ThemeMode.dark || + (themeMode == ThemeMode.system && + MediaQuery.of(context).platformBrightness == Brightness.dark); + return PopScope( canPop: false, // Allow back navigation only if not login screen onPopInvokedWithResult: (didPop, result) { @@ -568,756 +574,761 @@ class _EditProfileState extends ConsumerState { ], ), ) - : SingleChildScrollView( - child: Padding( - padding: const EdgeInsets.only( - left: 10.0, right: 10.0, top: 3.0), - child: Column( - children: [ - SingleChildScrollView( - child: Form( - key: _formKey, - child: Padding( - // padding: const EdgeInsets.all(20.0), - padding: const EdgeInsets.only( - top: 20.0, bottom: 20.0, left: 25, right: 25), - child: Column( + : Container( + color: isDarkTheme ? Color(0xFF111111) : null, + child: SingleChildScrollView( + child: Padding( + padding: const EdgeInsets.only( + left: 10.0, right: 10.0, top: 3.0), + child: Column( + children: [ + SingleChildScrollView( + child: Form( + key: _formKey, + child: Padding( + // padding: const EdgeInsets.all(20.0), + padding: const EdgeInsets.only( + top: 20.0, bottom: 20.0, left: 25, right: 25), + child: Column( + children: [ + // CircleAvatar( + // radius: 50, + // backgroundImage: _profileImage != null + // ? FileImage( + // _profileImage!) // If a local file is selected + // : _avatarUrl.isNotEmpty + // ? NetworkImage(_avatarUrl) // Load from URL + // : AssetImage( + // "assets/edit_profile/profile.png") + // as ImageProvider, + // + // //backgroundImage: NetworkImage(_avatarUrl) as ImageProvider, + // + // child: + // Align( + // alignment: Alignment.bottomRight, + // child: GestureDetector( + // onTap: _pickImage, // Call `_pickImage` on tap + // child: CircleAvatar( + // radius: 15, + // backgroundColor: Colors.white, + // child: Icon( + // Icons.camera_alt, + // size: 15, + // color: Colors.grey, + // ), + // ), + // ), + // ), + // ), + + // Stack( + // alignment: Alignment.center, + // children: [ + // // FutureBuilder to load the image + // FutureBuilder( + // future: _loadProfileImage(), + // builder: (context, snapshot) { + // if (snapshot.connectionState == ConnectionState.waiting) { + // // While the image is loading, show a progress indicator + // return CircleAvatar( + // radius: 50, + // child: CircularProgressIndicator(), + // ); + // } else if (snapshot.hasError || snapshot.data == null) { + // // If there's an error or no image, show an error icon + // return CircleAvatar( + // radius: 50, + // child: CircularProgressIndicator(), + // ); + // } else { + // // Display the loaded image + // return CircleAvatar( + // radius: 50, + // backgroundImage: snapshot.data, + // child: Align( + // alignment: Alignment.bottomRight, + // child: GestureDetector( + // onTap: _pickImage, + // child: CircleAvatar( + // radius: 15, + // backgroundColor: Colors.white, + // child: Icon( + // Icons.camera_alt, + // size: 15, + // color: Colors.grey, + // ), + // ), + // ), + // ), + // ); + // } + // }, + // ), + // ], + // ), + + Stack( + alignment: Alignment.center, children: [ - // CircleAvatar( - // radius: 50, - // backgroundImage: _profileImage != null - // ? FileImage( - // _profileImage!) // If a local file is selected - // : _avatarUrl.isNotEmpty - // ? NetworkImage(_avatarUrl) // Load from URL - // : AssetImage( - // "assets/edit_profile/profile.png") - // as ImageProvider, - // - // //backgroundImage: NetworkImage(_avatarUrl) as ImageProvider, - // - // child: - // Align( - // alignment: Alignment.bottomRight, - // child: GestureDetector( - // onTap: _pickImage, // Call `_pickImage` on tap - // child: CircleAvatar( - // radius: 15, - // backgroundColor: Colors.white, - // child: Icon( - // Icons.camera_alt, - // size: 15, - // color: Colors.grey, - // ), - // ), - // ), - // ), - // ), - - // Stack( - // alignment: Alignment.center, - // children: [ - // // FutureBuilder to load the image - // FutureBuilder( - // future: _loadProfileImage(), - // builder: (context, snapshot) { - // if (snapshot.connectionState == ConnectionState.waiting) { - // // While the image is loading, show a progress indicator - // return CircleAvatar( - // radius: 50, - // child: CircularProgressIndicator(), - // ); - // } else if (snapshot.hasError || snapshot.data == null) { - // // If there's an error or no image, show an error icon - // return CircleAvatar( - // radius: 50, - // child: CircularProgressIndicator(), - // ); - // } else { - // // Display the loaded image - // return CircleAvatar( - // radius: 50, - // backgroundImage: snapshot.data, - // child: Align( - // alignment: Alignment.bottomRight, - // child: GestureDetector( - // onTap: _pickImage, - // child: CircleAvatar( - // radius: 15, - // backgroundColor: Colors.white, - // child: Icon( - // Icons.camera_alt, - // size: 15, - // color: Colors.grey, - // ), - // ), - // ), - // ), - // ); - // } - // }, - // ), - // ], - // ), - - Stack( - alignment: Alignment.center, - children: [ - CircleAvatar( - radius: 50, - backgroundImage: _profileImage != null - ? FileImage( - _profileImage!) // If a local file is selected - : _avatarUrl.isNotEmpty - ? NetworkImage( - _avatarUrl) // Load from URL - : AssetImage( - 'assets/edit_profile/profile.jpg') - as ImageProvider, - child: _avatarUrl.isNotEmpty - ? FutureBuilder( - future: _loadImage(_avatarUrl), - builder: (context, snapshot) { - if (snapshot - .connectionState == - ConnectionState.waiting) { - return Center( - child: - CircularProgressIndicator(), - ); - } else if (snapshot - .hasError) { - return Center( - child: Icon(Icons.error), - ); - } else { - return Align( - alignment: - Alignment.bottomRight, - child: GestureDetector( - onTap: - _pickImage, // Call `_pickImage` on tap - child: CircleAvatar( - radius: 15, - backgroundColor: - Colors.white, - child: Icon( - Icons.camera_alt, - size: 15, - color: Colors.grey, - ), - ), - ), - ); - } - }, - ) - : Align( - alignment: - Alignment.bottomRight, - child: GestureDetector( - onTap: - _pickImage, // Call `_pickImage` on tap - child: CircleAvatar( - radius: 15, - backgroundColor: - Colors.white, - child: Icon( - Icons.camera_alt, - size: 15, - color: Colors.grey, - ), - ), + CircleAvatar( + radius: 50, + backgroundImage: _profileImage != null + ? FileImage( + _profileImage!) // If a local file is selected + : _avatarUrl.isNotEmpty + ? NetworkImage( + _avatarUrl) // Load from URL + : AssetImage( + 'assets/edit_profile/profile.jpg') + as ImageProvider, + child: _avatarUrl.isNotEmpty + ? FutureBuilder( + future: _loadImage(_avatarUrl), + builder: (context, snapshot) { + if (snapshot + .connectionState == + ConnectionState.waiting) { + return Center( + child: + CircularProgressIndicator(), + ); + } else if (snapshot + .hasError) { + return Center( + child: Icon(Icons.error), + ); + } else { + return Align( + alignment: + Alignment.bottomRight, + child: GestureDetector( + onTap: + _pickImage, // Call `_pickImage` on tap + child: CircleAvatar( + radius: 15, + backgroundColor: + Colors.white, + child: Icon( + Icons.camera_alt, + size: 15, + color: Colors.grey, ), ), - ), - ], - ), - - SizedBox(height: 20), - Row( - mainAxisAlignment: MainAxisAlignment.start, - children: [ - Text( - AppLocalizations.of(context)! - .register_name, - style: TextStyle( - fontFamily: context.translate( - 'Roboto', - 'NotoKufi', - ), - fontSize: 16, - fontWeight: FontWeight.w500, - color: Colors.grey, - ), - ), - ], - ), - SizedBox(height: 10), - TextFormField( - controller: _usernameController, - focusNode: _focusNodes[0], - decoration: InputDecoration( - // hintText: _showHints[0] ? 'Mohammad Hassan' : null, - hintStyle: TextStyle(color: Colors.grey, fontFamily: context.translate( - 'Roboto', - 'NotoKufi', - ),), - border: OutlineInputBorder( - borderRadius: BorderRadius.circular(8), - ), - enabled: false, - ), - ), - SizedBox(height: 10), - Row( - mainAxisAlignment: MainAxisAlignment.start, - children: [ - Text( - AppLocalizations.of(context)!.email_id, - style: TextStyle( - fontFamily: context.translate( - 'Roboto', - 'NotoKufi', - ), - fontSize: 16, - fontWeight: FontWeight.w500, - color: Colors.grey, - ), - ), - ], - ), - SizedBox(height: 10), - TextFormField( - controller: _emailController, - focusNode: _focusNodes[1], - decoration: InputDecoration( - // hintText: _showHints[1]? 'mohammad.hassan@fcsc.gov.ae': null, - border: OutlineInputBorder( - borderRadius: BorderRadius.circular(8), - ), - enabled: false, - ), - ), - SizedBox(height: 10), - Row( - mainAxisAlignment: MainAxisAlignment.start, - children: [ - Text( - AppLocalizations.of(context)!.full_name, - style: TextStyle( - fontFamily: context.translate( - 'Roboto', - 'NotoKufi', - ), - fontSize: 16, - fontWeight: FontWeight.w500, - color: Colors.grey, - ), - ), - ], - ), - SizedBox(height: 10), - TextFormField( - enabled: false, - validator: (value) { - if (value == null || value.isEmpty) { - return context.translate( - 'Required', 'مطلوب'); - } - - //RegExp(r"^[a-zA-Z\s]+$"); - final nameRegex = RegExp( - r"^[a-zA-Z0-9'\-\u0627\u0639~\u00C0-\u00FF\s]+$", - ); - if (!nameRegex.hasMatch(value)) { - return AppLocalizations.of(context)! - .invalid_characters; - } - return null; - }, - controller: _fullNameController, - focusNode: _focusNodes[2], - decoration: InputDecoration( - // hintText: _showHints[2] ? 'Mohammad' : null, - hintStyle: TextStyle(color: Colors.grey, - fontFamily: context.translate( - 'Roboto', - 'NotoKufi', - ),), - border: OutlineInputBorder( - borderRadius: BorderRadius.circular(8), - ), - // counterText: '', - enabled: !_isProfileCompleted, - ), - // maxLength: - // 40, // Set the maximum length to 20 characters - // maxLengthEnforcement: - // MaxLengthEnforcement.enforced, - ), - SizedBox(height: 10), - Row( - mainAxisAlignment: MainAxisAlignment.start, - children: [ - Text( - AppLocalizations.of(context)!.dob, - style: TextStyle( - fontFamily: context.translate( - 'Roboto', - 'NotoKufi', - ), - fontSize: 16, - fontWeight: FontWeight.w500, - color: Colors.grey, - ), - ), - ], - ), - SizedBox(height: 10), - TextFormField( - controller: _dateController, - focusNode: _focusNodes[3], - decoration: InputDecoration( - border: OutlineInputBorder( - borderRadius: BorderRadius.circular(8), - ), - // hintText: _showHints[3] ? 'Select your Date of Birth' : null, - hintStyle: TextStyle(color: Colors.grey, fontFamily: context.translate( - 'Roboto', - 'NotoKufi', - ),), - suffixIcon: Container( - width: 45, - padding: EdgeInsets.only(right: 1), - alignment: Alignment - .center, // Center the icon vertically - child: Icon( - Icons.keyboard_arrow_down_sharp, - color: Colors.grey, - ), - ), - enabled: !_isProfileCompleted, - ), - readOnly: true, - onTap: _pickDate, - validator: _validateDob, - ), - SizedBox(height: 10), - Row( - mainAxisAlignment: MainAxisAlignment.start, - children: [ - Text( - AppLocalizations.of(context)!.region, - style: TextStyle( - fontFamily: context.translate( - 'Roboto', - 'NotoKufi', - ), - fontSize: 16, - fontWeight: FontWeight.w500, - ), - ), - ], - ), - SizedBox(height: 10), - MouseRegion( - onEnter: (_) => setState( - () => _isHoveringDropdown = true), - onExit: (_) => setState( - () => _isHoveringDropdown = false), - child: DropdownButtonFormField( - style: TextStyle( - fontFamily: context.translate( - 'Roboto', - 'NotoKufi', - ), - fontSize: 16, - fontWeight: FontWeight.normal, - color: Color(0xFF544C4C), - ), - value: _selectedCountry, - decoration: InputDecoration( - enabledBorder: OutlineInputBorder( - borderRadius: - BorderRadius.circular(10), - borderSide: BorderSide( - color: MyTheme.topicColor( - IndicatorTopic.economy) - .shade400, - width: 1), // Enabled border - ), - border: OutlineInputBorder( - borderSide: BorderSide( - color: Color(0xFF7296BE), - ), - borderRadius: - BorderRadius.circular(8), - ), - labelText: 'Select', - ), - icon: Icon( - Icons.keyboard_arrow_down_sharp, - color: _isHoveringDropdown - ? Colors.black - : Colors.grey), - items: _countries - .map( - (item) => DropdownMenuItem( - value: item, - child: Text(item, - style: TextStyle( - fontFamily: context.translate( - 'Roboto', - 'NotoKufi', - ) - ),), ), - ) - .toList(), - onChanged: (String? newValue) { - setState(() { - _selectedCountry = newValue; - }); + ); + } }, - validator: _validateDropdown, + ) + : Align( + alignment: + Alignment.bottomRight, + child: GestureDetector( + onTap: + _pickImage, // Call `_pickImage` on tap + child: CircleAvatar( + radius: 15, + backgroundColor: + Colors.white, + child: Icon( + Icons.camera_alt, + size: 15, + color: Colors.grey, + ), + ), + ), ), ), - Row( - mainAxisAlignment: MainAxisAlignment.start, - children: [ - Text( - AppLocalizations.of(context)! - .preferredLang, + ], + ), + + SizedBox(height: 20), + Row( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Text( + AppLocalizations.of(context)! + .register_name, + style: TextStyle( + fontFamily: context.translate( + 'Roboto', + 'NotoKufi', + ), + fontSize: 16, + fontWeight: FontWeight.w500, + color: Colors.grey, + ), + ), + ], + ), + SizedBox(height: 10), + TextFormField( + controller: _usernameController, + focusNode: _focusNodes[0], + decoration: InputDecoration( + // hintText: _showHints[0] ? 'Mohammad Hassan' : null, + hintStyle: TextStyle(color: Colors.grey, fontFamily: context.translate( + 'Roboto', + 'NotoKufi', + ),), + border: OutlineInputBorder( + borderRadius: BorderRadius.circular(8), + ), + enabled: false, + ), + ), + SizedBox(height: 10), + Row( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Text( + AppLocalizations.of(context)!.email_id, + style: TextStyle( + fontFamily: context.translate( + 'Roboto', + 'NotoKufi', + ), + fontSize: 16, + fontWeight: FontWeight.w500, + color: Colors.grey, + ), + ), + ], + ), + SizedBox(height: 10), + TextFormField( + controller: _emailController, + focusNode: _focusNodes[1], + decoration: InputDecoration( + // hintText: _showHints[1]? 'mohammad.hassan@fcsc.gov.ae': null, + border: OutlineInputBorder( + borderRadius: BorderRadius.circular(8), + ), + enabled: false, + ), + ), + SizedBox(height: 10), + Row( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Text( + AppLocalizations.of(context)!.full_name, + style: TextStyle( + fontFamily: context.translate( + 'Roboto', + 'NotoKufi', + ), + fontSize: 16, + fontWeight: FontWeight.w500, + color: Colors.grey, + ), + ), + ], + ), + SizedBox(height: 10), + TextFormField( + enabled: false, + validator: (value) { + if (value == null || value.isEmpty) { + return context.translate( + 'Required', 'مطلوب'); + } + + //RegExp(r"^[a-zA-Z\s]+$"); + final nameRegex = RegExp( + r"^[a-zA-Z0-9'\-\u0627\u0639~\u00C0-\u00FF\s]+$", + ); + if (!nameRegex.hasMatch(value)) { + return AppLocalizations.of(context)! + .invalid_characters; + } + return null; + }, + controller: _fullNameController, + focusNode: _focusNodes[2], + decoration: InputDecoration( + // hintText: _showHints[2] ? 'Mohammad' : null, + hintStyle: TextStyle(color: Colors.grey, + fontFamily: context.translate( + 'Roboto', + 'NotoKufi', + ),), + border: OutlineInputBorder( + borderRadius: BorderRadius.circular(8), + ), + // counterText: '', + enabled: !_isProfileCompleted, + ), + // maxLength: + // 40, // Set the maximum length to 20 characters + // maxLengthEnforcement: + // MaxLengthEnforcement.enforced, + ), + SizedBox(height: 10), + Row( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Text( + AppLocalizations.of(context)!.dob, + style: TextStyle( + fontFamily: context.translate( + 'Roboto', + 'NotoKufi', + ), + fontSize: 16, + fontWeight: FontWeight.w500, + color: Colors.grey, + ), + ), + ], + ), + SizedBox(height: 10), + TextFormField( + controller: _dateController, + focusNode: _focusNodes[3], + decoration: InputDecoration( + border: OutlineInputBorder( + borderRadius: BorderRadius.circular(8), + ), + // hintText: _showHints[3] ? 'Select your Date of Birth' : null, + hintStyle: TextStyle(color: Colors.grey, fontFamily: context.translate( + 'Roboto', + 'NotoKufi', + ),), + suffixIcon: Container( + width: 45, + padding: EdgeInsets.only(right: 1), + alignment: Alignment + .center, // Center the icon vertically + child: Icon( + Icons.keyboard_arrow_down_sharp, + color: Colors.grey, + ), + ), + enabled: !_isProfileCompleted, + ), + readOnly: true, + onTap: _pickDate, + validator: _validateDob, + ), + SizedBox(height: 10), + Row( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Text( + AppLocalizations.of(context)!.region, + style: TextStyle( + fontFamily: context.translate( + 'Roboto', + 'NotoKufi', + ), + fontSize: 16, + fontWeight: FontWeight.w500, + ), + ), + ], + ), + SizedBox(height: 10), + MouseRegion( + onEnter: (_) => setState( + () => _isHoveringDropdown = true), + onExit: (_) => setState( + () => _isHoveringDropdown = false), + child: DropdownButtonFormField( + style: TextStyle( + fontFamily: context.translate( + 'Roboto', + 'NotoKufi', + ), + fontSize: 16, + fontWeight: FontWeight.normal, + color: Color(0xFF544C4C), + ), + value: _selectedCountry, + decoration: InputDecoration( + enabledBorder: OutlineInputBorder( + borderRadius: + BorderRadius.circular(10), + borderSide: BorderSide( + color: MyTheme.topicColor( + IndicatorTopic.economy) + .shade400, + width: 1), // Enabled border + ), + border: OutlineInputBorder( + borderSide: BorderSide( + color: Color(0xFF7296BE), + ), + borderRadius: + BorderRadius.circular(8), + ), + labelText: 'Select', + ), + icon: Icon( + Icons.keyboard_arrow_down_sharp, + color: _isHoveringDropdown + ? Colors.black + : Colors.grey), + items: _countries + .map( + (item) => DropdownMenuItem( + value: item, + child: Text(item, style: TextStyle( fontFamily: context.translate( 'Roboto', 'NotoKufi', - ), - fontSize: 16, - fontWeight: FontWeight.w500), - ), - ], - ), - SizedBox(height: 10), - MouseRegion( - onEnter: (_) => setState( - () => _isHoveringPreferredLang = true), - onExit: (_) => setState( - () => _isHoveringPreferredLang = false), - child: DropdownButtonFormField( - style: TextStyle( + ) + ),), + ), + ) + .toList(), + onChanged: (String? newValue) { + setState(() { + _selectedCountry = newValue; + }); + }, + validator: _validateDropdown, + ), + ), + Row( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Text( + AppLocalizations.of(context)! + .preferredLang, + style: TextStyle( fontFamily: context.translate( 'Roboto', 'NotoKufi', ), fontSize: 16, - fontWeight: FontWeight.normal, - color: Color(0xFF544C4C), - ), - value: _selectedLanguage, - decoration: InputDecoration( - enabledBorder: OutlineInputBorder( - borderRadius: - BorderRadius.circular(10), - borderSide: BorderSide( - color: MyTheme.topicColor( - IndicatorTopic.economy) - .shade400, - width: 1), // Enabled border - ), - border: OutlineInputBorder( - borderSide: BorderSide( - color: Color(0xFF7296BE), - ), - borderRadius: - BorderRadius.circular(8), - ), - labelText: 'Select', - ), - icon: Icon( - Icons.keyboard_arrow_down_sharp, - color: _isHoveringPreferredLang - ? Colors.black - : Colors.grey), - items: preferred_language - .map( - (item) => DropdownMenuItem( - value: item, - child: Text(item, - style: TextStyle( - fontFamily: context.translate( - 'Roboto', - 'NotoKufi', - ) - ),), - ), - ) - .toList(), - onChanged: (String? newValue) { - setState(() { - _selectedLanguage = newValue; - changedPreferredLanguage = 1; - }); - }, - validator: _validatePreferredLang, - ), + fontWeight: FontWeight.w500), ), + ], + ), + SizedBox(height: 10), + MouseRegion( + onEnter: (_) => setState( + () => _isHoveringPreferredLang = true), + onExit: (_) => setState( + () => _isHoveringPreferredLang = false), + child: DropdownButtonFormField( + style: TextStyle( + fontFamily: context.translate( + 'Roboto', + 'NotoKufi', + ), + fontSize: 16, + fontWeight: FontWeight.normal, + color: Color(0xFF544C4C), + ), + value: _selectedLanguage, + decoration: InputDecoration( + enabledBorder: OutlineInputBorder( + borderRadius: + BorderRadius.circular(10), + borderSide: BorderSide( + color: MyTheme.topicColor( + IndicatorTopic.economy) + .shade400, + width: 1), // Enabled border + ), + border: OutlineInputBorder( + borderSide: BorderSide( + color: Color(0xFF7296BE), + ), + borderRadius: + BorderRadius.circular(8), + ), + labelText: 'Select', + ), + icon: Icon( + Icons.keyboard_arrow_down_sharp, + color: _isHoveringPreferredLang + ? Colors.black + : Colors.grey), + items: preferred_language + .map( + (item) => DropdownMenuItem( + value: item, + child: Text(item, + style: TextStyle( + fontFamily: context.translate( + 'Roboto', + 'NotoKufi', + ) + ),), + ), + ) + .toList(), + onChanged: (String? newValue) { + setState(() { + _selectedLanguage = newValue; + changedPreferredLanguage = 1; + }); + }, + validator: _validatePreferredLang, + ), + ), - SizedBox(height: 20), - if (!_isProfileCompleted) // Conditional rendering - Column( - crossAxisAlignment: - CrossAxisAlignment.start, + SizedBox(height: 20), + if (!_isProfileCompleted) // Conditional rendering + Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Row( children: [ - Row( - children: [ - Checkbox( - value: isChecked, - onChanged: (value) { - setState(() { - isChecked = value ?? false; - showError = false; - }); - }, - side: BorderSide( - color: showError - ? Color(0xFFb22222) - : MyTheme.topicColor( - IndicatorTopic - .economy) - .shade400, - width: 1.5, - ), - ), - Expanded( - child: Column( - mainAxisAlignment: - MainAxisAlignment.start, - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - SizedBox(height: 10), - Text.rich( - TextSpan( - text: AppLocalizations.of( - context)! - .agree, - style: TextStyle( - fontFamily: context.translate( - 'Roboto', - 'NotoKufi', - ), - color: Colors.black), - children: [ - TextSpan( - text: AppLocalizations - .of( - context, - )! - .terms_conditions, - style: TextStyle( - fontFamily: context.translate( - 'Roboto', - 'NotoKufi', - ), - // color: Colors.blue, - color: Color( - 0xFF648CBA), - decoration: - TextDecoration - .underline, - ), - recognizer: - TapGestureRecognizer() - ..onTap = () => - context.push( - '/termsandconditions'), - ), - TextSpan( - text: AppLocalizations - .of( - context, - )! - .t_and, - style: TextStyle( - fontFamily: context.translate( - 'Roboto', - 'NotoKufi', - ), - color: Colors.black, - ), - ), - TextSpan( - text: AppLocalizations - .of( - context, - )! - .privacy_policy, - style: TextStyle( - fontFamily: context.translate( - 'Roboto', - 'NotoKufi', - ), - // color: Colors.blue, - color: Color( - 0xFF648CBA), - decoration: - TextDecoration - .underline, - ), - recognizer: - TapGestureRecognizer() - ..onTap = () => - context.push( - '/privacy_policy'), - ), - TextSpan( - text: AppLocalizations - .of( - context, - )! - .conditions, - style: TextStyle( - fontFamily: context.translate( - 'Roboto', - 'NotoKufi', - ), - color: Colors.black, - ), - ), - ], - ), - textAlign: TextAlign.start, - maxLines: 2, - overflow: - TextOverflow.visible, - softWrap: true, - ), - ], - ), - ), - ], + Checkbox( + value: isChecked, + onChanged: (value) { + setState(() { + isChecked = value ?? false; + showError = false; + }); + }, + side: BorderSide( + color: showError + ? Color(0xFFb22222) + : MyTheme.topicColor( + IndicatorTopic + .economy) + .shade400, + width: 1.5, + ), ), - if (showError) - Row( + Expanded( + child: Column( mainAxisAlignment: - MainAxisAlignment.start, + MainAxisAlignment.start, + crossAxisAlignment: + CrossAxisAlignment.start, children: [ - Padding( - padding: const EdgeInsets.only( - left: 10.0), - child: Text( - 'Please agree to terms and conditions', + SizedBox(height: 10), + Text.rich( + TextSpan( + text: AppLocalizations.of( + context)! + .agree, style: TextStyle( - fontFamily: context.translate( - 'Roboto', - 'NotoKufi', + fontFamily: context.translate( + 'Roboto', + 'NotoKufi', + ), + color: Colors.black), + children: [ + TextSpan( + text: AppLocalizations + .of( + context, + )! + .terms_conditions, + style: TextStyle( + fontFamily: context.translate( + 'Roboto', + 'NotoKufi', + ), + // color: Colors.blue, + color: Color( + 0xFF648CBA), + decoration: + TextDecoration + .underline, + ), + recognizer: + TapGestureRecognizer() + ..onTap = () => + context.push( + '/termsandconditions'), ), - color: Colors.red[700], - fontSize: 12, - ), + TextSpan( + text: AppLocalizations + .of( + context, + )! + .t_and, + style: TextStyle( + fontFamily: context.translate( + 'Roboto', + 'NotoKufi', + ), + color: Colors.black, + ), + ), + TextSpan( + text: AppLocalizations + .of( + context, + )! + .privacy_policy, + style: TextStyle( + fontFamily: context.translate( + 'Roboto', + 'NotoKufi', + ), + // color: Colors.blue, + color: Color( + 0xFF648CBA), + decoration: + TextDecoration + .underline, + ), + recognizer: + TapGestureRecognizer() + ..onTap = () => + context.push( + '/privacy_policy'), + ), + TextSpan( + text: AppLocalizations + .of( + context, + )! + .conditions, + style: TextStyle( + fontFamily: context.translate( + 'Roboto', + 'NotoKufi', + ), + color: Colors.black, + ), + ), + ], ), + textAlign: TextAlign.start, + maxLines: 2, + overflow: + TextOverflow.visible, + softWrap: true, ), ], ), + ), ], ), - Center( - child: GestureDetector( - onTap: () { - final email = _emailController.text; - context.push( - '/createNewPw/$userId/$email?key=editProfile'); - }, - child: Text( - AppLocalizations.of(context)! - .change_password, - style: TextStyle( - // color: Color(0xFF648CBA), - color: Color(0xFF985400), - fontSize: 14, - fontWeight: FontWeight.w700, - fontFamily: context.translate( - 'Roboto', - 'NotoKufi', + if (showError) + Row( + mainAxisAlignment: + MainAxisAlignment.start, + children: [ + Padding( + padding: const EdgeInsets.only( + left: 10.0), + child: Text( + 'Please agree to terms and conditions', + style: TextStyle( + fontFamily: context.translate( + 'Roboto', + 'NotoKufi', + ), + color: Colors.red[700], + fontSize: 12, + ), + ), ), - // decoration: TextDecoration.underline - ), + ], ), + ], + ), + Center( + child: GestureDetector( + onTap: () { + final email = _emailController.text; + context.push( + '/createNewPw/$userId/$email?key=editProfile'); + }, + child: Text( + AppLocalizations.of(context)! + .change_password, + style: TextStyle( + // color: Color(0xFF648CBA), + color: Color(0xFF985400), + fontSize: 14, + fontWeight: FontWeight.w700, + fontFamily: context.translate( + 'Roboto', + 'NotoKufi', + ), + // decoration: TextDecoration.underline ), ), - SizedBox(height: 20), - // ElevatedButton.icon( - // onPressed: () { - // showConfirmationDialog(context); - // }, - // icon: Icon( - // Icons.save, - // color: Colors.white, - // ), - // label: Text( - // AppLocalizations.of(context)!.save, - // style: TextStyle(color: Colors.white), - // ), - // style: ElevatedButton.styleFrom( - // backgroundColor: Color(0xFF92722A), - // minimumSize: Size(double.infinity, 50), - // shape: RoundedRectangleBorder( - // borderRadius: BorderRadius.circular(8), - // ), - // ), - // ), - ElevatedButton( - onPressed: () { - // if ((_formKey.currentState?.validate() ?? false) && (isChecked)) { - // _formKey.currentState?.save(); - showConfirmationDialog(context); - // } else { - // setState(() { - // showError = !isChecked; // Show error if the checkbox is not checked - // }); - // } - }, - style: ElevatedButton.styleFrom( - backgroundColor: Color(0xFF92722A), - minimumSize: Size(double.infinity, 50), - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(8), - ), - ), - child: Row( - mainAxisAlignment: MainAxisAlignment - .center, // Center the content - children: [ - Text( - AppLocalizations.of(context)!.save, - style: TextStyle(color: Colors.white, fontFamily: context.translate( - 'Roboto', - 'NotoKufi', - ),), - ), - SizedBox( - width: - 8), // Add space between text and icon - Image.asset( - MiscIconAssetPath.save, - color: Colors.white, - width: 20, - height: 20, - ), - ], - ), - ) - ], + ), ), - ), + SizedBox(height: 20), + // ElevatedButton.icon( + // onPressed: () { + // showConfirmationDialog(context); + // }, + // icon: Icon( + // Icons.save, + // color: Colors.white, + // ), + // label: Text( + // AppLocalizations.of(context)!.save, + // style: TextStyle(color: Colors.white), + // ), + // style: ElevatedButton.styleFrom( + // backgroundColor: Color(0xFF92722A), + // minimumSize: Size(double.infinity, 50), + // shape: RoundedRectangleBorder( + // borderRadius: BorderRadius.circular(8), + // ), + // ), + // ), + ElevatedButton( + onPressed: () { + // if ((_formKey.currentState?.validate() ?? false) && (isChecked)) { + // _formKey.currentState?.save(); + showConfirmationDialog(context); + // } else { + // setState(() { + // showError = !isChecked; // Show error if the checkbox is not checked + // }); + // } + }, + style: ElevatedButton.styleFrom( + backgroundColor: Color(0xFF92722A), + minimumSize: Size(double.infinity, 50), + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(8), + ), + ), + child: Row( + mainAxisAlignment: MainAxisAlignment + .center, // Center the content + children: [ + Text( + AppLocalizations.of(context)!.save, + style: TextStyle(color: Colors.white, fontFamily: context.translate( + 'Roboto', + 'NotoKufi', + ),), + ), + SizedBox( + width: + 8), // Add space between text and icon + Image.asset( + MiscIconAssetPath.save, + color: Colors.white, + width: 20, + height: 20, + ), + ], + ), + ) + ], ), ), - ], + ), ), - ), + ], ), + ), + ), + ) + + //bottomNavigationBar: MyBottomNavBar(), )); } diff --git a/lib/presentation/routes/drawer_routes/custom_drawer_routes.dart b/lib/presentation/routes/drawer_routes/custom_drawer_routes.dart index d58abdda..d3837612 100644 --- a/lib/presentation/routes/drawer_routes/custom_drawer_routes.dart +++ b/lib/presentation/routes/drawer_routes/custom_drawer_routes.dart @@ -14,6 +14,10 @@ import 'package:shared_preferences/shared_preferences.dart'; import 'package:flutter_gen/gen_l10n/app_localizations.dart'; import 'package:tutorial_coach_mark/tutorial_coach_mark.dart'; import 'package:uae_stat/config/injector.dart'; +import 'package:uae_stat/config/theme/app_theme.dart'; +import 'package:uae_stat/config/theme/service.dart'; +import 'package:uae_stat/config/theme/themeDialog.dart'; +import 'package:uae_stat/config/theme/theme_provider.dart'; import 'package:uae_stat/domain/repos/t_auth_repo.dart'; import 'package:uae_stat/domain/use_cases/language.dart'; import 'package:uae_stat/infrastructure/data/p_auth_repo.dart'; @@ -44,6 +48,7 @@ class BaseScaffold extends ConsumerStatefulWidget { this.appbarColor, this.mytitleColor, this.bottomColor = null, + this.backgroundColor, }); final Widget body; final Widget title; @@ -56,6 +61,7 @@ class BaseScaffold extends ConsumerStatefulWidget { final List? actions; final Color? bottomColor; final Color? appbarColor, mytitleColor; + final Color? backgroundColor; @override _BaseScaffoldState createState() => _BaseScaffoldState(); @@ -830,6 +836,111 @@ class _BaseScaffoldState extends ConsumerState { context.go('/login'); // Redirect to login after logout } + + // void _showThemeDialog(BuildContext context) async { + // AppTheme? result = await showDialog( + // context: context, + // builder: (context) => ThemeSelectorDialog(initialTheme: AppTheme.system), + // ); + // + // if (result != null) { + // // You can now use `result` to apply the selected theme + // print('Selected theme: $result'); + // final prefs = await SharedPreferences.getInstance(); + // final userId = prefs.getString('userId') ?? ''; + // // Example: save to PocketBase or local preferences + // final themeService = ThemeBaseService(); + // await themeService.updateUserTheme(userId, result.name); + // } + // } + + // void showThemeDialog(BuildContext context, WidgetRef ref) async { + // final currentTheme = ref.read(themeProvider); + // final current = currentTheme == ThemeMode.light + // ? AppTheme.light + // : currentTheme == ThemeMode.dark + // ? AppTheme.dark + // : AppTheme.system; + // + // final selected = await showDialog( + // context: context, + // builder: (context) => ThemeSelectorDialog(initialTheme: current), + // ); + // + // if (selected != null) { + // ref.read(themeProvider.notifier).updateTheme(selected); + // final themeService = ThemeBaseService(); + // await themeService.updateUserTheme(userId, selected.name); + // } + // } + + // void showThemeDialog(BuildContext context, WidgetRef ref) async { + // final currentTheme = ref.read(themeProvider); + // final current = currentTheme == ThemeMode.light + // ? AppTheme.light + // : currentTheme == ThemeMode.dark + // ? AppTheme.dark + // : AppTheme.system; + // + // final selected = await showDialog( + // context: context, + // builder: (context) => ThemeSelectorDialog(initialTheme: current), + // ); + // + // if (selected != null) { + // // Update app theme locally + // ref.read(themeProvider.notifier).updateTheme(selected); + // + // // Detect real system brightness if 'system' is selected + // String themeToSend; + // if (selected == AppTheme.system) { + // final brightness = MediaQuery.of(context).platformBrightness; + // themeToSend = brightness == Brightness.dark ? 'dark' : 'light'; + // } else { + // themeToSend = selected.name; + // } + // + // // Save to PocketBase + // await ThemeBaseService().updateUserTheme(userId, themeToSend); + // } + // } + + void _openThemeDialog(BuildContext context, WidgetRef ref, String userId) async { + final currentThemeMode = ref.read(themeProvider); // ThemeMode + final platformBrightness = MediaQuery.of(context).platformBrightness; + + // Convert ThemeMode to AppTheme + AppTheme initialAppTheme; + if (currentThemeMode == ThemeMode.light) { + initialAppTheme = AppTheme.light; + } else if (currentThemeMode == ThemeMode.dark) { + initialAppTheme = AppTheme.dark; + } else { + initialAppTheme = AppTheme.system; + } + + final selectedTheme = await showDialog( + context: context, + builder: (_) => ThemeSelectorDialog(initialTheme: initialAppTheme), + ); + + if (selectedTheme != null) { + // Update UI immediately + ref.read(themeProvider.notifier).updateTheme(selectedTheme, platformBrightness); + + // Send only 'light' or 'dark' to PocketBase + final themeToSend = selectedTheme == AppTheme.system + ? (platformBrightness == Brightness.dark ? 'dark' : 'light') + : selectedTheme.name; + + await ThemeBaseService().updateUserTheme(userId, themeToSend); + } + } + + + + + @override Widget build(BuildContext context) { final locale = ref.watch(localeProvider); @@ -837,9 +948,15 @@ class _BaseScaffoldState extends ConsumerState { String currentRoute = GoRouterState.of(context).matchedLocation; double myheight = MediaQuery.of(context).size.height; double mywidth = MediaQuery.of(context).size.width; + final themeMode = ref.read(themeProvider); + final isDarkTheme = themeMode == ThemeMode.dark || + (themeMode == ThemeMode.system && + MediaQuery.of(context).platformBrightness == Brightness.dark); + + final String currentRoute1 = ModalRoute.of(context)?.settings.name ?? ''; return Scaffold( - backgroundColor: Colors.white, + backgroundColor: Colors.white, appBar: AppBar( title: Padding( padding: EdgeInsets.only(top: 10), @@ -849,7 +966,7 @@ class _BaseScaffoldState extends ConsumerState { : Alignment.centerLeft, child: DefaultTextStyle( style: TextStyle( - color: widget.colorChange ? Colors.white : Color(0xFF414042), + color: widget.colorChange ? Colors.white : Color(0xFFFFFFFF), fontSize: 22, fontFamily: context.translate( 'Roboto', @@ -863,6 +980,22 @@ class _BaseScaffoldState extends ConsumerState { ), scrolledUnderElevation: 0, titleSpacing: 0, + flexibleSpace: (isDarkTheme && currentRoute == '/myhomepage') + ? Container( + decoration: const BoxDecoration( + image: DecorationImage( + image: AssetImage('assets/dark_bg.png'), + fit: BoxFit.cover, + ), + ), + ) + : (isDarkTheme && currentRoute == '/uaenumbers') + ? Container( + decoration: const BoxDecoration( + color: Color(0xFF333333), + ), + ) + : null, backgroundColor: widget.appbarColor ?? Colors.white, leadingWidth: widget.showBackButton ? mywidth * 0.18 : null, bottom: widget.showDivider @@ -940,7 +1073,7 @@ class _BaseScaffoldState extends ConsumerState { padding: EdgeInsets.zero, constraints: BoxConstraints(), key: drawerKey, - color: widget.colorChange ? Colors.white : Colors.black, + color: isDarkTheme ? Colors.white : Colors.black, icon: const Icon(Icons.menu, size: 30), onPressed: () { Scaffold.of(context).openDrawer(); @@ -954,7 +1087,7 @@ class _BaseScaffoldState extends ConsumerState { ), ), drawer: Drawer( - backgroundColor: Colors.white, + backgroundColor: isDarkTheme ? Color(0xFF111111) : Colors.white, child: Column(children: [ Expanded( child: ListView( @@ -1034,9 +1167,15 @@ class _BaseScaffoldState extends ConsumerState { crossAxisAlignment: CrossAxisAlignment.start, children: [ if (userId == "guest") ...[ - Text(userName ?? 'Guest User'), + Text(userName ?? 'Guest User', + style: TextStyle( + color: isDarkTheme ? Color(0xFFAAAAAA) : null, + ),), ] else ...[ - Text(userName ?? 'Loading...'), + Text(userName ?? 'Loading...', + style: TextStyle( + color: isDarkTheme ? Color(0xFFAAAAAA) : null, + ),), Tooltip( message: userEmail ?? 'Loading...', // Shows full email on hover @@ -1048,7 +1187,7 @@ class _BaseScaffoldState extends ConsumerState { child: Text( userEmail ?? 'Loading...', style: TextStyle(fontSize: 12, - +color: isDarkTheme ? Color(0xFFAAAAAA) : null, fontFamily: context.translate( 'Roboto', 'NotoKufi', @@ -1071,9 +1210,10 @@ class _BaseScaffoldState extends ConsumerState { ), if (userId != 'guest') ListTile( - leading: Icon(Icons.notifications_none), + leading: Icon(Icons.notifications_none,color: isDarkTheme ? Color(0xFFFFFFFF) : null), title: Text(AppLocalizations.of(context)!.notification, style: TextStyle( + color: isDarkTheme ? Color(0xFFAAAAAA) : null, fontFamily: context.translate( 'Roboto', 'NotoKufi', @@ -1083,7 +1223,7 @@ class _BaseScaffoldState extends ConsumerState { onTap: () => _navigateTo(context, '/notification'), ), ListTile( - leading: Icon(Icons.message_outlined), + leading: Icon(Icons.message_outlined,color: isDarkTheme ? Color(0xFFFFFFFF) : null), // leading: Image.asset( // DrawerAssetIconPath.feedback, // color: Colors.black, @@ -1093,6 +1233,7 @@ class _BaseScaffoldState extends ConsumerState { // title: const Text('Feedback'), title: Text(AppLocalizations.of(context)!.feedback_title, style: TextStyle( + color: isDarkTheme ? Color(0xFFAAAAAA) : null, fontFamily: context.translate( 'Roboto', 'NotoKufi', @@ -1102,7 +1243,7 @@ class _BaseScaffoldState extends ConsumerState { ), if (role == 'admin') ListTile( - leading: Icon(Icons.manage_accounts_outlined), + leading: Icon(Icons.manage_accounts_outlined,color: isDarkTheme ? Color(0xFFFFFFFF) : null), // leading: Image.asset( // DrawerAssetIconPath.manageUser, // color: Colors.black, @@ -1113,6 +1254,7 @@ class _BaseScaffoldState extends ConsumerState { title: Text( AppLocalizations.of(context)!.manage_user, style: TextStyle( + color: isDarkTheme ? Color(0xFFAAAAAA) : null, fontFamily: context.translate( 'Roboto', 'NotoKufi', @@ -1121,11 +1263,12 @@ class _BaseScaffoldState extends ConsumerState { onTap: () => _navigateTo(context, '/manageuser'), ), ListTile( - leading: Icon(Icons.bookmarks_outlined), + leading: Icon(Icons.bookmarks_outlined,color: isDarkTheme ? Color(0xFFFFFFFF) : null), // title: const Text('Bookmark'), title: Text( AppLocalizations.of(context)!.bookmark_title, style: TextStyle( + color: isDarkTheme ? Color(0xFFAAAAAA) : null, fontFamily: context.translate( 'Roboto', 'NotoKufi', @@ -1134,7 +1277,7 @@ class _BaseScaffoldState extends ConsumerState { onTap: () => _navigateTo(context, '/bookmark'), ), ListTile( - leading: Icon(Icons.menu_book_outlined), + leading: Icon(Icons.menu_book_outlined,color: isDarkTheme ? Color(0xFFFFFFFF) : null), // leading: Image.asset( // DrawerAssetIconPath.guide, // color: Colors.black, @@ -1144,6 +1287,7 @@ class _BaseScaffoldState extends ConsumerState { // title: const Text('User Guide'), title: Text(AppLocalizations.of(context)!.guide_title, style: TextStyle( + color: isDarkTheme ? Color(0xFFAAAAAA) : null, fontFamily: context.translate( 'Roboto', 'NotoKufi', @@ -1152,9 +1296,10 @@ class _BaseScaffoldState extends ConsumerState { onTap: () => _navigateTo(context, '/user-guide'), ), ListTile( - leading: Icon(Icons.mail_outlined), + leading: Icon(Icons.mail_outlined,color: isDarkTheme ? Color(0xFFFFFFFF) : null), title: Text(context.translate('Contact Us', 'اتصل بنا'), style: TextStyle( + color: isDarkTheme ? Color(0xFFAAAAAA) : null, fontFamily: context.translate( 'Roboto', 'NotoKufi', @@ -1163,10 +1308,11 @@ class _BaseScaffoldState extends ConsumerState { ), if (userId != 'guest') ListTile( - leading: Icon(Icons.logout), + leading: Icon(Icons.logout,color: isDarkTheme ? Color(0xFFFFFFFF) : null), // title: const Text('Logout'), title: Text(AppLocalizations.of(context)!.logout, style: TextStyle( + color: isDarkTheme ? Color(0xFFAAAAAA) : null, fontFamily: context.translate( 'Roboto', 'NotoKufi', @@ -1176,10 +1322,11 @@ class _BaseScaffoldState extends ConsumerState { ), if (userId == 'guest') ListTile( - leading: Icon(Icons.login), + leading: Icon(Icons.login,color: isDarkTheme ? Color(0xFFFFFFFF) : null), // title: const Text('Login'), title: Text(AppLocalizations.of(context)!.login_title, style: TextStyle( + color: isDarkTheme ? Color(0xFFAAAAAA) : null, fontFamily: context.translate( 'Roboto', 'NotoKufi', @@ -1189,10 +1336,11 @@ class _BaseScaffoldState extends ConsumerState { ), if (userId == 'guest') ListTile( - leading: Icon(Icons.app_registration), + leading: Icon(Icons.app_registration,color: isDarkTheme ? Color(0xFFFFFFFF) : null), // title: const Text('Register'), title: Text(AppLocalizations.of(context)!.register_title, style: TextStyle( + color: isDarkTheme ? Color(0xFFAAAAAA) : null, fontFamily: context.translate( 'Roboto', 'NotoKufi', @@ -1200,6 +1348,17 @@ class _BaseScaffoldState extends ConsumerState { ), onTap: () => context.go('/register'), ), + ListTile( + leading: Icon(Icons.lightbulb_circle_outlined,color: isDarkTheme ? Color(0xFFFFFFFF) : null), + title: Text(context.translate('Theme','سمة'), + style: TextStyle( + color: isDarkTheme ? Color(0xFFAAAAAA) : null, + fontFamily: context.translate( + 'Roboto', + 'NotoKufi', + ), ),), + onTap: () => _openThemeDialog(context, ref, userId), + ), ], ), ), @@ -1211,7 +1370,7 @@ class _BaseScaffoldState extends ConsumerState { if (snapshot.connectionState == ConnectionState.waiting) { return Text( 'Loading version...', - style: TextStyle(fontSize: 12, color: Colors.grey,fontFamily: context.translate( + style: TextStyle(fontSize: 12, color: isDarkTheme ? Color(0xFFAAAAAA) : Colors.grey,fontFamily: context.translate( 'Roboto', 'NotoKufi', ),), @@ -1229,7 +1388,7 @@ class _BaseScaffoldState extends ConsumerState { } else { return Text( 'Version ${snapshot.data}', - style: TextStyle(fontSize: 12, color: Colors.grey,fontFamily: context.translate( + style: TextStyle(fontSize: 12, color: isDarkTheme ? Color(0xFFAAAAAA) : Colors.grey,fontFamily: context.translate( 'Roboto', 'NotoKufi', ),), @@ -1240,97 +1399,210 @@ class _BaseScaffoldState extends ConsumerState { ), ), ])), - bottomNavigationBar: BottomNavigationBar( - backgroundColor: Colors.white, - currentIndex: _getSelectedIndex(currentRoute), - onTap: (index) => _onItemTapped(context, index), - type: BottomNavigationBarType.fixed, - items: [ - BottomNavigationBarItem( - icon: Padding( - padding: - const EdgeInsets.only(bottom: 4), // Adjust this for spacing - child: Image.asset( - BottomBarAssetIconPath.home, - color: _getSelectedIndex(currentRoute) == 0 - ? Colors.black - : Color(0xFF989898), - width: 23.98, - height: 25, + bottomNavigationBar: Stack( + children: [ + if (isDarkTheme) + Positioned( + bottom: 0, + left: 0, + right: 0, + child: Container( + height: kBottomNavigationBarHeight + 0, // Adjust as needed + decoration: BoxDecoration( + image: DecorationImage( + image: AssetImage('assets/dark_bg.png'), // your dark mode image + fit: BoxFit.cover, + ), + ), ), ), - // label: 'Home', - label: AppLocalizations.of(context)!.nav_home, - ), - BottomNavigationBarItem( - // icon: Icon(Icons.map), - icon: Padding( - padding: - const EdgeInsets.only(bottom: 4), // Adjust this for spacing - child: Image.asset( - BottomBarAssetIconPath.uaeMap, - color: _getSelectedIndex(currentRoute) == 1 - ? Colors.black - : Color(0xFF989898), - width: 23.98, - height: 25, + BottomNavigationBar( + backgroundColor: isDarkTheme ? Color(0xFF000000) : Colors.white, + currentIndex: _getSelectedIndex(currentRoute), + onTap: (index) => _onItemTapped(context, index), + type: BottomNavigationBarType.fixed, + items: [ + BottomNavigationBarItem( + icon: Padding( + padding: + const EdgeInsets.only(bottom: 4), // Adjust this for spacing + child: Image.asset( + BottomBarAssetIconPath.home, + color: _getSelectedIndex(currentRoute) == 0 + ? (isDarkTheme ? Color(0xFF24B4FB) : Colors.black) + : Color(0xFF989898), + width: 23.98, + height: 25, + ), + ), + // label: 'Home', + label: AppLocalizations.of(context)!.nav_home, + ), + BottomNavigationBarItem( + // icon: Icon(Icons.map), + icon: Padding( + padding: + const EdgeInsets.only(bottom: 4), // Adjust this for spacing + child: Image.asset( + BottomBarAssetIconPath.uaeMap, + color: _getSelectedIndex(currentRoute) == 1 + ? (isDarkTheme ? Color(0xFF24B4FB) : Colors.black) + : Color(0xFF989898), + width: 23.98, + height: 25, + ), + ), + // label: 'UAE Numbers' + label: AppLocalizations.of(context)!.nav_uae, + ), + BottomNavigationBarItem( + icon: Padding( + padding: + const EdgeInsets.only(bottom: 4), // Adjust this for spacing + child: Image.asset( + BottomBarAssetIconPath.ranking, + color: _getSelectedIndex(currentRoute) == 2 + ? (isDarkTheme ? Color(0xFF24B4FB) : Colors.black) + : Color(0xFF989898), + width: 23.98, + height: 25, + ), + ), + // label: 'Competitiveness', + label: AppLocalizations.of(context)!.nav_competitiveness, + ), + BottomNavigationBarItem( + icon: Padding( + padding: + const EdgeInsets.only(bottom: 4), // Adjust this for spacing + child: Image.asset( + BottomBarAssetIconPath.globe, + color: _getSelectedIndex(currentRoute) == 3 + ? (isDarkTheme ? Color(0xFF24B4FB) : Colors.black) + : Color(0xFF989898), + width: 23.98, + height: 25, + ), + ), + // label: 'Country Profile', + label: AppLocalizations.of(context)!.country_profile, + ), + ], + key: bottomNavKey, + selectedItemColor: isDarkTheme ? Color(0xFF24B4FB) : Colors.black, + unselectedItemColor: Colors.grey, + selectedLabelStyle: TextStyle( + fontFamily: context.translate( + 'Roboto', + 'NotoKufi', + ), + fontSize: 10, // Font size for unselected label ), - ), - // label: 'UAE Numbers' - label: AppLocalizations.of(context)!.nav_uae, - ), - BottomNavigationBarItem( - icon: Padding( - padding: - const EdgeInsets.only(bottom: 4), // Adjust this for spacing - child: Image.asset( - BottomBarAssetIconPath.ranking, - color: _getSelectedIndex(currentRoute) == 2 - ? Colors.black - : Color(0xFF989898), - width: 23.98, - height: 25, + unselectedLabelStyle: TextStyle( + fontFamily: context.translate( + 'Roboto', + 'NotoKufi', + ), + fontSize: 10, // Font size for unselected label ), + showUnselectedLabels: true, ), - // label: 'Competitiveness', - label: AppLocalizations.of(context)!.nav_competitiveness, - ), - BottomNavigationBarItem( - icon: Padding( - padding: - const EdgeInsets.only(bottom: 4), // Adjust this for spacing - child: Image.asset( - BottomBarAssetIconPath.globe, - color: _getSelectedIndex(currentRoute) == 3 - ? Colors.black - : Color(0xFF989898), - width: 23.98, - height: 25, - ), - ), - // label: 'Country Profile', - label: AppLocalizations.of(context)!.country_profile, - ), + ], - key: bottomNavKey, - selectedItemColor: Colors.black, - unselectedItemColor: Colors.grey, - selectedLabelStyle: TextStyle( - fontFamily: context.translate( - 'Roboto', - 'NotoKufi', - ), - fontSize: 10, // Font size for unselected label - ), - unselectedLabelStyle: TextStyle( - fontFamily: context.translate( - 'Roboto', - 'NotoKufi', - ), - fontSize: 10, // Font size for unselected label - ), - showUnselectedLabels: true, ), + + // BottomNavigationBar( + // backgroundColor: isDarkTheme ? Color(0xFF00000080) : Colors.white, + // currentIndex: _getSelectedIndex(currentRoute), + // onTap: (index) => _onItemTapped(context, index), + // type: BottomNavigationBarType.fixed, + // items: [ + // BottomNavigationBarItem( + // icon: Padding( + // padding: + // const EdgeInsets.only(bottom: 4), // Adjust this for spacing + // child: Image.asset( + // BottomBarAssetIconPath.home, + // color: _getSelectedIndex(currentRoute) == 0 + // ? Colors.black + // : Color(0xFF989898), + // width: 23.98, + // height: 25, + // ), + // ), + // // label: 'Home', + // label: AppLocalizations.of(context)!.nav_home, + // ), + // BottomNavigationBarItem( + // // icon: Icon(Icons.map), + // icon: Padding( + // padding: + // const EdgeInsets.only(bottom: 4), // Adjust this for spacing + // child: Image.asset( + // BottomBarAssetIconPath.uaeMap, + // color: _getSelectedIndex(currentRoute) == 1 + // ? Colors.black + // : Color(0xFF989898), + // width: 23.98, + // height: 25, + // ), + // ), + // // label: 'UAE Numbers' + // label: AppLocalizations.of(context)!.nav_uae, + // ), + // BottomNavigationBarItem( + // icon: Padding( + // padding: + // const EdgeInsets.only(bottom: 4), // Adjust this for spacing + // child: Image.asset( + // BottomBarAssetIconPath.ranking, + // color: _getSelectedIndex(currentRoute) == 2 + // ? Colors.black + // : Color(0xFF989898), + // width: 23.98, + // height: 25, + // ), + // ), + // // label: 'Competitiveness', + // label: AppLocalizations.of(context)!.nav_competitiveness, + // ), + // BottomNavigationBarItem( + // icon: Padding( + // padding: + // const EdgeInsets.only(bottom: 4), // Adjust this for spacing + // child: Image.asset( + // BottomBarAssetIconPath.globe, + // color: _getSelectedIndex(currentRoute) == 3 + // ? Colors.black + // : Color(0xFF989898), + // width: 23.98, + // height: 25, + // ), + // ), + // // label: 'Country Profile', + // label: AppLocalizations.of(context)!.country_profile, + // ), + // ], + // key: bottomNavKey, + // selectedItemColor: Colors.black, + // unselectedItemColor: Colors.grey, + // selectedLabelStyle: TextStyle( + // fontFamily: context.translate( + // 'Roboto', + // 'NotoKufi', + // ), + // fontSize: 10, // Font size for unselected label + // ), + // unselectedLabelStyle: TextStyle( + // fontFamily: context.translate( + // 'Roboto', + // 'NotoKufi', + // ), + // fontSize: 10, // Font size for unselected label + // ), + // showUnselectedLabels: true, + // ), + body: widget.body, ); } diff --git a/pubspec.yaml b/pubspec.yaml index b75e24f3..0e72b58c 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,8 +1,8 @@ name: uae_stat description: "View statistics about the UAE from the Federal Center for Statistics and Competitiveness." publish_to: "none" -#version: 1.0.59+60 -version: 1.0.5+6 +#version: 1.0.60+61 +version: 1.0.6+7 environment: sdk: ">=3.2.3 <4.0.0" @@ -104,6 +104,7 @@ flutter: generate: true uses-material-design: true assets: + - assets/dark_bg.png - assets/user_guide_videos/ - assets/logos/ - assets/logos/from_alsaray/