From fe712c670831cffc4cd711cb782ab39a8d8ead0f Mon Sep 17 00:00:00 2001 From: SurendarSuri30 Date: Mon, 4 Aug 2025 09:33:26 +0530 Subject: [PATCH] Google and Apple OAthu --- .../arm64-v8a/configure_fingerprint.bin | 24 +- .../armeabi-v7a/configure_fingerprint.bin | 24 +- .../4y161to1/x86/configure_fingerprint.bin | 24 +- .../4y161to1/x86_64/configure_fingerprint.bin | 24 +- .../arm64-v8a/configure_fingerprint.bin | 24 +- .../armeabi-v7a/configure_fingerprint.bin | 24 +- .../574gs2w4/x86/configure_fingerprint.bin | 24 +- .../574gs2w4/x86_64/configure_fingerprint.bin | 24 +- ios/Podfile.lock | 42 + ios/Runner.xcodeproj/project.pbxproj | 8 - ios/Runner/Runner.entitlements | 4 + lib/config/theme/service.dart | 27 +- lib/config/theme/themeDialog.dart | 40 +- lib/domain/entities/session_entity.dart | 2 +- lib/domain/repos/t_auth_repo.dart | 5 + lib/domain/use_cases/auth_use_case.dart | 15 + lib/infrastructure/data/p_auth_repo.dart | 25 + .../auth_verification/create_new_pw.dart | 228 ++- .../auth_verification/registration.dart | 390 ++-- lib/presentation/Screens/profilepage.dart | 515 +++-- lib/presentation/components/dialogs.dart | 46 +- .../routes/auth_routes/login_route.dart | 216 +- .../tab_routes/home_route.dart | 6 +- .../drawer_routes/Drawer Items/bookmark.dart | 440 ++-- .../Drawer Items/edit_profile.dart | 1801 +++++++++-------- .../drawer_routes/custom_drawer_routes.dart | 4 +- macos/Flutter/GeneratedPluginRegistrant.swift | 2 + pubspec.lock | 48 + pubspec.yaml | 1 + 29 files changed, 2425 insertions(+), 1632 deletions(-) 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 a96daedc..a3dd0491 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  3  2z +?com.android.build.gradle.internal.cxx.io.EncodedFileFingerPrint  Հ3  2z x -v/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/Debug/4y161to1/arm64-v8a/android_gradle_build.json  3 2 +v/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/Debug/4y161to1/arm64-v8a/android_gradle_build.json  Հ3 2 } -{/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/Debug/4y161to1/arm64-v8a/android_gradle_build_mini.json  3 2l +{/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/Debug/4y161to1/arm64-v8a/android_gradle_build_mini.json  Հ3 2l j -h/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/Debug/4y161to1/arm64-v8a/build.ninja  3 2p +h/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/Debug/4y161to1/arm64-v8a/build.ninja  Հ3 2p n -l/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/Debug/4y161to1/arm64-v8a/build.ninja.txt  3u +l/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/Debug/4y161to1/arm64-v8a/build.ninja.txt  Հ3u s -q/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/Debug/4y161to1/arm64-v8a/build_file_index.txt  3 _ 2v +q/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/Debug/4y161to1/arm64-v8a/build_file_index.txt  Հ3 _ 2v t -r/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/Debug/4y161to1/arm64-v8a/compile_commands.json  3z +r/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/Debug/4y161to1/arm64-v8a/compile_commands.json  Հ3z x -v/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/Debug/4y161to1/arm64-v8a/compile_commands.json.bin  3  +v/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/Debug/4y161to1/arm64-v8a/compile_commands.json.bin  Հ3  ~ -|/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/Debug/4y161to1/arm64-v8a/metadata_generation_command.txt  3 +|/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/Debug/4y161to1/arm64-v8a/metadata_generation_command.txt  Հ3  2s q -o/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/Debug/4y161to1/arm64-v8a/prefab_config.json  3  ( 2x +o/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/Debug/4y161to1/arm64-v8a/prefab_config.json  Հ3  ( 2x v -t/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/Debug/4y161to1/arm64-v8a/symbol_folder_index.txt  3  k 2c +t/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/Debug/4y161to1/arm64-v8a/symbol_folder_index.txt  Հ3  k 2c a -_/Users/venbateam/Documents/flutter/packages/flutter_tools/gradle/src/main/groovy/CMakeLists.txt  3  ހ2 \ No newline at end of file +_/Users/venbateam/Documents/flutter/packages/flutter_tools/gradle/src/main/groovy/CMakeLists.txt  Հ3  ހ2 \ No newline at end of file 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 7a4ff335..c181438a 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  3  2| +?com.android.build.gradle.internal.cxx.io.EncodedFileFingerPrint  Հ3  2| z -x/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/Debug/4y161to1/armeabi-v7a/android_gradle_build.json  3 2 +x/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/Debug/4y161to1/armeabi-v7a/android_gradle_build.json  Հ3 2  -}/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/Debug/4y161to1/armeabi-v7a/android_gradle_build_mini.json  3 2n +}/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/Debug/4y161to1/armeabi-v7a/android_gradle_build_mini.json  Հ3 2n l -j/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/Debug/4y161to1/armeabi-v7a/build.ninja  3 2r +j/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/Debug/4y161to1/armeabi-v7a/build.ninja  Հ3 2r p -n/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/Debug/4y161to1/armeabi-v7a/build.ninja.txt  3w +n/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/Debug/4y161to1/armeabi-v7a/build.ninja.txt  Հ3w u -s/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/Debug/4y161to1/armeabi-v7a/build_file_index.txt  3 _ 2x +s/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/Debug/4y161to1/armeabi-v7a/build_file_index.txt  Հ3 _ 2x v -t/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/Debug/4y161to1/armeabi-v7a/compile_commands.json  3| +t/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/Debug/4y161to1/armeabi-v7a/compile_commands.json  Հ3| z -x/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/Debug/4y161to1/armeabi-v7a/compile_commands.json.bin  3  +x/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/Debug/4y161to1/armeabi-v7a/compile_commands.json.bin  Հ3   -~/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/Debug/4y161to1/armeabi-v7a/metadata_generation_command.txt  3 +~/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/Debug/4y161to1/armeabi-v7a/metadata_generation_command.txt  Հ3  2u s -q/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/Debug/4y161to1/armeabi-v7a/prefab_config.json  3  ( 2z +q/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/Debug/4y161to1/armeabi-v7a/prefab_config.json  Հ3  ( 2z x -v/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/Debug/4y161to1/armeabi-v7a/symbol_folder_index.txt  3  m 2c +v/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/Debug/4y161to1/armeabi-v7a/symbol_folder_index.txt  Հ3  m 2c a -_/Users/venbateam/Documents/flutter/packages/flutter_tools/gradle/src/main/groovy/CMakeLists.txt  3  ހ2 \ No newline at end of file +_/Users/venbateam/Documents/flutter/packages/flutter_tools/gradle/src/main/groovy/CMakeLists.txt  Հ3  ހ2 \ No newline at end of file diff --git a/android/app/.cxx/Debug/4y161to1/x86/configure_fingerprint.bin b/android/app/.cxx/Debug/4y161to1/x86/configure_fingerprint.bin index 0dd5d4eb..c4cb9a5f 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  3  2t +?com.android.build.gradle.internal.cxx.io.EncodedFileFingerPrint  Հ3  2t r -p/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/Debug/4y161to1/x86/android_gradle_build.json  3 2y +p/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/Debug/4y161to1/x86/android_gradle_build.json  Հ3 2y w -u/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/Debug/4y161to1/x86/android_gradle_build_mini.json  3 2f +u/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/Debug/4y161to1/x86/android_gradle_build_mini.json  Հ3 2f d -b/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/Debug/4y161to1/x86/build.ninja  3 2j +b/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/Debug/4y161to1/x86/build.ninja  Հ3 2j h -f/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/Debug/4y161to1/x86/build.ninja.txt  3o +f/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/Debug/4y161to1/x86/build.ninja.txt  Հ3o m -k/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/Debug/4y161to1/x86/build_file_index.txt  3 _ 2p +k/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/Debug/4y161to1/x86/build_file_index.txt  Հ3 _ 2p n -l/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/Debug/4y161to1/x86/compile_commands.json  3t +l/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/Debug/4y161to1/x86/compile_commands.json  Հ3t r -p/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/Debug/4y161to1/x86/compile_commands.json.bin  3 z +p/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/Debug/4y161to1/x86/compile_commands.json.bin  Հ3 z x -v/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/Debug/4y161to1/x86/metadata_generation_command.txt  3 +v/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/Debug/4y161to1/x86/metadata_generation_command.txt  Հ3  2m k -i/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/Debug/4y161to1/x86/prefab_config.json  3  ( 2r +i/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/Debug/4y161to1/x86/prefab_config.json  Հ3  ( 2r p -n/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/Debug/4y161to1/x86/symbol_folder_index.txt  3  e 2c +n/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/Debug/4y161to1/x86/symbol_folder_index.txt  Հ3  e 2c a -_/Users/venbateam/Documents/flutter/packages/flutter_tools/gradle/src/main/groovy/CMakeLists.txt  3  ހ2 \ No newline at end of file +_/Users/venbateam/Documents/flutter/packages/flutter_tools/gradle/src/main/groovy/CMakeLists.txt  Հ3  ހ2 \ No newline at end of file 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 cdab0d69..3cd77a1e 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  3  2w +?com.android.build.gradle.internal.cxx.io.EncodedFileFingerPrint  Հ3  2w u -s/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/Debug/4y161to1/x86_64/android_gradle_build.json  3 2| +s/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/Debug/4y161to1/x86_64/android_gradle_build.json  Հ3 2| z -x/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/Debug/4y161to1/x86_64/android_gradle_build_mini.json  3 2i +x/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/Debug/4y161to1/x86_64/android_gradle_build_mini.json  Հ3 2i g -e/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/Debug/4y161to1/x86_64/build.ninja  3 2m +e/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/Debug/4y161to1/x86_64/build.ninja  Հ3 2m k -i/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/Debug/4y161to1/x86_64/build.ninja.txt  3r +i/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/Debug/4y161to1/x86_64/build.ninja.txt  Հ3r p -n/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/Debug/4y161to1/x86_64/build_file_index.txt  3 _ 2s +n/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/Debug/4y161to1/x86_64/build_file_index.txt  Հ3 _ 2s q -o/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/Debug/4y161to1/x86_64/compile_commands.json  3w +o/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/Debug/4y161to1/x86_64/compile_commands.json  Հ3w u -s/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/Debug/4y161to1/x86_64/compile_commands.json.bin  3 } +s/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/Debug/4y161to1/x86_64/compile_commands.json.bin  Հ3 } { -y/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/Debug/4y161to1/x86_64/metadata_generation_command.txt  3 +y/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/Debug/4y161to1/x86_64/metadata_generation_command.txt  Հ3  2p n -l/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/Debug/4y161to1/x86_64/prefab_config.json  3  ( 2u +l/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/Debug/4y161to1/x86_64/prefab_config.json  Հ3  ( 2u s -q/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/Debug/4y161to1/x86_64/symbol_folder_index.txt  3  h 2c +q/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/Debug/4y161to1/x86_64/symbol_folder_index.txt  Հ3  h 2c a -_/Users/venbateam/Documents/flutter/packages/flutter_tools/gradle/src/main/groovy/CMakeLists.txt  3  ހ2 \ No newline at end of file +_/Users/venbateam/Documents/flutter/packages/flutter_tools/gradle/src/main/groovy/CMakeLists.txt  Հ3  ހ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 fb068f44..b8974ca3 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  ׆3  ǟ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  ׆3 ǟ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  ׆3 ǟ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  ׆3 ǟ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  ׆3~ | -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  ׆3 _ ǟ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  ׆3  -/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  ׆3   -/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  ׆3  ǟ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  ׆3  ( ǟ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  ׆3  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  ׆3  ހ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 b921d132..d74ef4b3 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  ׆3  ǟ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  ׆3 ǟ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  ׆3 ǟ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  ׆3 ǟ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  ׆3 ~ -|/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  ׆3 _ ǟ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  ׆3  -/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  ׆3   -/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  ׆3  ǟ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  ׆3  ( ǟ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  ׆3  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  ׆3  ހ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 f0625e4b..047df3b4 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  ׆3  ǟ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  ׆3 ǟ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  ׆3 ǟ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  ׆3 ǟ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  ׆3x 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  ׆3 _ ǟ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  ׆3} { -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  ׆3   -/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  ׆3  ǟ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  ׆3  ( ǟ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  ׆3  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  ׆3  ހ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 4d90eeae..4c753fc2 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  ׆3  ǟ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  ׆3 ǟ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  ׆3 ǟ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  ׆3 ǟ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  ׆3{ 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  ׆3 _ ǟ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  ׆3 ~ -|/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  ׆3   -/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  ׆3  ǟ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  ׆3  ( ǟ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  ׆3  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  ׆3  ހ2 \ No newline at end of file diff --git a/ios/Podfile.lock b/ios/Podfile.lock index 601f0ada..dd052587 100644 --- a/ios/Podfile.lock +++ b/ios/Podfile.lock @@ -3,6 +3,16 @@ PODS: - Flutter - app_settings (5.1.1): - Flutter + - AppAuth (2.0.0): + - AppAuth/Core (= 2.0.0) + - AppAuth/ExternalUserAgent (= 2.0.0) + - AppAuth/Core (2.0.0) + - AppAuth/ExternalUserAgent (2.0.0): + - AppAuth/Core + - AppCheckCore (11.2.0): + - GoogleUtilities/Environment (~> 8.0) + - GoogleUtilities/UserDefaults (~> 8.0) + - PromisesObjC (~> 2.4) - appsflyer_sdk (6.16.2): - AppsFlyerFramework (= 6.16.2) - Flutter @@ -53,9 +63,19 @@ PODS: - FlutterMacOS - fluttertoast (0.0.2): - Flutter + - google_sign_in_ios (0.0.1): + - Flutter + - FlutterMacOS + - GoogleSignIn (~> 9.0) + - GTMSessionFetcher (>= 3.4.0) - GoogleDataTransport (10.1.0): - nanopb (~> 3.30910.0) - PromisesObjC (~> 2.4) + - GoogleSignIn (9.0.0): + - AppAuth (~> 2.0) + - AppCheckCore (~> 11.0) + - GTMAppAuth (~> 5.0) + - GTMSessionFetcher/Core (~> 3.3) - GoogleUtilities/AppDelegateSwizzler (8.0.2): - GoogleUtilities/Environment - GoogleUtilities/Logger @@ -80,6 +100,14 @@ PODS: - GoogleUtilities/UserDefaults (8.0.2): - GoogleUtilities/Logger - GoogleUtilities/Privacy + - GTMAppAuth (5.0.0): + - AppAuth/Core (~> 2.0) + - GTMSessionFetcher/Core (< 4.0, >= 3.3) + - GTMSessionFetcher (3.5.0): + - GTMSessionFetcher/Full (= 3.5.0) + - GTMSessionFetcher/Core (3.5.0) + - GTMSessionFetcher/Full (3.5.0): + - GTMSessionFetcher/Core - image_picker_ios (0.0.1): - Flutter - nanopb (3.30910.0): @@ -119,6 +147,7 @@ DEPENDENCIES: - flutter_native_splash (from `.symlinks/plugins/flutter_native_splash/ios`) - flutter_secure_storage_darwin (from `.symlinks/plugins/flutter_secure_storage_darwin/darwin`) - fluttertoast (from `.symlinks/plugins/fluttertoast/ios`) + - google_sign_in_ios (from `.symlinks/plugins/google_sign_in_ios/darwin`) - image_picker_ios (from `.symlinks/plugins/image_picker_ios/ios`) - package_info_plus (from `.symlinks/plugins/package_info_plus/ios`) - path_provider_foundation (from `.symlinks/plugins/path_provider_foundation/darwin`) @@ -130,6 +159,8 @@ DEPENDENCIES: SPEC REPOS: trunk: + - AppAuth + - AppCheckCore - AppsFlyerFramework - Firebase - FirebaseCore @@ -137,7 +168,10 @@ SPEC REPOS: - FirebaseInstallations - FirebaseMessaging - GoogleDataTransport + - GoogleSignIn - GoogleUtilities + - GTMAppAuth + - GTMSessionFetcher - nanopb - PromisesObjC @@ -164,6 +198,8 @@ EXTERNAL SOURCES: :path: ".symlinks/plugins/flutter_secure_storage_darwin/darwin" fluttertoast: :path: ".symlinks/plugins/fluttertoast/ios" + google_sign_in_ios: + :path: ".symlinks/plugins/google_sign_in_ios/darwin" image_picker_ios: :path: ".symlinks/plugins/image_picker_ios/ios" package_info_plus: @@ -184,6 +220,8 @@ EXTERNAL SOURCES: SPEC CHECKSUMS: app_links: 76b66b60cc809390ca1ad69bfd66b998d2387ac7 app_settings: 5127ae0678de1dcc19f2293271c51d37c89428b2 + AppAuth: 1c1a8afa7e12f2ec3a294d9882dfa5ab7d3cb063 + AppCheckCore: cc8fd0a3a230ddd401f326489c99990b013f0c4f appsflyer_sdk: ebe94dc3f00b07bdd001251dbc87879bda3c494a AppsFlyerFramework: fe5303bffcdfd941d5f570c2d21eaaea982e7bdc connectivity_plus: cb623214f4e1f6ef8fe7403d580fdad517d2f7dd @@ -199,8 +237,12 @@ SPEC CHECKSUMS: flutter_native_splash: 6cad9122ea0fad137d23137dd14b937f3e90b145 flutter_secure_storage_darwin: ce237a8775b39723566dc72571190a3769d70468 fluttertoast: 2c67e14dce98bbdb200df9e1acf610d7a6264ea1 + google_sign_in_ios: 205742c688aea0e64db9da03c33121694a365109 GoogleDataTransport: aae35b7ea0c09004c3797d53c8c41f66f219d6a7 + GoogleSignIn: c7f09cfbc85a1abf69187be091997c317cc33b77 GoogleUtilities: 26a3abef001b6533cf678d3eb38fd3f614b7872d + GTMAppAuth: 217a876b249c3c585a54fd6f73e6b58c4f5c4238 + GTMSessionFetcher: 5aea5ba6bd522a239e236100971f10cb71b96ab6 image_picker_ios: 7fe1ff8e34c1790d6fff70a32484959f563a928a nanopb: fad817b59e0457d11a5dfbde799381cd727c1275 package_info_plus: af8e2ca6888548050f16fa2f1938db7b5a5df499 diff --git a/ios/Runner.xcodeproj/project.pbxproj b/ios/Runner.xcodeproj/project.pbxproj index 71b2ac31..bfd71a07 100644 --- a/ios/Runner.xcodeproj/project.pbxproj +++ b/ios/Runner.xcodeproj/project.pbxproj @@ -322,14 +322,10 @@ inputFileListPaths = ( "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-input-files.xcfilelist", ); - inputPaths = ( - ); name = "[CP] Embed Pods Frameworks"; outputFileListPaths = ( "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-output-files.xcfilelist", ); - outputPaths = ( - ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n"; @@ -358,14 +354,10 @@ inputFileListPaths = ( "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources-${CONFIGURATION}-input-files.xcfilelist", ); - inputPaths = ( - ); name = "[CP] Copy Pods Resources"; outputFileListPaths = ( "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources-${CONFIGURATION}-output-files.xcfilelist", ); - outputPaths = ( - ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources.sh\"\n"; diff --git a/ios/Runner/Runner.entitlements b/ios/Runner/Runner.entitlements index 903def2a..80b5221d 100644 --- a/ios/Runner/Runner.entitlements +++ b/ios/Runner/Runner.entitlements @@ -4,5 +4,9 @@ aps-environment development + com.apple.developer.applesignin + + Default + diff --git a/lib/config/theme/service.dart b/lib/config/theme/service.dart index c115ad31..72cd7c80 100644 --- a/lib/config/theme/service.dart +++ b/lib/config/theme/service.dart @@ -1,14 +1,13 @@ import 'dart:convert'; import 'package:http/http.dart' as http; import 'package:pocketbase/pocketbase.dart'; +import 'package:shared_preferences/shared_preferences.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') ?? ''; @@ -40,14 +39,15 @@ class ThemeBaseService { // } Future getUserTheme(String userId) async { + print('getUserTheme'); 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 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: { @@ -57,13 +57,22 @@ class ThemeBaseService { ); if (response.statusCode == 200) { + print("THEME : ${jsonDecode(response.body)['theme']} "); + + final prefs = await SharedPreferences.getInstance(); + + // Store enum as string + await prefs.setString('ThemeType', jsonDecode(response.body)['theme']); + return jsonDecode(response.body)['theme'] ?? 'system'; } else { + print('THEME : system'); return 'system'; } } Future updateUserTheme(String userId, String theme) async { + print('updateUserTheme'); // Authenticate admin d final url = "${pb.baseUrl}/api/collections/users/records/$userId"; final adminAuth = await pb.admins.authWithPassword( @@ -85,7 +94,7 @@ class ThemeBaseService { ); if (response.statusCode == 200) { - print("Theme updated successfully"); + print("Theme updated successfully - ${response.body}"); } 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 index dcfbbc4b..f267a3fb 100644 --- a/lib/config/theme/themeDialog.dart +++ b/lib/config/theme/themeDialog.dart @@ -1,4 +1,5 @@ import 'package:flutter/material.dart'; +import 'package:shared_preferences/shared_preferences.dart'; import 'package:uae_stat/config/theme/app_theme.dart'; class ThemeSelectorDialog extends StatefulWidget { @@ -11,12 +12,28 @@ class ThemeSelectorDialog extends StatefulWidget { } class _ThemeSelectorDialogState extends State { - late AppTheme _selectedTheme; + AppTheme? _selectedTheme; @override void initState() { super.initState(); - _selectedTheme = widget.initialTheme; + + print("InitailTheme - ${widget.initialTheme}"); + _loadTheme(); + + // _selectedTheme = widget.initialTheme; + } + + Future _loadTheme() async { + final prefs = await SharedPreferences.getInstance(); + final storedTheme = prefs.getString('ThemeType') ?? widget.initialTheme; + print("storedTheme - $storedTheme"); + setState(() { + _selectedTheme = + storedTheme == 'system' ? AppTheme.system : widget.initialTheme; + }); + + print("_selectedTheme - $_selectedTheme"); } @override @@ -26,12 +43,21 @@ class _ThemeSelectorDialogState extends State { content: Column( mainAxisSize: MainAxisSize.min, children: AppTheme.values.map((theme) { + print("THEME_DIAL1- $theme"); return RadioListTile( - title: Text(theme.name[0].toUpperCase() + theme.name.substring(1)), - value: theme, - groupValue: _selectedTheme, - onChanged: (value) => setState(() => _selectedTheme = value!), - ); + title: + Text(theme.name[0].toUpperCase() + theme.name.substring(1)), + value: theme, + groupValue: _selectedTheme, + onChanged: (value) async { + final prefs = await SharedPreferences.getInstance(); + print("THEME_DIALval- $value"); + // Store enum as string + await prefs.setString( + 'ThemeType', value.toString().split('.').last); + + setState(() => _selectedTheme = value!); + }); }).toList(), ), actions: [ diff --git a/lib/domain/entities/session_entity.dart b/lib/domain/entities/session_entity.dart index 7e4610be..75b33126 100644 --- a/lib/domain/entities/session_entity.dart +++ b/lib/domain/entities/session_entity.dart @@ -31,7 +31,7 @@ class SessionEntity { SessionFreshness get freshness { final now = DateTime.now(); if (now.isAfter(expiresOn)) return SessionFreshness.expired; - if (expiresOn.difference(now) < const Duration(days: 7)) { + if (expiresOn.difference(now) < const Duration(days: 30)) { return SessionFreshness.stale; } return SessionFreshness.fresh; diff --git a/lib/domain/repos/t_auth_repo.dart b/lib/domain/repos/t_auth_repo.dart index 19339604..92b58496 100644 --- a/lib/domain/repos/t_auth_repo.dart +++ b/lib/domain/repos/t_auth_repo.dart @@ -37,6 +37,11 @@ class TAuthRepo { () => _state!, ); + Future googleAndAppleAuthencation(token) => Future.delayed( + kThemeAnimationDuration, + () => _sample, + ); + Future logout() => Future.delayed( kThemeAnimationDuration, () => _state = null, diff --git a/lib/domain/use_cases/auth_use_case.dart b/lib/domain/use_cases/auth_use_case.dart index 72fc6c01..c1a9db59 100644 --- a/lib/domain/use_cases/auth_use_case.dart +++ b/lib/domain/use_cases/auth_use_case.dart @@ -69,6 +69,21 @@ class AuthUseCase extends _$AuthUseCase { return session; // Return the session with user details. } + Future googleAndAppleAuthencation(token) async { + // print("loginTEST2"); + final session = await _repo.googleAndAppleAuthencation(token); + // print("loginTEST4"); + final localPrefs = await getIt.call().get(); + if (localPrefs != null) { + await getIt.call().syncPreferences( + localPrefs, + id: session.id, + ); + } + state = AsyncData(session); + return session; // Return the session with user details. + } + Future logout() async { await _repo.logout(); state = const AsyncData(null); diff --git a/lib/infrastructure/data/p_auth_repo.dart b/lib/infrastructure/data/p_auth_repo.dart index 5258479e..8ee8f054 100644 --- a/lib/infrastructure/data/p_auth_repo.dart +++ b/lib/infrastructure/data/p_auth_repo.dart @@ -53,6 +53,7 @@ class PAuthRepo implements TAuthRepo { email, pw, ); + print('googleAuth $user'); } on ClientException catch (err) { final message = err.response['message']; final isWrongEmailPw = message == 'Failed to authenticate.'; @@ -66,6 +67,30 @@ class PAuthRepo implements TAuthRepo { return se; } + Future googleAndAppleAuthencation(token) async { + print("GloginTEST3"); + late final RecordAuth user; + try { + // user = await PocketBaseService.users.authWithPassword( + // email, + // pw, + // ); + + user = token; + } on ClientException catch (err) { + final message = err.response['message']; + final isWrongEmailPw = message == 'Failed to authenticate.'; + if (isWrongEmailPw) throw LoginError.invalidEmailPw; + rethrow; + } + final isVerified = user.record!.getBoolValue('verified'); + if (!isVerified) throw LoginError.emailAddressNotVerified; + final se = _sessionEntityFromPocketbaseRecord(user); + await _LocalAuthRepo.storeLocally(se); + return se; + } + + @override Future logout() { PocketBaseService.authStore.clear(); diff --git a/lib/presentation/Screens/auth_verification/create_new_pw.dart b/lib/presentation/Screens/auth_verification/create_new_pw.dart index 65633182..c69290ea 100644 --- a/lib/presentation/Screens/auth_verification/create_new_pw.dart +++ b/lib/presentation/Screens/auth_verification/create_new_pw.dart @@ -17,7 +17,7 @@ import 'package:uae_stat/presentation/components/indicators/locale_provider.dart import 'package:uae_stat/presentation/components/my_toggle.dart'; import 'package:uae_stat/presentation/components/space.dart'; import 'package:flutter_gen/gen_l10n/app_localizations.dart'; - +// import 'package:uae_stat/l10n/app_localizations.dart'; import 'package:uae_stat/config/my_theme.dart'; class CreateNewPw extends ConsumerStatefulWidget { @@ -27,9 +27,9 @@ class CreateNewPw extends ConsumerStatefulWidget { const CreateNewPw( {Key? key, - required this.userId, - required this.email, - required this.keyParam}); + required this.userId, + required this.email, + required this.keyParam}); @override ConsumerState createState() => _CreateNewPwState(); @@ -126,7 +126,7 @@ class _CreateNewPwState extends ConsumerState { try { // Attempt to authenticate the user with email and password final authResponse = - await _pb.collection('users').authWithPassword(email, password); + await _pb.collection('users').authWithPassword(email, password); if (authResponse != null) { print('Password match successful for email: $email'); @@ -156,20 +156,20 @@ class _CreateNewPwState extends ConsumerState { }; bool isPasswordValid = - await verifyUserPassword(widget.email, oldPassword); + await verifyUserPassword(widget.email, oldPassword); print(isPasswordValid); if (isPasswordValid) { // Update password await _pb.collection('users').update( - userId, - body: { - 'password': newPassword, - 'passwordConfirm': newPassword, - }, - headers: headers, - ); + userId, + body: { + 'password': newPassword, + 'passwordConfirm': newPassword, + }, + headers: headers, + ); setState(() { isLoading = false; @@ -179,13 +179,13 @@ class _CreateNewPwState extends ConsumerState { ScaffoldMessenger.of(context).showSnackBar( SnackBar( content: Text( - AppLocalizations.of(context)!.password_update_successfully, + AppLocalizations.of(context)!.password_update_successfully, style: TextStyle( fontFamily: context.translate( 'Roboto', 'NotoKufi', - ) - ),), + )), + ), ), ); @@ -203,14 +203,14 @@ class _CreateNewPwState extends ConsumerState { }); ScaffoldMessenger.of(context).showSnackBar( SnackBar( - content: - Text(AppLocalizations.of(context)!.your_old_password_incorrect, - style: TextStyle( - fontFamily: context.translate( - 'Roboto', - 'NotoKufi', - ) - ),), + content: Text( + AppLocalizations.of(context)!.your_old_password_incorrect, + style: TextStyle( + fontFamily: context.translate( + 'Roboto', + 'NotoKufi', + )), + ), backgroundColor: Colors.red, ), ); @@ -222,13 +222,14 @@ class _CreateNewPwState extends ConsumerState { }); ScaffoldMessenger.of(context).showSnackBar( SnackBar( - content: Text(context.translate('Failed to update password: $e','فشل في تحديث كلمة المرور'), + content: Text( + context.translate( + 'Failed to update password: $e', 'فشل في تحديث كلمة المرور'), style: TextStyle( fontFamily: context.translate( 'Roboto', 'NotoKufi', - ) - ), + )), ), backgroundColor: Colors.red, ), @@ -256,53 +257,51 @@ class _CreateNewPwState extends ConsumerState { }); // final themeMode = ref.read(themeProvider); - final themeMode = ThemeMode.dark; - final isDarkTheme = themeMode == ThemeMode.dark || - (themeMode == ThemeMode.system && + // final themeMode = ThemeMode.dark; + final isDarkTheme = ref.read(themeProvider) == ThemeMode.dark || + (ref.read(themeProvider) == ThemeMode.system && MediaQuery.of(context).platformBrightness == Brightness.dark); return PopScope( - canPop: false, // Allow back navigation only if not login screen - onPopInvokedWithResult: (didPop, result) { - if (didPop) return; - logout(context);// Show exit confirmation dialog - }, - child: Scaffold( - backgroundColor: isDarkTheme ? Color(0xFF111111) : Colors.white, - body: Stack(children: [ - SingleChildScrollView( - child: SafeArea( - child: _isPasswordUpdated - ? _buildSuccessContent(screenHeight, screenWidth) - : _buildPasswordForm(ref, screenHeight, screenWidth), - ), - ), - if (isLoading) - Container( - color: Color(0x98FFFCE5), // Semi-transparent background - child: Column( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Container( - margin: EdgeInsets.symmetric( - horizontal: 40), // Left & Right space - child: LinearProgressIndicator( - minHeight: 5, // Adjust thickness - backgroundColor: - Colors.grey[100], // Optional: Background color - valueColor: AlwaysStoppedAnimation( - Color(0xFFAA8E83)), // Loader color - ), - ), - ], + canPop: false, // Allow back navigation only if not login screen + onPopInvokedWithResult: (didPop, result) { + if (didPop) return; + logout(context); // Show exit confirmation dialog + }, + child: Scaffold( + backgroundColor: isDarkTheme ? Color(0xFF111111) : Colors.white, + body: Stack(children: [ + SingleChildScrollView( + child: SafeArea( + child: _isPasswordUpdated + ? _buildSuccessContent( + screenHeight, screenWidth, isDarkTheme) + : _buildPasswordForm(ref, screenHeight, screenWidth), ), - ) - ])) - ); + ), + if (isLoading) + Container( + color: Color(0x98FFFCE5), // Semi-transparent background + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Container( + margin: EdgeInsets.symmetric( + horizontal: 40), // Left & Right space + child: LinearProgressIndicator( + minHeight: 5, // Adjust thickness + backgroundColor: + Colors.grey[100], // Optional: Background color + valueColor: AlwaysStoppedAnimation( + Color(0xFFAA8E83)), // Loader color + ), + ), + ], + ), + ) + ]))); } - - Widget _buildPasswordForm( WidgetRef ref, double screenHeight, double screenWidth) { final passwordLocale = ref.watch(localeProvider); @@ -310,6 +309,7 @@ class _CreateNewPwState extends ConsumerState { final isDarkTheme = themeMode == ThemeMode.dark || (themeMode == ThemeMode.system && MediaQuery.of(context).platformBrightness == Brightness.dark); + return Form( key: _formKey, child: Padding( @@ -334,7 +334,9 @@ class _CreateNewPwState extends ConsumerState { // Icons.close, Icons.arrow_back_ios, size: 24, // Icon size - color: isDarkTheme ? Colors.white : Colors.black, // Icon color + color: isDarkTheme + ? Colors.white + : Colors.black, // Icon color ), ), ), // Left icon @@ -375,7 +377,7 @@ class _CreateNewPwState extends ConsumerState { ), fontSize: passwordLocale?.languageCode == 'ar' ? 24 : 26, fontWeight: FontWeight.w300, - color: isDarkTheme ? Colors.white : null, + color: isDarkTheme ? Colors.white : Colors.black, ), ), SizedBox(height: 10), @@ -394,7 +396,7 @@ class _CreateNewPwState extends ConsumerState { 'NotoKufi', ), fontSize: - passwordLocale?.languageCode == 'ar' ? 14 : 15, + passwordLocale?.languageCode == 'ar' ? 14 : 15, fontWeight: FontWeight.w700, color: Color(0xFF898C81)), ), @@ -407,7 +409,7 @@ class _CreateNewPwState extends ConsumerState { 'NotoKufi', ), fontSize: - passwordLocale?.languageCode == 'ar' ? 14 : 15, + passwordLocale?.languageCode == 'ar' ? 14 : 15, color: Color(0xFF898C81), fontWeight: FontWeight.w700), ), @@ -423,12 +425,13 @@ class _CreateNewPwState extends ConsumerState { hintText: AppLocalizations.of(context)!.old_password, // prefixIcon: Icon(Icons.lock, color: Colors.blue), hintStyle: TextStyle( - color: isDarkTheme ? Colors.white : Color(0xFFC3C6CB), - fontWeight: FontWeight.w400, + color: isDarkTheme ? Colors.white : Color(0xFFC3C6CB), + fontWeight: FontWeight.w400, fontFamily: context.translate( 'Roboto', 'NotoKufi', - ),), + ), + ), prefixIconConstraints: const BoxConstraints( maxWidth: 25 + 16 + 10, maxHeight: 25 + (8 * 2), @@ -439,11 +442,16 @@ class _CreateNewPwState extends ConsumerState { end: 10, ), child: Image.asset( - isDarkTheme ? MiscIconAssetPath.lockDark : MiscIconAssetPath.lockLight, + isDarkTheme + ? MiscIconAssetPath.lockDark + : MiscIconAssetPath.lockLight, fit: BoxFit.fitHeight, height: 25, width: 25, - color: isDarkTheme ? Colors.white : MyTheme.topicColor(IndicatorTopic.economy).shade300, + color: Color(0xFFB68A34), + // color: isDarkTheme + // ? Colors.white + // : MyTheme.topicColor(IndicatorTopic.economy).shade300, ), ), suffixIcon: IconButton( @@ -460,7 +468,7 @@ class _CreateNewPwState extends ConsumerState { : MiscIconAssetPath.visibleOn, color: Color( - 0xFF9EA2A9, + 0xFFB68A34, ), // Apply color if needed, but keep in mind `Image.asset` might not support color directly. width: 24, height: 24, @@ -475,8 +483,9 @@ class _CreateNewPwState extends ConsumerState { enabledBorder: OutlineInputBorder( borderRadius: BorderRadius.circular(10), borderSide: BorderSide( - color: - MyTheme.topicColor(IndicatorTopic.economy).shade400, + color: Color(0xFFB68A34), + // color: + // MyTheme.topicColor(IndicatorTopic.economy).shade400, width: 1), ), focusedBorder: OutlineInputBorder( @@ -507,12 +516,13 @@ class _CreateNewPwState extends ConsumerState { hintText: AppLocalizations.of(context)!.enter_new_password, // prefixIcon: Icon(Icons.lock, color: Colors.blue), hintStyle: TextStyle( - color: Color(0xFFC3C6CB), - fontWeight: FontWeight.w400, + color: Color(0xFFC3C6CB), + fontWeight: FontWeight.w400, fontFamily: context.translate( 'Roboto', 'NotoKufi', - ),), + ), + ), prefixIconConstraints: const BoxConstraints( maxWidth: 25 + 16 + 10, maxHeight: 25 + (8 * 2), @@ -527,7 +537,8 @@ class _CreateNewPwState extends ConsumerState { fit: BoxFit.fitHeight, height: 25, width: 25, - color: MyTheme.topicColor(IndicatorTopic.economy).shade300, + color: Color(0xFFB68A34), + // color: MyTheme.topicColor(IndicatorTopic.economy).shade300, ), ), @@ -543,9 +554,9 @@ class _CreateNewPwState extends ConsumerState { _obscureNewPassword ? MiscIconAssetPath.visibilityOff : MiscIconAssetPath.visibleOn, - - color: Color( - 0xFF9EA2A9), // Apply color if needed, but keep in mind `Image.asset` might not support color directly. + color: Color(0xFFB68A34), + // color: Color( + // 0xFF9EA2A9), // Apply color if needed, but keep in mind `Image.asset` might not support color directly. width: 24, height: 24, ), @@ -559,8 +570,9 @@ class _CreateNewPwState extends ConsumerState { enabledBorder: OutlineInputBorder( borderRadius: BorderRadius.circular(10), borderSide: BorderSide( - color: - MyTheme.topicColor(IndicatorTopic.economy).shade400, + color: Color(0xFFB68A34), + // color: + // MyTheme.topicColor(IndicatorTopic.economy).shade400, width: 1), ), focusedBorder: OutlineInputBorder( @@ -589,12 +601,13 @@ class _CreateNewPwState extends ConsumerState { // hintText: 'Confirm new password', hintText: AppLocalizations.of(context)!.confirm_new_password, hintStyle: TextStyle( - color: Color(0xFFC3C6CB), - fontWeight: FontWeight.w400, + color: Color(0xFFC3C6CB), + fontWeight: FontWeight.w400, fontFamily: context.translate( 'Roboto', 'NotoKufi', - ),), + ), + ), prefixIconConstraints: const BoxConstraints( maxWidth: 25 + 16 + 10, maxHeight: 25 + (8 * 2), @@ -609,7 +622,8 @@ class _CreateNewPwState extends ConsumerState { fit: BoxFit.fitHeight, height: 25, width: 25, - color: MyTheme.topicColor(IndicatorTopic.economy).shade300, + color: Color(0xFFB68A34), + // color: MyTheme.topicColor(IndicatorTopic.economy).shade300, ), ), @@ -625,9 +639,9 @@ class _CreateNewPwState extends ConsumerState { _obscureConfirmPassword ? MiscIconAssetPath.visibilityOff : MiscIconAssetPath.visibleOn, - - color: Color( - 0xFF9EA2A9), // Apply color if needed, but keep in mind `Image.asset` might not support color directly. + color: Color(0xFFB68A34), + // color: Color( + // 0xFF9EA2A9), // Apply color if needed, but keep in mind `Image.asset` might not support color directly. width: 24, height: 24, ), @@ -641,8 +655,9 @@ class _CreateNewPwState extends ConsumerState { enabledBorder: OutlineInputBorder( borderRadius: BorderRadius.circular(10), borderSide: BorderSide( - color: - MyTheme.topicColor(IndicatorTopic.economy).shade400, + color: Color(0xFFB68A34), + // color: + // MyTheme.topicColor(IndicatorTopic.economy).shade400, width: 1), ), focusedBorder: OutlineInputBorder( @@ -681,7 +696,8 @@ class _CreateNewPwState extends ConsumerState { } }, style: ElevatedButton.styleFrom( - backgroundColor: Colors.brown[300], + backgroundColor: Color(0xFFB68A34), + // backgroundColor: Colors.brown[300], padding: EdgeInsets.symmetric(horizontal: 80, vertical: 16), shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular(10), @@ -698,7 +714,7 @@ class _CreateNewPwState extends ConsumerState { 'NotoKufi', ), fontSize: - passwordLocale?.languageCode == 'ar' ? 14 : 18, + passwordLocale?.languageCode == 'ar' ? 14 : 18, color: Colors.white), ), SizedBox(width: 2), @@ -731,7 +747,8 @@ class _CreateNewPwState extends ConsumerState { ); } - Widget _buildSuccessContent(double screenHeight, double screenWidth) { + Widget _buildSuccessContent( + double screenHeight, double screenWidth, bool isDarkTheme) { print('IN'); return Padding( padding: EdgeInsets.all(20.0), @@ -753,7 +770,7 @@ class _CreateNewPwState extends ConsumerState { ), fontSize: 16, fontWeight: FontWeight.w500, - color: Color(0xFF414042), + color: isDarkTheme ? Colors.white : Color(0xFF414042), ), ), SizedBox(height: 20), @@ -779,7 +796,8 @@ class _CreateNewPwState extends ConsumerState { ), ), backgroundColor: WidgetStatePropertyAll( - MyTheme.topicColor(IndicatorTopic.social), + Color(0xFFB68A34), + // MyTheme.topicColor(IndicatorTopic.social), ), // surfaceTintColor: MaterialStatePropertyAll( // MyTheme.economy[800], @@ -810,7 +828,7 @@ class _CreateNewPwState extends ConsumerState { ], ), ), - SizedBox(height: screenHeight*0.25), + SizedBox(height: screenHeight * 0.25), // Spacer(), Center( // child: Container( @@ -829,4 +847,4 @@ class _CreateNewPwState extends ConsumerState { ), ); } -} +} \ No newline at end of file diff --git a/lib/presentation/Screens/auth_verification/registration.dart b/lib/presentation/Screens/auth_verification/registration.dart index 2ffb6ab2..8cd9657b 100644 --- a/lib/presentation/Screens/auth_verification/registration.dart +++ b/lib/presentation/Screens/auth_verification/registration.dart @@ -14,6 +14,7 @@ import 'package:uae_stat/infrastructure/services/img_asset_paths/banner_asset_pa import 'package:uae_stat/infrastructure/services/img_asset_paths/icons/misc_icon_asset_path.dart'; import 'package:uae_stat/presentation/Screens/profilepage.dart'; import 'package:flutter_gen/gen_l10n/app_localizations.dart'; +// import 'package:uae_stat/l10n/app_localizations.dart'; import 'package:uae_stat/presentation/components/indicators/locale_provider.dart'; import 'package:uae_stat/presentation/components/my_toggle.dart'; @@ -293,8 +294,7 @@ class _RegisterScreenState extends ConsumerState { fontFamily: context.translate( 'Roboto', 'NotoKufi', - ) - ), + )), ), content: Text( context.translate( @@ -304,8 +304,7 @@ class _RegisterScreenState extends ConsumerState { fontFamily: context.translate( 'Roboto', 'NotoKufi', - ) - ), + )), ), actions: [ TextButton( @@ -313,24 +312,28 @@ class _RegisterScreenState extends ConsumerState { Navigator.pop(context); setState(() { isRegistering = - false; // Re-enable the button after error + false; // Re-enable the button after error }); }, style: TextButton.styleFrom( backgroundColor: - Color(0xFFAA8E83), // Set background color + Color(0xFFAA8E83), // Set background color foregroundColor: Colors.white, shape: RoundedRectangleBorder( borderRadius: - BorderRadius.circular(10.0), // Set text color + BorderRadius.circular(10.0), // Set text color ), ), child: Text( context.translate('Ok', 'حسنًا'), - style: TextStyle(color: Colors.white, fontSize: 16, fontFamily: context.translate( - 'Roboto', - 'NotoKufi', - ),), + style: TextStyle( + color: Colors.white, + fontSize: 16, + fontFamily: context.translate( + 'Roboto', + 'NotoKufi', + ), + ), ), ), ], @@ -360,8 +363,6 @@ class _RegisterScreenState extends ConsumerState { } } - - @override Widget build(BuildContext context) { double screenheight = MediaQuery.of(context).size.height; @@ -415,7 +416,7 @@ class _RegisterScreenState extends ConsumerState { if (didPop) return; context.go('/login'); // Show exit confirmation dialog }, - child:Scaffold( + child: Scaffold( backgroundColor: isDarkTheme ? Color(0xFF111111) : Colors.white, body: SafeArea( child: Stack(children: [ @@ -456,13 +457,20 @@ class _RegisterScreenState extends ConsumerState { Column(children: [ registrationSuccess ? Padding( - padding: const EdgeInsets.all(20.0), + padding: const EdgeInsets.only( + top: 20.0, + left: 20.0, + right: 20.0, + bottom: 10.0), child: Column( mainAxisAlignment: MainAxisAlignment.center, children: [ SizedBox(height: screenheight / 4), - buildIconContainer( - Icons.check_circle_rounded, Color(0xFF7DAFBC)), + buildIconContainer(Icons.check_circle_rounded, + Color(0xFFB68A34) + // Color(0xFF7DAFBC) + + ), SizedBox(height: 20), Text( context.translate( @@ -476,8 +484,9 @@ class _RegisterScreenState extends ConsumerState { ), fontSize: 16, fontWeight: FontWeight.w500, - color: isDarkTheme ? Color(0xFFFFFFFF) : Color(0xFF414042) - ), + color: isDarkTheme + ? Color(0xFFFFFFFF) + : Color(0xFF414042)), ), SizedBox(height: 10), Text( @@ -491,14 +500,21 @@ class _RegisterScreenState extends ConsumerState { 'NotoKufi', ), fontSize: 14, - color: isDarkTheme ? Color(0xFFFFFFFF) : Color(0xFF898C81), + color: isDarkTheme + ? Color(0xFFFFFFFF) + : Color(0xFF898C81), ), ), SizedBox(height: 10), ElevatedButton( onPressed: () => {context.go('/login')}, style: ElevatedButton.styleFrom( - backgroundColor: isDarkTheme ? Color(0xFF24B4FB) : Color(0xFFAA8E83), // Background color + backgroundColor: Color(0xFFB68A34), + + // isDarkTheme + // ? Color(0xFF24B4FB) + // : Color( + // 0xFFAA8E83), // Background color shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular( 12), // Border radius @@ -520,14 +536,14 @@ class _RegisterScreenState extends ConsumerState { Center( child: Container( height: screenheight / 16, - width: screenwidth / 2.5, + // width: screenwidth / 2.5, decoration: BoxDecoration( image: DecorationImage( - image: AssetImage( - isDarkTheme - ? BannerAssetPath.fcscLogoDark - : BannerAssetPath.fcscLogoLight), // Background image asset - fit: BoxFit.fill, + image: AssetImage(isDarkTheme + ? BannerAssetPath.fcscLogoDark + : BannerAssetPath + .fcscLogoLight), // Background image asset + // fit: BoxFit.fill, ), ), )) @@ -556,7 +572,9 @@ class _RegisterScreenState extends ConsumerState { ), fontSize: 16, fontWeight: FontWeight.w500, - color: isDarkTheme ? Color(0xFFFFFFFF) : Color(0xFF414042)), + color: isDarkTheme + ? Color(0xFFFFFFFF) + : Color(0xFF414042)), ), SizedBox(height: 10), Text( @@ -570,7 +588,9 @@ class _RegisterScreenState extends ConsumerState { 'NotoKufi', ), fontSize: 14, - color: isDarkTheme ? Color(0xFFEEEEEE) : Color(0xFF898C81), + color: isDarkTheme + ? Color(0xFFEEEEEE) + : Color(0xFF898C81), ), ), SizedBox(height: 10), @@ -590,11 +610,15 @@ class _RegisterScreenState extends ConsumerState { context.translate( 'Retry', 'أعد المحاولة'), style: TextStyle( - fontFamily: context.translate( - 'Roboto', - 'NotoKufi', - ), - color: isDarkTheme ? Color(0xFF24B4FB) : Color(0xFFAA8E83), + fontFamily: context.translate( + 'Roboto', + 'NotoKufi', + ), + color: Color(0xFFB68A34), + + // color: isDarkTheme + // ? Color(0xFF24B4FB) + // : Color(0xFFAA8E83), ), ), ), @@ -602,14 +626,14 @@ class _RegisterScreenState extends ConsumerState { Center( child: Container( height: screenheight / 16, - width: screenwidth / 2.5, + // width: screenwidth / 2.5, decoration: BoxDecoration( image: DecorationImage( - image: AssetImage( - isDarkTheme - ? BannerAssetPath.fcscLogoDark - : BannerAssetPath.fcscLogoLight), // Background image asset - fit: BoxFit.fill, + image: AssetImage(isDarkTheme + ? BannerAssetPath.fcscLogoDark + : BannerAssetPath + .fcscLogoLight), // Background image asset + // fit: BoxFit.fill, ), ), )) @@ -620,8 +644,8 @@ class _RegisterScreenState extends ConsumerState { key: _formKey, child: SingleChildScrollView( child: Column( - mainAxisAlignment: - MainAxisAlignment.center, + // mainAxisAlignment: + // MainAxisAlignment.center, children: [ SizedBox(height: screenheight / 60), Text( @@ -629,13 +653,15 @@ class _RegisterScreenState extends ConsumerState { AppLocalizations.of(context)! .register_title, style: TextStyle( - fontFamily: context.translate( - 'Roboto', - 'NotoKufi', - ), - fontSize: 32, - fontWeight: FontWeight.w400, - color: isDarkTheme ? Color(0xFFFFFFFF) : Color(0xFF000000), + fontFamily: context.translate( + 'Roboto', + 'NotoKufi', + ), + fontSize: 32, + fontWeight: FontWeight.w400, + color: isDarkTheme + ? Color(0xFFFFFFFF) + : Color(0xFF000000), ), ), SizedBox(height: 10), @@ -649,12 +675,14 @@ class _RegisterScreenState extends ConsumerState { ), fontSize: context.translate(18.0, 14.0), - color: isDarkTheme ? Color(0xFFFFFFFF) : Color(0xFF898C81), + color: isDarkTheme + ? Color(0xFFFFFFFF) + : Color(0xFF898C81), fontWeight: FontWeight.w600, ), ), - SizedBox(height: 20), + SizedBox(height: 15), // Display this if registration is pending approval Padding( padding: const EdgeInsets.only( @@ -667,9 +695,13 @@ class _RegisterScreenState extends ConsumerState { // focusNode: _focusNodes[0], decoration: InputDecoration( filled: true, - fillColor: isDarkTheme ? const Color(0xFF000000) : Colors.white, + fillColor: isDarkTheme + ? const Color(0xFF000000) + : Colors.white, errorStyle: TextStyle( - color: isDarkTheme ? Color(0xFFFFA200) : Color(0xFFb22222), + color: isDarkTheme + ? Color(0xFFFFA200) + : Color(0xFFb22222), fontFamily: context.translate( 'Roboto', 'NotoKufi', @@ -711,7 +743,8 @@ class _RegisterScreenState extends ConsumerState { borderRadius: BorderRadius.circular(10), borderSide: BorderSide( - color: Color(0xFFB68A34), // ✅ border + color: Color( + 0xFFB68A34), // ✅ border width: 1), // Enabled border ), focusedBorder: OutlineInputBorder( @@ -743,7 +776,7 @@ class _RegisterScreenState extends ConsumerState { 'Roboto', 'NotoKufi', ), - color: const Color(0xFFC3C6CB), + color: const Color(0xFFC3C6CB), fontSize: registerLocale ?.languageCode == 'ar' @@ -770,9 +803,13 @@ class _RegisterScreenState extends ConsumerState { // focusNode: _focusNodes[1], decoration: InputDecoration( filled: true, - fillColor: isDarkTheme ? const Color(0xFF000000) : Colors.white, + fillColor: isDarkTheme + ? const Color(0xFF000000) + : Colors.white, errorStyle: TextStyle( - color: isDarkTheme ? Color(0xFFFFA200) : Color(0xFFb22222), + color: isDarkTheme + ? Color(0xFFFFA200) + : Color(0xFFb22222), fontFamily: context.translate( 'Roboto', 'NotoKufi', @@ -842,7 +879,7 @@ class _RegisterScreenState extends ConsumerState { 'Roboto', 'NotoKufi', ), - color: const Color(0xFFC3C6CB), + color: const Color(0xFFC3C6CB), fontSize: registerLocale ?.languageCode == 'ar' @@ -873,9 +910,13 @@ class _RegisterScreenState extends ConsumerState { obscureText: _obscurePassword, decoration: InputDecoration( filled: true, - fillColor: isDarkTheme ? const Color(0xFF000000) : Colors.white, + fillColor: isDarkTheme + ? const Color(0xFF000000) + : Colors.white, errorStyle: TextStyle( - color: isDarkTheme ? Color(0xFFFFA200) : Color(0xFFb22222), + color: isDarkTheme + ? Color(0xFFFFA200) + : Color(0xFFb22222), fontFamily: context.translate( 'Roboto', 'NotoKufi', @@ -977,7 +1018,7 @@ class _RegisterScreenState extends ConsumerState { 'Roboto', 'NotoKufi', ), - color: const Color(0xFFC3C6CB), + color: const Color(0xFFC3C6CB), fontSize: registerLocale ?.languageCode == 'ar' @@ -991,7 +1032,7 @@ class _RegisterScreenState extends ConsumerState { MaxLengthEnforcement.enforced, ), ), - SizedBox(height: 15), + SizedBox(height: 10), Padding( padding: const EdgeInsets.only( top: 5.0, @@ -1006,9 +1047,13 @@ class _RegisterScreenState extends ConsumerState { _obscureConfirmPassword, decoration: InputDecoration( filled: true, - fillColor: isDarkTheme ? const Color(0xFF000000) : Colors.white, + fillColor: isDarkTheme + ? const Color(0xFF000000) + : Colors.white, errorStyle: TextStyle( - color: isDarkTheme ? Color(0xFFFFA200) : Color(0xFFb22222), + color: isDarkTheme + ? Color(0xFFFFA200) + : Color(0xFFb22222), fontFamily: context.translate( 'Roboto', 'NotoKufi', @@ -1099,7 +1144,7 @@ class _RegisterScreenState extends ConsumerState { 'Roboto', 'NotoKufi', ), - color: const Color(0xFFC3C6CB), + color: const Color(0xFFC3C6CB), fontSize: registerLocale ?.languageCode == 'ar' @@ -1140,8 +1185,8 @@ class _RegisterScreenState extends ConsumerState { }, side: BorderSide( color: showError - ? Color(0xFFD83731) - : Color(0xFFB68A34), + ? Color(0xFFD83731) + : Color(0xFFB68A34), width: 1, ), ), @@ -1159,7 +1204,8 @@ class _RegisterScreenState extends ConsumerState { .agree, // text: 'I agree to ', style: TextStyle( - fontFamily: context.translate( + fontFamily: + context.translate( 'Roboto', 'NotoKufi', ), @@ -1170,7 +1216,10 @@ class _RegisterScreenState extends ConsumerState { 'ar' ? 12 : 14, - color: isDarkTheme ? Color(0xFFFFFFFF) : Color(0xFF898C81), // Change to your desired color + color: isDarkTheme + ? Color(0xFFFFFFFF) + : Color( + 0xFF898C81), // Change to your desired color ), children: [ TextSpan( @@ -1184,7 +1233,8 @@ class _RegisterScreenState extends ConsumerState { .terms_conditions, // text: 'Terms & Conditions', style: TextStyle( - fontFamily: context.translate( + fontFamily: context + .translate( 'Roboto', 'NotoKufi', ), @@ -1197,7 +1247,11 @@ class _RegisterScreenState extends ConsumerState { fontWeight: FontWeight .bold, - color:isDarkTheme ? Color(0xFFB68A35) : Color(0xFF985400), + color: isDarkTheme + ? Color( + 0xFFB68A35) + : Color( + 0xFF985400), // Makes the text bold // decoration: // TextDecoration.underline, @@ -1212,11 +1266,16 @@ class _RegisterScreenState extends ConsumerState { .of(context)! .t_and, style: TextStyle( - fontFamily: context.translate( + fontFamily: context + .translate( 'Roboto', 'NotoKufi', ), - color: isDarkTheme ? Color(0xFFFFFFFF) : Color(0xFF898C81), + color: isDarkTheme + ? Color( + 0xFFFFFFFF) + : Color( + 0xFF898C81), ), ), TextSpan( @@ -1229,7 +1288,8 @@ class _RegisterScreenState extends ConsumerState { .of(context)! .privacy_policy, style: TextStyle( - fontFamily: context.translate( + fontFamily: context + .translate( 'Roboto', 'NotoKufi', ), @@ -1242,7 +1302,11 @@ class _RegisterScreenState extends ConsumerState { 'ar' ? 12 : 14, - color: isDarkTheme ? Color(0xFFB68A35) : Color(0xFF985400), + color: isDarkTheme + ? Color( + 0xFFB68A35) + : Color( + 0xFF985400), // decoration: // TextDecoration.underline, decorationColor: @@ -1256,7 +1320,8 @@ class _RegisterScreenState extends ConsumerState { .of(context)! .conditions, style: TextStyle( - fontFamily: context.translate( + fontFamily: context + .translate( 'Roboto', 'NotoKufi', ), @@ -1267,7 +1332,11 @@ class _RegisterScreenState extends ConsumerState { 'ar' ? 12 : 14, - color: isDarkTheme ? Color(0xFFFFFFFF) : Color( 0xFF898C81), // Change to your desired color + color: isDarkTheme + ? Color( + 0xFFFFFFFF) + : Color( + 0xFF898C81), // Change to your desired color ), ), ], @@ -1300,7 +1369,8 @@ class _RegisterScreenState extends ConsumerState { context.translate( 'Required', 'مطلوب'), style: TextStyle( - fontFamily: context.translate( + fontFamily: + context.translate( 'Roboto', 'NotoKufi', ), @@ -1329,7 +1399,8 @@ class _RegisterScreenState extends ConsumerState { ? null : _registerUser, style: ElevatedButton.styleFrom( - backgroundColor: Color(0xFFB68A34), // Brownish color for Register + backgroundColor: Color( + 0xFFB68A34), // Brownish color for Register shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular(10), @@ -1344,76 +1415,8 @@ class _RegisterScreenState extends ConsumerState { context)! .register_title, style: TextStyle( - fontFamily: context.translate( - 'Roboto', - 'NotoKufi', - ), - fontSize: registerLocale - ?.languageCode == - 'ar' - ? 14 - : 16, - color: Colors.white - ), - ), - SizedBox(width: 8), - Icon( - Icons - .chevron_right_outlined, - color: Colors.white, // Set your desired color here - ) - ], - ), - ), - ), - ), - SizedBox(height: 15), - Text( - AppLocalizations.of(context)! - .account_confirmation, - style: TextStyle( - fontFamily: context.translate( - 'Roboto', - 'NotoKufi', - ), - fontWeight: FontWeight.w500, - fontSize: - registerLocale?.languageCode == - 'ar' - ? 12 - : 14, - color: isDarkTheme ? Color(0xFFFFFFFF) : Color(0xFF898C81), - ), - ), - SizedBox(height: 15), - Padding( - padding: const EdgeInsets.only( - top: 5.0, - bottom: 10, - left: 30, - right: 30), - child: SizedBox( - width: screenwidth / 1, - child: ElevatedButton( - onPressed: () { - context.pop(); - }, - style: ElevatedButton.styleFrom( - backgroundColor: Color(0xFFB68A34), // Blueish color for Login - shape: RoundedRectangleBorder( - borderRadius: - BorderRadius.circular(10), - ), - ), - child: Row( - mainAxisSize: MainAxisSize.min, - children: [ - Text( - AppLocalizations.of( - context)! - .login_title, - style: TextStyle( - fontFamily: context.translate( + fontFamily: + context.translate( 'Roboto', 'NotoKufi', ), @@ -1428,17 +1431,94 @@ class _RegisterScreenState extends ConsumerState { Icon( Icons .chevron_right_outlined, - color: Colors.white, // Set your desired color here + color: Colors + .white, // Set your desired color here ) ], ), ), ), ), + SizedBox(height: 5), + Text( + AppLocalizations.of(context)! + .account_confirmation, + style: TextStyle( + fontFamily: context.translate( + 'Roboto', + 'NotoKufi', + ), + fontWeight: FontWeight.w500, + fontSize: + registerLocale?.languageCode == + 'ar' + ? 12 + : 14, + color: isDarkTheme + ? Color(0xFFFFFFFF) + : Color(0xFF898C81), + ), + ), + SizedBox(height: 5), + Padding( + padding: const EdgeInsets.only( + top: 5.0, + bottom: 10, + left: 30, + right: 30), + child: SizedBox( + width: screenwidth / 1, + child: ElevatedButton( + onPressed: () { + context.pop(); + }, + style: ElevatedButton.styleFrom( + backgroundColor: Color( + 0xFFB68A34), // Blueish color for Login + shape: RoundedRectangleBorder( + borderRadius: + BorderRadius.circular(10), + ), + ), + child: Row( + mainAxisSize: MainAxisSize.min, + children: [ + Text( + AppLocalizations.of( + context)! + .login_title, + style: TextStyle( + fontFamily: + context.translate( + 'Roboto', + 'NotoKufi', + ), + fontSize: registerLocale + ?.languageCode == + 'ar' + ? 14 + : 16, + color: Colors.white), + ), + SizedBox(width: 8), + Icon( + Icons + .chevron_right_outlined, + color: Colors + .white, // Set your desired color here + ) + ], + ), + ), + ), + ), + // Spacer(), + SizedBox( height: 10, ), - Center( + Padding( + padding: const EdgeInsets.all(20.0), // child: Container( // height: screenheight / 16, // width: screenwidth / 3, @@ -1452,9 +1532,9 @@ class _RegisterScreenState extends ConsumerState { // ) child: fcscBanner, ), - SizedBox( - height: 20, - ), + // SizedBox( + // height: 5, + // ), ], ), ), @@ -1491,4 +1571,4 @@ class _RegisterScreenState extends ConsumerState { )), ); } -} +} \ No newline at end of file diff --git a/lib/presentation/Screens/profilepage.dart b/lib/presentation/Screens/profilepage.dart index 97cd1f2b..6b715c4b 100644 --- a/lib/presentation/Screens/profilepage.dart +++ b/lib/presentation/Screens/profilepage.dart @@ -5,6 +5,7 @@ import 'package:external_repos/external_repos.dart'; import 'package:flutter/gestures.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; +import 'package:flutter_hooks/flutter_hooks.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:go_router/go_router.dart'; import 'package:http/http.dart' as http; @@ -23,7 +24,7 @@ import 'package:uae_stat/presentation/components/indicators/locale_provider.dart import 'package:uae_stat/presentation/components/my_toggle.dart'; import 'package:uae_stat/presentation/routes/bottom_bar_routes/tab_routes/home_route.dart'; import 'package:flutter_gen/gen_l10n/app_localizations.dart'; - +// import 'package:uae_stat/l10n/app_localizations.dart'; import '../components/my_bottom_nav_bar.dart'; import 'auth_verification/changepassword.dart'; import 'demo_home.dart'; @@ -71,14 +72,17 @@ class _ProfileScreenState extends ConsumerState { // Date format for the display final DateFormat _dateFormat = DateFormat('yyyy-MM-dd'); - final List _countries = [ - 'United Arab Emirates', - 'United States', - 'India', - 'Canada' - ]; + // final List _countries = [ + // 'United Arab Emirates', + // 'United States', + // 'India', + // 'Canada' + // ]; final List preferred_language = ['English', 'Arabic']; - String? _selectedCountry; + // String? _selectedCountry; + ISOCountry? _selectedCountry; + String? preferredLang; + String? _selectedLanguage; bool isChecked = false; bool showError = false; @@ -98,6 +102,8 @@ class _ProfileScreenState extends ConsumerState { super.initState(); // print(widget.userId); + _selectedCountry ??= ISOCountry.numeric784; + final themeMode = ref.read(themeProvider); isDarkTheme = themeMode == ThemeMode.dark || (themeMode == ThemeMode.system && @@ -198,10 +204,10 @@ class _ProfileScreenState extends ConsumerState { _isLoading = true; // Start loading }); final XFile? pickedFile = - await _picker.pickImage(source: ImageSource.gallery); + await _picker.pickImage(source: ImageSource.gallery); if (pickedFile != null) { final String fileExtension = - pickedFile.path.split('.').last.toLowerCase(); + pickedFile.path.split('.').last.toLowerCase(); if (fileExtension == 'jpg' || fileExtension == 'jpeg' || fileExtension == 'png' || @@ -212,13 +218,15 @@ class _ProfileScreenState extends ConsumerState { }); } else { ScaffoldMessenger.of(context).showSnackBar( - SnackBar(content: Text('Please select a JPG, JPEG, or PNG file.', - style: TextStyle( - fontFamily: context.translate( - 'Roboto', - 'NotoKufi', - ) - ),)), + SnackBar( + content: Text( + 'Please select a JPG, JPEG, or PNG file.', + style: TextStyle( + fontFamily: context.translate( + 'Roboto', + 'NotoKufi', + )), + )), ); } } @@ -245,7 +253,7 @@ class _ProfileScreenState extends ConsumerState { return Theme( data: Theme.of(context).copyWith( dialogBackgroundColor: - Colors.white, // Background color of the date picker + Colors.white, // Background color of the date picker textButtonTheme: TextButtonThemeData( style: ButtonStyle( shape: WidgetStateProperty.all(RoundedRectangleBorder( @@ -336,8 +344,13 @@ class _ProfileScreenState extends ConsumerState { // String username = 'users55538'; // String email = 'surendarsuri30@gmail.com'; String dateOfBirth = _dateController.text; // in DD/MM/YYYY format - String countryRegion = _selectedCountry ?? ''; - String preferredLang = _selectedLanguage == 'English' ? 'en' : 'ar'; + // String countryRegion = _selectedCountry ?? ''; + String countryRegion = context.translate( + _selectedCountry?.nameEN ?? '', + _selectedCountry?.nameAR ?? '', + ); + + preferredLang = _selectedLanguage == 'English' ? 'en' : 'ar'; bool termsAccepted = isChecked; // Parse the date from dd/MM/yyyy format and convert to yyyy-MM-dd @@ -347,14 +360,14 @@ class _ProfileScreenState extends ConsumerState { // Create a multipart request final uri = - Uri.parse('${_pb.baseUrl}/api/collections/users/records/$userID'); + Uri.parse('${_pb.baseUrl}/api/collections/users/records/$userID'); final request = http.MultipartRequest('PATCH', uri); // Add other fields request.fields['full_name'] = fullName; request.fields['dob'] = formattedDob; request.fields['country_region'] = countryRegion; - request.fields['language'] = preferredLang; + request.fields['language'] = preferredLang!; request.fields['is_profile_completed'] = 'True'; // Add the file, if available @@ -371,14 +384,15 @@ class _ProfileScreenState extends ConsumerState { // Send the request final response = await request.send(); print(response); - ScaffoldMessenger.of(context).showSnackBar( - SnackBar(content: Text(AppLocalizations.of(context)!.profile_updated_successfully, - style: TextStyle( - fontFamily: context.translate( - 'Roboto', - 'NotoKufi', - ) - ),))); + ScaffoldMessenger.of(context).showSnackBar(SnackBar( + content: Text( + AppLocalizations.of(context)!.profile_updated_successfully, + style: TextStyle( + fontFamily: context.translate( + 'Roboto', + 'NotoKufi', + )), + ))); // **Set Default Locale in Provider** print('_selectedLanguage $_selectedLanguage'); preferredLang = _selectedLanguage == 'English' ? 'en' : 'ar'; @@ -397,12 +411,17 @@ class _ProfileScreenState extends ConsumerState { context.go('/welcomePage'); } catch (error) { ScaffoldMessenger.of(context).showSnackBar( - SnackBar(content: Text(context.translate("Failed to update profile: $error",'$error فشل في تحديث الملف الشخصي: '),style: TextStyle( - fontFamily: context.translate( - 'Roboto', - 'NotoKufi', - ) - ),)),); + SnackBar( + content: Text( + context.translate("Failed to update profile: $error", + '$error فشل في تحديث الملف الشخصي: '), + style: TextStyle( + fontFamily: context.translate( + 'Roboto', + 'NotoKufi', + )), + )), + ); } } } @@ -444,21 +463,27 @@ class _ProfileScreenState extends ConsumerState { 'Logout', 'تسجيل الخروج', ), - style: - TextStyle(color: Color(0xFF898C81), fontWeight: FontWeight.w700,fontFamily: context.translate( - 'Roboto', - 'NotoKufi', - ),), + style: TextStyle( + color: Color(0xFF898C81), + fontWeight: FontWeight.w700, + fontFamily: context.translate( + 'Roboto', + 'NotoKufi', + ), + ), ), content: Text( context.translate( 'Are you sure you want to logout?', 'هل أنت متأكد أنك تريد تسجيل الخروج؟', ), - style: TextStyle(color: Color(0xFF898C81),fontFamily: context.translate( - 'Roboto', - 'NotoKufi', - ),), + style: TextStyle( + color: Color(0xFF898C81), + fontFamily: context.translate( + 'Roboto', + 'NotoKufi', + ), + ), ), actions: [ TextButton( @@ -477,10 +502,11 @@ class _ProfileScreenState extends ConsumerState { 'إلغاء', ), style: TextStyle( - color: Color(0xFFAA8E83),fontFamily: context.translate( - 'Roboto', - 'NotoKufi', - ), // Text color + color: Color(0xFFAA8E83), + fontFamily: context.translate( + 'Roboto', + 'NotoKufi', + ), // Text color ), ), ), @@ -499,10 +525,11 @@ class _ProfileScreenState extends ConsumerState { 'تسجيل الخروج', ), style: TextStyle( - color: Colors.white, fontFamily: context.translate( - 'Roboto', - 'NotoKufi', - ),// Text color + color: Colors.white, + fontFamily: context.translate( + 'Roboto', + 'NotoKufi', + ), // Text color ), ), ), @@ -528,6 +555,15 @@ class _ProfileScreenState extends ConsumerState { (themeMode == ThemeMode.system && MediaQuery.of(context).platformBrightness == Brightness.dark); + final searchTerm = ''; + + final _countries = ISOCountry.values.where((country) { + final query = searchTerm.trim().toLowerCase(); + if (query.isEmpty) return true; // 🔥 show all if search is empty + return country.nameEN.toLowerCase().contains(query) || + country.nameAR.toLowerCase().contains(query); + }).toList(); + return PopScope( canPop: false, // Allow back navigation only if not login screen onPopInvokedWithResult: (didPop, result) { @@ -541,16 +577,23 @@ class _ProfileScreenState extends ConsumerState { elevation: 0, leading: IconButton( icon: Icon(Icons.arrow_back_ios_new, color: Colors.black), - onPressed: () { - context.go('/'); + onPressed: () async { + final prefs = await SharedPreferences.getInstance(); + await _authRepo.logout(); + prefs.clear(); + context.go('/login'); + // context.go('/'); }, ), title: Text( AppLocalizations.of(context)!.my_profile, - style: TextStyle(color: Color(0xFF985400),fontFamily: context.translate( - 'Roboto', - 'NotoKufi', - ),), + style: TextStyle( + color: Color(0xFF985400), + fontFamily: context.translate( + 'Roboto', + 'NotoKufi', + ), + ), ), actions: [ Consumer( @@ -633,7 +676,7 @@ class _ProfileScreenState extends ConsumerState { backgroundImage: _profileImage != null ? FileImage(_profileImage!) : AssetImage("assets/edit_profile/profile.png") - as ImageProvider, + as ImageProvider, child: Align( alignment: Alignment.bottomRight, child: GestureDetector( @@ -657,7 +700,7 @@ class _ProfileScreenState extends ConsumerState { child: CircularProgressIndicator( strokeWidth: 2, valueColor: - AlwaysStoppedAnimation(Colors.grey), + AlwaysStoppedAnimation(Colors.grey), ), ), ], @@ -745,10 +788,13 @@ class _ProfileScreenState extends ConsumerState { Text( AppLocalizations.of(context)!.full_name, style: TextStyle( - fontSize: 16, fontWeight: FontWeight.w500,fontFamily: context.translate( - 'Roboto', - 'NotoKufi', - ),), + fontSize: 16, + fontWeight: FontWeight.w500, + fontFamily: context.translate( + 'Roboto', + 'NotoKufi', + ), + ), ), ], ), @@ -776,8 +822,11 @@ class _ProfileScreenState extends ConsumerState { enabledBorder: OutlineInputBorder( borderRadius: BorderRadius.circular(10), borderSide: BorderSide( - color: isDarkTheme ? Colors.white : MyTheme.topicColor(IndicatorTopic.economy) - .shade400, + color: Color(0xFFB68A34), + // color: isDarkTheme + // ? Colors.white + // : MyTheme.topicColor(IndicatorTopic.economy) + // .shade400, width: 1), // Enabled border ), hintText: _showHints[2] ? 'Enter the name' : null, @@ -791,7 +840,9 @@ class _ProfileScreenState extends ConsumerState { ), border: OutlineInputBorder( borderSide: BorderSide( - color: isDarkTheme ? Colors.white : Color(0xFF7296BE), + color: Color(0xFFB68A34), + // color: + // isDarkTheme ? Colors.white : Color(0xFF7296BE), ), borderRadius: BorderRadius.circular(8), ), @@ -807,12 +858,13 @@ class _ProfileScreenState extends ConsumerState { Text( AppLocalizations.of(context)!.dob, style: TextStyle( - fontFamily: context.translate( - 'Roboto', - 'NotoKufi', - ), - fontSize: 16, fontWeight: FontWeight.w500, - color:isDarkTheme ? Colors.white : null, + fontFamily: context.translate( + 'Roboto', + 'NotoKufi', + ), + fontSize: 16, + fontWeight: FontWeight.w500, + color: isDarkTheme ? Colors.white : null, ), ), ], @@ -828,14 +880,19 @@ class _ProfileScreenState extends ConsumerState { enabledBorder: OutlineInputBorder( borderRadius: BorderRadius.circular(10), borderSide: BorderSide( - color:isDarkTheme ? Colors.white : - MyTheme.topicColor(IndicatorTopic.economy) - .shade400, + color: Color(0xFFB68A34), + // color: isDarkTheme + // ? Colors.white + // : MyTheme.topicColor(IndicatorTopic.economy) + // .shade400, width: 1), // Enabled border ), border: OutlineInputBorder( borderSide: BorderSide( - color:isDarkTheme ? Colors.white : Color(0xFF7296BE), + color: Color(0xFFB68A34), + // color: isDarkTheme + // ? Colors.white + // : Color(0xFF7296BE), ), borderRadius: BorderRadius.circular(8), ), @@ -846,7 +903,9 @@ class _ProfileScreenState extends ConsumerState { 'Roboto', 'NotoKufi', ), - color: isDarkTheme ? Colors.white : Color(0xFFC3C6CB), + color: + isDarkTheme ? Colors.white : Color(0xFFC3C6CB), + // color: Color(0xFFB68A34), fontSize: 14, ), @@ -854,11 +913,11 @@ class _ProfileScreenState extends ConsumerState { width: 45, padding: EdgeInsets.only(right: 1), alignment: - Alignment.center, // Center the icon vertically + Alignment.center, // Center the icon vertically child: Icon( Icons.keyboard_arrow_down_sharp, color: - _isHoveringDate ? Colors.black : Colors.grey, + _isHoveringDate ? Colors.black : Colors.grey, ), ), ), @@ -878,9 +937,9 @@ class _ProfileScreenState extends ConsumerState { 'Roboto', 'NotoKufi', ), - fontSize: 16, fontWeight: FontWeight.w500, - color: isDarkTheme ? Colors.white : null - ), + fontSize: 16, + fontWeight: FontWeight.w500, + color: isDarkTheme ? Colors.white : null), ), ], ), @@ -890,20 +949,26 @@ class _ProfileScreenState extends ConsumerState { setState(() => _isHoveringDropdown = true), onExit: (_) => setState(() => _isHoveringDropdown = false), - child: DropdownButtonFormField( + + child: DropdownButtonFormField( + isExpanded: true, value: _selectedCountry, decoration: InputDecoration( enabledBorder: OutlineInputBorder( borderRadius: BorderRadius.circular(10), borderSide: BorderSide( - color: isDarkTheme ? Colors.white : - MyTheme.topicColor(IndicatorTopic.economy) - .shade400, + color: Color(0xFFB68A34), + // color: Colors.red, + // : MyTheme.topicColor( + // IndicatorTopic.economy).shade400, width: 1), // Enabled border ), border: OutlineInputBorder( borderSide: BorderSide( - color: isDarkTheme ? Colors.white : Color(0xFF7296BE), + color: Color(0xFFB68A34), + // color: isDarkTheme + // ? Colors.white + // : Color(0xFF7296BE), ), borderRadius: BorderRadius.circular(8), ), @@ -913,25 +978,90 @@ class _ProfileScreenState extends ConsumerState { ? Colors.black : Colors.grey), items: _countries - .map((item) => DropdownMenuItem( - value: item, - child: Text(item, - style: TextStyle( - fontFamily: context.translate( - 'Roboto', - 'NotoKufi', - ), - color: isDarkTheme ? Colors.white : null, - ),), - )) + .map((item) => DropdownMenuItem( + value: item, + child: SizedBox( + width: double.infinity, + child: Text( + // item.nameEN, + context.translate( + item.nameEN, item.nameAR), + overflow: TextOverflow.ellipsis, + maxLines: 1, + style: TextStyle( + fontFamily: context.translate( + 'Roboto', + 'NotoKufi', + ), + // color: Colors.red + color: + isDarkTheme ? Colors.white : null, + ), + ), + ), + )) .toList(), - onChanged: (String? newValue) { + onChanged: (ISOCountry? newValue) { setState(() { _selectedCountry = newValue; }); }, - validator: _validateDropdown, + validator: (value) { + if (value == null) + return context.translate( + 'Please select a country', 'يرجى اختيار دولة'); + return null; + }, ), + + //Available Default Four Countries + // child: DropdownButtonFormField( + // value: _selectedCountry, + // decoration: InputDecoration( + // enabledBorder: OutlineInputBorder( + // borderRadius: BorderRadius.circular(10), + // borderSide: BorderSide( + // color: Color(0xFFB68A34), + // // : MyTheme.topicColor( + // // IndicatorTopic.economy).shade400, + // width: 1), // Enabled border + // ), + // border: OutlineInputBorder( + // borderSide: BorderSide( + // color: Color(0xFFB68A34), + // // color: isDarkTheme + // // ? Colors.white + // // : Color(0xFF7296BE), + // ), + // borderRadius: BorderRadius.circular(8), + // ), + // labelText: context.translate('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', + // ), + // color: isDarkTheme ? Colors.white : null, + // ), + // ), + // )) + // .toList(), + // onChanged: (String? newValue) { + // setState(() { + // _selectedCountry = newValue; + // }); + // }, + // validator: _validateDropdown, + // ), ), SizedBox(height: 10), Row( @@ -940,12 +1070,13 @@ class _ProfileScreenState extends ConsumerState { Text( AppLocalizations.of(context)!.preferredLang, style: TextStyle( - fontFamily: context.translate( - 'Roboto', - 'NotoKufi', - ), - fontSize: 16, fontWeight: FontWeight.w500, - color: isDarkTheme ? Colors.white : null, + fontFamily: context.translate( + 'Roboto', + 'NotoKufi', + ), + fontSize: 16, + fontWeight: FontWeight.w500, + color: isDarkTheme ? Colors.white : null, ), ), ], @@ -962,14 +1093,18 @@ class _ProfileScreenState extends ConsumerState { enabledBorder: OutlineInputBorder( borderRadius: BorderRadius.circular(10), borderSide: BorderSide( - color: isDarkTheme ? Colors.white : - MyTheme.topicColor(IndicatorTopic.economy) - .shade400, + color: Color(0xFFB68A34), + // : MyTheme.topicColor( + // IndicatorTopic.economy) + // .shade400, width: 1), // Enabled border ), border: OutlineInputBorder( borderSide: BorderSide( - color: isDarkTheme ? Colors.white : Color(0xFF7296BE), + color: Color(0xFFB68A34), + // color: isDarkTheme + // ? Colors.white + // : Color(0xFF7296BE), ), borderRadius: BorderRadius.circular(8), ), @@ -980,16 +1115,18 @@ class _ProfileScreenState extends ConsumerState { : Colors.grey), items: preferred_language .map((item) => DropdownMenuItem( - value: item, - child: Text(item, - style: TextStyle( - fontFamily: context.translate( - 'Roboto', - 'NotoKufi', - ), - color: isDarkTheme ? Colors.white : null, - ),), - )) + value: item, + child: Text( + item, + style: TextStyle( + fontFamily: context.translate( + 'Roboto', + 'NotoKufi', + ), + color: isDarkTheme ? Colors.white : null, + ), + ), + )) .toList(), onChanged: (String? newValue) { setState(() { @@ -1012,9 +1149,14 @@ class _ProfileScreenState extends ConsumerState { }, side: BorderSide( color: showError - ? isDarkTheme ? Color(0xFFFFA200) : Color(0xFFb22222) - : isDarkTheme ? Colors.white : Color(0xFF7296BE), + ? isDarkTheme + ? Color(0xFFB68A34) + : Color(0xFFb22222) + : Color(0xFFB68A34), + // : isDarkTheme + // ? Colors.white + // : Color(0xFF7296BE), width: 1, ), ), @@ -1034,7 +1176,10 @@ class _ProfileScreenState extends ConsumerState { ), fontWeight: FontWeight.w500, fontSize: 14, - color: isDarkTheme ? Colors.white : Color(0xFF898C81), // Change to your desired color + color: isDarkTheme + ? Colors.white + : Color( + 0xFF898C81), // Change to your desired color ), children: [ TextSpan( @@ -1051,11 +1196,16 @@ class _ProfileScreenState extends ConsumerState { ), fontSize: 14, fontWeight: FontWeight.bold, - color: isDarkTheme ? Color(0xFF9EB3E4) : Color(0xFF985400), + color: Color(0xFFB68A34), + + // color: isDarkTheme + // ? Color(0xFF9EB3E4) + // : Color(0xFF985400), // Makes the text bold // decoration: // TextDecoration.underline, - decorationColor: Color(0xFF985400), + decorationColor: Color(0xFFB68A34), + // decorationColor: Color(0xFF985400), decorationThickness: 1), ), TextSpan( @@ -1065,7 +1215,9 @@ class _ProfileScreenState extends ConsumerState { 'Roboto', 'NotoKufi', ), - color: isDarkTheme ? Colors.white : Color( + color: isDarkTheme + ? Colors.white + : Color( 0xFF898C81), // Change to your desired color ), ), @@ -1082,10 +1234,14 @@ class _ProfileScreenState extends ConsumerState { 'Roboto', 'NotoKufi', ), - color: isDarkTheme ? Color(0xFF9EB3E4) : Color(0xFF985400), + color: Color(0xFFB68A34), + + // color: isDarkTheme + // ? Color(0xFF9EB3E4) + // : Color(0xFF985400), // decoration: // TextDecoration.underline, - decorationColor: Color(0xFF648CBA), + decorationColor: Color(0xFFB68A34), decorationThickness: 1), ), TextSpan( @@ -1098,7 +1254,9 @@ class _ProfileScreenState extends ConsumerState { ), fontWeight: FontWeight.w500, fontSize: 14, - color: isDarkTheme ? Colors.white : Color( + color: isDarkTheme + ? Colors.white + : Color( 0xFF898C81), // Change to your desired color ), ), @@ -1147,7 +1305,10 @@ class _ProfileScreenState extends ConsumerState { AppLocalizations.of(context)!.change_password, style: TextStyle( // color: Color(0xFF648CBA), - color: isDarkTheme ? Color(0xFF9EB3E4) : Color(0xFF985400), + color: Color(0xFFB68A34), + // color: isDarkTheme + // ? Color(0xFF9EB3E4) + // : Color(0xFF985400), fontSize: 14, fontWeight: FontWeight.w700, fontFamily: context.translate( @@ -1173,12 +1334,15 @@ class _ProfileScreenState extends ConsumerState { } else { setState(() { showError = - !isChecked; // Show error if the checkbox is not checked + !isChecked; // Show error if the checkbox is not checked }); } }, style: ElevatedButton.styleFrom( - backgroundColor: isDarkTheme ? Color(0xFF7296BE) :Color(0xFF92722A), + backgroundColor: Color(0xFFB68A34), + + // backgroundColor: + // isDarkTheme ? Color(0xFF7296BE) : Color(0xFF92722A), minimumSize: Size(double.infinity, 50), shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular(8), @@ -1186,14 +1350,17 @@ class _ProfileScreenState extends ConsumerState { ), child: Row( mainAxisAlignment: - MainAxisAlignment.center, // Center the content + MainAxisAlignment.center, // Center the content children: [ Text( AppLocalizations.of(context)!.save, - style: TextStyle(color: Colors.white,fontFamily: context.translate( - 'Roboto', - 'NotoKufi', - ),), + style: TextStyle( + color: Colors.white, + fontFamily: context.translate( + 'Roboto', + 'NotoKufi', + ), + ), ), SizedBox(width: 8), // Add space between text and icon Image.asset( @@ -1258,35 +1425,36 @@ class ConfirmationDialog extends ConsumerWidget { children: [ TextSpan( text: AppLocalizations.of(context)!.name, - style: - TextStyle(fontWeight: FontWeight.w700,fontFamily: context.translate( - 'Roboto', - 'NotoKufi', - ),color: isDarkTheme ? Colors.white : null), // Bold for "name" - ), - TextSpan( - text: context.translate(' or ', 'أو'), - style: TextStyle( - color: isDarkTheme ? Colors.white : null, - ) - ), - TextSpan( - text: AppLocalizations.of(context)!.dob, style: TextStyle( + fontWeight: FontWeight.w700, fontFamily: context.translate( 'Roboto', 'NotoKufi', ), - fontWeight: FontWeight.w700, - color: isDarkTheme ? Colors.white : null, + color: + isDarkTheme ? Colors.white : null), // Bold for "name" + ), + TextSpan( + text: context.translate(' or ', 'أو'), + style: TextStyle( + color: isDarkTheme ? Colors.white : null, + )), + TextSpan( + text: AppLocalizations.of(context)!.dob, + style: TextStyle( + fontFamily: context.translate( + 'Roboto', + 'NotoKufi', + ), + fontWeight: FontWeight.w700, + color: isDarkTheme ? Colors.white : null, ), // Bold for "date of birth" ), TextSpan( - text: ".", - style: TextStyle( - color: isDarkTheme ? Colors.white : null, - ) - ), + text: ".", + style: TextStyle( + color: isDarkTheme ? Colors.white : null, + )), ], ), textAlign: TextAlign.center, @@ -1309,23 +1477,36 @@ class ConfirmationDialog extends ConsumerWidget { Navigator.of(context).pop(false); }, style: OutlinedButton.styleFrom( - side: BorderSide(color: isDarkTheme ? Color(0xFF7296BE) : Color(0xFF92722A)), + side: BorderSide(color: Color(0xFFB68A34) + // color: + // isDarkTheme ? Color(0xFF7296BE) : Color(0xFF92722A) + // + + ), shape: RoundedRectangleBorder( borderRadius: BorderRadius.all(Radius.circular(7)), ), // Set the border color here ), child: Text( "Cancel", - style: TextStyle(color: isDarkTheme ? Color(0xFF7296BE) : Color(0xFF92722A),fontFamily: context.translate( - 'Roboto', - 'NotoKufi', - ),), + style: TextStyle( + color: Color(0xFFB68A34), + // color: isDarkTheme ? Color(0xFF7296BE) : Color(0xFF92722A), + fontFamily: context.translate( + 'Roboto', + 'NotoKufi', + ), + ), ), ), ElevatedButton( onPressed: () => Navigator.of(context).pop(true), style: ElevatedButton.styleFrom( - backgroundColor: isDarkTheme ? Color(0xFF7296BE) : Color(0xFF92722A), // Brown color + backgroundColor: Color(0xFFB68A34), + + // backgroundColor: isDarkTheme + // ? Color(0xFF7296BE) + // : Color(0xFF92722A), // Brown color foregroundColor: Colors.white, shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular(8), @@ -1351,4 +1532,4 @@ class ConfirmationDialog extends ConsumerWidget { ], ); } -} +} \ No newline at end of file diff --git a/lib/presentation/components/dialogs.dart b/lib/presentation/components/dialogs.dart index 198466b9..328c0d48 100644 --- a/lib/presentation/components/dialogs.dart +++ b/lib/presentation/components/dialogs.dart @@ -40,12 +40,12 @@ extension Dialogs on BuildContext { /// If [errorDialogBuilder] is provided, an /// [showLogBtn] is also true exception is thrown; Future loaderWithErrorDialog( - FutureOr Function() computation, { - Future Function( - Object error, [ - StackTrace stackTrace, - ])? errorDialogBuilder, - }) async { + FutureOr Function() computation, { + Future Function( + Object error, [ + StackTrace stackTrace, + ])? errorDialogBuilder, + }) async { final loaderContext = await _pushLoaderDialog(); late final T value; try { @@ -100,20 +100,17 @@ 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( - content, - style: TextStyle(color: Color(0xFF898C81)) - ), - ) + child: Text(content, + style: TextStyle(color: Color(0xFF898C81))), + ) : Text( content, - style: TextStyle(color:Color(0xFF898C81)), // Set content text color + style: TextStyle( + color: Color(0xFF898C81)), // Set content text color ), actions: [ TextButton( @@ -122,11 +119,12 @@ extension Dialogs on BuildContext { rootNavigator: true, ).pop, style: TextButton.styleFrom( - backgroundColor: Color(0xFFAA8E83), // Background color + // backgroundColor: Color(0xFFAA8E83), // Background color + backgroundColor: Color(0xFFB68A34), // Background color foregroundColor: Colors.white, // Font (text) color side: BorderSide( - // color: Color(0xFF92722A)), // Border outline color - color: Color(0xFFAA8E83)), // Border outline color + // color: Color(0xFF92722A)), // Border outline color + color: Color(0xFFB68A34)), // Border outline color shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular(8), // Optional: Rounded corners @@ -154,11 +152,11 @@ extension Dialogs on BuildContext { ); Future confirmationDialog( - String titleText, - String contentText, { - String cancelText = 'Cancel', - String confirmText = 'Confirm', - }) => + String titleText, + String contentText, { + String cancelText = 'Cancel', + String confirmText = 'Confirm', + }) => showDialog( context: this, barrierDismissible: false, diff --git a/lib/presentation/routes/auth_routes/login_route.dart b/lib/presentation/routes/auth_routes/login_route.dart index d5fa9185..2e4bb8d5 100644 --- a/lib/presentation/routes/auth_routes/login_route.dart +++ b/lib/presentation/routes/auth_routes/login_route.dart @@ -10,6 +10,7 @@ import 'package:flutter_hooks/flutter_hooks.dart'; import 'package:flutter_secure_storage/flutter_secure_storage.dart'; import 'package:go_router/go_router.dart'; import 'package:hooks_riverpod/hooks_riverpod.dart'; +import 'package:jwt_decoder/jwt_decoder.dart'; import 'package:shared_preferences/shared_preferences.dart'; import 'package:the_validator/the_validator.dart'; import 'package:uae_stat/config/app_links_helper.dart'; @@ -18,8 +19,10 @@ 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/entities/session_entity.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/data/p_auth_repo.dart'; import 'package:uae_stat/infrastructure/services/img_asset_paths/banner_asset_path.dart'; import 'package:uae_stat/infrastructure/services/img_asset_paths/icons/misc_icon_asset_path.dart'; import 'package:uae_stat/presentation/Screens/demo_home.dart'; @@ -30,6 +33,7 @@ import 'package:uae_stat/presentation/components/space.dart'; import 'package:uae_stat/presentation/components/themed_text_field.dart'; import 'package:uae_stat/presentation/routes/bottom_bar_routes/tab_routes/home_route.dart'; import 'package:http/http.dart' as http; +import 'package:url_launcher/url_launcher.dart'; import '../../Screens/auth_verification/registration.dart'; import 'package:pocketbase/pocketbase.dart'; import 'package:flutter_gen/gen_l10n/app_localizations.dart'; @@ -325,6 +329,175 @@ class LoginRoute extends HookConsumerWidget { print('themeMode $themeMode'); } + Future googleLogin(BuildContext context, WidgetRef ref,platform) async { + print(platform); + try { + final authData = + await pb.collection('users').authWithOAuth2(platform, (url) async { + await launchUrl(url); + }); + print(authData); + // ✅ Check if authData is valid + if (authData.token.isNotEmpty && authData.record != null) { + print("✅ Login Successful"); + print(authData.record); + + final userDetails = authData.record; + final userId = userDetails?.id; + final email = userDetails?.data['email'] ?? ''; + final isProfileComplete = + userDetails?.data['is_profile_completed'] ?? ''; + final loginCount = userDetails?.data['login_count'] ?? ''; + + print("User ID: ${userId}"); + print("Email: ${email}"); + print("Email: ${isProfileComplete}"); + print("Email: ${loginCount}"); + + await saveUserId(userId!, loginCount); + // await getDeviceToken(context, id); + await initializeTheme(context, ref, userId); + + final session = await context.loaderWithErrorDialog( + () => ref + .read( + authUseCaseProvider.notifier, + ) + .googleAndAppleAuthencation(authData), + errorDialogBuilder: ( + error, [ + StackTrace? stackTrace, + ]) { + if (error == LoginError.invalidEmailPw) { + return context.simpleDialog( + title: context.translate( + 'Incorrect Credentials', + 'أوراق غير صحيحة', + ), + content: context.translate( + 'Your email or password is invalid. Please try again.', + 'بريدك الإلكتروني أو كلمة المرور غير صالحة. حاول مرة اخرى.', + ), + ); + } + return context.simpleDialog(); + }, + ); + + print("sessionTST - $session"); + + // final se = _sessionEntityFromPocketbaseRecord(authData); + // await _LocalAuthRepo.storeLocally(se); + + // Extract intendedPath from query parameters (if coming from redirect) + final String? intendedPath = + GoRouterState.of(context).uri.queryParameters['intendedPath']; + print("Extracted intendedPath after login: $intendedPath"); + + if (isProfileComplete) { + print('Redirecting to Home / Intended Path'); + // **Set Default Locale in Provider** + if (preferredLanguage == 'ar') { + ref.read(localeProvider.notifier).setLocale(const Locale('ar')); + } else { + ref.read(localeProvider.notifier).setLocale(const Locale('en')); + } + + context.go(intendedPath ?? '/myhomepage'); + } else { + print('Redirecting to Profile Setup'); + + context.go('/profile/$userId'); + } + } else { + print("❌ Login failed: Invalid authData"); + } + } catch (e) { + print("❌ Error during Google login: $e"); + ScaffoldMessenger.of(context).showSnackBar( + SnackBar(content: Text("Login failed. Please try again.")), + ); + } + } + + // SessionEntity _sessionEntityFromPocketbaseRecord(RecordAuth ra) { + // final decodedToken = JwtDecoder.decode(ra.token); + // final expInSeconds = decodedToken['exp']; + // final expInMilliseconds = expInSeconds * 1000; + // final expiresOn = DateTime.fromMillisecondsSinceEpoch(expInMilliseconds); + // final se = SessionEntity( + // id: ra.record!.id, + // expiresOn: expiresOn, + // token: ra.token, + // modelJson: ra.record!.toJson(), + // ); + // return se; + // } + + // Future googleLogin(BuildContext context,WidgetRef ref) async { + // try { + // final authData = await pb.collection('users').authWithOAuth2('apple', (url) async { + // await launchUrl(url); + // }); + // print(authData); + // // ✅ Check if authData is valid + // if (authData.token.isNotEmpty && authData.record != null) { + // + // + // print("✅ Login Successful"); + // print(authData.record); + // + // + // final userDetails = authData.record; + // final userId = userDetails?.id; + // final email = userDetails?.data['email'] ?? ''; + // final isProfileComplete = userDetails?.data['is_profile_completed'] ?? ''; + // final loginCount = userDetails?.data['login_count'] ?? ''; + // // final verified = userDetails?.data['verified'] ?? ''; + // + // final se = _sessionEntityFromPocketbaseRecord(authData); + // await _LocalAuthRepo.storeLocally(se); + // + // print("User ID: ${userId}"); + // print("Email: ${email}"); + // print("Email: ${isProfileComplete}"); + // print("Email: ${loginCount}"); + // + // await saveUserId(userId!, loginCount); + // // await getDeviceToken(context, id); + // await initializeTheme(context,ref,userId); + // + // // Extract intendedPath from query parameters (if coming from redirect) + // final String? intendedPath = + // GoRouterState.of(context).uri.queryParameters['intendedPath']; + // print("Extracted intendedPath after login: $intendedPath"); + // + // if (isProfileComplete) { + // print('Redirecting to Home / Intended Path'); + // // **Set Default Locale in Provider** + // if (preferredLanguage == 'ar') { + // ref.read(localeProvider.notifier).setLocale(const Locale('ar')); + // } else { + // ref.read(localeProvider.notifier).setLocale(const Locale('en')); + // } + // context.go(intendedPath ?? '/myhomepage'); + // } else { + // print('Redirecting to Profile Setup'); + // + // context.go('/profile/$userId'); + // + // } + // } else { + // print("❌ Login failed: Invalid authData"); + // } + // } catch (e) { + // print("❌ Error during Google login: $e"); + // ScaffoldMessenger.of(context).showSnackBar( + // SnackBar(content: Text("Login failed. Please try again.")), + // ); + // } + // } + @override Widget build(BuildContext context, WidgetRef ref) { @@ -662,9 +835,9 @@ class LoginRoute extends HookConsumerWidget { print("Is Profile Complete: $isProfileComplete"); // Extract intendedPath from query parameters (if coming from redirect) - final String? intendedPath = - GoRouterState.of(context).uri.queryParameters['intendedPath']; - print("Extracted intendedPath after login: $intendedPath"); + // final String? intendedPath = + // GoRouterState.of(context).uri.queryParameters['intendedPath']; + // print("Extracted intendedPath after login: $intendedPath"); if (!context.mounted) return; @@ -676,7 +849,7 @@ class LoginRoute extends HookConsumerWidget { } else { ref.read(localeProvider.notifier).setLocale(const Locale('en')); } - context.go(intendedPath ?? '/myhomepage'); + context.go('/myhomepage'); } else { print('Redirecting to Profile Setup'); if (userId.isNotEmpty) { @@ -972,7 +1145,9 @@ class LoginRoute extends HookConsumerWidget { final signInWithGoogleBtn = SizedBox( width: double.infinity, child: OutlinedButton( - onPressed: () async {}, + onPressed: () async { + googleLogin(context,ref,'google'); + }, style: OutlinedButton.styleFrom( side: const BorderSide(color: Color(0xFF000000)), shape: RoundedRectangleBorder( @@ -1010,7 +1185,9 @@ class LoginRoute extends HookConsumerWidget { final signInWithAppleBtn = SizedBox( width: double.infinity, child: OutlinedButton( - onPressed: () async {}, + onPressed: () async { + googleLogin(context,ref,'apple'); + }, style: OutlinedButton.styleFrom( side: const BorderSide(color: Color(0xFF000000)), shape: RoundedRectangleBorder( @@ -1219,3 +1396,30 @@ class LoginRoute extends HookConsumerWidget { // ); // } } + + +// abstract class _LocalAuthRepo { +// static const _key = 'session'; +// static const _storage = FlutterSecureStorage(); +// +// static Future fetchLocallyStored() async { +// final e = await _storage.read(key: _key); +// if (e == null) return null; +// final se = SessionEntity.fromJson(e); +// if (se.freshness == SessionFreshness.expired) { +// await clear(); +// return null; +// } +// return se; +// } +// +// static Future storeLocally( +// SessionEntity se, +// ) => +// _storage.write( +// key: _key, +// value: se.toJson(), +// ); +// +// static Future clear() => _storage.delete(key: _key); +// } \ No newline at end of file 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 e8b3db4f..a9984fcd 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 @@ -1092,8 +1092,8 @@ class EconomyStatsState extends ConsumerState { currentTheme = ref.read(themeProvider); print('123456789'); print(currentTheme); - final isDark = currentTheme == ThemeMode.dark || - (currentTheme == ThemeMode.system && + final isDark = ref.read(themeProvider) == ThemeMode.dark || + (ref.read(themeProvider) == ThemeMode.system && MediaQuery.of(context).platformBrightness == Brightness.dark); final themeMode = (isDark ? 'dark' : 'light'); @@ -1634,7 +1634,7 @@ class InfoCard extends StatelessWidget { Text( title, style: TextStyle( - fontSize: 13, + fontSize: 12, fontWeight: FontWeight.w700, letterSpacing: 0, // color: Colors.black, diff --git a/lib/presentation/routes/drawer_routes/Drawer Items/bookmark.dart b/lib/presentation/routes/drawer_routes/Drawer Items/bookmark.dart index 3c57bc86..96c8cb0c 100644 --- a/lib/presentation/routes/drawer_routes/Drawer Items/bookmark.dart +++ b/lib/presentation/routes/drawer_routes/Drawer Items/bookmark.dart @@ -6,6 +6,7 @@ import 'package:flutter_svg/svg.dart'; import 'package:go_router/go_router.dart'; import 'package:dio/dio.dart'; import 'package:http/http.dart' as http; +// import 'package:uae_stat/l10n/app_localizations.dart'; import 'package:flutter_gen/gen_l10n/app_localizations.dart'; import 'package:pocketbase/pocketbase.dart'; import 'package:shared_preferences/shared_preferences.dart'; @@ -270,9 +271,9 @@ class _BookMarkState extends ConsumerState { AppLocalizations.of(context)!.removed_from_Bookmark, style: TextStyle( fontFamily: context.translate( - 'Roboto', - 'NotoKufi', - )), + 'Roboto', + 'NotoKufi', + )), ), duration: Duration(seconds: 2), ), @@ -389,7 +390,7 @@ class _BookMarkState extends ConsumerState { foregroundColor: Colors.white, shape: RoundedRectangleBorder( borderRadius: - BorderRadius.circular(10.0), // Set text color + BorderRadius.circular(10.0), // Set text color ), ), child: Text( @@ -463,7 +464,8 @@ class _BookMarkState extends ConsumerState { final List> tabs = [ { 'title': AppLocalizations.of(context)!.all_bookmarks, - 'color': isDarkTheme ? Colors.white : Colors.black, + 'color': isDarkTheme ? Colors.white : Color(0xFFB68A34), + // 'color': isDarkTheme ? Colors.white : Colors.black, }, { 'title': AppLocalizations.of(context)!.economy_title, @@ -480,11 +482,11 @@ class _BookMarkState extends ConsumerState { ]; List> bookmarks = - dataList.where((item) => item['isBookmark'] == true).toList(); + dataList.where((item) => item['isBookmark'] == true).toList(); List> filteredBookmarks = dataList.where((bookmark) { String mainTopic = bookmark['main_topic'].toString().trim().toLowerCase(); String selectedTabTitle = - tabs[selectedTabIndex]['title'].toString().trim().toLowerCase(); + tabs[selectedTabIndex]['title'].toString().trim().toLowerCase(); // Debugging prints print( @@ -515,206 +517,212 @@ class _BookMarkState extends ConsumerState { ), body: isLoading ? Container( - color: isDarkTheme ? Color(0xFF111111) : Colors.white, + color: isDarkTheme ? Color(0xFF111111) : Colors.white, // color: Color(0x98FFFCE5), // Semi-transparent background + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Container( + margin: EdgeInsets.symmetric( + horizontal: 40), // Left & Right space + child: LinearProgressIndicator( + minHeight: 5, // Adjust thickness + backgroundColor: + Colors.grey[100], // Optional: Background color + valueColor: AlwaysStoppedAnimation( + Color(0xFFAA8E83)), // Loader color + ), + ), + ], + ), + ) + : Column( + children: [ + TabBarHeader( + tabs: tabs, + selectedIndex: selectedTabIndex, + onTabSelected: (index) { + setState(() { + selectedTabIndex = index; + }); + }, + isDarkTheme: isDarkTheme), + Expanded( + child: selectedTabIndex == 0 + ? (bookmarks.isNotEmpty + ? SingleChildScrollView( + child: Column( + children: List.generate( + transformedList.length, (i) { + final mainTopic = transformedList[i]; + print('oustside1 $mainTopic'); + final list = + List.from(mainTopic['SubTopic'] ?? []); + print('oustside2 $list'); + return CustomExpandableTile( + index: i, + isExpanded: expandedIndex == i, + onTap: (int index) { +// 🔹 Expecting an index + setState(() { + expandedIndex = + (expandedIndex == index) + ? null + : index; + }); + }, + title: + mainTopic['main_topic'] ?? 'No Topic', + childWidget: Container( + decoration: BoxDecoration( + color: isDarkTheme + ? Color(0xFF111111) + : Colors.white, +// borderRadius: BorderRadius.all(Radius.circular(20)) + ), + padding: const EdgeInsets.all(16), + child: GridView.builder( + shrinkWrap: true, + physics: + NeverScrollableScrollPhysics(), + gridDelegate: + const SliverGridDelegateWithFixedCrossAxisCount( + crossAxisCount: 2, + crossAxisSpacing: 10.0, + mainAxisSpacing: 10.0, + mainAxisExtent: 100, + ), + itemCount: list.length, + itemBuilder: (context, index) { + return _buildBoxes( + mainTopic['SubTopic'][index], + context, + mainTopic['valueColor'], + isDarkTheme); + }, + ), + ), + filteredBookmarks: List.from( + mainTopic['SubTopic'] ?? []), + titleBackgroundColor: + mainTopic['valueColor'], +// Ensure it's a new list + isDarkTheme: isDarkTheme, + ); + }), + ), + ) + : Center( child: Column( mainAxisAlignment: MainAxisAlignment.center, children: [ - Container( - margin: EdgeInsets.symmetric( - horizontal: 40), // Left & Right space - child: LinearProgressIndicator( - minHeight: 5, // Adjust thickness - backgroundColor: - Colors.grey[100], // Optional: Background color - valueColor: AlwaysStoppedAnimation( - Color(0xFFAA8E83)), // Loader color + Icon(Icons.info_outline, + size: 100, color: Colors.grey[400]), + SizedBox(height: 16), + Text( + context.translate('No BookMark Added', + 'لم يتم إضافة أي علامة مرجعية'), + style: TextStyle( + fontFamily: context.translate( + 'Roboto', + 'NotoKufi', + ), + fontSize: 16, + color: Colors.grey), + ), + ], + ), + )) + : filteredBookmarks.isEmpty + ? Center( + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Icon(Icons.info_outline, + size: 100, color: Colors.grey[400]), + SizedBox(height: 16), + Text( + context.translate('No BookMark Added', + 'لم يتم إضافة أي علامة مرجعية'), + style: TextStyle( + fontSize: 16, + color: Colors.grey, + fontFamily: context.translate( + 'Roboto', + 'NotoKufi', + ), ), ), ], ), ) - : Column( - children: [ - TabBarHeader( - tabs: tabs, - selectedIndex: selectedTabIndex, - onTabSelected: (index) { - setState(() { - selectedTabIndex = index; - }); - }, - isDarkTheme: isDarkTheme), - Expanded( - child: selectedTabIndex == 0 - ? (bookmarks.isNotEmpty - ? SingleChildScrollView( - child: Column( - children: List.generate( - transformedList.length, (i) { - final mainTopic = transformedList[i]; - print('oustside1 $mainTopic'); - final list = - List.from(mainTopic['SubTopic'] ?? []); - print('oustside2 $list'); - return CustomExpandableTile( - index: i, - isExpanded: expandedIndex == i, - onTap: (int index) { -// 🔹 Expecting an index - setState(() { - expandedIndex = - (expandedIndex == index) - ? null - : index; - }); - }, - title: - mainTopic['main_topic'] ?? 'No Topic', - childWidget: Container( - decoration: BoxDecoration( - color: isDarkTheme - ? Color(0xFF111111) - : Colors.white, -// borderRadius: BorderRadius.all(Radius.circular(20)) - ), - padding: const EdgeInsets.all(16), - child: GridView.builder( - shrinkWrap: true, - physics: - NeverScrollableScrollPhysics(), - gridDelegate: - const SliverGridDelegateWithFixedCrossAxisCount( - crossAxisCount: 2, - crossAxisSpacing: 10.0, - mainAxisSpacing: 10.0, - mainAxisExtent: 100, - ), - itemCount: list.length, - itemBuilder: (context, index) { - return _buildBoxes( - mainTopic['SubTopic'][index], - context, - mainTopic['valueColor'], - isDarkTheme); - }, - ), - ), - filteredBookmarks: List.from( - mainTopic['SubTopic'] ?? []), - titleBackgroundColor: - mainTopic['valueColor'], -// Ensure it's a new list - isDarkTheme: isDarkTheme, - ); - }), - ), - ) - : Center( - child: Column( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Icon(Icons.info_outline, - size: 100, color: Colors.grey[400]), - SizedBox(height: 16), - Text( - context.translate('No BookMark Added', - 'لم يتم إضافة أي علامة مرجعية'), - style: TextStyle( - fontFamily: context.translate( - 'Roboto', - 'NotoKufi', - ), - fontSize: 16, - color: Colors.grey), - ), - ], - ), - )) - : filteredBookmarks.isEmpty - ? Center( - child: Column( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Icon(Icons.info_outline, - size: 100, color: Colors.grey[400]), - SizedBox(height: 16), - Text( - context.translate('No BookMark Added', - 'لم يتم إضافة أي علامة مرجعية'), - style: TextStyle( - fontSize: 16, - color: Colors.grey, - fontFamily: context.translate( - 'Roboto', - 'NotoKufi', - ), - ), - ), - ], - ), - ) - : Padding( - padding: const EdgeInsets.all(8.0), - child: Column( - children: [ - Container( - decoration: BoxDecoration( - color: tabs[selectedTabIndex] - ['color'], - borderRadius: BorderRadius.all( - Radius.circular(35))), - padding: const EdgeInsets.only( - left: 16, - bottom: 5, - top: 5, - right: 10), - child: Row( - mainAxisAlignment: - MainAxisAlignment.spaceBetween, - children: [ - Text( - tabs[selectedTabIndex]['title'], - style: TextStyle( - fontFamily: context.translate( - 'Roboto', - 'NotoKufi', - ), - color: Colors.white, - fontWeight: FontWeight.w600, - fontSize: 20, - ), - ), - ], - ), - ), - SizedBox( - height: 20, - ), - Expanded( - child: GridView.builder( - gridDelegate: - const SliverGridDelegateWithFixedCrossAxisCount( - crossAxisCount: 2, - crossAxisSpacing: 10.0, - mainAxisSpacing: 10.0, - mainAxisExtent: 100, - ), - itemCount: filteredBookmarks.length, - itemBuilder: (context, index) { - return _buildBox( - filteredBookmarks[index], - context, - isDarkTheme); - }, - ), - ), - ], - ), + : Padding( + padding: const EdgeInsets.all(8.0), + child: Column( + children: [ + Container( + decoration: BoxDecoration( + color: tabs[selectedTabIndex] + ['color'], + borderRadius: BorderRadius.only( + topLeft: Radius.circular(20), + topRight: Radius.circular(20)) + + // borderRadius: BorderRadius.all( + // Radius.circular(35)) + + ), + padding: const EdgeInsets.only( + left: 16, + bottom: 5, + top: 5, + right: 10), + child: Row( + mainAxisAlignment: + MainAxisAlignment.spaceBetween, + children: [ + Text( + tabs[selectedTabIndex]['title'], + style: TextStyle( + fontFamily: context.translate( + 'Roboto', + 'NotoKufi', ), - ), - ], + color: Colors.white, + fontWeight: FontWeight.w600, + fontSize: 20, + ), + ), + ], + ), + ), + SizedBox( + height: 20, + ), + Expanded( + child: GridView.builder( + gridDelegate: + const SliverGridDelegateWithFixedCrossAxisCount( + crossAxisCount: 2, + crossAxisSpacing: 10.0, + mainAxisSpacing: 10.0, + mainAxisExtent: 100, + ), + itemCount: filteredBookmarks.length, + itemBuilder: (context, index) { + return _buildBox( + filteredBookmarks[index], + context, + isDarkTheme); + }, + ), + ), + ], + ), ), + ), + ], + ), ), ); } @@ -836,11 +844,11 @@ class _BookMarkState extends ConsumerState { } Widget _buildBoxes( - Map data, - BuildContext context, - Color styleColor, - bool isDarkTheme, - ) { + Map data, + BuildContext context, + Color styleColor, + bool isDarkTheme, + ) { // Color borderColor = data['valueColor']; print('inside function $data'); return GestureDetector( @@ -953,9 +961,9 @@ class TabBarHeader extends StatelessWidget { TabBarHeader( {required this.tabs, - required this.selectedIndex, - required this.onTabSelected, - required this.isDarkTheme}); + required this.selectedIndex, + required this.onTabSelected, + required this.isDarkTheme}); @override Widget build(BuildContext context) { @@ -975,7 +983,7 @@ class TabBarHeader extends StatelessWidget { onPressed: () => onTabSelected(index), style: ButtonStyle( foregroundColor: - MaterialStateProperty.resolveWith((states) { + MaterialStateProperty.resolveWith((states) { return selectedIndex == index ? entry.value['color'] : Colors.grey[700]; @@ -1058,12 +1066,16 @@ class _CustomExpandableTileState extends State { color: widget.isDarkTheme ? Color(0xFF111111) : Colors - .white, // Ensuring the background outside the rounded container is white + .white, // Ensuring the background outside the rounded container is white ), child: Container( decoration: BoxDecoration( color: widget.titleBackgroundColor, - borderRadius: BorderRadius.all(Radius.circular(35))), + borderRadius: BorderRadius.only( + topLeft: Radius.circular(20), + topRight: Radius.circular(20)) + // borderRadius: BorderRadius.all(Radius.circular(35)) + ), padding: const EdgeInsets.only( left: 16, bottom: 5, top: 5, right: 10), child: Row( @@ -1102,9 +1114,9 @@ class _CustomExpandableTileState extends State { // height: widget.isExpanded ? myheight * 0.4 : 0, child: widget.isExpanded ? SingleChildScrollView( - child: Column( - children: [ - widget.childWidget, + child: Column( + children: [ + widget.childWidget, // Container( // decoration: BoxDecoration( // color: Colors.white, @@ -1127,9 +1139,9 @@ class _CustomExpandableTileState extends State { // }, // ), // ), - ], - ), - ) + ], + ), + ) : null, ), ), @@ -1137,4 +1149,4 @@ class _CustomExpandableTileState extends State { ), ); } -} +} \ No newline at end of file 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 7d08419f..eca45285 100644 --- a/lib/presentation/routes/drawer_routes/Drawer Items/edit_profile.dart +++ b/lib/presentation/routes/drawer_routes/Drawer Items/edit_profile.dart @@ -6,6 +6,7 @@ import 'package:flutter/gestures.dart'; import 'package:flutter/material.dart'; import 'package:flutter/scheduler.dart'; import 'package:flutter/services.dart'; +import 'package:flutter_hooks/flutter_hooks.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:go_router/go_router.dart'; import 'package:http/http.dart' as http; @@ -13,7 +14,6 @@ import 'package:image_picker/image_picker.dart'; import 'package:intl/intl.dart'; import 'package:pocketbase/pocketbase.dart'; import 'package:shared_preferences/shared_preferences.dart'; -// 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'; @@ -24,6 +24,7 @@ import 'package:uae_stat/infrastructure/services/img_asset_paths/icons/misc_icon import 'package:uae_stat/presentation/components/indicators/locale_provider.dart'; import 'package:uae_stat/presentation/routes/drawer_routes/custom_drawer_routes.dart'; import 'package:flutter_gen/gen_l10n/app_localizations.dart'; +// import 'package:uae_stat/l10n/app_localizations.dart'; class EditProfile extends ConsumerStatefulWidget { const EditProfile({super.key}); @@ -82,7 +83,8 @@ class _EditProfileState extends ConsumerState { "English": "en", "Arabic": "ar", }; - String? _selectedCountry; + // String? _selectedCountry; + ISOCountry? _selectedCountry; String? _selectedLanguage; bool isChecked = false; bool showError = false; @@ -201,7 +203,15 @@ class _EditProfileState extends ConsumerState { _usernameController.text = userDetailsResponse.data['uname'] ?? ''; _emailController.text = userDetailsResponse.data['email'] ?? ''; _fullNameController.text = userDetailsResponse.data['full_name'] ?? ''; - _selectedCountry = userDetailsResponse.data['country_region'] ?? ''; + // _selectedCountry = userDetailsResponse.data['country_region'] ?? ''; + + final countryName = + (userDetailsResponse.data['country_region'] ?? '').toLowerCase(); + _selectedCountry = ISOCountry.values.firstWhere( + (e) => e.nameEN.toLowerCase() == countryName, + orElse: () => ISOCountry.numeric784, // fallback to UAE + ); + // _selectedLanguage = userDetailsResponse.data['language'] ?? ''; _isProfileCompleted = userDetailsResponse.data['is_profile_completed'] ?? false; @@ -226,7 +236,7 @@ class _EditProfileState extends ConsumerState { if (avatarFilename.isNotEmpty && recordId.isNotEmpty) { _avatarUrl = - '$apiUrl/api/files/$collectionId/$recordId/$avatarFilename'; + '$apiUrl/api/files/$collectionId/$recordId/$avatarFilename'; } else { _avatarUrl = ''; // Reset to default or empty } @@ -259,14 +269,14 @@ class _EditProfileState extends ConsumerState { // await Future.delayed(Duration(seconds: 8)); // Example delay final XFile? pickedFile = - await _picker.pickImage(source: ImageSource.gallery); + await _picker.pickImage(source: ImageSource.gallery); if (pickedFile != null) { setState(() { isLoader = true; // Start loading }); print(pickedFile); final String fileExtension = - pickedFile.path.split('.').last.toLowerCase(); + pickedFile.path.split('.').last.toLowerCase(); print('fileExtension $fileExtension'); if (fileExtension == 'jpg' || fileExtension == 'jpeg' || @@ -280,14 +290,14 @@ class _EditProfileState extends ConsumerState { ScaffoldMessenger.of(context).showSnackBar( SnackBar( content: Text( - context.translate('Please select a JPG, JPEG, or PNG file.', - 'يرجى تحديد ملف بصيغة JPG أو JPEG أو PNG.'), - style: TextStyle( - fontFamily: context.translate( - 'Roboto', - 'NotoKufi', - )), - )), + context.translate('Please select a JPG, JPEG, or PNG file.', + 'يرجى تحديد ملف بصيغة JPG أو JPEG أو PNG.'), + style: TextStyle( + fontFamily: context.translate( + 'Roboto', + 'NotoKufi', + )), + )), ); } } @@ -376,6 +386,14 @@ class _EditProfileState extends ConsumerState { // if (result == true) { // Validate only the country field + + String? _validateDropdown(ISOCountry? value) { + if (value == null) { + return context.translate('Please select a country', 'يرجى اختيار دولة'); + } + return null; + } + if (_validateDropdown(_selectedCountry) == null && _validatePreferredLang(_selectedLanguage) == null) { try { @@ -383,13 +401,19 @@ class _EditProfileState extends ConsumerState { print('ShowConfirmationuserID - $userID '); // Retrieve data from the country/region field - String countryRegion = - _selectedCountry ?? ''; // Ensure the country is selected + // String countryRegion = + // _selectedCountry ?? ''; // Ensure the country is selected + + String countryRegion = context.translate( + _selectedCountry?.nameEN ?? '', + _selectedCountry?.nameAR ?? '', + ); + String preferredLang = _selectedLanguage ?? ''; // Create a multipart request final uri = - Uri.parse('${_pb.baseUrl}/api/collections/users/records/$userID'); + Uri.parse('${_pb.baseUrl}/api/collections/users/records/$userID'); final request = http.MultipartRequest('PATCH', uri); // Add fields to the request @@ -437,13 +461,13 @@ class _EditProfileState extends ConsumerState { ScaffoldMessenger.of(context).showSnackBar( SnackBar( content: Text( - AppLocalizations.of(context)!.profile_updated_successfully, - style: TextStyle( - fontFamily: context.translate( - 'Roboto', - 'NotoKufi', - )), - )), + AppLocalizations.of(context)!.profile_updated_successfully, + style: TextStyle( + fontFamily: context.translate( + 'Roboto', + 'NotoKufi', + )), + )), ); }); @@ -459,9 +483,9 @@ class _EditProfileState extends ConsumerState { 'Failed to update profile: ${response.statusCode}', style: TextStyle( fontFamily: context.translate( - 'Roboto', - 'NotoKufi', - )), + 'Roboto', + 'NotoKufi', + )), ), ), ); @@ -473,13 +497,13 @@ class _EditProfileState extends ConsumerState { ScaffoldMessenger.of(context).showSnackBar( SnackBar( content: Text( - 'Failed to update profile: $error', - style: TextStyle( - fontFamily: context.translate( - 'Roboto', - 'NotoKufi', - )), - )), + 'Failed to update profile: $error', + style: TextStyle( + fontFamily: context.translate( + 'Roboto', + 'NotoKufi', + )), + )), ); } } else { @@ -543,6 +567,16 @@ class _EditProfileState extends ConsumerState { (ref.watch(themeProvider) == ThemeMode.system && MediaQuery.of(context).platformBrightness == Brightness.dark); + // final searchTerm = useState(''); + String searchTerm = ''; + + final _countries = ISOCountry.values.where((country) { + final query = searchTerm.trim().toLowerCase(); + if (query.isEmpty) return true; + return country.nameEN.toLowerCase().contains(query) || + country.nameAR.toLowerCase().contains(query); + }).toList(); + return PopScope( canPop: false, // Allow back navigation only if not login screen onPopInvokedWithResult: (didPop, result) { @@ -550,8 +584,8 @@ class _EditProfileState extends ConsumerState { context.go('/myhomepage'); // Show exit confirmation dialog }, child: BaseScaffold( - backgroundColor: isDarkTheme ? Color(0xFF111111) : Colors.white, - appbarColor: isDarkTheme ? Color(0xFF111111) : Colors.white, + backgroundColor: isDarkTheme ? Color(0xFF111111) : Colors.white, + appbarColor: isDarkTheme ? Color(0xFF111111) : Colors.white, title: Text( AppLocalizations.of(context)!.my_profile, style: TextStyle( @@ -564,838 +598,932 @@ class _EditProfileState extends ConsumerState { ), body: isLoader ? Container( - color: Color(0x98FFFCE5), // Semi-transparent background - child: Column( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Container( - margin: EdgeInsets.symmetric( - horizontal: 40), // Left & Right space - child: LinearProgressIndicator( - minHeight: 5, // Adjust thickness - backgroundColor: - Colors.grey[100], // Optional: Background color - valueColor: AlwaysStoppedAnimation( - Color(0xFFAA8E83)), // Loader color - ), - ), - ], + color: Color(0x98FFFCE5), // Semi-transparent background + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Container( + margin: EdgeInsets.symmetric( + horizontal: 40), // Left & Right space + child: LinearProgressIndicator( + minHeight: 5, // Adjust thickness + backgroundColor: + Colors.grey[100], // Optional: Background color + valueColor: AlwaysStoppedAnimation( + Color(0xFFAA8E83)), // Loader color ), - ) + ), + ], + ), + ) : 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, - // ), - // ), - // ), - // ), - // ), + 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: [ + // // 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, - ), - ), - ), + 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, ), - ), - ], - ), - - 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 + ) + : Align( + alignment: + Alignment.bottomRight, + child: GestureDetector( + onTap: + _pickImage, // Call `_pickImage` on tap + child: CircleAvatar( + radius: 15, + backgroundColor: + Colors.white, child: Icon( - Icons.keyboard_arrow_down_sharp, + Icons.camera_alt, + size: 15, 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, - ), - ), - Row( - mainAxisAlignment: - MainAxisAlignment.start, - children: [ - Text( - AppLocalizations.of(context)! - .preferredLang, - 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( - 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, - 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, - ), - ], - ), - ), - ], + 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( + isExpanded: true, + value: + _selectedCountry, // ISOCountry type + decoration: InputDecoration( + enabledBorder: OutlineInputBorder( + borderRadius: + BorderRadius.circular(10), + borderSide: BorderSide( + color: Color(0xFFB68A34), + width: 1, + ), + ), + border: OutlineInputBorder( + borderRadius: + BorderRadius.circular(8), + borderSide: BorderSide( + color: Color(0xFFB68A34)), + ), + labelText: context.translate( + 'Select', 'اختيار'), + ), + icon: Icon( + Icons.keyboard_arrow_down_sharp, + color: _isHoveringPreferredLang + ? Colors.black + : Colors.grey, + ), + items: _countries.map((country) { + return DropdownMenuItem( + value: country, + child: SizedBox( + width: double.infinity, + child: Text( + context.translate( + country.nameEN, + country.nameAR), + overflow: + TextOverflow.ellipsis, + maxLines: 1, + style: TextStyle( + fontFamily: + context.translate( + 'Roboto', + 'NotoKufi'), + color: isDarkTheme + ? Colors.white + : null, ), - 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( + ), + ), + ); + }).toList(), + onChanged: (ISOCountry? newCountry) { + setState(() { + _selectedCountry = newCountry; + }); + }, + validator: (value) { + if (value == null) + return context.translate( + 'Please select a country', + 'يرجى اختيار دولة'); + return null; + }, + ), + + // child: DropdownButtonFormField( + // style: TextStyle( + // fontFamily: context.translate( + // 'Roboto', + // 'NotoKufi', + // ), + // fontSize: 16, + // fontWeight: FontWeight.normal, + // // color: Color(0xFF544C4C), + // color: isDarkTheme + // ? Colors.white + // : Color(0xFFC3C6CB), + // ), + // value: _selectedCountry, + // decoration: InputDecoration( + // enabledBorder: OutlineInputBorder( + // borderRadius: + // BorderRadius.circular(10), + // borderSide: BorderSide( + // color: Color(0xFFB68A34), + // // color: MyTheme.topicColor( + // // IndicatorTopic + // // .economy) + // // .shade400, + // width: 1), // Enabled border + // ), + // border: OutlineInputBorder( + // borderSide: BorderSide( + // // color: Color(0xFF7296BE), + // color: Color(0xFFB68A34), + // ), + // borderRadius: + // BorderRadius.circular(8), + // ), + // labelText: 'Select', + // ), + // icon: Icon( + // Icons.keyboard_arrow_down_sharp, + // color: _isHoveringDropdown + // ? isDarkTheme + // ? Colors.white + // : 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, + // ), + ), + Row( + mainAxisAlignment: + MainAxisAlignment.start, + children: [ + Text( + AppLocalizations.of(context)! + .preferredLang, + 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( + fontFamily: context.translate( + 'Roboto', + 'NotoKufi', + ), + fontSize: 16, + fontWeight: FontWeight.normal, + // color: Color(0xFF544C4C), + color: isDarkTheme + ? Colors.white + : Color(0xFFC3C6CB), + ), + value: _selectedLanguage, + decoration: InputDecoration( + enabledBorder: OutlineInputBorder( + borderRadius: + BorderRadius.circular(10), + borderSide: BorderSide( + color: Color(0xFFB68A34), + // color: MyTheme.topicColor( + // IndicatorTopic + // .economy) + // .shade400, + width: 1), // Enabled border + ), + border: OutlineInputBorder( + borderSide: BorderSide( + color: Color(0xFFB68A34), + // 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, + 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.red[700], - fontSize: 12, + color: + Colors.black), + children: [ + TextSpan( + text: AppLocalizations + .of( + context, + )! + .terms_conditions, + style: TextStyle( + fontFamily: context + .translate( + 'Roboto', + 'NotoKufi', + ), + // color: Colors.blue, + // color: Color( + // 0xFF648CBA), + // + color: Color( + 0xFFB68A34), + 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( + 0xFFB68A34), + + // 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, + ), + ), + ], ), - ], - ), - ], - ), - 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: isDarkTheme ? Color(0xFF9EB3E4) : Color(0xFF985400), - fontSize: 14, - fontWeight: FontWeight.w700, - fontFamily: context.translate( - 'Roboto', - 'NotoKufi', - ), - // decoration: TextDecoration.underline + textAlign: + TextAlign.start, + maxLines: 2, + overflow: TextOverflow + .visible, + softWrap: true, + ), + ], ), ), - ), + ], ), - 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: isDarkTheme ? Color(0xFF24B4FB) : Color(0xFF92722A), - minimumSize: - Size(double.infinity, 50), - shape: RoundedRectangleBorder( - borderRadius: - BorderRadius.circular(8), - ), - ), - child: Row( - mainAxisAlignment: MainAxisAlignment - .center, // Center the content + if (showError) + Row( + mainAxisAlignment: + MainAxisAlignment.start, children: [ - Text( - AppLocalizations.of(context)! - .save, - style: TextStyle( - color: Colors.white, - fontFamily: context.translate( - 'Roboto', - 'NotoKufi', + 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, ), ), ), - SizedBox( - width: - 8), // Add space between text and icon - Image.asset( - MiscIconAssetPath.save, - color: Colors.white, - width: 20, - height: 20, - ), ], ), - ) ], ), + 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: isDarkTheme + // ? Color(0xFF9EB3E4) + // : Color(0xFF985400), + color: Color(0xFFB68A34), + 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(0xFFB68A34), + + // backgroundColor: isDarkTheme + // ? Color(0xFF24B4FB) + // : 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(), - )); + //bottomNavigationBar: MyBottomNavBar(), + )); } } @@ -1482,7 +1610,8 @@ class ConfirmationDialog extends StatelessWidget { Navigator.of(context).pop(false); }, style: OutlinedButton.styleFrom( - side: BorderSide(color: Color(0xFF92722A)), + // side: BorderSide(color: Color(0xFF92722A)), + side: BorderSide(color: Color(0xFFB68A34)), shape: RoundedRectangleBorder( borderRadius: BorderRadius.all(Radius.circular(7)), ), // Set the border color here @@ -1490,7 +1619,8 @@ class ConfirmationDialog extends StatelessWidget { child: Text( 'Cancel', style: TextStyle( - color: Color(0xFF92722A), + color: Color(0xFFB68A34), + // color: Color(0xFF92722A), fontFamily: context.translate( 'Roboto', 'NotoKufi', @@ -1501,7 +1631,8 @@ class ConfirmationDialog extends StatelessWidget { ElevatedButton( onPressed: () => Navigator.of(context).pop(true), style: ElevatedButton.styleFrom( - backgroundColor: const Color(0xFF92722A), // Brown color + // backgroundColor: const Color(0xFF92722A), // Brown color + backgroundColor: const Color(0xFFB68A34), // Brown color foregroundColor: Colors.white, shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular(8), @@ -1527,4 +1658,4 @@ class ConfirmationDialog extends StatelessWidget { ], ); } -} +} \ No newline at end of file diff --git a/lib/presentation/routes/drawer_routes/custom_drawer_routes.dart b/lib/presentation/routes/drawer_routes/custom_drawer_routes.dart index fe40b637..c8eb3a78 100644 --- a/lib/presentation/routes/drawer_routes/custom_drawer_routes.dart +++ b/lib/presentation/routes/drawer_routes/custom_drawer_routes.dart @@ -1714,10 +1714,10 @@ class _BaseScaffoldState extends ConsumerState { context.go('/uaenumbers'); break; case 2: - context.go('/competitiveness'); + // context.go('/competitiveness'); break; case 3: - context.go('/countryprofile'); + // context.go('/countryprofile'); break; } } diff --git a/macos/Flutter/GeneratedPluginRegistrant.swift b/macos/Flutter/GeneratedPluginRegistrant.swift index 750dfb64..586789f0 100644 --- a/macos/Flutter/GeneratedPluginRegistrant.swift +++ b/macos/Flutter/GeneratedPluginRegistrant.swift @@ -13,6 +13,7 @@ import file_selector_macos import firebase_core import firebase_messaging import flutter_secure_storage_darwin +import google_sign_in_ios import package_info_plus import path_provider_foundation import share_plus @@ -30,6 +31,7 @@ func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) { FLTFirebaseCorePlugin.register(with: registry.registrar(forPlugin: "FLTFirebaseCorePlugin")) FLTFirebaseMessagingPlugin.register(with: registry.registrar(forPlugin: "FLTFirebaseMessagingPlugin")) FlutterSecureStorageDarwinPlugin.register(with: registry.registrar(forPlugin: "FlutterSecureStorageDarwinPlugin")) + FLTGoogleSignInPlugin.register(with: registry.registrar(forPlugin: "FLTGoogleSignInPlugin")) FPPPackageInfoPlusPlugin.register(with: registry.registrar(forPlugin: "FPPPackageInfoPlusPlugin")) PathProviderPlugin.register(with: registry.registrar(forPlugin: "PathProviderPlugin")) SharePlusMacosPlugin.register(with: registry.registrar(forPlugin: "SharePlusMacosPlugin")) diff --git a/pubspec.lock b/pubspec.lock index 0b61b6cb..a202624a 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -804,6 +804,54 @@ packages: url: "https://pub.dev" source: hosted version: "14.8.1" + google_identity_services_web: + dependency: transitive + description: + name: google_identity_services_web + sha256: "5d187c46dc59e02646e10fe82665fc3884a9b71bc1c90c2b8b749316d33ee454" + url: "https://pub.dev" + source: hosted + version: "0.3.3+1" + google_sign_in: + dependency: "direct main" + description: + name: google_sign_in + sha256: "939a8b58f84c4053811b8c1bc9adbcb59449a15b37958264bbf60020698cca0e" + url: "https://pub.dev" + source: hosted + version: "7.1.1" + google_sign_in_android: + dependency: transitive + description: + name: google_sign_in_android + sha256: f256b8f0e6c09d135c166fe20b25256e24d60fe1a72e6bdc112a200bd0d555b4 + url: "https://pub.dev" + source: hosted + version: "7.0.3" + google_sign_in_ios: + dependency: transitive + description: + name: google_sign_in_ios + sha256: c7ee744ebbcd98353966dbdee735d4fca085226f6bf725c6bea8a5c8fe0055bc + url: "https://pub.dev" + source: hosted + version: "6.1.0" + google_sign_in_platform_interface: + dependency: transitive + description: + name: google_sign_in_platform_interface + sha256: "8736443134d2cccadd4f228d600177cb3947e36683466a6ab96877ce6932885a" + url: "https://pub.dev" + source: hosted + version: "3.0.0" + google_sign_in_web: + dependency: transitive + description: + name: google_sign_in_web + sha256: "09ac306b2787b48f19c857b9f93375b654f774643c75bd6a1a078c85f4f7b468" + url: "https://pub.dev" + source: hosted + version: "1.0.0" graphs: dependency: transitive description: diff --git a/pubspec.yaml b/pubspec.yaml index b5ab16c7..5659dff6 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -77,6 +77,7 @@ dependencies: app_settings: ^6.1.1 appsflyer_sdk: ^6.16.2 dotted_border: ^2.1.0 + google_sign_in: ^7.1.1 dependency_overrides: fading_edge_scrollview: ^4.1.1