dark/light added

This commit is contained in:
Surendiran 2025-07-24 11:10:07 +05:30
parent bc58cfc4c0
commit 7db48a7fb2
53 changed files with 6721 additions and 3649 deletions

View File

@ -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 y/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/Debug/4y161to1/arm64-v8a/additional_project_files.txtC
A A
?com.android.build.gradle.internal.cxx.io.EncodedFileFingerPrint  <EFBFBD>ùÓÁ÷2  ¡¹ñÀ÷2z ?com.android.build.gradle.internal.cxx.io.EncodedFileFingerPrint  ãÄ¹Žƒ3  ¡¹ñÀ÷2z
x x
v/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/Debug/4y161to1/arm64-v8a/android_gradle_build.json  ƒùÓÁ÷2 £¹ñÀ÷2 v/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/Debug/4y161to1/arm64-v8a/android_gradle_build.json  ãÄ¹Žƒ3 £¹ñÀ÷2
} }
{/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/Debug/4y161to1/arm64-v8a/android_gradle_build_mini.json  ƒùÓÁ÷2ƒ ¥¹ñÀ÷2l {/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/Debug/4y161to1/arm64-v8a/android_gradle_build_mini.json  ãÄ¹Žƒ3ƒ ¥¹ñÀ÷2l
j j
h/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/Debug/4y161to1/arm64-v8a/build.ninja  ƒùÓÁ÷2êÌ ޹ñÀ÷2p h/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/Debug/4y161to1/arm64-v8a/build.ninja  ãÄ¹Žƒ3êÌ ޹ñÀ÷2p
n n
l/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/Debug/4y161to1/arm64-v8a/build.ninja.txt  ƒùÓÁ÷2u l/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/Debug/4y161to1/arm64-v8a/build.ninja.txt  ãÄ¹Žƒ3u
s s
q/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/Debug/4y161to1/arm64-v8a/build_file_index.txt  ƒùÓÁ÷2 _ ¦¹ñÀ÷2v q/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/Debug/4y161to1/arm64-v8a/build_file_index.txt  ãÄ¹Žƒ3 _ ¦¹ñÀ÷2v
t t
r/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/Debug/4y161to1/arm64-v8a/compile_commands.json  ƒùÓÁ÷2z r/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/Debug/4y161to1/arm64-v8a/compile_commands.json  ãÄ¹Žƒ3z
x x
v/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/Debug/4y161to1/arm64-v8a/compile_commands.json.bin  ƒùÓÁ÷2 v/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/Debug/4y161to1/arm64-v8a/compile_commands.json.bin  ãÄ¹Žƒ3
~ ~
|/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/Debug/4y161to1/arm64-v8a/metadata_generation_command.txt  ƒùÓÁ÷2 |/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/Debug/4y161to1/arm64-v8a/metadata_generation_command.txt  ãÄ¹Žƒ3
ö ¦¹ñÀ÷2s ö ¦¹ñÀ÷2s
q q
o/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/Debug/4y161to1/arm64-v8a/prefab_config.json  ƒùÓÁ÷2  ( ¦¹ñÀ÷2x o/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/Debug/4y161to1/arm64-v8a/prefab_config.json  äÄ¹Žƒ3  ( ¦¹ñÀ÷2x
v v
t/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/Debug/4y161to1/arm64-v8a/symbol_folder_index.txt  ƒùÓÁ÷2  k ¦¹ñÀ÷2c t/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/Debug/4y161to1/arm64-v8a/symbol_folder_index.txt  äÄ¹Žƒ3  k ¦¹ñÀ÷2c
a a
_/Users/venbateam/Documents/flutter/packages/flutter_tools/gradle/src/main/groovy/CMakeLists.txt  ƒùÓÁ÷2 ¤ òÑÞ€á2 _/Users/venbateam/Documents/flutter/packages/flutter_tools/gradle/src/main/groovy/CMakeLists.txt  äÄ¹Žƒ3 ¤ òÑÞ€á2

View File

@ -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 {/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/Debug/4y161to1/armeabi-v7a/additional_project_files.txtC
A A
?com.android.build.gradle.internal.cxx.io.EncodedFileFingerPrint  <EFBFBD>ùÓÁ÷2  ¸ïòÀ÷2| ?com.android.build.gradle.internal.cxx.io.EncodedFileFingerPrint  éÅ¹Žƒ3  ¸ïòÀ÷2|
z z
x/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/Debug/4y161to1/armeabi-v7a/android_gradle_build.json  <EFBFBD>ùÓÁ÷2 ºïòÀ÷2<C3B7> x/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/Debug/4y161to1/armeabi-v7a/android_gradle_build.json  éÅ¹Žƒ3 ºïòÀ÷2<C3B7>
 
}/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/Debug/4y161to1/armeabi-v7a/android_gradle_build_mini.json  <EFBFBD>ùÓÁ÷2 »ïòÀ÷2n }/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/Debug/4y161to1/armeabi-v7a/android_gradle_build_mini.json  éÅ¹Žƒ3 »ïòÀ÷2n
l l
j/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/Debug/4y161to1/armeabi-v7a/build.ninja  <EFBFBD>ùÓÁ÷2öÌ ªïòÀ÷2r j/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/Debug/4y161to1/armeabi-v7a/build.ninja  éÅ¹Žƒ3öÌ ªïòÀ÷2r
p p
n/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/Debug/4y161to1/armeabi-v7a/build.ninja.txt  <EFBFBD>ùÓÁ÷2w n/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/Debug/4y161to1/armeabi-v7a/build.ninja.txt  éÅ¹Žƒ3w
u u
s/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/Debug/4y161to1/armeabi-v7a/build_file_index.txt  <EFBFBD>ùÓÁ÷2 _ »ïòÀ÷2x s/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/Debug/4y161to1/armeabi-v7a/build_file_index.txt  éÅ¹Žƒ3 _ »ïòÀ÷2x
v v
t/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/Debug/4y161to1/armeabi-v7a/compile_commands.json  <EFBFBD>ùÓÁ÷2| t/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/Debug/4y161to1/armeabi-v7a/compile_commands.json  éÅ¹Žƒ3|
z z
x/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/Debug/4y161to1/armeabi-v7a/compile_commands.json.bin  <EFBFBD>ùÓÁ÷2 ƒ 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  <EFBFBD>ùÓÁ÷2 ~/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/Debug/4y161to1/armeabi-v7a/metadata_generation_command.txt  éÅ¹Žƒ3
€ »ïòÀ÷2u € »ïòÀ÷2u
s s
q/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/Debug/4y161to1/armeabi-v7a/prefab_config.json  <EFBFBD>ùÓÁ÷2  ( »ïòÀ÷2z q/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/Debug/4y161to1/armeabi-v7a/prefab_config.json  éÅ¹Žƒ3  ( »ïòÀ÷2z
x x
v/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/Debug/4y161to1/armeabi-v7a/symbol_folder_index.txt  <EFBFBD>ùÓÁ÷2  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 a
_/Users/venbateam/Documents/flutter/packages/flutter_tools/gradle/src/main/groovy/CMakeLists.txt  <EFBFBD>ùÓÁ÷2 ¤ òÑÞ€á2 _/Users/venbateam/Documents/flutter/packages/flutter_tools/gradle/src/main/groovy/CMakeLists.txt  éÅ¹Žƒ3 ¤ òÑÞ€á2

View File

@ -2,27 +2,27 @@ C/C++ Structured Logw
u u
s/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/Debug/4y161to1/x86/additional_project_files.txtC s/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/Debug/4y161to1/x86/additional_project_files.txtC
A A
?com.android.build.gradle.internal.cxx.io.EncodedFileFingerPrint  ˜ùÓÁ÷2  „òòÀ÷2t ?com.android.build.gradle.internal.cxx.io.EncodedFileFingerPrint  ôÅ¹Žƒ3  „òòÀ÷2t
r r
p/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/Debug/4y161to1/x86/android_gradle_build.json  ˜ùÓÁ÷2ô „òòÀ÷2y p/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/Debug/4y161to1/x86/android_gradle_build.json  ôÅ¹Žƒ3ô „òòÀ÷2y
w w
u/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/Debug/4y161to1/x86/android_gradle_build_mini.json  ˜ùÓÁ÷2÷ …òòÀ÷2f u/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/Debug/4y161to1/x86/android_gradle_build_mini.json  ôÅ¹Žƒ3÷ …òòÀ÷2f
d d
b/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/Debug/4y161to1/x86/build.ninja  ˜ùÓÁ÷2ÆÌ ûñòÀ÷2j b/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/Debug/4y161to1/x86/build.ninja  ôÅ¹Žƒ3ÆÌ ûñòÀ÷2j
h h
f/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/Debug/4y161to1/x86/build.ninja.txt  ˜ùÓÁ÷2o f/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/Debug/4y161to1/x86/build.ninja.txt  ôÅ¹Žƒ3o
m m
k/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/Debug/4y161to1/x86/build_file_index.txt  ˜ùÓÁ÷2 _ …òòÀ÷2p k/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/Debug/4y161to1/x86/build_file_index.txt  ôÅ¹Žƒ3 _ …òòÀ÷2p
n n
l/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/Debug/4y161to1/x86/compile_commands.json  ˜ùÓÁ÷2t l/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/Debug/4y161to1/x86/compile_commands.json  ôÅ¹Žƒ3t
r r
p/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/Debug/4y161to1/x86/compile_commands.json.bin  ˜ùÓÁ÷2 z p/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/Debug/4y161to1/x86/compile_commands.json.bin  ôÅ¹Žƒ3 z
x x
v/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/Debug/4y161to1/x86/metadata_generation_command.txt  ˜ùÓÁ÷2 v/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/Debug/4y161to1/x86/metadata_generation_command.txt  ôÅ¹Žƒ3
Ø …òòÀ÷2m Ø …òòÀ÷2m
k k
i/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/Debug/4y161to1/x86/prefab_config.json  ˜ùÓÁ÷2  ( …òòÀ÷2r i/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/Debug/4y161to1/x86/prefab_config.json  ôÅ¹Žƒ3  ( …òòÀ÷2r
p p
n/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/Debug/4y161to1/x86/symbol_folder_index.txt  ˜ùÓÁ÷2  e …òòÀ÷2c n/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/Debug/4y161to1/x86/symbol_folder_index.txt  ôÅ¹Žƒ3  e …òòÀ÷2c
a a
_/Users/venbateam/Documents/flutter/packages/flutter_tools/gradle/src/main/groovy/CMakeLists.txt  ˜ùÓÁ÷2 ¤ òÑÞ€á2 _/Users/venbateam/Documents/flutter/packages/flutter_tools/gradle/src/main/groovy/CMakeLists.txt  ôÅ¹Žƒ3 ¤ òÑÞ€á2

View File

@ -2,27 +2,27 @@ C/C++ Structured Logz
x x
v/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/Debug/4y161to1/x86_64/additional_project_files.txtC v/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/Debug/4y161to1/x86_64/additional_project_files.txtC
A A
?com.android.build.gradle.internal.cxx.io.EncodedFileFingerPrint  žùÓÁ÷2  •ôòÀ÷2w ?com.android.build.gradle.internal.cxx.io.EncodedFileFingerPrint  ýÅ¹Žƒ3  •ôòÀ÷2w
u u
s/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/Debug/4y161to1/x86_64/android_gradle_build.json  žùÓÁ÷2ú •ôòÀ÷2| s/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/Debug/4y161to1/x86_64/android_gradle_build.json  ýÅ¹Žƒ3ú •ôòÀ÷2|
z z
x/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/Debug/4y161to1/x86_64/android_gradle_build_mini.json  žùÓÁ÷2ý ôòÀ÷2i x/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/Debug/4y161to1/x86_64/android_gradle_build_mini.json  ýÅ¹Žƒ3ý ôòÀ÷2i
g g
e/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/Debug/4y161to1/x86_64/build.ninja  žùÓÁ÷2ØÌ <20>ôòÀ÷2m e/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/Debug/4y161to1/x86_64/build.ninja  ýÅ¹Žƒ3ØÌ <20>ôòÀ÷2m
k k
i/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/Debug/4y161to1/x86_64/build.ninja.txt  žùÓÁ÷2r i/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/Debug/4y161to1/x86_64/build.ninja.txt  ýÅ¹Žƒ3r
p p
n/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/Debug/4y161to1/x86_64/build_file_index.txt  žùÓÁ÷2 _ ôòÀ÷2s n/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/Debug/4y161to1/x86_64/build_file_index.txt  ýÅ¹Žƒ3 _ ôòÀ÷2s
q q
o/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/Debug/4y161to1/x86_64/compile_commands.json  žùÓÁ÷2w o/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/Debug/4y161to1/x86_64/compile_commands.json  ýÅ¹Žƒ3w
u u
s/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/Debug/4y161to1/x86_64/compile_commands.json.bin  žùÓÁ÷2 } s/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/Debug/4y161to1/x86_64/compile_commands.json.bin  ýÅ¹Žƒ3 }
{ {
y/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/Debug/4y161to1/x86_64/metadata_generation_command.txt  žùÓÁ÷2 y/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/Debug/4y161to1/x86_64/metadata_generation_command.txt  ýÅ¹Žƒ3
ç ôòÀ÷2p ç ôòÀ÷2p
n n
l/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/Debug/4y161to1/x86_64/prefab_config.json  žùÓÁ÷2  ( ôòÀ÷2u l/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/Debug/4y161to1/x86_64/prefab_config.json  ýÅ¹Žƒ3  ( ôòÀ÷2u
s s
q/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/Debug/4y161to1/x86_64/symbol_folder_index.txt  žùÓÁ÷2  h ôòÀ÷2c q/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/Debug/4y161to1/x86_64/symbol_folder_index.txt  ýÅ¹Žƒ3  h ôòÀ÷2c
a a
_/Users/venbateam/Documents/flutter/packages/flutter_tools/gradle/src/main/groovy/CMakeLists.txt  žùÓÁ÷2 ¤ òÑÞ€á2 _/Users/venbateam/Documents/flutter/packages/flutter_tools/gradle/src/main/groovy/CMakeLists.txt  ýÅ¹Žƒ3 ¤ òÑÞ€á2

View File

@ -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 /Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/RelWithDebInfo/574gs2w4/arm64-v8a/additional_project_files.txtC
A A
?com.android.build.gradle.internal.cxx.io.EncodedFileFingerPrint  µ§Ä‚ú2  ™ªÇŸô2„ ?com.android.build.gradle.internal.cxx.io.EncodedFileFingerPrint  ©¥<EFBFBD>û2  ™ªÇŸô2„
<EFBFBD> <EFBFBD>
/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  ©¥<EFBFBD>û2 œªÇŸô2Š
 
/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/RelWithDebInfo/574gs2w4/arm64-v8a/android_gradle_build_mini.json  µ§Ä‚ú2 ¤ªÇŸô2u /Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/RelWithDebInfo/574gs2w4/arm64-v8a/android_gradle_build_mini.json  ©¥<EFBFBD>û2 ¤ªÇŸô2u
s 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  ©¥<EFBFBD>û2²Í ù©ÇŸô2y
w 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  ©¥<EFBFBD>û2~
| |
z/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/RelWithDebInfo/574gs2w4/arm64-v8a/build_file_index.txt  µ§Ä‚ú2 _ ¥ªÇŸô2 z/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/RelWithDebInfo/574gs2w4/arm64-v8a/build_file_index.txt  ©¥<EFBFBD>û2 _ ¥ªÇŸô2
} }
{/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/RelWithDebInfo/574gs2w4/arm64-v8a/compile_commands.json  µ§Ä‚ú2 {/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/RelWithDebInfo/574gs2w4/arm64-v8a/compile_commands.json  ©¥<EFBFBD>û2
<EFBFBD> <EFBFBD>
/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  ©¥<EFBFBD>û2 
ˆ ˆ
/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/RelWithDebInfo/574gs2w4/arm64-v8a/metadata_generation_command.txt  µ§Ä‚ú2 /Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/RelWithDebInfo/574gs2w4/arm64-v8a/metadata_generation_command.txt  ©¥<EFBFBD>û2
š ¥ªÇŸô2| š ¥ªÇŸô2|
z z
x/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/RelWithDebInfo/574gs2w4/arm64-v8a/prefab_config.json  µ§Ä‚ú2  ( ¥ªÇŸô2<C3B4> x/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/RelWithDebInfo/574gs2w4/arm64-v8a/prefab_config.json  ©¥<EFBFBD>û2  ( ¥ªÇŸô2<C3B4>
 
}/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  ©¥<EFBFBD>û2  t ¥ªÇŸô2c
a a
_/Users/venbateam/Documents/flutter/packages/flutter_tools/gradle/src/main/groovy/CMakeLists.txt  µ§Ä‚ú2 ¤ òÑÞ€á2 _/Users/venbateam/Documents/flutter/packages/flutter_tools/gradle/src/main/groovy/CMakeLists.txt  ©¥<EFBFBD>û2 ¤ òÑÞ€á2

View File

@ -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 /Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/RelWithDebInfo/574gs2w4/armeabi-v7a/additional_project_files.txtC
A A
?com.android.build.gradle.internal.cxx.io.EncodedFileFingerPrint  Õ§Ä‚ú2  £¼ÇŸô2‡ ?com.android.build.gradle.internal.cxx.io.EncodedFileFingerPrint  º¥<EFBFBD>û2  £¼ÇŸô2‡
 
<EFBFBD>/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/RelWithDebInfo/574gs2w4/armeabi-v7a/android_gradle_build.json  Õ§Ä‚ú2 ¤¼ÇŸô2Œ <EFBFBD>/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/RelWithDebInfo/574gs2w4/armeabi-v7a/android_gradle_build.json  º¥<EFBFBD>û2 ¤¼ÇŸô2Œ
 
/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/RelWithDebInfo/574gs2w4/armeabi-v7a/android_gradle_build_mini.json  Õ§Ä‚ú2 ¥¼ÇŸô2w /Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/RelWithDebInfo/574gs2w4/armeabi-v7a/android_gradle_build_mini.json  º¥<EFBFBD>û2 ¥¼ÇŸô2w
u 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  º¥<EFBFBD>û2¾Í ¼ÇŸô2{
y 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  º¥<EFBFBD>û2
~ ~
|/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/RelWithDebInfo/574gs2w4/armeabi-v7a/build_file_index.txt  Õ§Ä‚ú2 _ ¦¼ÇŸô2<C3B4> |/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/RelWithDebInfo/574gs2w4/armeabi-v7a/build_file_index.txt  º¥<EFBFBD>û2 _ ¦¼ÇŸô2<C3B4>
 
}/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  º¥<EFBFBD>û2
 
<EFBFBD>/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/RelWithDebInfo/574gs2w4/armeabi-v7a/compile_commands.json.bin  Õ§Ä‚ú2 <09> <EFBFBD>/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/RelWithDebInfo/574gs2w4/armeabi-v7a/compile_commands.json.bin  º¥<EFBFBD>û2 <09>
Š Š
/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  º¥<EFBFBD>û2
¤ ¥¼ÇŸô2~ ¤ ¥¼ÇŸô2~
| |
z/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/RelWithDebInfo/574gs2w4/armeabi-v7a/prefab_config.json  Õ§Ä‚ú2  ( ¦¼ÇŸô2„ z/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/RelWithDebInfo/574gs2w4/armeabi-v7a/prefab_config.json  º¥<EFBFBD>û2  ( ¦¼ÇŸô2„
<EFBFBD> <EFBFBD>
/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  º¥<EFBFBD>û2  v ¦¼ÇŸô2c
a a
_/Users/venbateam/Documents/flutter/packages/flutter_tools/gradle/src/main/groovy/CMakeLists.txt  Õ§Ä‚ú2 ¤ òÑÞ€á2 _/Users/venbateam/Documents/flutter/packages/flutter_tools/gradle/src/main/groovy/CMakeLists.txt  º¥<EFBFBD>û2 ¤ òÑÞ€á2

View File

@ -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 |/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/RelWithDebInfo/574gs2w4/x86/additional_project_files.txtC
A A
?com.android.build.gradle.internal.cxx.io.EncodedFileFingerPrint  Þ§Ä‚ú2  µÂÇŸô2} ?com.android.build.gradle.internal.cxx.io.EncodedFileFingerPrint  Ã¥<EFBFBD>û2  µÂÇŸô2}
{ {
y/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/RelWithDebInfo/574gs2w4/x86/android_gradle_build.json  Þ§Ä‚ú2 ·ÂÇŸô2ƒ y/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/RelWithDebInfo/574gs2w4/x86/android_gradle_build.json  Ã¥<EFBFBD>û2 ·ÂÇŸô2ƒ
 
~/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/RelWithDebInfo/574gs2w4/x86/android_gradle_build_mini.json  Þ§Ä‚ú2 ¸ÂÇŸô2o ~/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/RelWithDebInfo/574gs2w4/x86/android_gradle_build_mini.json  Ã¥<EFBFBD>û2 ¸ÂÇŸô2o
m 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  Ã¥<EFBFBD>û2ŽÍ ¨ÂÇŸô2s
q 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  Ã¥<EFBFBD>û2x
v 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  Ã¥<EFBFBD>û2 _ ¹ÂÇŸô2y
w 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  Ã¥<EFBFBD>û2}
{ {
y/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/RelWithDebInfo/574gs2w4/x86/compile_commands.json.bin  Þ§Ä‚ú2 y/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/RelWithDebInfo/574gs2w4/x86/compile_commands.json.bin  Ã¥<EFBFBD>û2
<EFBFBD> <EFBFBD>
/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  Ã¥<EFBFBD>û2
ü ¹ÂÇŸô2v ü ¹ÂÇŸô2v
t 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  Ã¥<EFBFBD>û2  ( ¹ÂÇŸô2{
y 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  Ã¥<EFBFBD>û2  n ¹ÂÇŸô2c
a a
_/Users/venbateam/Documents/flutter/packages/flutter_tools/gradle/src/main/groovy/CMakeLists.txt  Þ§Ä‚ú2 ¤ òÑÞ€á2 _/Users/venbateam/Documents/flutter/packages/flutter_tools/gradle/src/main/groovy/CMakeLists.txt  Ã¥<EFBFBD>û2 ¤ òÑÞ€á2

View File

@ -2,27 +2,27 @@ C/C++ Structured Log
<EFBFBD> <EFBFBD>
/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/RelWithDebInfo/574gs2w4/x86_64/additional_project_files.txtC /Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/RelWithDebInfo/574gs2w4/x86_64/additional_project_files.txtC
A A
?com.android.build.gradle.internal.cxx.io.EncodedFileFingerPrint  Œ¨Ä‚ú2  ·ÆÇŸô2€ ?com.android.build.gradle.internal.cxx.io.EncodedFileFingerPrint  Ê¥<EFBFBD>û2  ·ÆÇŸô2€
~ ~
|/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/RelWithDebInfo/574gs2w4/x86_64/android_gradle_build.json  Œ¨Ä‚ú2Œ ¸ÆÇŸô2‡ |/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/RelWithDebInfo/574gs2w4/x86_64/android_gradle_build.json  Ê¥<EFBFBD>û2Œ ¸ÆÇŸô2‡
 
<EFBFBD>/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/RelWithDebInfo/574gs2w4/x86_64/android_gradle_build_mini.json  Œ¨Ä‚ú2<18> ¹ÆÇŸô2r <EFBFBD>/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/RelWithDebInfo/574gs2w4/x86_64/android_gradle_build_mini.json  Ê¥<EFBFBD>û2<18> ¹ÆÇŸô2r
p 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  Ê¥<EFBFBD>û2 Í §ÆÇŸô2v
t 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  Ê¥<EFBFBD>û2{
y 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  Ê¥<EFBFBD>û2 _ ¹ÆÇŸô2|
z 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  Ê¥<EFBFBD>û2
~ ~
|/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/RelWithDebInfo/574gs2w4/x86_64/compile_commands.json.bin  Œ¨Ä‚ú2 ˆ |/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/RelWithDebInfo/574gs2w4/x86_64/compile_commands.json.bin  Ê¥<EFBFBD>û2 ˆ
 
/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/RelWithDebInfo/574gs2w4/x86_64/metadata_generation_command.txt  Œ¨Ä‚ú2 /Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/RelWithDebInfo/574gs2w4/x86_64/metadata_generation_command.txt  Ê¥<EFBFBD>û2
 ¹ÆÇŸô2y  ¹ÆÇŸô2y
w 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  Ê¥<EFBFBD>û2  ( ¹ÆÇŸô2~
| |
z/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/RelWithDebInfo/574gs2w4/x86_64/symbol_folder_index.txt  Œ¨Ä‚ú2  q ¹ÆÇŸô2c z/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/RelWithDebInfo/574gs2w4/x86_64/symbol_folder_index.txt  Ê¥<EFBFBD>û2  q ¹ÆÇŸô2c
a a
_/Users/venbateam/Documents/flutter/packages/flutter_tools/gradle/src/main/groovy/CMakeLists.txt  Œ¨Ä‚ú2 ¤ òÑÞ€á2 _/Users/venbateam/Documents/flutter/packages/flutter_tools/gradle/src/main/groovy/CMakeLists.txt  Ê¥<EFBFBD>û2 ¤ òÑÞ€á2

View File

@ -20,12 +20,12 @@ if (project.hasProperty('google-services.json')) {
def flutterVersionCode = localProperties.getProperty("flutter.versionCode") def flutterVersionCode = localProperties.getProperty("flutter.versionCode")
if (flutterVersionCode == null) { if (flutterVersionCode == null) {
flutterVersionCode = "61" flutterVersionCode = "62"
} }
def flutterVersionName = localProperties.getProperty("flutter.versionName") def flutterVersionName = localProperties.getProperty("flutter.versionName")
if (flutterVersionName == null) { if (flutterVersionName == null) {
flutterVersionName = "1.0.60" flutterVersionName = "1.0.61"
} }
def keystorePropertiesFile = rootProject.file("key.properties") def keystorePropertiesFile = rootProject.file("key.properties")

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 7.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 19 KiB

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

BIN
assets/icons/misc/lock.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 509 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 764 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 319 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 801 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 557 B

After

Width:  |  Height:  |  Size: 679 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 557 B

View File

@ -506,7 +506,7 @@
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic; CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 7; CURRENT_PROJECT_VERSION = 8;
DEVELOPMENT_ASSET_PATHS = Runner/Assets.xcassets; DEVELOPMENT_ASSET_PATHS = Runner/Assets.xcassets;
DEVELOPMENT_TEAM = 9N5SRFUGK2; DEVELOPMENT_TEAM = 9N5SRFUGK2;
ENABLE_BITCODE = NO; ENABLE_BITCODE = NO;
@ -517,7 +517,7 @@
"$(inherited)", "$(inherited)",
"@executable_path/Frameworks", "@executable_path/Frameworks",
); );
MARKETING_VERSION = 1.0.6; MARKETING_VERSION = 1.0.7;
PRODUCT_BUNDLE_IDENTIFIER = ae.gov.fcsc.frontend.ios; PRODUCT_BUNDLE_IDENTIFIER = ae.gov.fcsc.frontend.ios;
PRODUCT_NAME = "$(TARGET_NAME)"; PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = ""; PROVISIONING_PROFILE_SPECIFIER = "";
@ -705,7 +705,7 @@
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic; CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 7; CURRENT_PROJECT_VERSION = 8;
DEVELOPMENT_ASSET_PATHS = Runner/Assets.xcassets; DEVELOPMENT_ASSET_PATHS = Runner/Assets.xcassets;
DEVELOPMENT_TEAM = 9N5SRFUGK2; DEVELOPMENT_TEAM = 9N5SRFUGK2;
ENABLE_BITCODE = NO; ENABLE_BITCODE = NO;
@ -716,7 +716,7 @@
"$(inherited)", "$(inherited)",
"@executable_path/Frameworks", "@executable_path/Frameworks",
); );
MARKETING_VERSION = 1.0.6; MARKETING_VERSION = 1.0.7;
PRODUCT_BUNDLE_IDENTIFIER = ae.gov.fcsc.frontend.ios; PRODUCT_BUNDLE_IDENTIFIER = ae.gov.fcsc.frontend.ios;
PRODUCT_NAME = "$(TARGET_NAME)"; PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = ""; PROVISIONING_PROFILE_SPECIFIER = "";
@ -742,7 +742,7 @@
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic; CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 7; CURRENT_PROJECT_VERSION = 8;
DEVELOPMENT_ASSET_PATHS = Runner/Assets.xcassets; DEVELOPMENT_ASSET_PATHS = Runner/Assets.xcassets;
DEVELOPMENT_TEAM = 9N5SRFUGK2; DEVELOPMENT_TEAM = 9N5SRFUGK2;
ENABLE_BITCODE = NO; ENABLE_BITCODE = NO;
@ -753,7 +753,7 @@
"$(inherited)", "$(inherited)",
"@executable_path/Frameworks", "@executable_path/Frameworks",
); );
MARKETING_VERSION = 1.0.6; MARKETING_VERSION = 1.0.7;
PRODUCT_BUNDLE_IDENTIFIER = ae.gov.fcsc.frontend.ios; PRODUCT_BUNDLE_IDENTIFIER = ae.gov.fcsc.frontend.ios;
PRODUCT_NAME = "$(TARGET_NAME)"; PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = ""; PROVISIONING_PROFILE_SPECIFIER = "";

View File

@ -2,9 +2,14 @@ abstract class MiscIconAssetPath {
static const _basePath = 'assets/icons/misc'; static const _basePath = 'assets/icons/misc';
static const rightChevronInSemiCircle = static const rightChevronInSemiCircle =
'$_basePath/right_chevron_in_semicircle.png'; '$_basePath/right_chevron_in_semicircle.png';
static const signInWithGoogle = '$_basePath/signInWithGoogle.png';
static const signInWithApple = '$_basePath/signInWithApple.png';
static const signInWithUAEPass = '$_basePath/signInWithUAEPass.png';
static const lock = '$_basePath/lock.png';
static const lockDark = '$_basePath/lockDark.png'; static const lockDark = '$_basePath/lockDark.png';
static const lockLight = '$_basePath/lockLight.png'; static const lockLight = '$_basePath/lockLight.png';
static const menu = '$_basePath/menu.png'; static const menu = '$_basePath/menu.png';
static const person = '$_basePath/person.png';
static const personDark = '$_basePath/personDark.png'; static const personDark = '$_basePath/personDark.png';
static const personLight = '$_basePath/personLight.png'; static const personLight = '$_basePath/personLight.png';
static const back = '$_basePath/back.png'; static const back = '$_basePath/back.png';

View File

@ -4,6 +4,7 @@ import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:shared_preferences/shared_preferences.dart'; import 'package:shared_preferences/shared_preferences.dart';
import 'package:go_router/go_router.dart'; import 'package:go_router/go_router.dart';
import 'package:flutter_svg/flutter_svg.dart'; import 'package:flutter_svg/flutter_svg.dart';
import 'package:uae_stat/config/theme/theme_provider.dart';
import 'package:uae_stat/domain/use_cases/language.dart'; import 'package:uae_stat/domain/use_cases/language.dart';
import 'package:uae_stat/infrastructure/services/img_asset_paths/icons/misc_icon_asset_path.dart'; import 'package:uae_stat/infrastructure/services/img_asset_paths/icons/misc_icon_asset_path.dart';
import 'package:uae_stat/presentation/routes/drawer_routes/custom_drawer_routes.dart'; import 'package:uae_stat/presentation/routes/drawer_routes/custom_drawer_routes.dart';
@ -47,6 +48,13 @@ class _CountryProfilePageState extends ConsumerState<CountryProfilePage> {
setState(() => _searchTerm = value); setState(() => _searchTerm = value);
} }
@override
void initState() {
super.initState();
final currentTheme = ref.read(themeProvider); // should return ThemeMode
print(currentTheme); // ThemeMode.dark, ThemeMode.light, etc.
}
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
final locale = AppLocalizations.of(context)!; final locale = AppLocalizations.of(context)!;

View File

@ -265,7 +265,7 @@ class _UaenumberWidgetState extends ConsumerState<uaenumberWidget> {
} }
return Container( return Container(
color: isDarkTheme ? Color(0xFF333333) : Color(0xFFFFFFFF), // Set background here color: isDarkTheme ? Color(0xFF000000) : Color(0xFFFFFFFF), // Set background here
child: Padding( child: Padding(
padding: const EdgeInsets.only(left: 16.0, right: 16.0, top: 5.0, bottom: 5.0), padding: const EdgeInsets.only(left: 16.0, right: 16.0, top: 5.0, bottom: 5.0),
child: Column( child: Column(
@ -274,11 +274,11 @@ class _UaenumberWidgetState extends ConsumerState<uaenumberWidget> {
height: 40, height: 40,
decoration: BoxDecoration( decoration: BoxDecoration(
color: isDarkTheme ? Color(0xFF000000) : Colors.white, color: isDarkTheme ? Color(0xFF000000) : Colors.white,
borderRadius: BorderRadius.circular(30.0), borderRadius: BorderRadius.circular(5.0),
border: Border.all(width: 1, color: Color(0xFFAA8E83)), border: Border.all(width: 2, color: Color(0xFFA0A0A0)),
), ),
child: Padding( child: Padding(
padding: EdgeInsets.only(left: 12.0), padding: EdgeInsets.only(left: 5.0),
child: TextField( child: TextField(
controller: _searchController, controller: _searchController,
onChanged: (value) { onChanged: (value) {
@ -287,9 +287,9 @@ class _UaenumberWidgetState extends ConsumerState<uaenumberWidget> {
decoration: InputDecoration( decoration: InputDecoration(
hintText: AppLocalizations.of(context)!.search, hintText: AppLocalizations.of(context)!.search,
hintStyle: TextStyle( hintStyle: TextStyle(
color: isDarkTheme ? Color(0xFFBBBBBB) : Color(0xFFAA8E83), color: isDarkTheme ? Color(0xFF898C81) : Color(0xFF898C81),
fontFamily: context.translate('Roboto', 'NotoKufi'), fontFamily: context.translate('Roboto', 'NotoKufi'),
fontSize: 14, fontSize: 18,
// height: 1.8, // height: 1.8,
), ),
prefixIconConstraints: BoxConstraints( prefixIconConstraints: BoxConstraints(
@ -320,7 +320,7 @@ class _UaenumberWidgetState extends ConsumerState<uaenumberWidget> {
}, },
) )
: null, : null,
contentPadding: EdgeInsets.symmetric(vertical: 15, horizontal: 18.0), contentPadding: EdgeInsets.symmetric(vertical: 12, horizontal: 18.0),
border: InputBorder.none, border: InputBorder.none,
// contentPadding: // contentPadding:
// EdgeInsets.symmetric(vertical: 9, horizontal: 18.0), // EdgeInsets.symmetric(vertical: 9, horizontal: 18.0),
@ -502,9 +502,9 @@ class _UaenumberWidgetState extends ConsumerState<uaenumberWidget> {
color: isDarkTheme ? Color(0xFF111111) : Colors.white, color: isDarkTheme ? Color(0xFF111111) : Colors.white,
border: Border.all( border: Border.all(
color: bordercolor, color: bordercolor,
width: 1, width: 2,
), ),
borderRadius: BorderRadius.circular(12), borderRadius: BorderRadius.circular(5),
), ),
padding: const EdgeInsets.only( padding: const EdgeInsets.only(
top: 3.0, bottom: 3.0, left: 5.0, right: 5.0), top: 3.0, bottom: 3.0, left: 5.0, right: 5.0),
@ -605,12 +605,13 @@ class _CustomExpandableTileState extends ConsumerState<CustomExpandableTile> {
onTap: () => widget.onTap(widget.index), onTap: () => widget.onTap(widget.index),
child: Container( child: Container(
decoration: BoxDecoration( decoration: BoxDecoration(
color: isDarkTheme ? Color(0xFF333333) : Colors.white, color: isDarkTheme ? Color(0xFF000000) : Color(0xFFFFFFFF),
), ),
child: Container( child: Container(
decoration: BoxDecoration( decoration: BoxDecoration(
color: widget.titleBackgroundColor, color: widget.titleBackgroundColor,
borderRadius: BorderRadius.all(Radius.circular(35))), borderRadius: BorderRadius.only(topLeft: Radius.circular(20),topRight: Radius.circular(20))
),
padding: const EdgeInsets.only( padding: const EdgeInsets.only(
left: 16, bottom: 5, top: 5, right: 10), left: 16, bottom: 5, top: 5, right: 10),
child: Row( child: Row(
@ -645,13 +646,13 @@ class _CustomExpandableTileState extends ConsumerState<CustomExpandableTile> {
duration: Duration(milliseconds: 300), duration: Duration(milliseconds: 300),
curve: Curves.easeInOut, curve: Curves.easeInOut,
width: double.infinity, width: double.infinity,
color: isDarkTheme ? Color(0xFF333333) : Colors.white, color: isDarkTheme ? Color(0xFF000000) : Color(0xFFFFFFFF),
height: widget.isExpanded ? myheight * 0.52 : 0, height: widget.isExpanded ? myheight * 0.52 : 0,
child: widget.isExpanded child: widget.isExpanded
? SingleChildScrollView( ? SingleChildScrollView(
child: Container( child: Container(
decoration: BoxDecoration( decoration: BoxDecoration(
color: isDarkTheme ? Color(0xFF333333) : Colors.white, color: isDarkTheme ? Color(0xFF000000) : Color(0xFFFFFFFF),
// borderRadius: BorderRadius.all(Radius.circular(20)) // borderRadius: BorderRadius.all(Radius.circular(20))
), ),
padding: const EdgeInsets.all(1), padding: const EdgeInsets.all(1),

View File

@ -7,6 +7,7 @@ import 'package:shared_preferences/shared_preferences.dart';
import 'package:uae_stat/config/api_config.dart'; import 'package:uae_stat/config/api_config.dart';
import 'package:uae_stat/config/connectivity_provider.dart'; import 'package:uae_stat/config/connectivity_provider.dart';
import 'package:uae_stat/config/my_router.dart'; import 'package:uae_stat/config/my_router.dart';
import 'package:uae_stat/config/theme/theme_provider.dart';
import 'package:uae_stat/domain/use_cases/language.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/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/banner_asset_path.dart';
@ -253,6 +254,13 @@ class _CreateNewPwState extends ConsumerState<CreateNewPw> {
context.push('/internetcheck'); context.push('/internetcheck');
} }
}); });
// final themeMode = ref.read(themeProvider);
final themeMode = ThemeMode.dark;
final isDarkTheme = themeMode == ThemeMode.dark ||
(themeMode == ThemeMode.system &&
MediaQuery.of(context).platformBrightness == Brightness.dark);
return PopScope( return PopScope(
canPop: false, // Allow back navigation only if not login screen canPop: false, // Allow back navigation only if not login screen
onPopInvokedWithResult: (didPop, result) { onPopInvokedWithResult: (didPop, result) {
@ -260,7 +268,7 @@ class _CreateNewPwState extends ConsumerState<CreateNewPw> {
logout(context);// Show exit confirmation dialog logout(context);// Show exit confirmation dialog
}, },
child: Scaffold( child: Scaffold(
backgroundColor: Colors.white, backgroundColor: isDarkTheme ? Color(0xFF111111) : Colors.white,
body: Stack(children: [ body: Stack(children: [
SingleChildScrollView( SingleChildScrollView(
child: SafeArea( child: SafeArea(
@ -298,6 +306,10 @@ class _CreateNewPwState extends ConsumerState<CreateNewPw> {
Widget _buildPasswordForm( Widget _buildPasswordForm(
WidgetRef ref, double screenHeight, double screenWidth) { WidgetRef ref, double screenHeight, double screenWidth) {
final passwordLocale = ref.watch(localeProvider); final passwordLocale = ref.watch(localeProvider);
final themeMode = ref.read(themeProvider);
final isDarkTheme = themeMode == ThemeMode.dark ||
(themeMode == ThemeMode.system &&
MediaQuery.of(context).platformBrightness == Brightness.dark);
return Form( return Form(
key: _formKey, key: _formKey,
child: Padding( child: Padding(
@ -322,7 +334,7 @@ class _CreateNewPwState extends ConsumerState<CreateNewPw> {
// Icons.close, // Icons.close,
Icons.arrow_back_ios, Icons.arrow_back_ios,
size: 24, // Icon size size: 24, // Icon size
color: Colors.black, // Icon color color: isDarkTheme ? Colors.white : Colors.black, // Icon color
), ),
), ),
), // Left icon ), // Left icon
@ -363,6 +375,7 @@ class _CreateNewPwState extends ConsumerState<CreateNewPw> {
), ),
fontSize: passwordLocale?.languageCode == 'ar' ? 24 : 26, fontSize: passwordLocale?.languageCode == 'ar' ? 24 : 26,
fontWeight: FontWeight.w300, fontWeight: FontWeight.w300,
color: isDarkTheme ? Colors.white : null,
), ),
), ),
SizedBox(height: 10), SizedBox(height: 10),
@ -410,7 +423,7 @@ class _CreateNewPwState extends ConsumerState<CreateNewPw> {
hintText: AppLocalizations.of(context)!.old_password, hintText: AppLocalizations.of(context)!.old_password,
// prefixIcon: Icon(Icons.lock, color: Colors.blue), // prefixIcon: Icon(Icons.lock, color: Colors.blue),
hintStyle: TextStyle( hintStyle: TextStyle(
color: Color(0xFFC3C6CB), color: isDarkTheme ? Colors.white : Color(0xFFC3C6CB),
fontWeight: FontWeight.w400, fontWeight: FontWeight.w400,
fontFamily: context.translate( fontFamily: context.translate(
'Roboto', 'Roboto',
@ -426,11 +439,11 @@ class _CreateNewPwState extends ConsumerState<CreateNewPw> {
end: 10, end: 10,
), ),
child: Image.asset( child: Image.asset(
MiscIconAssetPath.lockLight, isDarkTheme ? MiscIconAssetPath.lockDark : MiscIconAssetPath.lockLight,
fit: BoxFit.fitHeight, fit: BoxFit.fitHeight,
height: 25, height: 25,
width: 25, width: 25,
color: MyTheme.topicColor(IndicatorTopic.economy).shade300, color: isDarkTheme ? Colors.white : MyTheme.topicColor(IndicatorTopic.economy).shade300,
), ),
), ),
suffixIcon: IconButton( suffixIcon: IconButton(

View File

@ -635,7 +635,7 @@ class _RegisterScreenState extends ConsumerState<RegisterScreen> {
), ),
fontSize: 32, fontSize: 32,
fontWeight: FontWeight.w400, fontWeight: FontWeight.w400,
color: isDarkTheme ? Color(0xFFFFFFFF) : null, color: isDarkTheme ? Color(0xFFFFFFFF) : Color(0xFF000000),
), ),
), ),
SizedBox(height: 10), SizedBox(height: 10),
@ -649,7 +649,7 @@ class _RegisterScreenState extends ConsumerState<RegisterScreen> {
), ),
fontSize: fontSize:
context.translate(18.0, 14.0), context.translate(18.0, 14.0),
color: isDarkTheme ? Color(0xFFFFFFFF) : Color(0xff898C81), color: isDarkTheme ? Color(0xFFFFFFFF) : Color(0xFF898C81),
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
), ),
), ),
@ -694,14 +694,10 @@ class _RegisterScreenState extends ConsumerState<RegisterScreen> {
end: 10, end: 10,
), ),
child: Image.asset( child: Image.asset(
MiscIconAssetPath.personLight, MiscIconAssetPath.person,
fit: BoxFit.fitHeight, fit: BoxFit.fitHeight,
height: 25, height: 25,
width: 25, width: 25,
color: MyTheme.topicColor(
IndicatorTopic
.economy)
.shade300,
), ),
), ),
@ -715,7 +711,7 @@ class _RegisterScreenState extends ConsumerState<RegisterScreen> {
borderRadius: borderRadius:
BorderRadius.circular(10), BorderRadius.circular(10),
borderSide: BorderSide( borderSide: BorderSide(
color: isDarkTheme ? Colors.white : MyTheme.topicColor(IndicatorTopic.economy).shade400, // border color: Color(0xFFB68A34), // border
width: 1), // Enabled border width: 1), // Enabled border
), ),
focusedBorder: OutlineInputBorder( focusedBorder: OutlineInputBorder(
@ -729,7 +725,7 @@ class _RegisterScreenState extends ConsumerState<RegisterScreen> {
borderRadius: borderRadius:
BorderRadius.circular(10), BorderRadius.circular(10),
borderSide: BorderSide( borderSide: BorderSide(
color: isDarkTheme ? Color(0xFFFFA100) : Color(0xFFb22222), color: Color(0xFFD83731),
width: 1), // Error border width: 1), // Error border
), ),
focusedErrorBorder: focusedErrorBorder:
@ -737,7 +733,7 @@ class _RegisterScreenState extends ConsumerState<RegisterScreen> {
borderRadius: borderRadius:
BorderRadius.circular(10), BorderRadius.circular(10),
borderSide: BorderSide( borderSide: BorderSide(
color: isDarkTheme ? Color(0xFFFFA100) : Color(0xFFb22222), color: Color(0xFFD83731),
width: width:
1), // Match the error color 1), // Match the error color
), ),
@ -747,7 +743,7 @@ class _RegisterScreenState extends ConsumerState<RegisterScreen> {
'Roboto', 'Roboto',
'NotoKufi', 'NotoKufi',
), ),
color: isDarkTheme ? const Color(0xFFEEEEEE) : const Color(0xFFC3C6CB), color: const Color(0xFFC3C6CB),
fontSize: registerLocale fontSize: registerLocale
?.languageCode == ?.languageCode ==
'ar' 'ar'
@ -804,12 +800,8 @@ class _RegisterScreenState extends ConsumerState<RegisterScreen> {
child: Image.asset( child: Image.asset(
MiscIconAssetPath.vector, MiscIconAssetPath.vector,
fit: BoxFit.fitHeight, fit: BoxFit.fitHeight,
height: 20, height: 25,
width: 25, width: 25,
color: MyTheme.topicColor(
IndicatorTopic
.economy)
.shade100,
), ),
), ),
@ -818,7 +810,7 @@ class _RegisterScreenState extends ConsumerState<RegisterScreen> {
borderRadius: borderRadius:
BorderRadius.circular(10), BorderRadius.circular(10),
borderSide: BorderSide( borderSide: BorderSide(
color: isDarkTheme ? Colors.white : MyTheme.topicColor(IndicatorTopic.economy).shade400, color: Color(0xFFB68A34),
width: 1), width: 1),
), ),
focusedBorder: OutlineInputBorder( focusedBorder: OutlineInputBorder(
@ -832,7 +824,7 @@ class _RegisterScreenState extends ConsumerState<RegisterScreen> {
borderRadius: borderRadius:
BorderRadius.circular(10), BorderRadius.circular(10),
borderSide: BorderSide( borderSide: BorderSide(
color: isDarkTheme ? Color(0xFFFFA100) : Color(0xFFb22222), color: Color(0xFFD83731),
width: 1), // Error border width: 1), // Error border
), ),
focusedErrorBorder: focusedErrorBorder:
@ -840,7 +832,7 @@ class _RegisterScreenState extends ConsumerState<RegisterScreen> {
borderRadius: borderRadius:
BorderRadius.circular(10), BorderRadius.circular(10),
borderSide: BorderSide( borderSide: BorderSide(
color: isDarkTheme ? Color(0xFFFFA100) : Color(0xFFb22222), color: Color(0xFFD83731),
width: width:
1), // Match the error color 1), // Match the error color
), ),
@ -850,7 +842,7 @@ class _RegisterScreenState extends ConsumerState<RegisterScreen> {
'Roboto', 'Roboto',
'NotoKufi', 'NotoKufi',
), ),
color: isDarkTheme ? const Color(0xFFEEEEEE) : const Color(0xFFC3C6CB), color: const Color(0xFFC3C6CB),
fontSize: registerLocale fontSize: registerLocale
?.languageCode == ?.languageCode ==
'ar' 'ar'
@ -908,14 +900,10 @@ class _RegisterScreenState extends ConsumerState<RegisterScreen> {
end: 10, end: 10,
), ),
child: Image.asset( child: Image.asset(
MiscIconAssetPath.lockLight, MiscIconAssetPath.lock,
fit: BoxFit.fitHeight, fit: BoxFit.fitHeight,
height: 25, height: 25,
width: 25, width: 25,
color: MyTheme.topicColor(
IndicatorTopic
.economy)
.shade300,
), ),
), ),
@ -956,7 +944,7 @@ class _RegisterScreenState extends ConsumerState<RegisterScreen> {
borderRadius: borderRadius:
BorderRadius.circular(10), BorderRadius.circular(10),
borderSide: BorderSide( borderSide: BorderSide(
color: isDarkTheme ? Colors.white : MyTheme.topicColor(IndicatorTopic.economy).shade400, color: Color(0xFFB68A34),
width: 1), width: 1),
), ),
focusedBorder: OutlineInputBorder( focusedBorder: OutlineInputBorder(
@ -970,7 +958,7 @@ class _RegisterScreenState extends ConsumerState<RegisterScreen> {
borderRadius: borderRadius:
BorderRadius.circular(10), BorderRadius.circular(10),
borderSide: BorderSide( borderSide: BorderSide(
color: isDarkTheme ? Color(0xFFFFA100) : Color(0xFFb22222), color: Color(0xFFD83731),
width: 1), // Error border width: 1), // Error border
), ),
focusedErrorBorder: focusedErrorBorder:
@ -978,7 +966,7 @@ class _RegisterScreenState extends ConsumerState<RegisterScreen> {
borderRadius: borderRadius:
BorderRadius.circular(10), BorderRadius.circular(10),
borderSide: BorderSide( borderSide: BorderSide(
color: isDarkTheme ? Color(0xFFFFA100) : Color(0xFFb22222), color: Color(0xFFD83731),
width: width:
1), // Match the error color 1), // Match the error color
), ),
@ -989,7 +977,7 @@ class _RegisterScreenState extends ConsumerState<RegisterScreen> {
'Roboto', 'Roboto',
'NotoKufi', 'NotoKufi',
), ),
color: isDarkTheme ? const Color(0xFFEEEEEE) : const Color(0xFFC3C6CB), color: const Color(0xFFC3C6CB),
fontSize: registerLocale fontSize: registerLocale
?.languageCode == ?.languageCode ==
'ar' 'ar'
@ -1045,14 +1033,10 @@ class _RegisterScreenState extends ConsumerState<RegisterScreen> {
end: 10, end: 10,
), ),
child: Image.asset( child: Image.asset(
MiscIconAssetPath.lockLight, MiscIconAssetPath.lock,
fit: BoxFit.fitHeight, fit: BoxFit.fitHeight,
height: 25, height: 25,
width: 25, width: 25,
color: MyTheme.topicColor(
IndicatorTopic
.economy)
.shade300,
), ),
), ),
@ -1083,7 +1067,7 @@ class _RegisterScreenState extends ConsumerState<RegisterScreen> {
borderRadius: borderRadius:
BorderRadius.circular(10), BorderRadius.circular(10),
borderSide: BorderSide( borderSide: BorderSide(
color: isDarkTheme ? Colors.white : MyTheme.topicColor(IndicatorTopic.economy).shade400, color: Color(0xFFB68A34),
width: 1), width: 1),
), ),
focusedBorder: OutlineInputBorder( focusedBorder: OutlineInputBorder(
@ -1097,7 +1081,7 @@ class _RegisterScreenState extends ConsumerState<RegisterScreen> {
borderRadius: borderRadius:
BorderRadius.circular(10), BorderRadius.circular(10),
borderSide: BorderSide( borderSide: BorderSide(
color: isDarkTheme ? Color(0xFFFFA100) : Color(0xFFb22222), color: Color(0xFFD83731),
width: 1), // Error border width: 1), // Error border
), ),
focusedErrorBorder: focusedErrorBorder:
@ -1105,7 +1089,7 @@ class _RegisterScreenState extends ConsumerState<RegisterScreen> {
borderRadius: borderRadius:
BorderRadius.circular(10), BorderRadius.circular(10),
borderSide: BorderSide( borderSide: BorderSide(
color: isDarkTheme ? Color(0xFFFFA100) : Color(0xFFb22222), color: Color(0xFFD83731),
width: width:
1), // Match the error color 1), // Match the error color
), ),
@ -1115,7 +1099,7 @@ class _RegisterScreenState extends ConsumerState<RegisterScreen> {
'Roboto', 'Roboto',
'NotoKufi', 'NotoKufi',
), ),
color: isDarkTheme ? const Color(0xFFEEEEEE) : const Color(0xFFC3C6CB), color: const Color(0xFFC3C6CB),
fontSize: registerLocale fontSize: registerLocale
?.languageCode == ?.languageCode ==
'ar' 'ar'
@ -1156,8 +1140,8 @@ class _RegisterScreenState extends ConsumerState<RegisterScreen> {
}, },
side: BorderSide( side: BorderSide(
color: showError color: showError
? isDarkTheme ? Color(0xFFFFA200) : Color(0xFFb22222) ? Color(0xFFD83731)
: isDarkTheme ? Colors.white : MyTheme.topicColor(IndicatorTopic.economy).shade400, : Color(0xFFB68A34),
width: 1, width: 1,
), ),
), ),
@ -1186,7 +1170,7 @@ class _RegisterScreenState extends ConsumerState<RegisterScreen> {
'ar' 'ar'
? 12 ? 12
: 14, : 14,
color: isDarkTheme ? Color(0xFFEEEEEE) : Color(0xFF898C81), // Change to your desired color color: isDarkTheme ? Color(0xFFFFFFFF) : Color(0xFF898C81), // Change to your desired color
), ),
children: [ children: [
TextSpan( TextSpan(
@ -1213,7 +1197,7 @@ class _RegisterScreenState extends ConsumerState<RegisterScreen> {
fontWeight: fontWeight:
FontWeight FontWeight
.bold, .bold,
color:isDarkTheme ? Color(0xFF9EB3E4) : Color(0xFF985400), color:isDarkTheme ? Color(0xFFB68A35) : Color(0xFF985400),
// Makes the text bold // Makes the text bold
// decoration: // decoration:
// TextDecoration.underline, // TextDecoration.underline,
@ -1232,7 +1216,7 @@ class _RegisterScreenState extends ConsumerState<RegisterScreen> {
'Roboto', 'Roboto',
'NotoKufi', 'NotoKufi',
), ),
color: isDarkTheme ? Color(0xFFEEEEEE) : Color(0xFF898C81), color: isDarkTheme ? Color(0xFFFFFFFF) : Color(0xFF898C81),
), ),
), ),
TextSpan( TextSpan(
@ -1258,7 +1242,7 @@ class _RegisterScreenState extends ConsumerState<RegisterScreen> {
'ar' 'ar'
? 12 ? 12
: 14, : 14,
color: isDarkTheme ? Color(0xFF9EB3E4) : Color(0xFF985400), color: isDarkTheme ? Color(0xFFB68A35) : Color(0xFF985400),
// decoration: // decoration:
// TextDecoration.underline, // TextDecoration.underline,
decorationColor: decorationColor:
@ -1283,7 +1267,7 @@ class _RegisterScreenState extends ConsumerState<RegisterScreen> {
'ar' 'ar'
? 12 ? 12
: 14, : 14,
color: isDarkTheme ? Color(0xFFEEEEEE) : Color( 0xFF898C81), // Change to your desired color color: isDarkTheme ? Color(0xFFFFFFFF) : Color( 0xFF898C81), // Change to your desired color
), ),
), ),
], ],
@ -1320,7 +1304,7 @@ class _RegisterScreenState extends ConsumerState<RegisterScreen> {
'Roboto', 'Roboto',
'NotoKufi', 'NotoKufi',
), ),
color: isDarkTheme ? Color(0xFFFFA200) : Color(0xFFb22222), color: Color(0xFFD83731),
fontSize: registerLocale fontSize: registerLocale
?.languageCode == ?.languageCode ==
'ar' 'ar'
@ -1345,7 +1329,7 @@ class _RegisterScreenState extends ConsumerState<RegisterScreen> {
? null ? null
: _registerUser, : _registerUser,
style: ElevatedButton.styleFrom( style: ElevatedButton.styleFrom(
backgroundColor: isDarkTheme ? Color(0xFF9EB3E4) : Color(0xFFA7887A), // Brownish color for Register backgroundColor: Color(0xFFB68A34), // Brownish color for Register
shape: RoundedRectangleBorder( shape: RoundedRectangleBorder(
borderRadius: borderRadius:
BorderRadius.circular(10), BorderRadius.circular(10),
@ -1369,14 +1353,14 @@ class _RegisterScreenState extends ConsumerState<RegisterScreen> {
'ar' 'ar'
? 14 ? 14
: 16, : 16,
color: isDarkTheme ? Color(0xFF000000) : Colors.white color: Colors.white
), ),
), ),
SizedBox(width: 8), SizedBox(width: 8),
Icon( Icon(
Icons Icons
.chevron_right_outlined, .chevron_right_outlined,
color: isDarkTheme ? Color(0xFF000000) : Colors.white, // Set your desired color here color: Colors.white, // Set your desired color here
) )
], ],
), ),
@ -1398,7 +1382,7 @@ class _RegisterScreenState extends ConsumerState<RegisterScreen> {
'ar' 'ar'
? 12 ? 12
: 14, : 14,
color: isDarkTheme ? Color(0xFFEEEEEE) : Color(0xFF898C81), color: isDarkTheme ? Color(0xFFFFFFFF) : Color(0xFF898C81),
), ),
), ),
SizedBox(height: 15), SizedBox(height: 15),
@ -1415,7 +1399,7 @@ class _RegisterScreenState extends ConsumerState<RegisterScreen> {
context.pop(); context.pop();
}, },
style: ElevatedButton.styleFrom( style: ElevatedButton.styleFrom(
backgroundColor: isDarkTheme ? Color(0xFF24B4FB) : Color(0xFF82AFCB), // Blueish color for Login backgroundColor: Color(0xFFB68A34), // Blueish color for Login
shape: RoundedRectangleBorder( shape: RoundedRectangleBorder(
borderRadius: borderRadius:
BorderRadius.circular(10), BorderRadius.circular(10),
@ -1438,13 +1422,13 @@ class _RegisterScreenState extends ConsumerState<RegisterScreen> {
'ar' 'ar'
? 14 ? 14
: 16, : 16,
color: isDarkTheme ? Color(0xFF000000) : Colors.white), color: Colors.white),
), ),
SizedBox(width: 8), SizedBox(width: 8),
Icon( Icon(
Icons Icons
.chevron_right_outlined, .chevron_right_outlined,
color: isDarkTheme ? Color(0xFF000000) : Colors.white, // Set your desired color here color: Colors.white, // Set your desired color here
) )
], ],
), ),

File diff suppressed because it is too large Load Diff

View File

@ -15,6 +15,7 @@ import 'package:shared_preferences/shared_preferences.dart';
import 'package:uae_stat/config/api_config.dart'; import 'package:uae_stat/config/api_config.dart';
import 'package:uae_stat/config/connectivity_provider.dart'; import 'package:uae_stat/config/connectivity_provider.dart';
import 'package:uae_stat/config/my_theme.dart'; import 'package:uae_stat/config/my_theme.dart';
import 'package:uae_stat/config/theme/theme_provider.dart';
import 'package:uae_stat/domain/use_cases/language.dart'; import 'package:uae_stat/domain/use_cases/language.dart';
import 'package:uae_stat/infrastructure/data/p_auth_repo.dart'; import 'package:uae_stat/infrastructure/data/p_auth_repo.dart';
import 'package:uae_stat/infrastructure/services/img_asset_paths/icons/misc_icon_asset_path.dart'; import 'package:uae_stat/infrastructure/services/img_asset_paths/icons/misc_icon_asset_path.dart';
@ -83,6 +84,7 @@ class _ProfileScreenState extends ConsumerState<ProfileScreen> {
bool showError = false; bool showError = false;
final _picker = ImagePicker(); final _picker = ImagePicker();
File? _profileImage; File? _profileImage;
late bool isDarkTheme;
// Regular expression to validate Full Name (no special characters) // Regular expression to validate Full Name (no special characters)
final RegExp _nameRegExp = RegExp(r"^[a-zA-Z\s]+$"); final RegExp _nameRegExp = RegExp(r"^[a-zA-Z\s]+$");
@ -96,6 +98,11 @@ class _ProfileScreenState extends ConsumerState<ProfileScreen> {
super.initState(); super.initState();
// print(widget.userId); // print(widget.userId);
final themeMode = ref.read(themeProvider);
isDarkTheme = themeMode == ThemeMode.dark ||
(themeMode == ThemeMode.system &&
MediaQuery.of(context).platformBrightness == Brightness.dark);
// Add listeners for focus nodes // Add listeners for focus nodes
for (int i = 0; i < _focusNodes.length; i++) { for (int i = 0; i < _focusNodes.length; i++) {
_focusNodes[i].addListener(() { _focusNodes[i].addListener(() {
@ -515,6 +522,12 @@ class _ProfileScreenState extends ConsumerState<ProfileScreen> {
} }
}); });
final profileLocale = ref.watch(localeProvider); final profileLocale = ref.watch(localeProvider);
final themeMode = ref.read(themeProvider);
final isDarkTheme = themeMode == ThemeMode.dark ||
(themeMode == ThemeMode.system &&
MediaQuery.of(context).platformBrightness == Brightness.dark);
return PopScope( return PopScope(
canPop: false, // Allow back navigation only if not login screen canPop: false, // Allow back navigation only if not login screen
onPopInvokedWithResult: (didPop, result) { onPopInvokedWithResult: (didPop, result) {
@ -580,7 +593,7 @@ class _ProfileScreenState extends ConsumerState<ProfileScreen> {
), ),
body: SingleChildScrollView( body: SingleChildScrollView(
child: Container( child: Container(
color: Colors.white, color: isDarkTheme ? Color(0xFF111111) : null,
child: Form( child: Form(
key: _formKey, key: _formKey,
child: Padding( child: Padding(
@ -716,7 +729,7 @@ class _ProfileScreenState extends ConsumerState<ProfileScreen> {
'Roboto', 'Roboto',
'NotoKufi', 'NotoKufi',
), ),
color: Color(0xFFC3C6CB), color: isDarkTheme ? Colors.white : Color(0xFFC3C6CB),
fontSize: 14, fontSize: 14,
), ),
border: OutlineInputBorder( border: OutlineInputBorder(
@ -763,7 +776,7 @@ class _ProfileScreenState extends ConsumerState<ProfileScreen> {
enabledBorder: OutlineInputBorder( enabledBorder: OutlineInputBorder(
borderRadius: BorderRadius.circular(10), borderRadius: BorderRadius.circular(10),
borderSide: BorderSide( borderSide: BorderSide(
color: MyTheme.topicColor(IndicatorTopic.economy) color: isDarkTheme ? Colors.white : MyTheme.topicColor(IndicatorTopic.economy)
.shade400, .shade400,
width: 1), // Enabled border width: 1), // Enabled border
), ),
@ -773,12 +786,12 @@ class _ProfileScreenState extends ConsumerState<ProfileScreen> {
'Roboto', 'Roboto',
'NotoKufi', 'NotoKufi',
), ),
color: Color(0xFFC3C6CB), color: isDarkTheme ? Colors.white : Color(0xFFC3C6CB),
fontSize: 14, fontSize: 14,
), ),
border: OutlineInputBorder( border: OutlineInputBorder(
borderSide: BorderSide( borderSide: BorderSide(
color: Color(0xFF7296BE), color: isDarkTheme ? Colors.white : Color(0xFF7296BE),
), ),
borderRadius: BorderRadius.circular(8), borderRadius: BorderRadius.circular(8),
), ),
@ -798,7 +811,9 @@ class _ProfileScreenState extends ConsumerState<ProfileScreen> {
'Roboto', 'Roboto',
'NotoKufi', 'NotoKufi',
), ),
fontSize: 16, fontWeight: FontWeight.w500), fontSize: 16, fontWeight: FontWeight.w500,
color:isDarkTheme ? Colors.white : null,
),
), ),
], ],
), ),
@ -813,14 +828,14 @@ class _ProfileScreenState extends ConsumerState<ProfileScreen> {
enabledBorder: OutlineInputBorder( enabledBorder: OutlineInputBorder(
borderRadius: BorderRadius.circular(10), borderRadius: BorderRadius.circular(10),
borderSide: BorderSide( borderSide: BorderSide(
color: color:isDarkTheme ? Colors.white :
MyTheme.topicColor(IndicatorTopic.economy) MyTheme.topicColor(IndicatorTopic.economy)
.shade400, .shade400,
width: 1), // Enabled border width: 1), // Enabled border
), ),
border: OutlineInputBorder( border: OutlineInputBorder(
borderSide: BorderSide( borderSide: BorderSide(
color: Color(0xFF7296BE), color:isDarkTheme ? Colors.white : Color(0xFF7296BE),
), ),
borderRadius: BorderRadius.circular(8), borderRadius: BorderRadius.circular(8),
), ),
@ -831,7 +846,7 @@ class _ProfileScreenState extends ConsumerState<ProfileScreen> {
'Roboto', 'Roboto',
'NotoKufi', 'NotoKufi',
), ),
color: Color(0xFFC3C6CB), color: isDarkTheme ? Colors.white : Color(0xFFC3C6CB),
fontSize: 14, fontSize: 14,
), ),
@ -863,7 +878,9 @@ class _ProfileScreenState extends ConsumerState<ProfileScreen> {
'Roboto', 'Roboto',
'NotoKufi', 'NotoKufi',
), ),
fontSize: 16, fontWeight: FontWeight.w500), fontSize: 16, fontWeight: FontWeight.w500,
color: isDarkTheme ? Colors.white : null
),
), ),
], ],
), ),
@ -879,14 +896,14 @@ class _ProfileScreenState extends ConsumerState<ProfileScreen> {
enabledBorder: OutlineInputBorder( enabledBorder: OutlineInputBorder(
borderRadius: BorderRadius.circular(10), borderRadius: BorderRadius.circular(10),
borderSide: BorderSide( borderSide: BorderSide(
color: color: isDarkTheme ? Colors.white :
MyTheme.topicColor(IndicatorTopic.economy) MyTheme.topicColor(IndicatorTopic.economy)
.shade400, .shade400,
width: 1), // Enabled border width: 1), // Enabled border
), ),
border: OutlineInputBorder( border: OutlineInputBorder(
borderSide: BorderSide( borderSide: BorderSide(
color: Color(0xFF7296BE), color: isDarkTheme ? Colors.white : Color(0xFF7296BE),
), ),
borderRadius: BorderRadius.circular(8), borderRadius: BorderRadius.circular(8),
), ),
@ -903,7 +920,8 @@ class _ProfileScreenState extends ConsumerState<ProfileScreen> {
fontFamily: context.translate( fontFamily: context.translate(
'Roboto', 'Roboto',
'NotoKufi', 'NotoKufi',
) ),
color: isDarkTheme ? Colors.white : null,
),), ),),
)) ))
.toList(), .toList(),
@ -926,7 +944,9 @@ class _ProfileScreenState extends ConsumerState<ProfileScreen> {
'Roboto', 'Roboto',
'NotoKufi', 'NotoKufi',
), ),
fontSize: 16, fontWeight: FontWeight.w500), fontSize: 16, fontWeight: FontWeight.w500,
color: isDarkTheme ? Colors.white : null,
),
), ),
], ],
), ),
@ -942,14 +962,14 @@ class _ProfileScreenState extends ConsumerState<ProfileScreen> {
enabledBorder: OutlineInputBorder( enabledBorder: OutlineInputBorder(
borderRadius: BorderRadius.circular(10), borderRadius: BorderRadius.circular(10),
borderSide: BorderSide( borderSide: BorderSide(
color: color: isDarkTheme ? Colors.white :
MyTheme.topicColor(IndicatorTopic.economy) MyTheme.topicColor(IndicatorTopic.economy)
.shade400, .shade400,
width: 1), // Enabled border width: 1), // Enabled border
), ),
border: OutlineInputBorder( border: OutlineInputBorder(
borderSide: BorderSide( borderSide: BorderSide(
color: Color(0xFF7296BE), color: isDarkTheme ? Colors.white : Color(0xFF7296BE),
), ),
borderRadius: BorderRadius.circular(8), borderRadius: BorderRadius.circular(8),
), ),
@ -966,7 +986,8 @@ class _ProfileScreenState extends ConsumerState<ProfileScreen> {
fontFamily: context.translate( fontFamily: context.translate(
'Roboto', 'Roboto',
'NotoKufi', 'NotoKufi',
) ),
color: isDarkTheme ? Colors.white : null,
),), ),),
)) ))
.toList(), .toList(),
@ -991,8 +1012,9 @@ class _ProfileScreenState extends ConsumerState<ProfileScreen> {
}, },
side: BorderSide( side: BorderSide(
color: showError color: showError
? Color(0xFFb22222) ? isDarkTheme ? Color(0xFFFFA200) : Color(0xFFb22222)
: Color(0xFF7296BE), : isDarkTheme ? Colors.white : Color(0xFF7296BE),
width: 1, width: 1,
), ),
), ),
@ -1012,9 +1034,7 @@ class _ProfileScreenState extends ConsumerState<ProfileScreen> {
), ),
fontWeight: FontWeight.w500, fontWeight: FontWeight.w500,
fontSize: 14, fontSize: 14,
color: Color( color: isDarkTheme ? Colors.white : Color(0xFF898C81), // Change to your desired color
0xFF898C81,
), // Change to your desired color
), ),
children: [ children: [
TextSpan( TextSpan(
@ -1031,7 +1051,7 @@ class _ProfileScreenState extends ConsumerState<ProfileScreen> {
), ),
fontSize: 14, fontSize: 14,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
color: Color(0xFF985400), color: isDarkTheme ? Color(0xFF9EB3E4) : Color(0xFF985400),
// Makes the text bold // Makes the text bold
// decoration: // decoration:
// TextDecoration.underline, // TextDecoration.underline,
@ -1045,7 +1065,7 @@ class _ProfileScreenState extends ConsumerState<ProfileScreen> {
'Roboto', 'Roboto',
'NotoKufi', 'NotoKufi',
), ),
color: Color( color: isDarkTheme ? Colors.white : Color(
0xFF898C81), // Change to your desired color 0xFF898C81), // Change to your desired color
), ),
), ),
@ -1062,7 +1082,7 @@ class _ProfileScreenState extends ConsumerState<ProfileScreen> {
'Roboto', 'Roboto',
'NotoKufi', 'NotoKufi',
), ),
color: Color(0xFF985400), color: isDarkTheme ? Color(0xFF9EB3E4) : Color(0xFF985400),
// decoration: // decoration:
// TextDecoration.underline, // TextDecoration.underline,
decorationColor: Color(0xFF648CBA), decorationColor: Color(0xFF648CBA),
@ -1078,7 +1098,7 @@ class _ProfileScreenState extends ConsumerState<ProfileScreen> {
), ),
fontWeight: FontWeight.w500, fontWeight: FontWeight.w500,
fontSize: 14, fontSize: 14,
color: Color( color: isDarkTheme ? Colors.white : Color(
0xFF898C81), // Change to your desired color 0xFF898C81), // Change to your desired color
), ),
), ),
@ -1127,7 +1147,7 @@ class _ProfileScreenState extends ConsumerState<ProfileScreen> {
AppLocalizations.of(context)!.change_password, AppLocalizations.of(context)!.change_password,
style: TextStyle( style: TextStyle(
// color: Color(0xFF648CBA), // color: Color(0xFF648CBA),
color: Color(0xFF985400), color: isDarkTheme ? Color(0xFF9EB3E4) : Color(0xFF985400),
fontSize: 14, fontSize: 14,
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
fontFamily: context.translate( fontFamily: context.translate(
@ -1158,7 +1178,7 @@ class _ProfileScreenState extends ConsumerState<ProfileScreen> {
} }
}, },
style: ElevatedButton.styleFrom( style: ElevatedButton.styleFrom(
backgroundColor: Color(0xFF92722A), backgroundColor: isDarkTheme ? Color(0xFF7296BE) :Color(0xFF92722A),
minimumSize: Size(double.infinity, 50), minimumSize: Size(double.infinity, 50),
shape: RoundedRectangleBorder( shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(8), borderRadius: BorderRadius.circular(8),
@ -1196,10 +1216,15 @@ class _ProfileScreenState extends ConsumerState<ProfileScreen> {
} }
} }
class ConfirmationDialog extends StatelessWidget { class ConfirmationDialog extends ConsumerWidget {
const ConfirmationDialog({Key? key}) : super(key: key); const ConfirmationDialog({Key? key}) : super(key: key);
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context, WidgetRef ref) {
final themeMode = ref.read(themeProvider);
final isDarkTheme = themeMode == ThemeMode.dark ||
(themeMode == ThemeMode.system &&
MediaQuery.of(context).platformBrightness == Brightness.dark);
return AlertDialog( return AlertDialog(
content: Column( content: Column(
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
@ -1208,7 +1233,7 @@ class ConfirmationDialog extends StatelessWidget {
AppLocalizations.of(context)!.sure_save_page, AppLocalizations.of(context)!.sure_save_page,
style: TextStyle( style: TextStyle(
fontSize: 14, fontSize: 14,
color: Color(0xFF898C81), color: isDarkTheme ? Colors.white : Color(0xFF898C81),
fontFamily: context.translate( fontFamily: context.translate(
'Roboto', 'Roboto',
'NotoKufi', 'NotoKufi',
@ -1223,7 +1248,7 @@ class ConfirmationDialog extends StatelessWidget {
text: AppLocalizations.of(context)!.not_able_to_change, text: AppLocalizations.of(context)!.not_able_to_change,
style: TextStyle( style: TextStyle(
fontSize: 14, fontSize: 14,
color: Color(0xFF898C81), color: isDarkTheme ? Colors.white : Color(0xFF898C81),
fontFamily: context.translate( fontFamily: context.translate(
'Roboto', 'Roboto',
'NotoKufi', 'NotoKufi',
@ -1237,10 +1262,13 @@ class ConfirmationDialog extends StatelessWidget {
TextStyle(fontWeight: FontWeight.w700,fontFamily: context.translate( TextStyle(fontWeight: FontWeight.w700,fontFamily: context.translate(
'Roboto', 'Roboto',
'NotoKufi', 'NotoKufi',
),), // Bold for "name" ),color: isDarkTheme ? Colors.white : null), // Bold for "name"
), ),
TextSpan( TextSpan(
text: context.translate(' or ', 'أو'), text: context.translate(' or ', 'أو'),
style: TextStyle(
color: isDarkTheme ? Colors.white : null,
)
), ),
TextSpan( TextSpan(
text: AppLocalizations.of(context)!.dob, text: AppLocalizations.of(context)!.dob,
@ -1249,10 +1277,15 @@ class ConfirmationDialog extends StatelessWidget {
'Roboto', 'Roboto',
'NotoKufi', 'NotoKufi',
), ),
fontWeight: FontWeight.w700), // Bold for "date of birth" fontWeight: FontWeight.w700,
color: isDarkTheme ? Colors.white : null,
), // Bold for "date of birth"
), ),
TextSpan( TextSpan(
text: ".", text: ".",
style: TextStyle(
color: isDarkTheme ? Colors.white : null,
)
), ),
], ],
), ),
@ -1276,14 +1309,14 @@ class ConfirmationDialog extends StatelessWidget {
Navigator.of(context).pop(false); Navigator.of(context).pop(false);
}, },
style: OutlinedButton.styleFrom( style: OutlinedButton.styleFrom(
side: BorderSide(color: Color(0xFF92722A)), side: BorderSide(color: isDarkTheme ? Color(0xFF7296BE) : Color(0xFF92722A)),
shape: RoundedRectangleBorder( shape: RoundedRectangleBorder(
borderRadius: BorderRadius.all(Radius.circular(7)), borderRadius: BorderRadius.all(Radius.circular(7)),
), // Set the border color here ), // Set the border color here
), ),
child: Text( child: Text(
"Cancel", "Cancel",
style: TextStyle(color: Color(0xFF92722A),fontFamily: context.translate( style: TextStyle(color: isDarkTheme ? Color(0xFF7296BE) : Color(0xFF92722A),fontFamily: context.translate(
'Roboto', 'Roboto',
'NotoKufi', 'NotoKufi',
),), ),),
@ -1292,7 +1325,7 @@ class ConfirmationDialog extends StatelessWidget {
ElevatedButton( ElevatedButton(
onPressed: () => Navigator.of(context).pop(true), onPressed: () => Navigator.of(context).pop(true),
style: ElevatedButton.styleFrom( style: ElevatedButton.styleFrom(
backgroundColor: const Color(0xFF92722A), // Brown color backgroundColor: isDarkTheme ? Color(0xFF7296BE) : Color(0xFF92722A), // Brown color
foregroundColor: Colors.white, foregroundColor: Colors.white,
shape: RoundedRectangleBorder( shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(8), borderRadius: BorderRadius.circular(8),

View File

@ -59,19 +59,19 @@ class ThemedFormField extends HookWidget {
'Roboto', 'Roboto',
'NotoKufi', 'NotoKufi',
), ),
color: errorTextColor ?? const Color(0xFFB22222), color: const Color(0xFFD83731),
), ),
errorBorder: OutlineInputBorder( errorBorder: OutlineInputBorder(
borderRadius: BorderRadius.circular(10), borderRadius: BorderRadius.circular(10),
borderSide: BorderSide( borderSide: BorderSide(
color: errorBorderColor ?? const Color(0xFFB22222), color: const Color(0xFFD83731),
width: 1, width: 1,
), ),
), ),
focusedErrorBorder: OutlineInputBorder( focusedErrorBorder: OutlineInputBorder(
borderRadius: BorderRadius.circular(10), borderRadius: BorderRadius.circular(10),
borderSide: BorderSide( borderSide: BorderSide(
color: errorBorderColor ?? const Color(0xFFB22222), color: const Color(0xFFD83731),
width: 1, width: 1,
), ),
), ),
@ -81,18 +81,18 @@ class ThemedFormField extends HookWidget {
border: OutlineInputBorder( border: OutlineInputBorder(
borderRadius: BorderRadius.circular(10), borderRadius: BorderRadius.circular(10),
borderSide: BorderSide( borderSide: BorderSide(
color: borderColor ?? MyTheme.topicColor(IndicatorTopic.economy).shade300, color: Color(0xFFB68A34),
), ),
), ),
enabledBorder: OutlineInputBorder( enabledBorder: OutlineInputBorder(
borderRadius: BorderRadius.circular(10), borderRadius: BorderRadius.circular(10),
borderSide: BorderSide( borderSide: BorderSide(
color: borderColor ?? MyTheme.topicColor(IndicatorTopic.economy).shade300, color: Color(0xFFB68A34),
), ),
), ),
hintText: hintText, hintText: hintText,
hintStyle: TextStyle( // dynamic hint color hintStyle: TextStyle( // dynamic hint color
color: hintColor ?? const Color(0xffC3C6CB), color: const Color(0xFFC3C6CB),
), ),
prefixIconConstraints: const BoxConstraints( prefixIconConstraints: const BoxConstraints(
maxWidth: 25 + 16 + 10, maxWidth: 25 + 16 + 10,
@ -108,7 +108,7 @@ class ThemedFormField extends HookWidget {
fit: BoxFit.fitHeight, fit: BoxFit.fitHeight,
height: 25, height: 25,
width: 25, width: 25,
color: MyTheme.topicColor(IndicatorTopic.economy).shade300, // color: MyTheme.topicColor(IndicatorTopic.economy).shade300,
), ),
), ),
suffixIcon: isObscurable ? obscureBtn : null, suffixIcon: isObscurable ? obscureBtn : null,

View File

@ -553,7 +553,7 @@ class LoginRoute extends HookConsumerWidget {
), ),
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
fontSize: locale?.languageCode == 'ar' ? 12 : 14, fontSize: locale?.languageCode == 'ar' ? 12 : 14,
color: isDarkTheme ? Color(0xFF9EB3E4) : Color(0xFF985400), color: Color(0xFF8A8C81),
), ),
), ),
); );
@ -735,7 +735,8 @@ class LoginRoute extends HookConsumerWidget {
), ),
), ),
backgroundColor: WidgetStatePropertyAll( backgroundColor: WidgetStatePropertyAll(
isDarkTheme ? Color(0xFF24B4FB) : Color(0xFFAA8E83), // isDarkTheme ? Color(0xFFB68A34) : Color(0xFFB68A34),
Color(0xFFB68A34),
// MyTheme.topicColor(IndicatorTopic.social), // MyTheme.topicColor(IndicatorTopic.social),
), ),
// surfaceTintColor: MaterialStatePropertyAll( // surfaceTintColor: MaterialStatePropertyAll(
@ -781,11 +782,11 @@ class LoginRoute extends HookConsumerWidget {
'Email', 'Email',
'بريد إلكتروني', 'بريد إلكتروني',
), ),
hintColor: isDarkTheme ? Color(0XFFEEEEEE) : Color(0xFFC3C6CB), // hintColor: isDarkTheme ? Color(0XFFEEEEEE) : Color(0xFFC3C6CB),
backgroundColor: isDarkTheme ? Color(0xFF000000) : Colors.white, backgroundColor: isDarkTheme ? Color(0xFF000000) : Colors.white,
borderColor: isDarkTheme ? Colors.white : MyTheme.topicColor(IndicatorTopic.economy).shade300, // borderColor: Color(0xFFB68A34),
errorBorderColor: isDarkTheme ? const Color(0xFFFFA100) : const Color(0xFFB22222), // errorBorderColor: isDarkTheme ? const Color(0xFFFFA100) : const Color(0xFFB22222),
errorTextColor: isDarkTheme ? const Color(0xFFFFA100) : const Color(0xFFB22222), // errorTextColor: isDarkTheme ? const Color(0xFFFFA100) : const Color(0xFFB22222),
validator: (value) { validator: (value) {
final emailRegex = final emailRegex =
r'^[a-zA-Z0-9àèìòùÀÈÌÒÙéàç~!#$%^&*()_+=-{}|;,.?<>]+@[a-zA-Z0-9àèìòùÀÈÌÒÙéàç~!#$%^&*()_+=-{}|;,.?<>]+\.[a-zA-Z]{2,}$'; r'^[a-zA-Z0-9àèìòùÀÈÌÒÙéàç~!#$%^&*()_+=-{}|;,.?<>]+@[a-zA-Z0-9àèìòùÀÈÌÒÙéàç~!#$%^&*()_+=-{}|;,.?<>]+\.[a-zA-Z]{2,}$';
@ -796,7 +797,8 @@ class LoginRoute extends HookConsumerWidget {
} }
return null; return null;
}, },
imgPath: isDarkTheme ? MiscIconAssetPath.personDark : MiscIconAssetPath.personLight, // imgPath: isDarkTheme ? MiscIconAssetPath.personDark : MiscIconAssetPath.personLight,
imgPath: MiscIconAssetPath.person,
controller: emailCtl, controller: emailCtl,
), ),
15.verticalSpace, 15.verticalSpace,
@ -813,12 +815,13 @@ class LoginRoute extends HookConsumerWidget {
'Password', 'Password',
'كلمة المرور', 'كلمة المرور',
), ),
hintColor: isDarkTheme ? Color(0XFFEEEEEE) : Color(0xFFC3C6CB), // hintColor: isDarkTheme ? Color(0XFFEEEEEE) : Color(0xFFC3C6CB),
backgroundColor: isDarkTheme ? Color(0xFF000000) : Colors.white, backgroundColor: isDarkTheme ? Color(0xFF000000) : Colors.white,
borderColor: isDarkTheme ? Colors.white : MyTheme.topicColor(IndicatorTopic.economy).shade300, // borderColor: isDarkTheme ? Colors.white : MyTheme.topicColor(IndicatorTopic.economy).shade300,
errorBorderColor: isDarkTheme ? const Color(0xFFFFA100) : const Color(0xFFB22222), // errorBorderColor: isDarkTheme ? const Color(0xFFFFA100) : const Color(0xFFB22222),
errorTextColor: isDarkTheme ? const Color(0xFFFFA100) : const Color(0xFFB22222), // errorTextColor: isDarkTheme ? const Color(0xFFFFA100) : const Color(0xFFB22222),
imgPath: isDarkTheme ? MiscIconAssetPath.lockDark : MiscIconAssetPath.lockLight, // imgPath: isDarkTheme ? MiscIconAssetPath.lockDark : MiscIconAssetPath.lockLight,
imgPath: MiscIconAssetPath.lock,
controller: pwCtl, controller: pwCtl,
isObscurable: true, isObscurable: true,
), ),
@ -865,7 +868,7 @@ class LoginRoute extends HookConsumerWidget {
'NotoKufi', 'NotoKufi',
), ),
fontSize: context.translate(18.0, 14.0), fontSize: context.translate(18.0, 14.0),
color: isDarkTheme ? Color(0xFFEEEEEE) : Color(0xff898C81), color: isDarkTheme ? Color(0xFFFFFFFF) : Color(0xFF898C81),
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
), ),
), ),
@ -894,7 +897,7 @@ class LoginRoute extends HookConsumerWidget {
), ),
style: TextStyle( style: TextStyle(
fontSize: locale?.languageCode == 'ar' ? 12 : 14, fontSize: locale?.languageCode == 'ar' ? 12 : 14,
color: isDarkTheme ? Color(0xFFCCCCCC) : Color(0xff898C81), color: isDarkTheme ? Color(0xFFFFFFFF) : Color(0xFF898C81),
), ),
), ),
const TextSpan( const TextSpan(
@ -907,7 +910,7 @@ class LoginRoute extends HookConsumerWidget {
), ),
style: TextStyle( style: TextStyle(
fontSize: locale?.languageCode == 'ar' ? 12 : 14, fontSize: locale?.languageCode == 'ar' ? 12 : 14,
color: isDarkTheme ? Color(0xFF9EB3E4) : Color(0xFF985400), color: isDarkTheme ? Color(0xFFB68A35) : Color(0xFF985400),
), ),
), ),
], ],
@ -918,13 +921,13 @@ class LoginRoute extends HookConsumerWidget {
// width: double.infinity, // width: double.infinity,
// child: ElevatedButton( // child: ElevatedButton(
// onPressed: () async { // onPressed: () async {
// final prefs = await SharedPreferences.getInstance(); // // final prefs = await SharedPreferences.getInstance();
// prefs.clear(); // // prefs.clear();
// final userId = 'guest'; // // final userId = 'guest';
// if (userId.isNotEmpty) { // // if (userId.isNotEmpty) {
// await saveUserId(userId); // // await saveUserId(userId);
// } // // }
// context.go('/myhomepage'); // // context.go('/myhomepage');
// //context.go('/${context.language}/${BottomNavBarItem.home.routePath}'), // //context.go('/${context.language}/${BottomNavBarItem.home.routePath}'),
// }, // },
// //context.go('/${context.language}/${BottomNavBarItem.home.routePath}'), // //context.go('/${context.language}/${BottomNavBarItem.home.routePath}'),
@ -969,6 +972,120 @@ class LoginRoute extends HookConsumerWidget {
// ), // ),
// ), // ),
// ); // );
final signInWithGoogleBtn = SizedBox(
width: double.infinity,
child: OutlinedButton(
onPressed: () async {},
style: OutlinedButton.styleFrom(
side: const BorderSide(color: Color(0xFF000000)),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(8),
),
padding: const EdgeInsets.symmetric(vertical: 12),
backgroundColor: Colors.white,
foregroundColor: Colors.black,
textStyle: TextStyle(
fontFamily: context.translate('Roboto', 'NotoKufi'),
fontSize: 16,
fontWeight: FontWeight.w500,
),
),
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Image.asset(
MiscIconAssetPath.signInWithGoogle, // replace with your Google icon asset
height: 20,
),
const SizedBox(width: 10),
Text(
'Sign in with Google',
textAlign: TextAlign.center,
style: TextStyle(
color: Color(0xFF000000),
fontWeight: FontWeight.w600,
),
),
],
),
),
);
final signInWithAppleBtn = SizedBox(
width: double.infinity,
child: OutlinedButton(
onPressed: () async {},
style: OutlinedButton.styleFrom(
side: const BorderSide(color: Color(0xFF000000)),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(8),
),
padding: const EdgeInsets.symmetric(vertical: 12),
backgroundColor: Colors.white,
foregroundColor: Colors.black,
textStyle: TextStyle(
fontFamily: context.translate('Roboto', 'NotoKufi'),
fontSize: 16,
fontWeight: FontWeight.w500,
),
),
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Image.asset(
MiscIconAssetPath.signInWithApple, // replace with your Google icon asset
height: 20,
),
const SizedBox(width: 10),
Text(
'Sign in with Apple',
textAlign: TextAlign.center,
style: TextStyle(
color: Color(0xFF000000),
fontWeight: FontWeight.w600,
),
),
],
),
),
);
final signInWithUAEPassBtn = SizedBox(
width: double.infinity,
child: OutlinedButton(
onPressed: () async {},
style: OutlinedButton.styleFrom(
side: const BorderSide(color: Color(0xFF000000)),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(8),
),
padding: const EdgeInsets.symmetric(vertical: 12),
backgroundColor: Colors.white,
foregroundColor: Colors.black,
textStyle: TextStyle(
fontFamily: context.translate('Roboto', 'NotoKufi'),
fontSize: 16,
fontWeight: FontWeight.w500,
),
),
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Image.asset(
MiscIconAssetPath.signInWithUAEPass, // replace with your Google icon asset
height: 20,
),
const SizedBox(width: 10),
Text(
'Sign in with UAE PASS',
textAlign: TextAlign.center,
style: TextStyle(
color: Color(0xFF000000),
fontWeight: FontWeight.w600,
),
),
],
),
),
);
final fcscBanner = Image.asset( final fcscBanner = Image.asset(
isDarkTheme isDarkTheme
? BannerAssetPath.fcscLogoDark ? BannerAssetPath.fcscLogoDark
@ -1010,11 +1127,16 @@ class LoginRoute extends HookConsumerWidget {
helloAndPleaseLoginTexts, helloAndPleaseLoginTexts,
40.verticalSpace, 40.verticalSpace,
form, form,
15.verticalSpace, 25.verticalSpace,
dontHaveAnAccountRegisterBtn, dontHaveAnAccountRegisterBtn,
// continueAsGuestBtn, // continueAsGuestBtn,
// Spacer(), 25.verticalSpace,
signInWithGoogleBtn,
15.verticalSpace, 15.verticalSpace,
signInWithAppleBtn,
15.verticalSpace,
signInWithUAEPassBtn,
25.verticalSpace,
fcscBanner, fcscBanner,
], ],
), ),
@ -1034,7 +1156,7 @@ class LoginRoute extends HookConsumerWidget {
// _showExitConfirmation(context); // Show exit confirmation dialog // _showExitConfirmation(context); // Show exit confirmation dialog
}, },
child: Scaffold( child: Scaffold(
backgroundColor: isDarkTheme ? Color(0xFF111111) : Colors.white, backgroundColor: isDarkTheme ? Color(0xFF000000) : Colors.white,
body: SafeArea(child: scaffoldBody), body: SafeArea(child: scaffoldBody),
), ),
); );

View File

@ -1284,14 +1284,15 @@ class EconomyStatsState extends ConsumerState<EconomyStatsWidget> {
} }
String firstMainTopic = data.first['main_topic'] ?? ''; String firstMainTopic = data.first['main_topic'] ?? '';
return Container( return Container(
decoration: isDarkTheme color: isDarkTheme ? Color(0xFF000000) : Color(0xFFFFFFFF),
? BoxDecoration( // decoration: isDarkTheme
image: DecorationImage( // ? BoxDecoration(
image: AssetImage('assets/dark_bg.png'), // image: DecorationImage(
fit: BoxFit.cover, // image: AssetImage('assets/dark_bg.png'),
), // fit: BoxFit.cover,
) // ),
: null, // )
// : null,
height: myheight, height: myheight,
// color: Colors.cyan, // color: Colors.cyan,
child: Padding( child: Padding(
@ -1523,7 +1524,7 @@ class RoundedCornerContainer extends StatelessWidget {
return Container( return Container(
decoration: BoxDecoration( decoration: BoxDecoration(
color: backgroundColor, color: backgroundColor,
borderRadius: BorderRadius.circular(16), // Rounded corners borderRadius: BorderRadius.only(topRight: Radius.circular(20),topLeft: Radius.circular(20)), // Rounded corners
), ),
child: Center( child: Center(
child: Text( child: Text(
@ -1603,7 +1604,7 @@ class InfoCard extends StatelessWidget {
decoration: BoxDecoration( decoration: BoxDecoration(
color: isDarkTheme ? Color(0xFF111111) : null, color: isDarkTheme ? Color(0xFF111111) : null,
border: Border.all(color: bordercolor), border: Border.all(color: bordercolor),
borderRadius: BorderRadius.circular(8), borderRadius: BorderRadius.circular(10),
), ),
child: Column( child: Column(
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
@ -1634,7 +1635,7 @@ class InfoCard extends StatelessWidget {
title, title,
style: TextStyle( style: TextStyle(
fontSize: 13, fontSize: 13,
fontWeight: FontWeight.w400, fontWeight: FontWeight.w700,
letterSpacing: 0, letterSpacing: 0,
// color: Colors.black, // color: Colors.black,
fontFamily: context.translate( fontFamily: context.translate(

View File

@ -1,8 +1,11 @@
import 'dart:convert';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:flutter_svg/svg.dart'; import 'package:flutter_svg/svg.dart';
import 'package:go_router/go_router.dart'; import 'package:go_router/go_router.dart';
import 'package:dio/dio.dart'; import 'package:dio/dio.dart';
import 'package:http/http.dart' as http;
import 'package:flutter_gen/gen_l10n/app_localizations.dart'; import 'package:flutter_gen/gen_l10n/app_localizations.dart';
import 'package:pocketbase/pocketbase.dart'; import 'package:pocketbase/pocketbase.dart';
import 'package:shared_preferences/shared_preferences.dart'; import 'package:shared_preferences/shared_preferences.dart';
@ -13,6 +16,7 @@ import 'package:uae_stat/config/toggle_lang_service.dart';
import 'package:uae_stat/domain/use_cases/language.dart'; import 'package:uae_stat/domain/use_cases/language.dart';
import 'package:uae_stat/infrastructure/services/img_asset_paths/icons/bookmark_asset_path.dart'; import 'package:uae_stat/infrastructure/services/img_asset_paths/icons/bookmark_asset_path.dart';
import 'package:uae_stat/infrastructure/services/img_asset_paths/icons/uae_numbers_asset_path.dart'; import 'package:uae_stat/infrastructure/services/img_asset_paths/icons/uae_numbers_asset_path.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/indicators/locale_provider.dart';
import 'package:uae_stat/presentation/routes/drawer_routes/custom_drawer_routes.dart'; import 'package:uae_stat/presentation/routes/drawer_routes/custom_drawer_routes.dart';
@ -29,11 +33,14 @@ class _BookMarkState extends ConsumerState<BookMark> {
bool isLoading = true; bool isLoading = true;
Map<String, Map<String, dynamic>> groupedMap = {}; Map<String, Map<String, dynamic>> groupedMap = {};
int? expandedIndex = 0; int? expandedIndex = 0;
// Current selected tab index // Current selected tab index
int selectedTabIndex = 0; int selectedTabIndex = 0;
late UserService _userService; late UserService _userService;
late ThemeMode currentTheme; late ThemeMode currentTheme;
List<dynamic> homePageData = [];
List<dynamic> filteredData = [];
@override @override
void initState() { void initState() {
super.initState(); super.initState();
@ -42,13 +49,44 @@ class _BookMarkState extends ConsumerState<BookMark> {
currentTheme = ref.read(themeProvider); currentTheme = ref.read(themeProvider);
print('123456789'); print('123456789');
print(currentTheme); print(currentTheme);
final isDark = currentTheme == ThemeMode.dark || // final isDark = currentTheme == ThemeMode.dark ||
(currentTheme == ThemeMode.system && // (currentTheme == ThemeMode.system &&
MediaQuery.of(context).platformBrightness == Brightness.dark); // MediaQuery.of(context).platformBrightness == Brightness.dark);
final themeMode = (isDark ? 'dark' : 'light'); WidgetsBinding.instance.addPostFrameCallback((_) {
final isDark = currentTheme == ThemeMode.dark ||
(currentTheme == ThemeMode.system &&
MediaQuery.of(context).platformBrightness == Brightness.dark);
fetchBookmarks(locale?.languageCode ?? 'en',themeMode); final themeMode = (isDark ? 'dark' : 'light');
print("ThemeMode - $themeMode");
fetchData(locale?.languageCode ?? 'en', themeMode);
fetchBookmarks(locale?.languageCode ?? 'en', themeMode);
});
}
Future<void> fetchData(locale, themeMode) async {
const baseUrl = '$apiUrl/api/getUAENumbersData';
try {
final response = await http
.get(Uri.parse(baseUrl + '?language=$locale&color_mode=$themeMode'));
if (response.statusCode == 200) {
setState(() {
homePageData = (json.decode(response.body) as List)
.map((e) => Map<String, dynamic>.from(e))
.toList();
filteredData = List.from(homePageData);
isLoading = false;
});
} else {
throw Exception('Failed to load data');
}
} catch (e) {
setState(() {
isLoading = false;
});
print('Error fetching data: $e');
}
} }
String colorToHex(Color color) { String colorToHex(Color color) {
@ -57,7 +95,7 @@ class _BookMarkState extends ConsumerState<BookMark> {
'${color.blue.toRadixString(16).padLeft(2, '0').toUpperCase()}'; '${color.blue.toRadixString(16).padLeft(2, '0').toUpperCase()}';
} }
// Function to convert hex color string to int // Function to convert hex color string to int
Color _parseColor(String? colorString) { Color _parseColor(String? colorString) {
if (colorString == null || colorString.isEmpty) { if (colorString == null || colorString.isEmpty) {
return const Color(0xFF80A8CD); // Default color return const Color(0xFF80A8CD); // Default color
@ -71,7 +109,7 @@ class _BookMarkState extends ConsumerState<BookMark> {
} }
} }
Future<void> fetchBookmarks(locale,themeMode) async { Future<void> fetchBookmarks(locale, themeMode) async {
try { try {
final prefs = await SharedPreferences.getInstance(); final prefs = await SharedPreferences.getInstance();
final userID = prefs.getString('userId') ?? ''; final userID = prefs.getString('userId') ?? '';
@ -85,13 +123,17 @@ class _BookMarkState extends ConsumerState<BookMark> {
final response = await Dio().get( final response = await Dio().get(
'$apiUrl/api/getUserBookmark', '$apiUrl/api/getUserBookmark',
queryParameters: {'user_id': userID, 'language': locale,'color_mode':themeMode}, queryParameters: {
'user_id': userID,
'language': locale,
'color_mode': themeMode
},
); );
if (response.statusCode == 200 && response.data != null) { if (response.statusCode == 200 && response.data != null) {
if (response.data is Map<String, dynamic> && if (response.data is Map<String, dynamic> &&
response.data.containsKey("error")) { response.data.containsKey("error")) {
// API returned an error message instead of bookmark data // API returned an error message instead of bookmark data
setState(() { setState(() {
dataList = []; // Clear the list dataList = []; // Clear the list
}); });
@ -117,24 +159,24 @@ class _BookMarkState extends ConsumerState<BookMark> {
List<Map<String, dynamic>> transformAndStore( List<Map<String, dynamic>> transformAndStore(
List<Map<String, dynamic>> fetchedData) { List<Map<String, dynamic>> fetchedData) {
// Define the required order // Define the required order
List<String> order = [ List<String> order = [
context.translate('ECONOMY', 'الاقتصاد'), context.translate('ECONOMY', 'الاقتصاد'),
context.translate('SOCIAL', 'الاجتماعي'), context.translate('SOCIAL', 'الاجتماعي'),
context.translate('ENVIRONMENT', 'البيئة') context.translate('ENVIRONMENT', 'البيئة')
]; ];
// Create a list to store sorted data // Create a list to store sorted data
List<Map<String, dynamic>> sortedList = []; List<Map<String, dynamic>> sortedList = [];
// Group data based on categories // Group data based on categories
Map<String, List<Map<String, dynamic>>> groupedData = { Map<String, List<Map<String, dynamic>>> groupedData = {
context.translate('ECONOMY', 'الاقتصاد'): [], context.translate('ECONOMY', 'الاقتصاد'): [],
context.translate('SOCIAL', 'الاجتماعي'): [], context.translate('SOCIAL', 'الاجتماعي'): [],
context.translate('ENVIRONMENT', 'البيئة'): [] context.translate('ENVIRONMENT', 'البيئة'): []
}; };
// Categorize data // Categorize data
for (var item in fetchedData) { for (var item in fetchedData) {
String mainTopic = item["main_topic"]?.toString() ?? ""; String mainTopic = item["main_topic"]?.toString() ?? "";
if (groupedData.containsKey(mainTopic)) { if (groupedData.containsKey(mainTopic)) {
@ -142,14 +184,14 @@ class _BookMarkState extends ConsumerState<BookMark> {
} }
} }
// Store sorted data in the correct order // Store sorted data in the correct order
for (String topic in order) { for (String topic in order) {
if (groupedData.containsKey(topic)) { if (groupedData.containsKey(topic)) {
sortedList.addAll(groupedData[topic]!); sortedList.addAll(groupedData[topic]!);
} }
} }
// Store the sorted list (replace this with your storage method) // Store the sorted list (replace this with your storage method)
return sortedList; return sortedList;
} }
@ -158,10 +200,10 @@ class _BookMarkState extends ConsumerState<BookMark> {
String? mainTopic = item['main_topic']; String? mainTopic = item['main_topic'];
String subtitle = item['subtitle']; String subtitle = item['subtitle'];
// Ignore if main_topic is null // Ignore if main_topic is null
if (mainTopic == null) continue; if (mainTopic == null) continue;
// If main_topic doesn't exist in groupedMap, create a new entry // If main_topic doesn't exist in groupedMap, create a new entry
if (!groupedMap.containsKey(mainTopic)) { if (!groupedMap.containsKey(mainTopic)) {
groupedMap[mainTopic] = { groupedMap[mainTopic] = {
'main_topic': mainTopic, 'main_topic': mainTopic,
@ -170,7 +212,7 @@ class _BookMarkState extends ConsumerState<BookMark> {
}; };
} }
// Add subtitle as a key with its corresponding map value // Add subtitle as a key with its corresponding map value
groupedMap[mainTopic]!['SubTopic'].add({ groupedMap[mainTopic]!['SubTopic'].add({
'subtitle': subtitle, 'subtitle': subtitle,
'isBookmark': item['isBookmark'], 'isBookmark': item['isBookmark'],
@ -208,9 +250,9 @@ class _BookMarkState extends ConsumerState<BookMark> {
'Authorization': adminToken, 'Authorization': adminToken,
}); });
// currentTheme = ref.read(themeProvider); // currentTheme = ref.read(themeProvider);
// print('123456789'); // print('123456789');
// print(currentTheme); // print(currentTheme);
final isDark = currentTheme == ThemeMode.dark || final isDark = currentTheme == ThemeMode.dark ||
(currentTheme == ThemeMode.system && (currentTheme == ThemeMode.system &&
MediaQuery.of(context).platformBrightness == Brightness.dark); MediaQuery.of(context).platformBrightness == Brightness.dark);
@ -219,8 +261,8 @@ class _BookMarkState extends ConsumerState<BookMark> {
final locale = ref.read(localeProvider); final locale = ref.read(localeProvider);
fetchBookmarks(locale?.languageCode ?? 'en',themeMode); fetchBookmarks(locale?.languageCode ?? 'en', themeMode);
// ToastUtil.showSuccessToast("Removed from Bookmark."); // ToastUtil.showSuccessToast("Removed from Bookmark.");
ScaffoldMessenger.of(context).showSnackBar( ScaffoldMessenger.of(context).showSnackBar(
SnackBar( SnackBar(
@ -228,10 +270,9 @@ class _BookMarkState extends ConsumerState<BookMark> {
AppLocalizations.of(context)!.removed_from_Bookmark, AppLocalizations.of(context)!.removed_from_Bookmark,
style: TextStyle( style: TextStyle(
fontFamily: context.translate( fontFamily: context.translate(
'Roboto', 'Roboto',
'NotoKufi', 'NotoKufi',
) )),
),
), ),
duration: Duration(seconds: 2), duration: Duration(seconds: 2),
), ),
@ -242,13 +283,17 @@ class _BookMarkState extends ConsumerState<BookMark> {
SnackBar( SnackBar(
content: Text( content: Text(
context.translate( context.translate(
'Unable to remove from bookmarks. Please try again', 'Unable to remove from bookmarks. Please try again',
'تعذر الإزالة من الإشارات المرجعية. يرجى المحاولة مرة أخرى.',), 'تعذر الإزالة من الإشارات المرجعية. يرجى المحاولة مرة أخرى.',
style: ),
TextStyle(color: Color(0xFFEB5F24), fontWeight: FontWeight.w600, fontFamily: context.translate( style: TextStyle(
'Roboto', color: Color(0xFFEB5F24),
'NotoKufi', fontWeight: FontWeight.w600,
),), fontFamily: context.translate(
'Roboto',
'NotoKufi',
),
),
), ),
backgroundColor: Color(0xFFD6E9C6), backgroundColor: Color(0xFFD6E9C6),
duration: Duration(seconds: 2), duration: Duration(seconds: 2),
@ -349,11 +394,14 @@ class _BookMarkState extends ConsumerState<BookMark> {
), ),
child: Text( child: Text(
context.translate('Yes', 'نعم'), context.translate('Yes', 'نعم'),
style: TextStyle(color: Colors.white, fontSize: 16, style: TextStyle(
color: Colors.white,
fontSize: 16,
fontFamily: context.translate( fontFamily: context.translate(
'Roboto', 'Roboto',
'NotoKufi', 'NotoKufi',
),), ),
),
), ),
), ),
), ),
@ -372,25 +420,6 @@ class _BookMarkState extends ConsumerState<BookMark> {
} }
}); });
final List<Map<String, dynamic>> tabs = [
{
'title': AppLocalizations.of(context)!.all_bookmarks,
'color': Colors.black
},
{
'title': AppLocalizations.of(context)!.economy_title,
'color': Color(0xFF90B0D5)
},
{
'title': AppLocalizations.of(context)!.social_title,
'color': Color(0xFFAA8E83)
},
{
'title': AppLocalizations.of(context)!.environment_title,
'color': Color(0xFF7DAFBC)
},
];
ref.listen<Locale?>(localeProvider, (previous, next) async { ref.listen<Locale?>(localeProvider, (previous, next) async {
final localeCode = next?.languageCode ?? 'en'; // Default to 'en' if null final localeCode = next?.languageCode ?? 'en'; // Default to 'en' if null
setState(() { setState(() {
@ -405,14 +434,14 @@ class _BookMarkState extends ConsumerState<BookMark> {
final themeString = isDark ? 'dark' : 'light'; final themeString = isDark ? 'dark' : 'light';
fetchBookmarks(localeCode,themeString); fetchBookmarks(localeCode, themeString);
}); });
ref.listen<ThemeMode>(themeProvider, (previous, next) async { ref.listen<ThemeMode>(themeProvider, (previous, next) async {
final localeCode = ref.watch(localeProvider)?.languageCode ?? 'en'; final localeCode = ref.watch(localeProvider)?.languageCode ?? 'en';
print(localeCode); print(localeCode);
// Default to 'en' if null // Default to 'en' if null
setState(() { setState(() {
isLoading = true; isLoading = true;
print('isLoadingref $isLoading'); print('isLoadingref $isLoading');
@ -424,13 +453,31 @@ class _BookMarkState extends ConsumerState<BookMark> {
MediaQuery.of(context).platformBrightness == Brightness.dark); MediaQuery.of(context).platformBrightness == Brightness.dark);
final themeString = isDark ? 'dark' : 'light'; final themeString = isDark ? 'dark' : 'light';
fetchBookmarks(localeCode,themeString); fetchBookmarks(localeCode, themeString);
}); });
final isDarkTheme = ref.watch(themeProvider) == ThemeMode.dark || final isDarkTheme = ref.watch(themeProvider) == ThemeMode.dark ||
(ref.watch(themeProvider) == ThemeMode.system && (ref.watch(themeProvider) == ThemeMode.system &&
MediaQuery.of(context).platformBrightness == Brightness.dark); MediaQuery.of(context).platformBrightness == Brightness.dark);
final List<Map<String, dynamic>> tabs = [
{
'title': AppLocalizations.of(context)!.all_bookmarks,
'color': isDarkTheme ? Colors.white : Colors.black,
},
{
'title': AppLocalizations.of(context)!.economy_title,
'color': isDarkTheme ? Color(0xFF89AFD8) : Color(0xFF89AFD8)
},
{
'title': AppLocalizations.of(context)!.social_title,
'color': isDarkTheme ? Color(0xFF675863) : Color(0xFF675863)
},
{
'title': AppLocalizations.of(context)!.environment_title,
'color': isDarkTheme ? Color(0xFFB3CF99) : Color(0xFFB3CF99)
},
];
List<Map<String, dynamic>> bookmarks = List<Map<String, dynamic>> bookmarks =
dataList.where((item) => item['isBookmark'] == true).toList(); dataList.where((item) => item['isBookmark'] == true).toList();
@ -439,13 +486,13 @@ class _BookMarkState extends ConsumerState<BookMark> {
String selectedTabTitle = String selectedTabTitle =
tabs[selectedTabIndex]['title'].toString().trim().toLowerCase(); tabs[selectedTabIndex]['title'].toString().trim().toLowerCase();
// Debugging prints // Debugging prints
print( print(
"main_topic: '$mainTopic', selected_tab_title: '$selectedTabTitle'"); "main_topic: '$mainTopic', selected_tab_title: '$selectedTabTitle'");
return mainTopic == selectedTabTitle; return mainTopic == selectedTabTitle;
}).toList(); }).toList();
// print( 'filtered one :${filteredBookmarks['main_topic']} , Tabs : ${tabs[selectedTabIndex]["title"]}'); // print( 'filtered one :${filteredBookmarks['main_topic']} , Tabs : ${tabs[selectedTabIndex]["title"]}');
List<Map<String, dynamic>> transformedList = groupedMap.values.toList(); List<Map<String, dynamic>> transformedList = groupedMap.values.toList();
print('filtered $filteredBookmarks'); print('filtered $filteredBookmarks');
return PopScope( return PopScope(
@ -455,19 +502,21 @@ class _BookMarkState extends ConsumerState<BookMark> {
context.go('/myhomepage'); context.go('/myhomepage');
}, },
child: BaseScaffold( child: BaseScaffold(
backgroundColor: isDarkTheme ? Color(0xFF111111) : Colors.white,
appbarColor: isDarkTheme ? Color(0xFF111111) : Colors.white,
title: Text( title: Text(
AppLocalizations.of(context)!.bookmarks, AppLocalizations.of(context)!.bookmarks,
style: TextStyle( style: TextStyle(
color: isDarkTheme ? Colors.white : Colors.black, color: isDarkTheme ? Colors.white : Colors.black,
fontFamily: context.translate( fontFamily: context.translate(
'Roboto', 'Roboto',
'NotoKufi', 'NotoKufi',
) )),
),
), ),
body: isLoading body: isLoading
? Container( ? Container(
color: Color(0x98FFFCE5), // Semi-transparent background color: isDarkTheme ? Color(0xFF111111) : Colors.white,
// color: Color(0x98FFFCE5), // Semi-transparent background
child: Column( child: Column(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: [ children: [
@ -488,21 +537,21 @@ class _BookMarkState extends ConsumerState<BookMark> {
: Column( : Column(
children: [ children: [
TabBarHeader( TabBarHeader(
tabs: tabs, tabs: tabs,
selectedIndex: selectedTabIndex, selectedIndex: selectedTabIndex,
onTabSelected: (index) { onTabSelected: (index) {
setState(() { setState(() {
selectedTabIndex = index; selectedTabIndex = index;
}); });
}, },
), isDarkTheme: isDarkTheme),
Expanded( Expanded(
child: selectedTabIndex == 0 child: selectedTabIndex == 0
? (bookmarks.isNotEmpty ? (bookmarks.isNotEmpty
? SingleChildScrollView( ? SingleChildScrollView(
child: Column( child: Column(
children: children: List.generate(
List.generate(transformedList.length, (i) { transformedList.length, (i) {
final mainTopic = transformedList[i]; final mainTopic = transformedList[i];
print('oustside1 $mainTopic'); print('oustside1 $mainTopic');
final list = final list =
@ -512,24 +561,28 @@ class _BookMarkState extends ConsumerState<BookMark> {
index: i, index: i,
isExpanded: expandedIndex == i, isExpanded: expandedIndex == i,
onTap: (int index) { onTap: (int index) {
// 🔹 Expecting an index // 🔹 Expecting an index
setState(() { setState(() {
expandedIndex = (expandedIndex == index) expandedIndex =
? null (expandedIndex == index)
: index; ? null
: index;
}); });
}, },
title: title:
mainTopic['main_topic'] ?? 'No Topic', mainTopic['main_topic'] ?? 'No Topic',
childWidget: Container( childWidget: Container(
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.white, color: isDarkTheme
// borderRadius: BorderRadius.all(Radius.circular(20)) ? Color(0xFF111111)
: Colors.white,
// borderRadius: BorderRadius.all(Radius.circular(20))
), ),
padding: const EdgeInsets.all(16), padding: const EdgeInsets.all(16),
child: GridView.builder( child: GridView.builder(
shrinkWrap: true, shrinkWrap: true,
physics: NeverScrollableScrollPhysics(), physics:
NeverScrollableScrollPhysics(),
gridDelegate: gridDelegate:
const SliverGridDelegateWithFixedCrossAxisCount( const SliverGridDelegateWithFixedCrossAxisCount(
crossAxisCount: 2, crossAxisCount: 2,
@ -542,15 +595,17 @@ class _BookMarkState extends ConsumerState<BookMark> {
return _buildBoxes( return _buildBoxes(
mainTopic['SubTopic'][index], mainTopic['SubTopic'][index],
context, context,
mainTopic['valueColor']); mainTopic['valueColor'],
isDarkTheme);
}, },
), ),
), ),
filteredBookmarks: filteredBookmarks: List.from(
List.from(mainTopic['SubTopic'] ?? []), mainTopic['SubTopic'] ?? []),
titleBackgroundColor: titleBackgroundColor:
mainTopic['valueColor'], mainTopic['valueColor'],
// Ensure it's a new list // Ensure it's a new list
isDarkTheme: isDarkTheme,
); );
}), }),
), ),
@ -566,11 +621,12 @@ class _BookMarkState extends ConsumerState<BookMark> {
context.translate('No BookMark Added', context.translate('No BookMark Added',
'لم يتم إضافة أي علامة مرجعية'), 'لم يتم إضافة أي علامة مرجعية'),
style: TextStyle( style: TextStyle(
fontFamily: context.translate( fontFamily: context.translate(
'Roboto', 'Roboto',
'NotoKufi', 'NotoKufi',
), ),
fontSize: 16, color: Colors.grey), fontSize: 16,
color: Colors.grey),
), ),
], ],
), ),
@ -587,7 +643,8 @@ class _BookMarkState extends ConsumerState<BookMark> {
context.translate('No BookMark Added', context.translate('No BookMark Added',
'لم يتم إضافة أي علامة مرجعية'), 'لم يتم إضافة أي علامة مرجعية'),
style: TextStyle( style: TextStyle(
fontSize: 16, color: Colors.grey, fontSize: 16,
color: Colors.grey,
fontFamily: context.translate( fontFamily: context.translate(
'Roboto', 'Roboto',
'NotoKufi', 'NotoKufi',
@ -603,11 +660,15 @@ class _BookMarkState extends ConsumerState<BookMark> {
children: [ children: [
Container( Container(
decoration: BoxDecoration( decoration: BoxDecoration(
color: tabs[selectedTabIndex]['color'], color: tabs[selectedTabIndex]
['color'],
borderRadius: BorderRadius.all( borderRadius: BorderRadius.all(
Radius.circular(35))), Radius.circular(35))),
padding: const EdgeInsets.only( padding: const EdgeInsets.only(
left: 16, bottom: 5, top: 5, right: 10), left: 16,
bottom: 5,
top: 5,
right: 10),
child: Row( child: Row(
mainAxisAlignment: mainAxisAlignment:
MainAxisAlignment.spaceBetween, MainAxisAlignment.spaceBetween,
@ -619,7 +680,7 @@ class _BookMarkState extends ConsumerState<BookMark> {
'Roboto', 'Roboto',
'NotoKufi', 'NotoKufi',
), ),
color: Colors.white, color: Colors.white,
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
fontSize: 20, fontSize: 20,
), ),
@ -642,7 +703,9 @@ class _BookMarkState extends ConsumerState<BookMark> {
itemCount: filteredBookmarks.length, itemCount: filteredBookmarks.length,
itemBuilder: (context, index) { itemBuilder: (context, index) {
return _buildBox( return _buildBox(
filteredBookmarks[index], context); filteredBookmarks[index],
context,
isDarkTheme);
}, },
), ),
), ),
@ -656,8 +719,9 @@ class _BookMarkState extends ConsumerState<BookMark> {
); );
} }
Widget _buildBox(Map<String, dynamic> data, BuildContext context) { Widget _buildBox(
// Color borderColor = data['valueColor']; Map<String, dynamic> data, BuildContext context, bool isDarkTheme) {
// Color borderColor = data['valueColor'];
return GestureDetector( return GestureDetector(
onTap: () { onTap: () {
final data_set = data['data_set']; final data_set = data['data_set'];
@ -677,7 +741,7 @@ class _BookMarkState extends ConsumerState<BookMark> {
height: 100, height: 100,
padding: const EdgeInsets.all(8.0), padding: const EdgeInsets.all(8.0),
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.white, color: isDarkTheme ? Color(0xFF111111) : Colors.white,
borderRadius: BorderRadius.circular(10), borderRadius: BorderRadius.circular(10),
border: Border.all(color: data['valueColor']), border: Border.all(color: data['valueColor']),
), ),
@ -698,11 +762,14 @@ class _BookMarkState extends ConsumerState<BookMark> {
alignment: Alignment.center, alignment: Alignment.center,
child: Text( child: Text(
data['title'] ?? '', data['title'] ?? '',
style: TextStyle(fontWeight: FontWeight.w500, style: TextStyle(
fontWeight: FontWeight.w500,
fontFamily: context.translate( fontFamily: context.translate(
'Roboto', 'Roboto',
'NotoKufi', 'NotoKufi',
),), ),
color: isDarkTheme ? Colors.white : null,
),
overflow: TextOverflow.ellipsis, overflow: TextOverflow.ellipsis,
maxLines: 1, maxLines: 1,
), ),
@ -712,7 +779,7 @@ class _BookMarkState extends ConsumerState<BookMark> {
onTap: () { onTap: () {
debugPrint("Icon clicked in: ${data['title']}"); debugPrint("Icon clicked in: ${data['title']}");
showRemoveBookmarkDialog(data['id']); showRemoveBookmarkDialog(data['id']);
// removeBookmark(data['id']); // removeBookmark(data['id']);
}, },
child: SvgPicture.asset( child: SvgPicture.asset(
BookmarkAssetPath.delete, BookmarkAssetPath.delete,
@ -721,23 +788,24 @@ class _BookMarkState extends ConsumerState<BookMark> {
height: 20, height: 20,
)), )),
// GestureDetector( // GestureDetector(
// onTap: () { // onTap: () {
// debugPrint("Icon clicked in: ${data['title']}"); // debugPrint("Icon clicked in: ${data['title']}");
// // showRemoveBookmarkDialog(data['id']); // // showRemoveBookmarkDialog(data['id']);
// }, // },
// child: const Icon( // child: const Icon(
// Icons.bookmarks_rounded, // Icons.bookmarks_rounded,
// color: Colors.black, // color: Colors.black,
// size: 20, // size: 20,
// ), // ),
// ), // ),
], ],
), ),
Text( Text(
data['value_source'] ?? '', data['value_source'] ?? '',
style: TextStyle( style: TextStyle(
fontWeight: FontWeight.w500, color: Colors.grey, fontWeight: FontWeight.w500,
color: Colors.grey,
fontFamily: context.translate( fontFamily: context.translate(
'Roboto', 'Roboto',
'NotoKufi', 'NotoKufi',
@ -768,14 +836,18 @@ class _BookMarkState extends ConsumerState<BookMark> {
} }
Widget _buildBoxes( Widget _buildBoxes(
Map<String, dynamic> data, BuildContext context, Color styleColor) { Map<String, dynamic> data,
// Color borderColor = data['valueColor']; BuildContext context,
Color styleColor,
bool isDarkTheme,
) {
// Color borderColor = data['valueColor'];
print('inside function $data'); print('inside function $data');
return GestureDetector( return GestureDetector(
onTap: () { onTap: () {
final data_set = data['data_set']; final data_set = data['data_set'];
// final Color colorPattern = data['valueColor']; // final Color colorPattern = data['valueColor'];
final encodedMainTopic = data['main_topic']; final encodedMainTopic = data['main_topic'];
final encodedTitle = data['title']; final encodedTitle = data['title'];
String hexColor = colorToHex(styleColor); String hexColor = colorToHex(styleColor);
@ -783,10 +855,10 @@ class _BookMarkState extends ConsumerState<BookMark> {
debugPrint( debugPrint(
'/chartScreen/$data_set?bgColor=$hexColor&mainTopic=$encodedMainTopic&title=$encodedTitle'); '/chartScreen/$data_set?bgColor=$hexColor&mainTopic=$encodedMainTopic&title=$encodedTitle');
// String hexColor = colorToHex(colorPattern); // Get hex string // String hexColor = colorToHex(colorPattern); // Get hex string
// print(hexColor); // Prints: 0xFFAA8E83 // print(hexColor); // Prints: 0xFFAA8E83
// debugPrint("Box clicked: ${data['title']}"); // debugPrint("Box clicked: ${data['title']}");
context.push( context.push(
'/chartScreen/$data_set?bgColor=$hexColor&mainTopic=$encodedMainTopic&title=$encodedTitle'); '/chartScreen/$data_set?bgColor=$hexColor&mainTopic=$encodedMainTopic&title=$encodedTitle');
}, },
@ -795,7 +867,7 @@ class _BookMarkState extends ConsumerState<BookMark> {
height: 100, height: 100,
padding: const EdgeInsets.all(8.0), padding: const EdgeInsets.all(8.0),
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.white, color: isDarkTheme ? Color(0xFF111111) : Colors.white,
borderRadius: BorderRadius.circular(10), borderRadius: BorderRadius.circular(10),
border: Border.all(color: styleColor), border: Border.all(color: styleColor),
), ),
@ -814,10 +886,14 @@ class _BookMarkState extends ConsumerState<BookMark> {
alignment: Alignment.center, alignment: Alignment.center,
child: Text( child: Text(
data['title'] ?? '', data['title'] ?? '',
style: TextStyle(fontWeight: FontWeight.w500, fontFamily: context.translate( style: TextStyle(
'Roboto', fontWeight: FontWeight.w500,
'NotoKufi', fontFamily: context.translate(
),), 'Roboto',
'NotoKufi',
),
color: isDarkTheme ? Colors.white : null,
),
overflow: TextOverflow.ellipsis, overflow: TextOverflow.ellipsis,
maxLines: 1, maxLines: 1,
), ),
@ -839,10 +915,13 @@ class _BookMarkState extends ConsumerState<BookMark> {
Text( Text(
data['value_source'] ?? '', data['value_source'] ?? '',
style: TextStyle( style: TextStyle(
fontWeight: FontWeight.w500, color: Colors.grey, fontFamily: context.translate( fontWeight: FontWeight.w500,
'Roboto', color: Colors.grey,
'NotoKufi', fontFamily: context.translate(
),), 'Roboto',
'NotoKufi',
),
),
overflow: TextOverflow.ellipsis, overflow: TextOverflow.ellipsis,
maxLines: 1, maxLines: 1,
), ),
@ -870,17 +949,18 @@ class TabBarHeader extends StatelessWidget {
final List<Map<String, dynamic>> tabs; final List<Map<String, dynamic>> tabs;
final int selectedIndex; final int selectedIndex;
final ValueChanged<int> onTabSelected; final ValueChanged<int> onTabSelected;
bool isDarkTheme;
const TabBarHeader({ TabBarHeader(
required this.tabs, {required this.tabs,
required this.selectedIndex, required this.selectedIndex,
required this.onTabSelected, required this.onTabSelected,
}); required this.isDarkTheme});
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Container( return Container(
color: Colors.white, color: isDarkTheme ? Color(0xFF111111) : Colors.white,
padding: const EdgeInsets.symmetric(vertical: 8), padding: const EdgeInsets.symmetric(vertical: 8),
child: SingleChildScrollView( child: SingleChildScrollView(
scrollDirection: Axis.horizontal, scrollDirection: Axis.horizontal,
@ -901,11 +981,15 @@ class TabBarHeader extends StatelessWidget {
: Colors.grey[700]; : Colors.grey[700];
}), }),
), ),
child: Text(text, child: Text(
style: TextStyle( fontFamily: context.translate( text,
'Roboto', style: TextStyle(
'NotoKufi', fontFamily: context.translate(
),),), 'Roboto',
'NotoKufi',
),
),
),
), ),
if (index < tabs.length - 1) buildDivider(), if (index < tabs.length - 1) buildDivider(),
], ],
@ -936,6 +1020,7 @@ class CustomExpandableTile extends StatefulWidget {
final bool isExpanded; final bool isExpanded;
final ValueChanged<int> onTap; final ValueChanged<int> onTap;
final Widget childWidget; final Widget childWidget;
final bool isDarkTheme;
const CustomExpandableTile({ const CustomExpandableTile({
required this.title, required this.title,
@ -945,6 +1030,7 @@ class CustomExpandableTile extends StatefulWidget {
required this.isExpanded, required this.isExpanded,
required this.onTap, required this.onTap,
required this.childWidget, required this.childWidget,
required this.isDarkTheme,
}); });
@override @override
@ -960,7 +1046,7 @@ class _CustomExpandableTileState extends State<CustomExpandableTile> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
double myheight = MediaQuery.of(context).size.height; double myheight = MediaQuery.of(context).size.height;
// print(widget.filteredBookmarks); // print(widget.filteredBookmarks);
return Card( return Card(
elevation: 0, elevation: 0,
child: Column( child: Column(
@ -969,8 +1055,10 @@ class _CustomExpandableTileState extends State<CustomExpandableTile> {
onTap: () => widget.onTap(widget.index), onTap: () => widget.onTap(widget.index),
child: Container( child: Container(
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors color: widget.isDarkTheme
.white, // Ensuring the background outside the rounded container is white ? Color(0xFF111111)
: Colors
.white, // Ensuring the background outside the rounded container is white
), ),
child: Container( child: Container(
decoration: BoxDecoration( decoration: BoxDecoration(
@ -997,7 +1085,7 @@ class _CustomExpandableTileState extends State<CustomExpandableTile> {
widget.isExpanded widget.isExpanded
? Icons.keyboard_arrow_up ? Icons.keyboard_arrow_up
: Icons.keyboard_arrow_down, : Icons.keyboard_arrow_down,
color: Colors.white, color: widget.isDarkTheme ? Colors.black : Colors.white,
size: 28.0, size: 28.0,
), ),
], ],
@ -1010,35 +1098,35 @@ class _CustomExpandableTileState extends State<CustomExpandableTile> {
duration: Duration(milliseconds: 300), duration: Duration(milliseconds: 300),
curve: Curves.easeInOut, curve: Curves.easeInOut,
width: double.infinity, width: double.infinity,
color: Colors.white, color: widget.isDarkTheme ? Colors.black : Colors.white,
// height: widget.isExpanded ? myheight * 0.4 : 0, // height: widget.isExpanded ? myheight * 0.4 : 0,
child: widget.isExpanded child: widget.isExpanded
? SingleChildScrollView( ? SingleChildScrollView(
child: Column( child: Column(
children: [ children: [
widget.childWidget, widget.childWidget,
// Container( // Container(
// decoration: BoxDecoration( // decoration: BoxDecoration(
// color: Colors.white, // color: Colors.white,
// // borderRadius: BorderRadius.all(Radius.circular(20)) // // borderRadius: BorderRadius.all(Radius.circular(20))
// ), // ),
// padding: const EdgeInsets.all(16), // padding: const EdgeInsets.all(16),
// child: GridView.builder( // child: GridView.builder(
// shrinkWrap: true, // shrinkWrap: true,
// physics: NeverScrollableScrollPhysics(), // physics: NeverScrollableScrollPhysics(),
// gridDelegate: // gridDelegate:
// const SliverGridDelegateWithFixedCrossAxisCount( // const SliverGridDelegateWithFixedCrossAxisCount(
// crossAxisCount: 2, // crossAxisCount: 2,
// crossAxisSpacing: 10.0, // crossAxisSpacing: 10.0,
// mainAxisSpacing: 10.0, // mainAxisSpacing: 10.0,
// mainAxisExtent: 100, // mainAxisExtent: 100,
// ), // ),
// itemCount: widget.filteredBookmarks.length, // itemCount: widget.filteredBookmarks.length,
// itemBuilder: (context, index) { // itemBuilder: (context, index) {
// return _buildBox(widget.filteredBookmarks[index], context,widget.titleBackgroundColor); // return _buildBox(widget.filteredBookmarks[index], context,widget.titleBackgroundColor);
// }, // },
// ), // ),
// ), // ),
], ],
), ),
) )

View File

@ -1,7 +1,12 @@
import 'dart:convert';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:go_router/go_router.dart'; import 'package:go_router/go_router.dart';
import 'package:http/http.dart' as http;
import 'package:uae_stat/config/api_config.dart';
import 'package:uae_stat/config/connectivity_provider.dart'; import 'package:uae_stat/config/connectivity_provider.dart';
import 'package:uae_stat/config/theme/theme_provider.dart';
import 'package:uae_stat/config/toggle_lang_service.dart'; import 'package:uae_stat/config/toggle_lang_service.dart';
import 'package:uae_stat/domain/use_cases/language.dart'; import 'package:uae_stat/domain/use_cases/language.dart';
import 'package:uae_stat/infrastructure/services/img_asset_paths/icons/enquiry_asset_icon_path.dart'; import 'package:uae_stat/infrastructure/services/img_asset_paths/icons/enquiry_asset_icon_path.dart';
@ -20,10 +25,53 @@ class Contact extends ConsumerStatefulWidget {
class _ContactState extends ConsumerState<Contact> { class _ContactState extends ConsumerState<Contact> {
late UserService _userService; late UserService _userService;
List<dynamic> homePageData = [];
List<dynamic> filteredData = [];
late ThemeMode currentTheme;
bool isLoading = true;
@override @override
void initState() { void initState() {
super.initState(); super.initState();
_userService = UserService(); _userService = UserService();
final locale = ref.read(localeProvider);
currentTheme = ref.read(themeProvider);
print('123456789');
print(currentTheme);
WidgetsBinding.instance.addPostFrameCallback((_) {
final isDark = currentTheme == ThemeMode.dark ||
(currentTheme == ThemeMode.system &&
MediaQuery.of(context).platformBrightness == Brightness.dark);
final themeMode = (isDark ? 'dark' : 'light');
print("ThemeMode - $themeMode");
fetchData(locale?.languageCode ?? 'en', themeMode);
});
}
Future<void> fetchData(locale, themeMode) async {
const baseUrl = '$apiUrl/api/getUAENumbersData';
try {
final response = await http
.get(Uri.parse(baseUrl + '?language=$locale&color_mode=$themeMode'));
if (response.statusCode == 200) {
setState(() {
homePageData = (json.decode(response.body) as List)
.map((e) => Map<String, dynamic>.from(e))
.toList();
filteredData = List.from(homePageData);
isLoading = false;
});
} else {
throw Exception('Failed to load data');
}
} catch (e) {
setState(() {
isLoading = false;
});
print('Error fetching data: $e');
}
} }
@override @override
@ -42,6 +90,49 @@ class _ContactState extends ConsumerState<Contact> {
await _userService.updateLanguage(localeCode); await _userService.updateLanguage(localeCode);
}); });
ref.listen<Locale?>(localeProvider, (previous, next) async {
final localeCode = next?.languageCode ?? 'en';
setState(() {
isLoading = true;
});
await _userService.updateLanguage(localeCode);
final currentTheme = ref.read(themeProvider);
final isDark = currentTheme == ThemeMode.dark ||
(currentTheme == ThemeMode.system &&
MediaQuery.of(context).platformBrightness == Brightness.dark);
final themeString = isDark ? 'dark' : 'light';
fetchData(localeCode, themeString);
});
ref.listen<ThemeMode>(themeProvider, (previous, next) async {
final localeCode = ref.watch(localeProvider)?.languageCode ?? 'en';
print(localeCode);
// Default to 'en' if null
setState(() {
isLoading = true;
print('isLoadingref $isLoading');
});
final currentTheme = ref.read(themeProvider);
final isDark = currentTheme == ThemeMode.dark ||
(currentTheme == ThemeMode.system &&
MediaQuery.of(context).platformBrightness == Brightness.dark);
final themeString = isDark ? 'dark' : 'light';
print("themeString- $themeString");
fetchData(localeCode, themeString);
});
final themeMode = ref.read(themeProvider);
final isDarkTheme = themeMode == ThemeMode.dark ||
(themeMode == ThemeMode.system &&
MediaQuery.of(context).platformBrightness == Brightness.dark);
print("isDarkTheme - $isDarkTheme");
return PopScope( return PopScope(
canPop: false, canPop: false,
onPopInvokedWithResult: (didPop, result) { onPopInvokedWithResult: (didPop, result) {
@ -49,145 +140,175 @@ class _ContactState extends ConsumerState<Contact> {
context.go('/myhomepage'); context.go('/myhomepage');
}, },
child: BaseScaffold( child: BaseScaffold(
body: Container( backgroundColor: isDarkTheme ? Color(0xFF333333) : Colors.white,
color: Colors.grey[200], appbarColor: isDarkTheme ? Color(0xFF333333) : Colors.white,
width: screenWidth, body: isLoading
padding: const EdgeInsets.all(16.0), ? Container(
child: SingleChildScrollView( // color: Color(0x98FFFCE5), // Semi-transparent background
child: Column( color: isDarkTheme
children: [ ? Color(0xFF333333)
buildContactCard( : Color(0x98FFFCE5), // Semi-transparent background
context, child: Column(
title: 'DUBAI - EMIRATES TOWER - 32ND FLOOR', mainAxisAlignment: MainAxisAlignment.center,
titleAr: 'دبي - أبراج الإمارات - الطابق 32', children: [
details: [ Container(
{ margin: EdgeInsets.symmetric(
'icon': EnquiryAssetIconPath.building, horizontal: 40), // Left & Right space
'text': 'Office: Dubai - Emirates Tower - 32nd Floor', child: LinearProgressIndicator(
'textAr': 'المقر الرئيسي: دبي - أبراج الإمارات - الطابق 32' minHeight: 5, // Adjust thickness
}, backgroundColor:
{ Colors.grey[100], // Optional: Background color
'icon': EnquiryAssetIconPath.phone, valueColor: AlwaysStoppedAnimation<Color>(
'text': 'Tel: 00971 4608 0000', Color(0xFFAA8E83)), // Loader color
'textAr': 'الهاتف: 0097146080000' ),
}, ),
{
'icon': EnquiryAssetIconPath.fax,
'text': 'Fax: 00971 4327 3535',
'textAr': 'فاكس: 0097143273535'
},
{
'icon': EnquiryAssetIconPath.map,
'text': 'P.O.Box: 127000 Dubai',
'textAr': 'ص.ب: 127000 دبي'
},
{
'icon': EnquiryAssetIconPath.at,
'text': 'Email Address: info@fcsc.gov.ae',
'textAr': 'البريد الإلكتروني: info@fcsc.gov.ae'
},
{
'icon': EnquiryAssetIconPath.map,
'text': 'Latitude: 25.223926',
'textAr': 'خط العرض: 25.223926'
},
{
'icon': EnquiryAssetIconPath.map,
'text': 'Longitude: 55.350526',
'textAr': 'خط الطول: 55.350526'
},
], ],
), ),
const SizedBox(height: 10), )
buildContactCard( : Container(
context, // color: Colors.grey[200],
title: 'MEDIA SECTION', // color: isDarkTheme ? Color(0xFF3B3C3F) : Colors.grey[200],
titleAr: 'قسم الاعلام', color: isDarkTheme ? Color(0xFF333333) : Colors.grey[200],
details: [ width: screenWidth,
{ padding: const EdgeInsets.all(16.0),
'icon': EnquiryAssetIconPath.building, child: SingleChildScrollView(
'text': 'Office: Media Section', child: Column(
'textAr': 'المقر الرئيسي: قسم الاعلام' children: [
}, buildContactCard(context,
{ title: 'DUBAI - EMIRATES TOWER - 32ND FLOOR',
'icon': EnquiryAssetIconPath.phone, titleAr: 'دبي - أبراج الإمارات - الطابق 32',
'text': 'Tel: 00971 4608 0000', details: [
'textAr': 'الهاتف: 0097146080000' {
}, 'icon': EnquiryAssetIconPath.building,
{ 'text':
'icon': EnquiryAssetIconPath.fax, 'Office: Dubai - Emirates Tower - 32nd Floor',
'text': 'Fax: 00971 4327 3535', 'textAr':
'textAr': 'فاكس: 0097143273535' 'المقر الرئيسي: دبي - أبراج الإمارات - الطابق 32'
}, },
{ {
'icon': EnquiryAssetIconPath.map, 'icon': EnquiryAssetIconPath.phone,
'text': 'P.O.Box: 127000 Dubai', 'text': 'Tel: 00971 4608 0000',
'textAr': 'ص.ب: 127000 دبي' 'textAr': 'الهاتف: 0097146080000'
}, },
{ {
'icon': EnquiryAssetIconPath.at, 'icon': EnquiryAssetIconPath.fax,
'text': 'Email Address: GCO@fcsc.gov.ae', 'text': 'Fax: 00971 4327 3535',
'textAr': 'البريد الإلكتروني: GCO@fcsc.gov.ae' 'textAr': 'فاكس: 0097143273535'
}, },
{ {
'icon': EnquiryAssetIconPath.map, 'icon': EnquiryAssetIconPath.map,
'text': 'Latitude: 25.223926', 'text': 'P.O.Box: 127000 Dubai',
'textAr': 'خط العرض: 25.223926' 'textAr': 'ص.ب: 127000 دبي'
}, },
{ {
'icon': EnquiryAssetIconPath.map, 'icon': EnquiryAssetIconPath.at,
'text': 'Longitude: 55.350526', 'text': 'Email Address: info@fcsc.gov.ae',
'textAr': 'خط الطول: 55.350526' 'textAr': 'البريد الإلكتروني: info@fcsc.gov.ae'
}, },
], {
'icon': EnquiryAssetIconPath.map,
'text': 'Latitude: 25.223926',
'textAr': 'خط العرض: 25.223926'
},
{
'icon': EnquiryAssetIconPath.map,
'text': 'Longitude: 55.350526',
'textAr': 'خط الطول: 55.350526'
},
],
isDarkTheme: isDarkTheme),
const SizedBox(height: 10),
buildContactCard(
context,
title: 'MEDIA SECTION',
titleAr: 'قسم الاعلام',
details: [
{
'icon': EnquiryAssetIconPath.building,
'text': 'Office: Media Section',
'textAr': 'المقر الرئيسي: قسم الاعلام'
},
{
'icon': EnquiryAssetIconPath.phone,
'text': 'Tel: 00971 4608 0000',
'textAr': 'الهاتف: 0097146080000'
},
{
'icon': EnquiryAssetIconPath.fax,
'text': 'Fax: 00971 4327 3535',
'textAr': 'فاكس: 0097143273535'
},
{
'icon': EnquiryAssetIconPath.map,
'text': 'P.O.Box: 127000 Dubai',
'textAr': 'ص.ب: 127000 دبي'
},
{
'icon': EnquiryAssetIconPath.at,
'text': 'Email Address: GCO@fcsc.gov.ae',
'textAr': 'البريد الإلكتروني: GCO@fcsc.gov.ae'
},
{
'icon': EnquiryAssetIconPath.map,
'text': 'Latitude: 25.223926',
'textAr': 'خط العرض: 25.223926'
},
{
'icon': EnquiryAssetIconPath.map,
'text': 'Longitude: 55.350526',
'textAr': 'خط الطول: 55.350526'
},
],
isDarkTheme: isDarkTheme,
),
const SizedBox(height: 10),
buildContactCard(
context,
title: 'SGDS',
titleAr: 'أهداف التنمية المستدامة',
details: [
{
'icon': EnquiryAssetIconPath.building,
'text': 'Office: SDGs',
'textAr': 'المقر الرئيسي: أهداف التنمية المستدامة'
},
{
'icon': EnquiryAssetIconPath.phone,
'text': 'Tel: 00971 4608 0000',
'textAr': 'الهاتف: 0097146080000'
},
{
'icon': EnquiryAssetIconPath.fax,
'text': 'Fax: 00971 4327 3535',
'textAr': 'فاكس : 0097143273535'
},
{
'icon': EnquiryAssetIconPath.map,
'text': 'P.O.Box: 127000 Dubai',
'textAr': 'ص.ب: 127000 دبي'
},
{
'icon': EnquiryAssetIconPath.at,
'text': 'Email Address: sdgs@fcsc.gov.ae',
'textAr': 'البريد الإلكتروني: sdgs@fcsc.gov.ae'
},
{
'icon': EnquiryAssetIconPath.map,
'text': 'Latitude: 25.223926',
'textAr': 'خط العرض: 25.223926'
},
{
'icon': EnquiryAssetIconPath.map,
'text': 'Longitude: 55.350526',
'textAr': 'خط الطول: 55.350526'
},
],
isDarkTheme: isDarkTheme,
),
],
),
), ),
const SizedBox(height: 10), ),
buildContactCard(
context,
title: 'SGDS',
titleAr: 'أهداف التنمية المستدامة',
details: [
{
'icon': EnquiryAssetIconPath.building,
'text': 'Office: SDGs',
'textAr': 'المقر الرئيسي: أهداف التنمية المستدامة'
},
{
'icon': EnquiryAssetIconPath.phone,
'text': 'Tel: 00971 4608 0000',
'textAr': 'الهاتف: 0097146080000'
},
{
'icon': EnquiryAssetIconPath.fax,
'text': 'Fax: 00971 4327 3535',
'textAr': 'فاكس : 0097143273535'
},
{
'icon': EnquiryAssetIconPath.map,
'text': 'P.O.Box: 127000 Dubai',
'textAr': 'ص.ب: 127000 دبي'
},
{
'icon': EnquiryAssetIconPath.at,
'text': 'Email Address: sdgs@fcsc.gov.ae',
'textAr': 'البريد الإلكتروني: sdgs@fcsc.gov.ae'
},
{
'icon': EnquiryAssetIconPath.map,
'text': 'Latitude: 25.223926',
'textAr': 'خط العرض: 25.223926'
},
{
'icon': EnquiryAssetIconPath.map,
'text': 'Longitude: 55.350526',
'textAr': 'خط الطول: 55.350526'
},
],
),
],
),
),
),
title: Text(context.translate('Contact Us', 'اتصل بنا')), title: Text(context.translate('Contact Us', 'اتصل بنا')),
), ),
); );
@ -196,11 +317,13 @@ class _ContactState extends ConsumerState<Contact> {
Widget buildContactCard(BuildContext context, Widget buildContactCard(BuildContext context,
{required String title, {required String title,
required String titleAr, required String titleAr,
required List<Map<String, String>> details}) { required List<Map<String, String>> details,
isDarkTheme}) {
return Container( return Container(
padding: const EdgeInsets.symmetric(vertical: 10, horizontal: 12), padding: const EdgeInsets.symmetric(vertical: 10, horizontal: 12),
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.white, // color: Colors.white,
color: isDarkTheme ? Color(0xFF030303) : Colors.white,
borderRadius: BorderRadius.circular(6.0), borderRadius: BorderRadius.circular(6.0),
boxShadow: [ boxShadow: [
BoxShadow( BoxShadow(
@ -226,31 +349,38 @@ class _ContactState extends ConsumerState<Contact> {
), ),
), ),
const SizedBox(height: 8), const SizedBox(height: 8),
...details.map((item) => buildTextRow(item['icon']!, ...details.map((item) => buildTextRow(
context.translate(item['text']!, item['textAr']!))), item['icon']!,
context.translate(
item['text']!,
item['textAr']!,
),
isDarkTheme)),
], ],
), ),
); );
} }
Widget buildTextRow(String iconName, String text) { Widget buildTextRow(String iconName, String text, bool isDarkTheme) {
List<String> values = List.filled(2, ''); List<String> values = List.filled(2, '');
String cleanText = ''; String cleanText = '';
if (text.toLowerCase().contains('tel:') || text.toLowerCase().contains('الهاتف:')) { if (text.toLowerCase().contains('tel:') ||
text.toLowerCase().contains('الهاتف:')) {
values = text.split(':'); values = text.split(':');
print ('List of values----- :$values'); print('List of values----- :$values');
print ('value 1 ${values[0]}'); print('value 1 ${values[0]}');
cleanText=values[1].replaceAll(' ', ''); cleanText = values[1].replaceAll(' ', '');
} else if(text.toLowerCase().contains('email address:') || text.toLowerCase().contains('البريد الإلكتروني:')){ } else if (text.toLowerCase().contains('email address:') ||
text.toLowerCase().contains('البريد الإلكتروني:')) {
values = text.split(':'); values = text.split(':');
cleanText = values[1].replaceAll(' ', ''); cleanText = values[1].replaceAll(' ', '');
} else{ } else {
cleanText = text; cleanText = text;
} }
Future<void> sendEmail(String emailAddress) async { Future<void> sendEmail(String emailAddress) async {
print ('before email : $emailAddress'); print('before email : $emailAddress');
final uri = Uri( final uri = Uri(
scheme: 'mailto', scheme: 'mailto',
path: emailAddress, path: emailAddress,
@ -275,76 +405,99 @@ class _ContactState extends ConsumerState<Contact> {
const SizedBox(width: 10), const SizedBox(width: 10),
iconName == EnquiryAssetIconPath.phone iconName == EnquiryAssetIconPath.phone
? InkWell( ? InkWell(
onTap: () async{ onTap: () async {
print('clean test : $cleanText'); print('clean test : $cleanText');
final uri = Uri(scheme: 'tel', path: cleanText); final uri = Uri(scheme: 'tel', path: cleanText);
if (await canLaunchUrl(uri)) { if (await canLaunchUrl(uri)) {
await launchUrl(uri); await launchUrl(uri);
} else { } else {
debugPrint('Could not launch $uri'); debugPrint('Could not launch $uri');
} }
}, },
child: RichText( child: RichText(
text: TextSpan( text: TextSpan(
text: values[0], text: values[0],
style: TextStyle(fontSize: 14, color: Color(0xFF5F5F5F), fontFamily: context.translate( style: TextStyle(
'Roboto', fontSize: 14,
'NotoKufi', color: isDarkTheme ? Colors.white : Color(0xFF5F5F5F),
),), fontFamily: context.translate(
children: <TextSpan>[ 'Roboto',
TextSpan(text: ':',), 'NotoKufi',
TextSpan(text: values[1], ),
style: TextStyle(fontSize: 14, color:Color(0xFF985400), fontFamily: context.translate( ),
'Roboto', children: <TextSpan>[
'NotoKufi', TextSpan(
),) text: ':',
),
TextSpan(
text: values[1],
style: TextStyle(
fontSize: 14,
color: Color(0xFF985400),
fontFamily: context.translate(
'Roboto',
'NotoKufi',
),
)),
],
),
), ),
], // child: Text(
), // text,
), // style: const TextStyle(
// child: Text( // fontSize: 14,
// text, // color: Color(0xFF5F5F5F),
// style: const TextStyle( // ),
// fontSize: 14, // ),
// color: Color(0xFF5F5F5F), )
// ),
// ),
)
: iconName == EnquiryAssetIconPath.at : iconName == EnquiryAssetIconPath.at
? InkWell( ? InkWell(
onTap: () => sendEmail(cleanText), onTap: () => sendEmail(cleanText),
child: RichText( child: RichText(
text: TextSpan( text: TextSpan(
text: values[0], text: values[0],
style: TextStyle(fontSize: 14, color: Color(0xFF5F5F5F), fontFamily: context.translate( style: TextStyle(
'Roboto', fontSize: 14,
'NotoKufi', color:
),), isDarkTheme ? Colors.white : Color(0xFF5F5F5F),
children: <TextSpan>[ // color: Color(0xFF5F5F5F),
TextSpan(text: ':',), fontFamily: context.translate(
TextSpan(text: values[1], 'Roboto',
style: TextStyle(fontSize: 14, color:Color(0xFF985400), fontFamily: context.translate( 'NotoKufi',
'Roboto', ),
'NotoKufi', ),
),) children: <TextSpan>[
), TextSpan(
], text: ':',
), ),
), TextSpan(
) text: values[1],
:Expanded( style: TextStyle(
child: Text( fontSize: 14,
text, color: Color(0xFF985400),
style: TextStyle( fontFamily: context.translate(
fontFamily: context.translate( 'Roboto',
'Roboto', 'NotoKufi',
'NotoKufi', ),
), )),
fontSize: 14, ],
color: Color(0xFF5F5F5F), ),
), ),
), )
), : Expanded(
child: Text(
text,
style: TextStyle(
fontFamily: context.translate(
'Roboto',
'NotoKufi',
),
fontSize: 14,
color: isDarkTheme ? Colors.white : Color(0xFF5F5F5F),
// color: Color(0xFF5F5F5F),
),
),
),
], ],
), ),
); );

View File

@ -1,9 +1,13 @@
import 'dart:convert';
import 'package:external_repos/external_repos.dart'; import 'package:external_repos/external_repos.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_rating_bar/flutter_rating_bar.dart'; import 'package:flutter_rating_bar/flutter_rating_bar.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:go_router/go_router.dart'; import 'package:go_router/go_router.dart';
import 'package:http/http.dart' as http;
import 'package:intl/intl.dart'; import 'package:intl/intl.dart';
import 'package:uae_stat/config/theme/theme_provider.dart';
import 'package:flutter_gen/gen_l10n/app_localizations.dart'; import 'package:flutter_gen/gen_l10n/app_localizations.dart';
import 'package:pocketbase/pocketbase.dart'; import 'package:pocketbase/pocketbase.dart';
import 'package:shared_preferences/shared_preferences.dart'; import 'package:shared_preferences/shared_preferences.dart';
@ -39,6 +43,8 @@ class _FeedbackFormState extends ConsumerState<FeedbackForm>
// PocketBase('http://127.0.0.1:8090'); // Initialize PocketBase client // PocketBase('http://127.0.0.1:8090'); // Initialize PocketBase client
final TextEditingController _feedbackController = TextEditingController(); final TextEditingController _feedbackController = TextEditingController();
List<dynamic> homePageData = [];
List<dynamic> filteredData = [];
double _easeOfUseRating = 0; double _easeOfUseRating = 0;
double _qualityRating = 0; double _qualityRating = 0;
@ -107,18 +113,59 @@ class _FeedbackFormState extends ConsumerState<FeedbackForm>
bool _hasError = false; bool _hasError = false;
String _errorMessage = ''; String _errorMessage = '';
late UserService _userService; late UserService _userService;
late ThemeMode currentTheme;
@override @override
void initState() { void initState() {
super.initState(); super.initState();
_userService = UserService(); _userService = UserService();
final locale = ref.read(localeProvider);
currentTheme = ref.read(themeProvider);
print('123456789');
print(currentTheme);
WidgetsBinding.instance.addPostFrameCallback((_) {
final isDark = currentTheme == ThemeMode.dark ||
(currentTheme == ThemeMode.system &&
MediaQuery.of(context).platformBrightness == Brightness.dark);
final themeMode = (isDark ? 'dark' : 'light');
print("ThemeMode - $themeMode");
fetchData(locale?.languageCode ?? 'en', themeMode);
});
WidgetsBinding.instance.addObserver(this); WidgetsBinding.instance.addObserver(this);
_loadFeedbackText(); _loadFeedbackText();
_feedbackController.addListener(_handleTextChange); _feedbackController.addListener(_handleTextChange);
// fetchEmailConfiguration(); // fetchEmailConfiguration();
checkUserId(); checkUserId();
} }
Future<void> fetchData(locale, themeMode) async {
const baseUrl = '$apiUrl/api/getUAENumbersData';
try {
final response = await http
.get(Uri.parse(baseUrl + '?language=$locale&color_mode=$themeMode'));
if (response.statusCode == 200) {
setState(() {
homePageData = (json.decode(response.body) as List)
.map((e) => Map<String, dynamic>.from(e))
.toList();
filteredData = List.from(homePageData);
isLoading = false;
});
} else {
throw Exception('Failed to load data');
}
} catch (e) {
setState(() {
isLoading = false;
});
print('Error fetching data: $e');
}
}
Future<String?> getUserId() async { Future<String?> getUserId() async {
final prefs = await SharedPreferences.getInstance(); final prefs = await SharedPreferences.getInstance();
return prefs.getString('userId'); // Retrieve the userId return prefs.getString('userId'); // Retrieve the userId
@ -248,11 +295,54 @@ class _FeedbackFormState extends ConsumerState<FeedbackForm>
} }
}); });
// ref.listen<Locale?>(localeProvider, (previous, next) async {
// final localeCode = next?.languageCode ?? 'en'; // Default to 'en' if null
// await _userService.updateLanguage(localeCode);
// });
ref.listen<Locale?>(localeProvider, (previous, next) async { ref.listen<Locale?>(localeProvider, (previous, next) async {
final localeCode = next?.languageCode ?? 'en'; // Default to 'en' if null final localeCode = next?.languageCode ?? 'en';
setState(() {
isLoading = true;
});
await _userService.updateLanguage(localeCode); await _userService.updateLanguage(localeCode);
final currentTheme = ref.read(themeProvider);
final isDark = currentTheme == ThemeMode.dark ||
(currentTheme == ThemeMode.system &&
MediaQuery.of(context).platformBrightness == Brightness.dark);
final themeString = isDark ? 'dark' : 'light';
fetchData(localeCode, themeString);
}); });
ref.listen<ThemeMode>(themeProvider, (previous, next) async {
final localeCode = ref.watch(localeProvider)?.languageCode ?? 'en';
print(localeCode);
// Default to 'en' if null
setState(() {
isLoading = true;
print('isLoadingref $isLoading');
});
final currentTheme = ref.read(themeProvider);
final isDark = currentTheme == ThemeMode.dark ||
(currentTheme == ThemeMode.system &&
MediaQuery.of(context).platformBrightness == Brightness.dark);
final themeString = isDark ? 'dark' : 'light';
print("themeString- $themeString");
fetchData(localeCode, themeString);
});
final themeMode = ref.read(themeProvider);
final isDarkTheme = themeMode == ThemeMode.dark ||
(themeMode == ThemeMode.system &&
MediaQuery.of(context).platformBrightness == Brightness.dark);
print("isDarkTheme - $isDarkTheme");
final userName = GoRouterState.of(context).extra as String? ?? 'Guest User'; final userName = GoRouterState.of(context).extra as String? ?? 'Guest User';
return PopScope( return PopScope(
canPop: false, // Allow back navigation only if not login screen canPop: false, // Allow back navigation only if not login screen
@ -261,6 +351,11 @@ class _FeedbackFormState extends ConsumerState<FeedbackForm>
context.go('/myhomepage'); // Show exit confirmation dialog context.go('/myhomepage'); // Show exit confirmation dialog
}, },
child: BaseScaffold( child: BaseScaffold(
backgroundColor: isDarkTheme ? Color(0xFF111111) : Colors.white,
appbarColor: isDarkTheme ? Color(0xFF111111) : Colors.white,
// backgroundColor: isDarkTheme ? Color(0xFF333333) : Color(0xFF414042),
// appbarColor: isDarkTheme ? Color(0xFF333333) : Color(0xFF414042),
// title: Text("Feedback"), // title: Text("Feedback"),
title: Text( title: Text(
AppLocalizations.of(context)!.feedback_title, AppLocalizations.of(context)!.feedback_title,
@ -292,7 +387,9 @@ class _FeedbackFormState extends ConsumerState<FeedbackForm>
// ), // ),
body: isLoading body: isLoading
? Container( ? Container(
color: Color(0x98FFFCE5), // Semi-transparent background // color: Color(0x98FFFCE5), // Semi-transparent background
color: isDarkTheme ? Color(0xFF000000) : Colors.white,
child: Column( child: Column(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: [ children: [
@ -315,16 +412,16 @@ class _FeedbackFormState extends ConsumerState<FeedbackForm>
top: 8.0, bottom: 16.0, left: 23.0, right: 23.0), top: 8.0, bottom: 16.0, left: 23.0, right: 23.0),
child: SingleChildScrollView( child: SingleChildScrollView(
child: _isFeedbackSubmitted child: _isFeedbackSubmitted
? _buildThankYouMessage(userName) ? _buildThankYouMessage(userName, isDarkTheme)
: _isFeedbackFailed : _isFeedbackFailed
? _buildFailureMessage() ? _buildFailureMessage(isDarkTheme)
: _buildFeedbackForm(), : _buildFeedbackForm(isDarkTheme),
), ),
), ),
)); ));
} }
Widget _buildFeedbackForm() { Widget _buildFeedbackForm(bool isDarkTheme) {
return Column( return Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
@ -335,7 +432,7 @@ class _FeedbackFormState extends ConsumerState<FeedbackForm>
), ),
style: TextStyle( style: TextStyle(
fontSize: 18, fontSize: 18,
color: Color(0xFF898C81), color: isDarkTheme ? Colors.white : Color(0xFF898C81),
fontFamily: context.translate( fontFamily: context.translate(
'Roboto', 'Roboto',
'NotoKufi', 'NotoKufi',
@ -359,7 +456,8 @@ class _FeedbackFormState extends ConsumerState<FeedbackForm>
'NotoKufi', 'NotoKufi',
), ),
fontWeight: FontWeight.w400, fontWeight: FontWeight.w400,
color: Color(0xff898C81), color: isDarkTheme ? Colors.white : Color(0xff898C81),
// color: Color(0xff898C81),
), ),
), ),
), ),
@ -387,6 +485,7 @@ class _FeedbackFormState extends ConsumerState<FeedbackForm>
// icon: _emojiOptions[index]["icon"], // icon: _emojiOptions[index]["icon"],
label: _emojiOptions[index]["label"], label: _emojiOptions[index]["label"],
index: index, index: index,
isDarkTheme: isDarkTheme,
); );
}), }),
), ),
@ -398,10 +497,14 @@ class _FeedbackFormState extends ConsumerState<FeedbackForm>
'Please rate your experience before submitting your feedback.', 'Please rate your experience before submitting your feedback.',
'يرجى تقييم تجربتك قبل تقديم ملاحظاتك.', 'يرجى تقييم تجربتك قبل تقديم ملاحظاتك.',
), ),
style: TextStyle(color: Color(0xFFD83731), fontSize: 14, fontFamily: context.translate( style: TextStyle(
'Roboto', color: Color(0xFFD83731),
'NotoKufi', fontSize: 14,
),), fontFamily: context.translate(
'Roboto',
'NotoKufi',
),
),
), ),
), ),
], ],
@ -421,19 +524,17 @@ class _FeedbackFormState extends ConsumerState<FeedbackForm>
'NotoKufi', 'NotoKufi',
), ),
fontWeight: FontWeight.w400, fontWeight: FontWeight.w400,
color: Color(0xFF898C81), // color: Color(0xFF898C81),
color: isDarkTheme ? Colors.white : Color(0xff898C81),
), ),
)), )),
const SizedBox(height: 15), const SizedBox(height: 15),
_buildRatingRow( _buildRatingRow(context.translate('Ease of use', 'سهولة الاستخدام'),
context.translate('Ease of use', 'سهولة الاستخدام'), _easeOfUseRating, (rating) {
_easeOfUseRating, setState(() {
(rating) { _easeOfUseRating = rating;
setState(() { });
_easeOfUseRating = rating; }, isDarkTheme),
});
},
),
_buildRatingRow( _buildRatingRow(
context.translate('Quality', 'الجودة'), context.translate('Quality', 'الجودة'),
_qualityRating, _qualityRating,
@ -442,6 +543,7 @@ class _FeedbackFormState extends ConsumerState<FeedbackForm>
_qualityRating = rating; _qualityRating = rating;
}); });
}, },
isDarkTheme,
), ),
_buildRatingRow( _buildRatingRow(
context.translate('Design', 'التصميم'), context.translate('Design', 'التصميم'),
@ -451,6 +553,7 @@ class _FeedbackFormState extends ConsumerState<FeedbackForm>
_designRating = rating; _designRating = rating;
}); });
}, },
isDarkTheme,
), ),
_buildRatingRow( _buildRatingRow(
context.translate('Redundant', 'مكرر'), context.translate('Redundant', 'مكرر'),
@ -460,6 +563,7 @@ class _FeedbackFormState extends ConsumerState<FeedbackForm>
_redundancyRating = rating; _redundancyRating = rating;
}); });
}, },
isDarkTheme,
), ),
const SizedBox(height: 20), const SizedBox(height: 20),
TextField( TextField(
@ -467,42 +571,51 @@ class _FeedbackFormState extends ConsumerState<FeedbackForm>
minLines: 5, // Start with 5 lines minLines: 5, // Start with 5 lines
maxLines: null, // Allows the field to expand automatically maxLines: null, // Allows the field to expand automatically
maxLength: _characterLimit, maxLength: _characterLimit,
style: TextStyle(color: Color(0xFF898C81), fontFamily: context.translate( style: TextStyle(
'Roboto', color: isDarkTheme ? Colors.white : Color(0xFF898C81),
'NotoKufi', fontFamily: context.translate(
),), 'Roboto',
'NotoKufi',
),
),
decoration: InputDecoration( decoration: InputDecoration(
hintText: context.translate( hintText: context.translate(
'Tell us how we can improve', 'أخبرنا كيف يمكننا التحسين'), 'Tell us how we can improve', 'أخبرنا كيف يمكننا التحسين'),
hintStyle: TextStyle(color: Color(0xFF898C81), fontFamily: context.translate( hintStyle: TextStyle(
'Roboto', color: isDarkTheme ? Colors.white : Color(0xFF898C81),
'NotoKufi', fontFamily: context.translate(
),), 'Roboto',
'NotoKufi',
),
),
border: OutlineInputBorder( border: OutlineInputBorder(
borderRadius: BorderRadius.circular(10.0), borderRadius: BorderRadius.circular(10.0),
borderSide: BorderSide(color: Color(0xFF7296BE), width: 1), borderSide: BorderSide(color: Color(0xFFB68A34), width: 2),
), ),
// Border when the TextField is enabled but not focused // Border when the TextField is enabled but not focused
enabledBorder: OutlineInputBorder( enabledBorder: OutlineInputBorder(
borderRadius: BorderRadius.circular(10.0), borderRadius: BorderRadius.circular(10.0),
borderSide: BorderSide(color: Color(0xFF7296BE), width: 1), borderSide: BorderSide(color: Color(0xFFB68A34), width: 2),
), ),
// Border when there is an error // Border when there is an error
errorBorder: OutlineInputBorder( errorBorder: OutlineInputBorder(
borderRadius: BorderRadius.circular(10.0), borderRadius: BorderRadius.circular(10.0),
borderSide: BorderSide(color: Color(0xFFD83731), width: 1), borderSide: BorderSide(color: Color(0xFFD83731), width: 2),
), ),
// Border when focused and there is an error // Border when focused and there is an error
focusedErrorBorder: OutlineInputBorder( focusedErrorBorder: OutlineInputBorder(
borderRadius: BorderRadius.circular(10.0), borderRadius: BorderRadius.circular(10.0),
borderSide: BorderSide(color: Color(0xFFD83731), width: 1), borderSide: BorderSide(color: Color(0xFFD83731), width: 2),
), ),
errorText: errorText:
_hasError ? _errorMessage : null, // Show error below field _hasError ? _errorMessage : null, // Show error below field
errorStyle: TextStyle(
color: Color(0xFFD83731),
),
), ),
onChanged: (text) { onChanged: (text) {
// Trigger re-validation and character limit on each change // Trigger re-validation and character limit on each change
@ -532,9 +645,10 @@ class _FeedbackFormState extends ConsumerState<FeedbackForm>
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
), ),
), ),
backgroundColor: WidgetStatePropertyAll( backgroundColor: WidgetStatePropertyAll(Color(0xFFB68A34)),
MyTheme.topicColor(IndicatorTopic.environment), // backgroundColor: WidgetStatePropertyAll(
), // MyTheme.topicColor(IndicatorTopic.environment),
// ),
foregroundColor: const WidgetStatePropertyAll( foregroundColor: const WidgetStatePropertyAll(
Colors.white, Colors.white,
), ),
@ -548,16 +662,18 @@ class _FeedbackFormState extends ConsumerState<FeedbackForm>
'إرسال', 'إرسال',
), ),
style: TextStyle( style: TextStyle(
fontFamily: context.translate( fontFamily: context.translate(
'Roboto', 'Roboto',
'NotoKufi', 'NotoKufi',
) ),
color: isDarkTheme ? Colors.black : Colors.white,
), ),
), ),
6.horizontalSpace, 6.horizontalSpace,
const Icon( Icon(
Icons.chevron_right_outlined, Icons.chevron_right_outlined,
color: Colors.white, // color: Colors.white,
color: isDarkTheme ? Colors.black : Colors.white,
), ),
], ],
), ),
@ -567,7 +683,7 @@ class _FeedbackFormState extends ConsumerState<FeedbackForm>
); );
} }
Widget _buildThankYouMessage(String userName) { Widget _buildThankYouMessage(String userName, bool isDarkTheme) {
double screenHeight = MediaQuery.of(context).size.height; double screenHeight = MediaQuery.of(context).size.height;
return Center( return Center(
child: Column( child: Column(
@ -612,18 +728,26 @@ class _FeedbackFormState extends ConsumerState<FeedbackForm>
Text( Text(
'${AppLocalizations.of(context)!.thankYou} $userName !', '${AppLocalizations.of(context)!.thankYou} $userName !',
style: TextStyle(fontSize: 24, fontWeight: FontWeight.bold, fontFamily: context.translate( style: TextStyle(
'Roboto', fontSize: 24,
'NotoKufi', fontWeight: FontWeight.bold,
),), fontFamily: context.translate(
'Roboto',
'NotoKufi',
),
),
), ),
const SizedBox(height: 15), const SizedBox(height: 15),
Text( Text(
AppLocalizations.of(context)!.feedback_message, AppLocalizations.of(context)!.feedback_message,
style: TextStyle(fontSize: 16, color: Color(0xFF898C81), fontFamily: context.translate( style: TextStyle(
'Roboto', fontSize: 16,
'NotoKufi', color: isDarkTheme ? Colors.white : Color(0xFF898C81),
),), fontFamily: context.translate(
'Roboto',
'NotoKufi',
),
),
textAlign: TextAlign.center, textAlign: TextAlign.center,
), ),
// const SizedBox(height: 30), // const SizedBox(height: 30),
@ -638,7 +762,7 @@ class _FeedbackFormState extends ConsumerState<FeedbackForm>
} }
// New widget for failure message // New widget for failure message
Widget _buildFailureMessage() { Widget _buildFailureMessage(bool isDarkTheme) {
double screenHeight = MediaQuery.of(context).size.height; double screenHeight = MediaQuery.of(context).size.height;
double screenWidth = MediaQuery.of(context).size.width; double screenWidth = MediaQuery.of(context).size.width;
return Center( return Center(
@ -682,14 +806,18 @@ class _FeedbackFormState extends ConsumerState<FeedbackForm>
), ),
fontSize: 24, fontSize: 24,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
color: Color(0xFF414042)), color: isDarkTheme ? Colors.white : Color(0xFF414042)),
), ),
const SizedBox(height: 10), const SizedBox(height: 10),
Text(AppLocalizations.of(context)!.feedback_failed_msg, Text(AppLocalizations.of(context)!.feedback_failed_msg,
style: TextStyle(fontSize: 16, color: Color(0xFF898C81), fontFamily: context.translate( style: TextStyle(
'Roboto', fontSize: 16,
'NotoKufi', color: isDarkTheme ? Colors.white : Color(0xFF898C81),
),), fontFamily: context.translate(
'Roboto',
'NotoKufi',
),
),
textAlign: TextAlign.center), textAlign: TextAlign.center),
// const SizedBox(height: 30), // const SizedBox(height: 30),
// ElevatedButton( // ElevatedButton(
@ -710,6 +838,7 @@ class _FeedbackFormState extends ConsumerState<FeedbackForm>
required Widget icon, required Widget icon,
required String label, required String label,
required int index, required int index,
required bool isDarkTheme,
}) { }) {
bool isSelected = _selectedEmojiIndex == index; bool isSelected = _selectedEmojiIndex == index;
return GestureDetector( return GestureDetector(
@ -746,7 +875,11 @@ class _FeedbackFormState extends ConsumerState<FeedbackForm>
), ),
fontWeight: FontWeight.w400, fontWeight: FontWeight.w400,
fontSize: 14, fontSize: 14,
color: Colors.black, color: isDarkTheme
? Colors.white
: Colors.black, // Wrong: black in dark theme?
// color: Colors.black,
// color: isSelected ? Colors.green : Colors.black, // color: isSelected ? Colors.green : Colors.black,
), ),
), ),
@ -785,6 +918,7 @@ class _FeedbackFormState extends ConsumerState<FeedbackForm>
String label, String label,
double rating, double rating,
Function(double) onRatingUpdate, Function(double) onRatingUpdate,
bool isDarkTheme,
) { ) {
return Row( return Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
@ -797,7 +931,8 @@ class _FeedbackFormState extends ConsumerState<FeedbackForm>
'NotoKufi', 'NotoKufi',
), ),
fontWeight: FontWeight.w400, fontWeight: FontWeight.w400,
color: Color(0xFF898C81), // color: Color(0xFF898C81),
color: isDarkTheme ? Colors.white : Color(0xff898C81),
)), )),
RatingBar.builder( RatingBar.builder(
initialRating: rating, initialRating: rating,
@ -839,12 +974,11 @@ class _FeedbackFormState extends ConsumerState<FeedbackForm>
SnackBar( SnackBar(
content: Text( content: Text(
AppLocalizations.of(context)!.formError, AppLocalizations.of(context)!.formError,
style: TextStyle( style: TextStyle(
fontFamily: context.translate( fontFamily: context.translate(
'Roboto', 'Roboto',
'NotoKufi', 'NotoKufi',
) )),
),
// "Please correct the errors before submitting." // "Please correct the errors before submitting."
)), )),
); );
@ -881,13 +1015,14 @@ class _FeedbackFormState extends ConsumerState<FeedbackForm>
await _removeFeedbackText(); await _removeFeedbackText();
ScaffoldMessenger.of(context).showSnackBar( ScaffoldMessenger.of(context).showSnackBar(
SnackBar( SnackBar(
content: Text(AppLocalizations.of(context)!.feedback_submitted, content: Text(
AppLocalizations.of(context)!.feedback_submitted,
style: TextStyle( style: TextStyle(
fontFamily: context.translate( fontFamily: context.translate(
'Roboto', 'Roboto',
'NotoKufi', 'NotoKufi',
) )),
),), ),
), ),
); );
setState(() { setState(() {
@ -903,12 +1038,11 @@ class _FeedbackFormState extends ConsumerState<FeedbackForm>
content: Text( content: Text(
// "Failed to submit feedback: $e" // "Failed to submit feedback: $e"
AppLocalizations.of(context)!.feedback_failed(e.toString()), AppLocalizations.of(context)!.feedback_failed(e.toString()),
style: TextStyle( style: TextStyle(
fontFamily: context.translate( fontFamily: context.translate(
'Roboto', 'Roboto',
'NotoKufi', 'NotoKufi',
) )),
),
)), )),
); );
setState(() { setState(() {

View File

@ -15,6 +15,7 @@ import 'package:uae_stat/presentation/components/my_bottom_nav_bar.dart';
import 'package:uae_stat/presentation/components/my_drawer.dart'; import 'package:uae_stat/presentation/components/my_drawer.dart';
import 'package:uae_stat/presentation/routes/drawer_routes/custom_drawer_routes.dart'; import 'package:uae_stat/presentation/routes/drawer_routes/custom_drawer_routes.dart';
import 'package:flutter_gen/gen_l10n/app_localizations.dart'; import 'package:flutter_gen/gen_l10n/app_localizations.dart';
// import 'package:flutter_gen/gen_l10n/app_localizations.dart';
class ManageUserRouter extends ConsumerStatefulWidget { class ManageUserRouter extends ConsumerStatefulWidget {
late final Widget title; late final Widget title;
@ -153,13 +154,14 @@ class _ManageUserRouterState extends ConsumerState<ManageUserRouter> {
}); });
ScaffoldMessenger.of(context).showSnackBar( ScaffoldMessenger.of(context).showSnackBar(
SnackBar( SnackBar(
content: Text(AppLocalizations.of(context)!.status_success, content: Text(
AppLocalizations.of(context)!.status_success,
style: TextStyle( style: TextStyle(
fontFamily: context.translate( fontFamily: context.translate(
'Roboto', 'Roboto',
'NotoKufi', 'NotoKufi',
) )),
),), ),
), ),
); );
} catch (e) { } catch (e) {
@ -169,15 +171,15 @@ class _ManageUserRouterState extends ConsumerState<ManageUserRouter> {
Navigator.of(context).pop(); Navigator.of(context).pop();
ScaffoldMessenger.of(context).showSnackBar( ScaffoldMessenger.of(context).showSnackBar(
SnackBar( SnackBar(
content: Text(context.translate( content: Text(
'Error updating status: $e', '$e خطأ في تحديث الحالة: '), context.translate(
style: TextStyle( 'Error updating status: $e', '$e خطأ في تحديث الحالة: '),
fontFamily: context.translate( style: TextStyle(
'Roboto', fontFamily: context.translate(
'NotoKufi', 'Roboto',
) 'NotoKufi',
), )),
)), )),
); );
} }
} }
@ -307,7 +309,9 @@ class _ManageUserRouterState extends ConsumerState<ManageUserRouter> {
child: Text( child: Text(
// 'Yes', // 'Yes',
AppLocalizations.of(context)!.yes, AppLocalizations.of(context)!.yes,
style: TextStyle(color: Colors.white, fontSize: 16, style: TextStyle(
color: Colors.white,
fontSize: 16,
fontFamily: context.translate( fontFamily: context.translate(
'Roboto', 'Roboto',
'NotoKufi', 'NotoKufi',
@ -357,10 +361,9 @@ class _ManageUserRouterState extends ConsumerState<ManageUserRouter> {
AppLocalizations.of(context)!.manage_user, AppLocalizations.of(context)!.manage_user,
style: TextStyle( style: TextStyle(
fontFamily: context.translate( fontFamily: context.translate(
'Roboto', 'Roboto',
'NotoKufi', 'NotoKufi',
) )),
),
), ),
body: isLoading body: isLoading
? Container( ? Container(
@ -440,7 +443,8 @@ class _ManageUserRouterState extends ConsumerState<ManageUserRouter> {
hintText: AppLocalizations.of(context)!.search, hintText: AppLocalizations.of(context)!.search,
hintStyle: TextStyle( hintStyle: TextStyle(
color: Color(0xFFAA8E83), color: Color(0xFFAA8E83),
fontFamily: context.translate('Roboto', 'NotoKufi'), fontFamily:
context.translate('Roboto', 'NotoKufi'),
fontSize: 14, fontSize: 14,
height: 2.5, // Helps with vertical alignment height: 2.5, // Helps with vertical alignment
), ),
@ -460,7 +464,8 @@ class _ManageUserRouterState extends ConsumerState<ManageUserRouter> {
Color(0xFFAA8E83), BlendMode.srcIn), Color(0xFFAA8E83), BlendMode.srcIn),
), ),
), ),
contentPadding: EdgeInsets.only(top: 14), // Aligns hint text with icon contentPadding: EdgeInsets.only(
top: 14), // Aligns hint text with icon
border: InputBorder.none, border: InputBorder.none,
), ),
onChanged: filterUsers, onChanged: filterUsers,
@ -536,10 +541,9 @@ class _ManageUserRouterState extends ConsumerState<ManageUserRouter> {
AppLocalizations.of(context)!.user_name, AppLocalizations.of(context)!.user_name,
style: TextStyle( style: TextStyle(
fontFamily: context.translate( fontFamily: context.translate(
'Roboto', 'Roboto',
'NotoKufi', 'NotoKufi',
) )),
),
), ),
onSort: (columnIndex, ascending) { onSort: (columnIndex, ascending) {
_sort( _sort(
@ -554,10 +558,9 @@ class _ManageUserRouterState extends ConsumerState<ManageUserRouter> {
AppLocalizations.of(context)!.email_id, AppLocalizations.of(context)!.email_id,
style: TextStyle( style: TextStyle(
fontFamily: context.translate( fontFamily: context.translate(
'Roboto', 'Roboto',
'NotoKufi', 'NotoKufi',
) )),
),
), ),
onSort: (columnIndex, ascending) { onSort: (columnIndex, ascending) {
_sort( _sort(
@ -572,10 +575,9 @@ class _ManageUserRouterState extends ConsumerState<ManageUserRouter> {
AppLocalizations.of(context)!.reg_date, AppLocalizations.of(context)!.reg_date,
style: TextStyle( style: TextStyle(
fontFamily: context.translate( fontFamily: context.translate(
'Roboto', 'Roboto',
'NotoKufi', 'NotoKufi',
) )),
),
), ),
onSort: (columnIndex, ascending) { onSort: (columnIndex, ascending) {
_sort( _sort(
@ -591,10 +593,9 @@ class _ManageUserRouterState extends ConsumerState<ManageUserRouter> {
AppLocalizations.of(context)!.status, AppLocalizations.of(context)!.status,
style: TextStyle( style: TextStyle(
fontFamily: context.translate( fontFamily: context.translate(
'Roboto', 'Roboto',
'NotoKufi', 'NotoKufi',
) )),
),
), ),
onSort: (columnIndex, ascending) { onSort: (columnIndex, ascending) {
_sort( _sort(
@ -616,7 +617,8 @@ class _ManageUserRouterState extends ConsumerState<ManageUserRouter> {
context)! context)!
.no_result_found, .no_result_found,
style: TextStyle( style: TextStyle(
fontFamily: context.translate( fontFamily: context
.translate(
'Roboto', 'Roboto',
'NotoKufi', 'NotoKufi',
), ),
@ -634,38 +636,34 @@ class _ManageUserRouterState extends ConsumerState<ManageUserRouter> {
return DataRow( return DataRow(
cells: [ cells: [
DataCell( DataCell(
Text( Text(
user.userName, user.userName,
style: TextStyle( style: TextStyle(
fontFamily: context.translate( fontFamily:
'Roboto', context.translate(
'NotoKufi', 'Roboto',
) 'NotoKufi',
),
),
),
DataCell(
Text(
user.emailId,
style: TextStyle(
fontFamily: context.translate(
'Roboto',
'NotoKufi',
)
),
)), )),
DataCell( ),
Text(
user.registrationDate,
style: TextStyle(
fontFamily: context.translate(
'Roboto',
'NotoKufi',
)
),
)
), ),
DataCell(Text(
user.emailId,
style: TextStyle(
fontFamily:
context.translate(
'Roboto',
'NotoKufi',
)),
)),
DataCell(Text(
user.registrationDate,
style: TextStyle(
fontFamily:
context.translate(
'Roboto',
'NotoKufi',
)),
)),
DataCell( DataCell(
DropdownButton<String>( DropdownButton<String>(
value: user.status, value: user.status,
@ -677,7 +675,8 @@ class _ManageUserRouterState extends ConsumerState<ManageUserRouter> {
child: Text( child: Text(
status.value, status.value,
style: TextStyle( style: TextStyle(
fontFamily: context.translate( fontFamily:
context.translate(
'Roboto', 'Roboto',
'NotoKufi', 'NotoKufi',
), ),

View File

@ -8,12 +8,14 @@ import 'package:pocketbase/pocketbase.dart';
import 'package:shared_preferences/shared_preferences.dart'; import 'package:shared_preferences/shared_preferences.dart';
import 'package:uae_stat/config/api_config.dart'; import 'package:uae_stat/config/api_config.dart';
import 'package:uae_stat/config/connectivity_provider.dart'; import 'package:uae_stat/config/connectivity_provider.dart';
import 'package:uae_stat/config/theme/theme_provider.dart';
import 'package:uae_stat/config/toggle_lang_service.dart'; import 'package:uae_stat/config/toggle_lang_service.dart';
import 'package:uae_stat/domain/use_cases/language.dart'; import 'package:uae_stat/domain/use_cases/language.dart';
import 'package:uae_stat/presentation/components/indicators/locale_provider.dart'; import 'package:uae_stat/presentation/components/indicators/locale_provider.dart';
import '../../custom_drawer_routes.dart'; import '../../custom_drawer_routes.dart';
import 'package:http/http.dart' as http; import 'package:http/http.dart' as http;
import 'package:flutter_gen/gen_l10n/app_localizations.dart'; import 'package:flutter_gen/gen_l10n/app_localizations.dart';
// import 'package:uae_stat/l10n/app_localizations.dart';
class NotificationPage extends ConsumerStatefulWidget { class NotificationPage extends ConsumerStatefulWidget {
@override @override
@ -26,13 +28,17 @@ class _NotificationPageState extends ConsumerState<NotificationPage> {
bool isLoading = true; bool isLoading = true;
List<Map<String, dynamic>> notifications = []; List<Map<String, dynamic>> notifications = [];
List<String> userReadedNotiOrNot = []; List<String> userReadedNotiOrNot = [];
String notificationCount=''; String notificationCount = '';
List<dynamic> homePageData = [];
List<dynamic> filteredData = [];
// Current selected tab index // Current selected tab index
int selectedTabIndex = 0; int selectedTabIndex = 0;
late final Locale locale; late final Locale locale;
dynamic userID; dynamic userID;
late UserService _userService; late UserService _userService;
late ThemeMode currentTheme;
// Tab categories // Tab categories
// final List<String> tabs = [ // final List<String> tabs = [
@ -50,17 +56,56 @@ class _NotificationPageState extends ConsumerState<NotificationPage> {
locale = ref.read(localeProvider) ?? const Locale('en'); locale = ref.read(localeProvider) ?? const Locale('en');
_userService = UserService(); _userService = UserService();
_initializePage(); _initializePage();
currentTheme = ref.read(themeProvider);
print('123456789');
print(currentTheme);
WidgetsBinding.instance.addPostFrameCallback((_) {
final isDark = currentTheme == ThemeMode.dark ||
(currentTheme == ThemeMode.system &&
MediaQuery.of(context).platformBrightness == Brightness.dark);
final themeMode = (isDark ? 'dark' : 'light');
print("ThemeMode - $themeMode");
fetchData(locale?.languageCode ?? 'en', themeMode);
});
}
Future<void> fetchData(locale, themeMode) async {
const baseUrl = '$apiUrl/api/getUAENumbersData';
try {
final response = await http
.get(Uri.parse(baseUrl + '?language=$locale&color_mode=$themeMode'));
if (response.statusCode == 200) {
setState(() {
homePageData = (json.decode(response.body) as List)
.map((e) => Map<String, dynamic>.from(e))
.toList();
filteredData = List.from(homePageData);
isLoading = false;
});
} else {
throw Exception('Failed to load data');
}
} catch (e) {
setState(() {
isLoading = false;
});
print('Error fetching data: $e');
}
} }
Future<void> _initializePage() async { Future<void> _initializePage() async {
_userService = UserService(); _userService = UserService();
await _fetchUserData();(); await _fetchUserData();
await fetchNotifications(locale?.languageCode ?? 'en'); ();
_processNotifications(notifications , userReadedNotiOrNot); await fetchNotifications(locale?.languageCode ?? 'en');
_processNotifications(notifications, userReadedNotiOrNot);
} }
void _processNotifications( List<Map<String, dynamic>> notification ,List<String> push ){ void _processNotifications(
print ('inside last function ${notification.length}'); List<Map<String, dynamic>> notification, List<String> push) {
print('inside last function ${notification.length}');
print('inside last function ${push.length}'); print('inside last function ${push.length}');
int count = 0; int count = 0;
@ -70,9 +115,11 @@ class _NotificationPageState extends ConsumerState<NotificationPage> {
} }
} }
print('count is $count'); print('count is $count');
if(count>0){ if (count > 0) {
notificationCount='($count)';} notificationCount = '($count)';
else{notificationCount='';} } else {
notificationCount = '';
}
} }
Future<String?> getUserId() async { Future<String?> getUserId() async {
@ -178,14 +225,58 @@ class _NotificationPageState extends ConsumerState<NotificationPage> {
} }
}); });
// ref.listen<Locale?>(localeProvider, (previous, next) async {
// final localeCode = next?.languageCode ?? 'en'; // Default to 'en' if null
// setState(() {
// isLoading = true;
// });
// await _userService.updateLanguage(localeCode);
// fetchNotifications(localeCode);
// });
ref.listen<Locale?>(localeProvider, (previous, next) async { ref.listen<Locale?>(localeProvider, (previous, next) async {
final localeCode = next?.languageCode ?? 'en'; // Default to 'en' if null final localeCode = next?.languageCode ?? 'en';
setState(() { setState(() {
isLoading = true; isLoading = true;
}); });
await _userService.updateLanguage(localeCode); await _userService.updateLanguage(localeCode);
fetchNotifications(localeCode); final currentTheme = ref.read(themeProvider);
final isDark = currentTheme == ThemeMode.dark ||
(currentTheme == ThemeMode.system &&
MediaQuery.of(context).platformBrightness == Brightness.dark);
final themeString = isDark ? 'dark' : 'light';
fetchData(localeCode, themeString);
}); });
ref.listen<ThemeMode>(themeProvider, (previous, next) async {
final localeCode = ref.watch(localeProvider)?.languageCode ?? 'en';
print(localeCode);
// Default to 'en' if null
setState(() {
isLoading = true;
print('isLoadingref $isLoading');
});
final currentTheme = ref.read(themeProvider);
final isDark = currentTheme == ThemeMode.dark ||
(currentTheme == ThemeMode.system &&
MediaQuery.of(context).platformBrightness == Brightness.dark);
final themeString = isDark ? 'dark' : 'light';
print("themeString- $themeString");
fetchData(localeCode, themeString);
});
final themeMode = ref.read(themeProvider);
final isDarkTheme = themeMode == ThemeMode.dark ||
(themeMode == ThemeMode.system &&
MediaQuery.of(context).platformBrightness == Brightness.dark);
print("isDarkTheme - $isDarkTheme");
final List<Map<String, dynamic>> tabs = [ final List<Map<String, dynamic>> tabs = [
{'title': AppLocalizations.of(context)!.all_updates}, {'title': AppLocalizations.of(context)!.all_updates},
{'title': AppLocalizations.of(context)!.app_updates}, {'title': AppLocalizations.of(context)!.app_updates},
@ -210,6 +301,8 @@ class _NotificationPageState extends ConsumerState<NotificationPage> {
context.go('/myhomepage'); context.go('/myhomepage');
}, },
child: BaseScaffold( child: BaseScaffold(
backgroundColor: isDarkTheme ? Color(0xFF111111) : Colors.white,
appbarColor: isDarkTheme ? Color(0xFF111111) : Colors.white,
title: Text( title: Text(
context.translate( context.translate(
'Notification $notificationCount', 'Notification $notificationCount',
@ -217,14 +310,16 @@ class _NotificationPageState extends ConsumerState<NotificationPage> {
), ),
style: TextStyle( style: TextStyle(
fontFamily: context.translate( fontFamily: context.translate(
'Roboto', 'Roboto',
'NotoKufi', 'NotoKufi',
) )),
),
), ),
body: isLoading body: isLoading
? Container( ? Container(
color: Color(0x98FFFCE5), // Semi-transparent background // color: Color(0x98FFFCE5), // Semi-transparent background
color: isDarkTheme
? Color(0xFF111111)
: Color(0x98FFFCE5), // Semi-transparent background
child: Column( child: Column(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: [ children: [
@ -247,6 +342,7 @@ class _NotificationPageState extends ConsumerState<NotificationPage> {
TabBarHeader( TabBarHeader(
tabs: tabs.map((tab) => tab['title'] as String).toList(), tabs: tabs.map((tab) => tab['title'] as String).toList(),
selectedIndex: selectedTabIndex, selectedIndex: selectedTabIndex,
isDarkTheme: isDarkTheme,
onTabSelected: (index) { onTabSelected: (index) {
setState(() { setState(() {
selectedTabIndex = index; selectedTabIndex = index;
@ -265,10 +361,13 @@ class _NotificationPageState extends ConsumerState<NotificationPage> {
Text( Text(
'No notifications available.', 'No notifications available.',
style: TextStyle( style: TextStyle(
fontSize: 16, color: Colors.grey, fontFamily: context.translate( fontSize: 16,
'Roboto', color: Colors.grey,
'NotoKufi', fontFamily: context.translate(
),), 'Roboto',
'NotoKufi',
),
),
), ),
], ],
), ),
@ -295,6 +394,7 @@ class _NotificationPageState extends ConsumerState<NotificationPage> {
id: notification['id'], id: notification['id'],
userReadedNotiOrNot: userReadedNotiOrNot, userReadedNotiOrNot: userReadedNotiOrNot,
userID: userID, userID: userID,
isDarkTheme: isDarkTheme,
), ),
); );
}, },
@ -311,17 +411,19 @@ class TabBarHeader extends StatelessWidget {
final List<String> tabs; final List<String> tabs;
final int selectedIndex; final int selectedIndex;
final ValueChanged<int> onTabSelected; final ValueChanged<int> onTabSelected;
bool isDarkTheme;
const TabBarHeader({ TabBarHeader({
required this.tabs, required this.tabs,
required this.selectedIndex, required this.selectedIndex,
required this.onTabSelected, required this.onTabSelected,
required this.isDarkTheme,
}); });
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Container( return Container(
color: Colors.grey[200], color: isDarkTheme ? Color(0xFF111111) : Colors.grey[200],
padding: const EdgeInsets.symmetric(vertical: 8), padding: const EdgeInsets.symmetric(vertical: 8),
child: SingleChildScrollView( child: SingleChildScrollView(
scrollDirection: Axis.horizontal, scrollDirection: Axis.horizontal,
@ -342,12 +444,14 @@ class TabBarHeader extends StatelessWidget {
: Colors.grey[700]; : Colors.grey[700];
}), }),
), ),
child: Text(text, child: Text(
text,
style: TextStyle( style: TextStyle(
fontFamily: context.translate( fontFamily: context.translate(
'Roboto', 'Roboto',
'NotoKufi', 'NotoKufi',
), ), ),
),
), ),
), ),
if (index < tabs.length - 1) buildDivider(), if (index < tabs.length - 1) buildDivider(),
@ -379,8 +483,9 @@ class NotificationTile extends StatelessWidget {
final String id; final String id;
final String userID; final String userID;
final List<String> userReadedNotiOrNot; final List<String> userReadedNotiOrNot;
bool isDarkTheme;
const NotificationTile({ NotificationTile({
required this.title, required this.title,
required this.message, required this.message,
required this.date, required this.date,
@ -388,6 +493,7 @@ class NotificationTile extends StatelessWidget {
required this.id, required this.id,
required this.userID, required this.userID,
required this.userReadedNotiOrNot, required this.userReadedNotiOrNot,
required this.isDarkTheme,
}); });
@override @override
@ -411,11 +517,19 @@ class NotificationTile extends StatelessWidget {
child: ListTile( child: ListTile(
leading: isPushed leading: isPushed
? const Icon(Icons.circle, size: 12, color: Color(0xFFFF274E)) ? const Icon(Icons.circle, size: 12, color: Color(0xFFFF274E))
: const Icon(Icons.circle, size: 12, color: Color(0x99414042)), : Icon(Icons.circle,
size: 12,
color: isDarkTheme ? Colors.white : const Color(0x99414042)),
title: Text( title: Text(
title, title,
style: TextStyle( style: TextStyle(
color: isPushed ? const Color(0xFF414042) : const Color(0x99414042), color: isPushed
? isDarkTheme
? Colors.white
: Color(0xFF414042)
: isDarkTheme
? Colors.white
: Color(0x99414042),
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
fontFamily: context.translate( fontFamily: context.translate(
'Roboto', 'Roboto',
@ -426,7 +540,13 @@ class NotificationTile extends StatelessWidget {
subtitle: Text( subtitle: Text(
date, date,
style: TextStyle( style: TextStyle(
color: isPushed ? const Color(0xFF8E8E8E) : const Color(0x998E8E8E), color: isPushed
? isDarkTheme
? Colors.white
: Color(0xFF8E8E8E)
: isDarkTheme
? Colors.white
: Color(0x998E8E8E),
fontSize: 12, fontSize: 12,
fontWeight: FontWeight.w400, fontWeight: FontWeight.w400,
fontFamily: context.translate( fontFamily: context.translate(

View File

@ -7,6 +7,7 @@ import 'package:pocketbase/pocketbase.dart';
import 'package:shared_preferences/shared_preferences.dart'; import 'package:shared_preferences/shared_preferences.dart';
import 'package:uae_stat/config/api_config.dart'; import 'package:uae_stat/config/api_config.dart';
import 'package:uae_stat/config/connectivity_provider.dart'; import 'package:uae_stat/config/connectivity_provider.dart';
import 'package:uae_stat/config/theme/theme_provider.dart';
import 'package:uae_stat/config/toggle_lang_service.dart'; import 'package:uae_stat/config/toggle_lang_service.dart';
import 'package:uae_stat/domain/use_cases/language.dart'; import 'package:uae_stat/domain/use_cases/language.dart';
import 'package:uae_stat/presentation/components/indicators/locale_provider.dart'; import 'package:uae_stat/presentation/components/indicators/locale_provider.dart';
@ -42,6 +43,10 @@ class _NotificationDetailsState extends ConsumerState<NotificationDetails> {
bool isLoading = true; bool isLoading = true;
late UserService _userService; late UserService _userService;
late ThemeMode currentTheme;
List<dynamic> homePageData = [];
List<dynamic> filteredData = [];
// Current selected tab index // Current selected tab index
int selectedTabIndex = 0; int selectedTabIndex = 0;
late final Locale locale; late final Locale locale;
@ -54,6 +59,19 @@ class _NotificationDetailsState extends ConsumerState<NotificationDetails> {
locale = ref.read(localeProvider) ?? const Locale('en'); locale = ref.read(localeProvider) ?? const Locale('en');
_userService = UserService(); _userService = UserService();
fetchNotifications(locale?.languageCode ?? 'en'); fetchNotifications(locale?.languageCode ?? 'en');
currentTheme = ref.read(themeProvider);
print('123456789');
print(currentTheme);
WidgetsBinding.instance.addPostFrameCallback((_) {
final isDark = currentTheme == ThemeMode.dark ||
(currentTheme == ThemeMode.system &&
MediaQuery.of(context).platformBrightness == Brightness.dark);
final themeMode = (isDark ? 'dark' : 'light');
print("ThemeMode - $themeMode");
fetchData(locale?.languageCode ?? 'en', themeMode);
});
} }
String formatDate(String dateString) { String formatDate(String dateString) {
@ -67,6 +85,30 @@ class _NotificationDetailsState extends ConsumerState<NotificationDetails> {
} }
} }
Future<void> fetchData(locale, themeMode) async {
const baseUrl = '$apiUrl/api/getUAENumbersData';
try {
final response = await http
.get(Uri.parse(baseUrl + '?language=$locale&color_mode=$themeMode'));
if (response.statusCode == 200) {
setState(() {
homePageData = (json.decode(response.body) as List)
.map((e) => Map<String, dynamic>.from(e))
.toList();
filteredData = List.from(homePageData);
isLoading = false;
});
} else {
throw Exception('Failed to load data');
}
} catch (e) {
setState(() {
isLoading = false;
});
print('Error fetching data: $e');
}
}
Future<void> fetchNotifications(locale) async { Future<void> fetchNotifications(locale) async {
notificationID = widget.id; notificationID = widget.id;
final baseUrl = apiUrl + '/api/getNotification'; final baseUrl = apiUrl + '/api/getNotification';
@ -129,6 +171,49 @@ class _NotificationDetailsState extends ConsumerState<NotificationDetails> {
fetchNotifications(localeCode); fetchNotifications(localeCode);
}); });
ref.listen<Locale?>(localeProvider, (previous, next) async {
final localeCode = next?.languageCode ?? 'en';
setState(() {
isLoading = true;
});
await _userService.updateLanguage(localeCode);
final currentTheme = ref.read(themeProvider);
final isDark = currentTheme == ThemeMode.dark ||
(currentTheme == ThemeMode.system &&
MediaQuery.of(context).platformBrightness == Brightness.dark);
final themeString = isDark ? 'dark' : 'light';
fetchData(localeCode, themeString);
});
ref.listen<ThemeMode>(themeProvider, (previous, next) async {
final localeCode = ref.watch(localeProvider)?.languageCode ?? 'en';
print(localeCode);
// Default to 'en' if null
setState(() {
isLoading = true;
print('isLoadingref $isLoading');
});
final currentTheme = ref.read(themeProvider);
final isDark = currentTheme == ThemeMode.dark ||
(currentTheme == ThemeMode.system &&
MediaQuery.of(context).platformBrightness == Brightness.dark);
final themeString = isDark ? 'dark' : 'light';
print("themeString- $themeString");
fetchData(localeCode, themeString);
});
final themeMode = ref.read(themeProvider);
final isDarkTheme = themeMode == ThemeMode.dark ||
(themeMode == ThemeMode.system &&
MediaQuery.of(context).platformBrightness == Brightness.dark);
print("isDarkTheme - $isDarkTheme");
return PopScope( return PopScope(
canPop: false, canPop: false,
onPopInvokedWithResult: (didPop, result) { onPopInvokedWithResult: (didPop, result) {
@ -136,6 +221,8 @@ class _NotificationDetailsState extends ConsumerState<NotificationDetails> {
context.go('/notification'); context.go('/notification');
}, },
child: BaseScaffold( child: BaseScaffold(
backgroundColor: isDarkTheme ? Color(0xFF111111) : Colors.white,
appbarColor: isDarkTheme ? Color(0xFF111111) : Colors.white,
title: Text( title: Text(
context.translate( context.translate(
'Notification', 'Notification',
@ -143,16 +230,17 @@ class _NotificationDetailsState extends ConsumerState<NotificationDetails> {
), ),
style: TextStyle( style: TextStyle(
fontFamily: context.translate( fontFamily: context.translate(
'Roboto', 'Roboto',
'NotoKufi', 'NotoKufi',
) )),
),
), ),
showBackButton: true, showBackButton: true,
navBackArrow: Text(widget.backNavigation ?? 'Default Value'), navBackArrow: Text(widget.backNavigation ?? 'Default Value'),
body: isLoading body: isLoading
? Container( ? Container(
color: Color(0x98FFFCE5), // Semi-transparent background color: isDarkTheme
? Color(0xFF111111)
: Color(0x98FFFCE5), // Semi-transparent background
child: Column( child: Column(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: [ children: [
@ -180,13 +268,12 @@ class _NotificationDetailsState extends ConsumerState<NotificationDetails> {
style: TextStyle( style: TextStyle(
fontSize: 18, fontSize: 18,
fontWeight: FontWeight.w500, fontWeight: FontWeight.w500,
color: Color(0xFF414042), color:
isDarkTheme ? Colors.white : Color(0xFF414042),
fontFamily: context.translate( fontFamily: context.translate(
'Roboto', 'Roboto',
'NotoKufi', 'NotoKufi',
) )),
),
), ),
const SizedBox(height: 20), const SizedBox(height: 20),
Center( Center(
@ -209,25 +296,26 @@ class _NotificationDetailsState extends ConsumerState<NotificationDetails> {
style: TextStyle( style: TextStyle(
fontSize: 14, fontSize: 14,
fontWeight: FontWeight.w400, fontWeight: FontWeight.w400,
color: Color(0xFF414042), color:
isDarkTheme ? Colors.white : Color(0xFF414042),
fontFamily: context.translate( fontFamily: context.translate(
'Roboto', 'Roboto',
'NotoKufi', 'NotoKufi',
) )),
),
), ),
const SizedBox(height: 10), const SizedBox(height: 10),
Text( Text(
"Date: ${notification != null ? formatDate(notification!['created'] ?? '') : 'N/A'}", "Date: ${notification != null ? formatDate(notification!['created'] ?? '') : 'N/A'}",
style: TextStyle( style: TextStyle(
fontSize: 12, fontSize: 12,
fontWeight: FontWeight.w400, fontWeight: FontWeight.w400,
color: Color(0xFF8E8E8E), color: isDarkTheme
? Colors.white
: Color(0xFF8E8E8E),
fontFamily: context.translate( fontFamily: context.translate(
'Roboto', 'Roboto',
'NotoKufi', 'NotoKufi',
) )),
),
), ),
], ],
), ),

View File

@ -1,22 +1,132 @@
import 'dart:convert';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:http/http.dart' as http;
import 'package:uae_stat/config/api_config.dart';
import 'package:uae_stat/config/theme/theme_provider.dart';
import 'package:uae_stat/config/toggle_lang_service.dart';
import 'package:uae_stat/domain/use_cases/language.dart'; import 'package:uae_stat/domain/use_cases/language.dart';
import 'package:uae_stat/presentation/Screens/Bottom%20Navigation%20Pages/Country_Profile/country_profile.dart';
import 'package:uae_stat/presentation/routes/drawer_routes/custom_drawer_routes.dart'; import 'package:uae_stat/presentation/routes/drawer_routes/custom_drawer_routes.dart';
class aboutFCSC extends StatelessWidget { class aboutFCSC extends ConsumerStatefulWidget {
const aboutFCSC({super.key}); const aboutFCSC({super.key});
@override
ConsumerState<aboutFCSC> createState() => _aboutFCSCState();
}
class _aboutFCSCState extends ConsumerState<aboutFCSC> {
// class aboutFCSC extends StatelessWidget {
// const aboutFCSC({super.key});
List<dynamic> homePageData = [];
List<dynamic> filteredData = [];
bool isLoading = true;
late UserService _userService;
late ThemeMode currentTheme;
@override
void initState() {
super.initState();
_userService = UserService();
final locale = ref.read(localeProvider);
currentTheme = ref.read(themeProvider);
print('123456789');
print(currentTheme);
WidgetsBinding.instance.addPostFrameCallback((_) {
final isDark = currentTheme == ThemeMode.dark ||
(currentTheme == ThemeMode.system &&
MediaQuery.of(context).platformBrightness == Brightness.dark);
final themeMode = (isDark ? 'dark' : 'light');
print("ThemeMode - $themeMode");
fetchData(locale?.languageCode ?? 'en', themeMode);
});
}
Future<void> fetchData(locale, themeMode) async {
const baseUrl = '$apiUrl/api/getUAENumbersData';
try {
final response = await http
.get(Uri.parse(baseUrl + '?language=$locale&color_mode=$themeMode'));
if (response.statusCode == 200) {
setState(() {
homePageData = (json.decode(response.body) as List)
.map((e) => Map<String, dynamic>.from(e))
.toList();
filteredData = List.from(homePageData);
isLoading = false;
});
} else {
throw Exception('Failed to load data');
}
} catch (e) {
setState(() {
isLoading = false;
});
print('Error fetching data: $e');
}
}
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
ref.listen<Locale?>(localeProvider, (previous, next) async {
final localeCode = next?.languageCode ?? 'en';
setState(() {
isLoading = true;
});
await _userService.updateLanguage(localeCode);
final currentTheme = ref.read(themeProvider);
final isDark = currentTheme == ThemeMode.dark ||
(currentTheme == ThemeMode.system &&
MediaQuery.of(context).platformBrightness == Brightness.dark);
final themeString = isDark ? 'dark' : 'light';
fetchData(localeCode, themeString);
});
ref.listen<ThemeMode>(themeProvider, (previous, next) async {
final localeCode = ref.watch(localeProvider)?.languageCode ?? 'en';
print(localeCode);
// Default to 'en' if null
setState(() {
isLoading = true;
print('isLoadingref $isLoading');
});
final currentTheme = ref.read(themeProvider);
final isDark = currentTheme == ThemeMode.dark ||
(currentTheme == ThemeMode.system &&
MediaQuery.of(context).platformBrightness == Brightness.dark);
final themeString = isDark ? 'dark' : 'light';
print("themeString- $themeString");
fetchData(localeCode, themeString);
});
final themeMode = ref.read(themeProvider);
final isDarkTheme = themeMode == ThemeMode.dark ||
(themeMode == ThemeMode.system &&
MediaQuery.of(context).platformBrightness == Brightness.dark);
print("isDarkTheme - $isDarkTheme");
return BaseScaffold( return BaseScaffold(
backgroundColor: isDarkTheme ? Colors.black : Colors.white,
appbarColor: isDarkTheme ? Colors.black : Colors.white,
showDivider: true, showDivider: true,
showBackButton: true, showBackButton: true,
dividerColor: Colors.grey[300], dividerColor: Colors.grey[300],
appbarColor: Colors.white, // appbarColor: Colors.white,
bottomColor: Colors.white, bottomColor: Colors.white,
mycenterTitle: true, mycenterTitle: true,
title: Text( title: Text(
context.translate('Getting Started','البدء'), context.translate('Getting Started', 'البدء'),
style: TextStyle( style: TextStyle(
fontFamily: context.translate( fontFamily: context.translate(
'Roboto', 'Roboto',
@ -31,70 +141,90 @@ class aboutFCSC extends StatelessWidget {
body: SingleChildScrollView( body: SingleChildScrollView(
physics: ClampingScrollPhysics(), physics: ClampingScrollPhysics(),
child: Container( child: Container(
width: MediaQuery.of(context).size.width, width: MediaQuery.of(context).size.width,
height: MediaQuery.of(context).size.height, height: MediaQuery.of(context).size.height,
color: Colors.white, color: isDarkTheme ? Colors.black : Colors.white,
padding: EdgeInsets.all(16), padding: EdgeInsets.all(16),
child: Column( child: Column(
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
children: [ children: [
Align( Align(
alignment: Alignment.topLeft, alignment: Alignment.topLeft,
child: Text( child: Text(
context.translate('About FCSC','حول التطبيق'), context.translate('About FCSC', 'حول التطبيق'),
style: TextStyle( style: TextStyle(
fontSize: 20, fontSize: 20,
color: Color(0xFF414042), color: isDarkTheme ? Colors.white : Color(0xFF414042),
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
fontFamily: context.translate( fontFamily: context.translate(
'Roboto', 'Roboto',
'NotoKufi', 'NotoKufi',
),
), ),
), ),
), ),
), SizedBox(
SizedBox( width: MediaQuery.of(context).size.width,
width: MediaQuery.of(context).size.width, height: MediaQuery.of(context).size.height * 0.36,
height: MediaQuery.of(context).size.height * 0.36, child: Image.asset(
child: Image.asset( 'assets/user_guide/AboutFCSC.png',
'assets/user_guide/AboutFCSC.png', fit: BoxFit.contain,
fit: BoxFit.contain, ),
), ),
), SizedBox(
SizedBox( height: 5,
height: 5, ),
), RichText(
RichText( text: TextSpan(
text: TextSpan( text: context.translate(
text: context.translate('The ', 'The ',
'تم تصميم تطبيق المركز الاتحادي للتنافسية والإحصاء (FCSC) لتوفير وصول المستخدمين المسجلين والمعتمدين إلى إحصائيات دقيقة وشاملة حول دولة الإمارات. يعمل التطبيق كمنصة مركزية لاستكشاف البيانات الرئيسية والاتجاهات والرؤى عبر مختلف القطاعات، مما يسهل الوصول إلى المعلومات الضرورية لدعم اتخاذ القرارات والتحليلات.',), 'تم تصميم تطبيق المركز الاتحادي للتنافسية والإحصاء (FCSC) لتوفير وصول المستخدمين المسجلين والمعتمدين إلى إحصائيات دقيقة وشاملة حول دولة الإمارات. يعمل التطبيق كمنصة مركزية لاستكشاف البيانات الرئيسية والاتجاهات والرؤى عبر مختلف القطاعات، مما يسهل الوصول إلى المعلومات الضرورية لدعم اتخاذ القرارات والتحليلات.',
style: TextStyle(
color: Colors.grey, fontSize: 16, fontFamily: context.translate(
'Roboto',
'NotoKufi',
), height: 1.4,),
children: <TextSpan>[
TextSpan(
text:
context.translate(' Federal Competitiveness and Statistics Centre (FCSC),',''),
style: TextStyle(
fontWeight: FontWeight.bold,
color: Color(0xFF414042),
fontFamily: context.translate(
'Roboto',
'NotoKufi',
),),
), ),
TextSpan( style: TextStyle(
text: color: isDarkTheme ? Colors.white : Colors.grey,
context.translate(' in your App is designed to provide registered and approved users with access to accurate and comprehensive statistics about the UAE. The app serves as a centralized platform for exploring key datasets, trends, and insights across various sectors.',''),), fontSize: 16,
], fontFamily: context.translate(
'Roboto',
'NotoKufi',
),
height: 1.4,
),
children: <TextSpan>[
TextSpan(
text: context.translate(
' Federal Competitiveness and Statistics Centre (FCSC),',
''),
style: TextStyle(
fontWeight: FontWeight.bold,
color: isDarkTheme ? Colors.white : Color(0xFF414042),
fontFamily: context.translate(
'Roboto',
'NotoKufi',
),
),
),
TextSpan(
text: context.translate(
' in your App is designed to provide registered and approved users with access to accurate and comprehensive statistics about the UAE. The app serves as a centralized platform for exploring key datasets, trends, and insights across various sectors.',
''),
style: TextStyle(
color: isDarkTheme ? Colors.white : Colors.grey,
// fontSize: 16,
fontFamily: context.translate(
'Roboto',
'NotoKufi',
),
height: 1.4,
),
),
],
),
), ),
), SizedBox(
SizedBox( height: 20,
height: 20, ),
), ],
],), ),
), ),
), ),
); );

View File

@ -1,14 +1,121 @@
import 'dart:convert';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:http/http.dart' as http;
import 'package:uae_stat/config/api_config.dart';
import 'package:uae_stat/config/theme/theme_provider.dart';
import 'package:uae_stat/config/toggle_lang_service.dart';
import 'package:uae_stat/domain/use_cases/language.dart'; import 'package:uae_stat/domain/use_cases/language.dart';
import 'package:uae_stat/presentation/Screens/Bottom%20Navigation%20Pages/Country_Profile/country_profile.dart';
import 'package:uae_stat/presentation/routes/drawer_routes/custom_drawer_routes.dart'; import 'package:uae_stat/presentation/routes/drawer_routes/custom_drawer_routes.dart';
class GetStarted extends ConsumerStatefulWidget {
class GetStarted extends StatelessWidget {
const GetStarted({super.key}); const GetStarted({super.key});
@override
ConsumerState<GetStarted> createState() => _GetStartedState();
}
class _GetStartedState extends ConsumerState<GetStarted> {
// class GetStarted extends StatelessWidget {
// const GetStarted({super.key});
List<dynamic> homePageData = [];
List<dynamic> filteredData = [];
bool isLoading = true;
late UserService _userService;
late ThemeMode currentTheme;
@override
void initState() {
super.initState();
_userService = UserService();
final locale = ref.read(localeProvider);
currentTheme = ref.read(themeProvider);
print('123456789');
print(currentTheme);
WidgetsBinding.instance.addPostFrameCallback((_) {
final isDark = currentTheme == ThemeMode.dark ||
(currentTheme == ThemeMode.system &&
MediaQuery.of(context).platformBrightness == Brightness.dark);
final themeMode = (isDark ? 'dark' : 'light');
print("ThemeMode - $themeMode");
fetchData(locale?.languageCode ?? 'en', themeMode);
});
}
Future<void> fetchData(locale, themeMode) async {
const baseUrl = '$apiUrl/api/getUAENumbersData';
try {
final response = await http
.get(Uri.parse(baseUrl + '?language=$locale&color_mode=$themeMode'));
if (response.statusCode == 200) {
setState(() {
homePageData = (json.decode(response.body) as List)
.map((e) => Map<String, dynamic>.from(e))
.toList();
filteredData = List.from(homePageData);
isLoading = false;
});
} else {
throw Exception('Failed to load data');
}
} catch (e) {
setState(() {
isLoading = false;
});
print('Error fetching data: $e');
}
}
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
ref.listen<Locale?>(localeProvider, (previous, next) async {
final localeCode = next?.languageCode ?? 'en';
setState(() {
isLoading = true;
});
await _userService.updateLanguage(localeCode);
final currentTheme = ref.read(themeProvider);
final isDark = currentTheme == ThemeMode.dark ||
(currentTheme == ThemeMode.system &&
MediaQuery.of(context).platformBrightness == Brightness.dark);
final themeString = isDark ? 'dark' : 'light';
fetchData(localeCode, themeString);
});
ref.listen<ThemeMode>(themeProvider, (previous, next) async {
final localeCode = ref.watch(localeProvider)?.languageCode ?? 'en';
print(localeCode);
// Default to 'en' if null
setState(() {
isLoading = true;
print('isLoadingref $isLoading');
});
final currentTheme = ref.read(themeProvider);
final isDark = currentTheme == ThemeMode.dark ||
(currentTheme == ThemeMode.system &&
MediaQuery.of(context).platformBrightness == Brightness.dark);
final themeString = isDark ? 'dark' : 'light';
print("themeString- $themeString");
fetchData(localeCode, themeString);
});
final themeMode = ref.read(themeProvider);
final isDarkTheme = themeMode == ThemeMode.dark ||
(themeMode == ThemeMode.system &&
MediaQuery.of(context).platformBrightness == Brightness.dark);
print("isDarkTheme - $isDarkTheme");
return Theme( return Theme(
data: ThemeData( data: ThemeData(
fontFamily: context.translate( fontFamily: context.translate(
@ -16,21 +123,27 @@ class GetStarted extends StatelessWidget {
'NotoKufi', 'NotoKufi',
), // Set default font family for this page ), // Set default font family for this page
textTheme: TextTheme( textTheme: TextTheme(
bodyMedium: TextStyle(fontSize: 16, color: Color(0xFF898C81),fontFamily: context.translate( bodyMedium: TextStyle(
'Roboto', fontSize: 16,
'NotoKufi', color: Color(0xFF898C81),
),), fontFamily: context.translate(
'Roboto',
'NotoKufi',
),
),
), ),
), ),
child: BaseScaffold( child: BaseScaffold(
backgroundColor: isDarkTheme ? Colors.black : Colors.white,
appbarColor: isDarkTheme ? Colors.black : Colors.white,
showDivider: true, showDivider: true,
showBackButton: true, showBackButton: true,
dividerColor: Colors.grey[300], dividerColor: Colors.grey[300],
appbarColor: Colors.white, // appbarColor: Colors.white,
bottomColor: Colors.white, bottomColor: Colors.white,
mycenterTitle: true, mycenterTitle: true,
title: Text( title: Text(
context.translate('Getting Started','البدء'), context.translate('Getting Started', 'البدء'),
style: TextStyle( style: TextStyle(
fontFamily: context.translate( fontFamily: context.translate(
'Roboto', 'Roboto',
@ -44,7 +157,7 @@ class GetStarted extends StatelessWidget {
), ),
body: Container( body: Container(
height: double.infinity, height: double.infinity,
color: Colors.white, color: isDarkTheme ? Colors.black : Colors.white,
padding: EdgeInsets.all(16), padding: EdgeInsets.all(16),
child: SingleChildScrollView( child: SingleChildScrollView(
child: Column( child: Column(
@ -52,47 +165,58 @@ class GetStarted extends StatelessWidget {
children: [ children: [
Align( Align(
alignment: Alignment.topLeft, alignment: Alignment.topLeft,
child: Text(context.translate('How to Get Started','كيفية البدء'), child: Text(
style: context.translate('How to Get Started', 'كيفية البدء'),
TextStyle( style: TextStyle(
fontFamily: context.translate( fontFamily: context.translate(
'Roboto', 'Roboto',
'NotoKufi', 'NotoKufi',
), ),
fontSize:20, fontSize: 20,
color: Color(0xFF414042), color: isDarkTheme ? Colors.white : Color(0xFF414042),
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
),), ),
),
), ),
SizedBox( SizedBox(
width:MediaQuery.of(context).size.width, width: MediaQuery.of(context).size.width,
height:MediaQuery.of(context).size.height * 0.36, height: MediaQuery.of(context).size.height * 0.36,
child: Image.asset( child: Image.asset(
'assets/user_guide/getStarted.png', 'assets/user_guide/getStarted.png',
fit: BoxFit.contain, fit: BoxFit.contain,
), ),
), ),
Text( Text(
context.translate( context.translate(
'1. Download the app from the App Store or Google Play Store.', '1. Download the app from the App Store or Google Play Store.',
'1 .قم بتحميل التطبيق من متجر التطبيقات (Appstore) أو متجر جوجل بلاي (Google Play)..', '1 .قم بتحميل التطبيق من متجر التطبيقات (Appstore) أو متجر جوجل بلاي (Google Play)..',
), ),
textAlign: TextAlign.justify, // Align the text textAlign: TextAlign.justify, // Align the text
softWrap: true, softWrap: true,
), style: TextStyle(
SizedBox(height: 2,), color: isDarkTheme ? Colors.white : Colors.black54,
Text( ),
context.translate(
'2. Log in to access advanced features',
'2 .قم بتسجيل الدخول لفتح الميزات المتقدمة.',),
textAlign: TextAlign.justify, // Align the text
softWrap: true,
), ),
SizedBox( SizedBox(
height:MediaQuery.of(context).size.height * 0.12, height: 2,
),
Text(
context.translate(
'2. Log in to access advanced features',
'2 .قم بتسجيل الدخول لفتح الميزات المتقدمة.',
),
textAlign: TextAlign.justify, // Align the text
softWrap: true,
style: TextStyle(
color: isDarkTheme ? Colors.white : Colors.black54,
),
),
SizedBox(
height: MediaQuery.of(context).size.height * 0.12,
),
SizedBox(
height: 20,
), ),
SizedBox(height: 20,),
], ],
), ),
), ),

View File

@ -1,14 +1,123 @@
import 'dart:convert';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:http/http.dart' as http;
import 'package:uae_stat/config/api_config.dart';
import 'package:uae_stat/config/theme/theme_provider.dart';
import 'package:uae_stat/config/toggle_lang_service.dart';
import 'package:uae_stat/domain/use_cases/language.dart'; import 'package:uae_stat/domain/use_cases/language.dart';
import 'package:uae_stat/presentation/Screens/Bottom%20Navigation%20Pages/Country_Profile/country_profile.dart';
import '../../../../../../infrastructure/services/img_asset_paths/banner_asset_path.dart'; import '../../../../../../infrastructure/services/img_asset_paths/banner_asset_path.dart';
import '../../../custom_drawer_routes.dart'; import '../../../custom_drawer_routes.dart';
class AppFeatures extends StatelessWidget { class AppFeatures extends ConsumerStatefulWidget {
AppFeatures({super.key}); const AppFeatures({super.key});
@override
ConsumerState<AppFeatures> createState() => _AppFeaturesState();
}
class _AppFeaturesState extends ConsumerState<AppFeatures> {
// class AppFeatures extends StatelessWidget {
// AppFeatures({super.key});
List<dynamic> homePageData = [];
List<dynamic> filteredData = [];
bool isLoading = true;
late UserService _userService;
late ThemeMode currentTheme;
@override
void initState() {
super.initState();
_userService = UserService();
final locale = ref.read(localeProvider);
currentTheme = ref.read(themeProvider);
print('123456789');
print(currentTheme);
WidgetsBinding.instance.addPostFrameCallback((_) {
final isDark = currentTheme == ThemeMode.dark ||
(currentTheme == ThemeMode.system &&
MediaQuery.of(context).platformBrightness == Brightness.dark);
final themeMode = (isDark ? 'dark' : 'light');
print("ThemeMode - $themeMode");
fetchData(locale?.languageCode ?? 'en', themeMode);
});
}
Future<void> fetchData(locale, themeMode) async {
const baseUrl = '$apiUrl/api/getUAENumbersData';
try {
final response = await http
.get(Uri.parse(baseUrl + '?language=$locale&color_mode=$themeMode'));
if (response.statusCode == 200) {
setState(() {
homePageData = (json.decode(response.body) as List)
.map((e) => Map<String, dynamic>.from(e))
.toList();
filteredData = List.from(homePageData);
isLoading = false;
});
} else {
throw Exception('Failed to load data');
}
} catch (e) {
setState(() {
isLoading = false;
});
print('Error fetching data: $e');
}
}
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
ref.listen<Locale?>(localeProvider, (previous, next) async {
final localeCode = next?.languageCode ?? 'en';
setState(() {
isLoading = true;
});
await _userService.updateLanguage(localeCode);
final currentTheme = ref.read(themeProvider);
final isDark = currentTheme == ThemeMode.dark ||
(currentTheme == ThemeMode.system &&
MediaQuery.of(context).platformBrightness == Brightness.dark);
final themeString = isDark ? 'dark' : 'light';
fetchData(localeCode, themeString);
});
ref.listen<ThemeMode>(themeProvider, (previous, next) async {
final localeCode = ref.watch(localeProvider)?.languageCode ?? 'en';
print(localeCode);
// Default to 'en' if null
setState(() {
isLoading = true;
print('isLoadingref $isLoading');
});
final currentTheme = ref.read(themeProvider);
final isDark = currentTheme == ThemeMode.dark ||
(currentTheme == ThemeMode.system &&
MediaQuery.of(context).platformBrightness == Brightness.dark);
final themeString = isDark ? 'dark' : 'light';
print("themeString- $themeString");
fetchData(localeCode, themeString);
});
final themeMode = ref.read(themeProvider);
final isDarkTheme = themeMode == ThemeMode.dark ||
(themeMode == ThemeMode.system &&
MediaQuery.of(context).platformBrightness == Brightness.dark);
print("isDarkTheme - $isDarkTheme");
return Theme( return Theme(
data: ThemeData( data: ThemeData(
fontFamily: context.translate( fontFamily: context.translate(
@ -20,14 +129,16 @@ class AppFeatures extends StatelessWidget {
), ),
), ),
child: BaseScaffold( child: BaseScaffold(
backgroundColor: isDarkTheme ? Color(0xFF111111) : Colors.white,
appbarColor: isDarkTheme ? Color(0xFF111111) : Colors.white,
showDivider: true, showDivider: true,
showBackButton: true, showBackButton: true,
bottomColor: Colors.white, bottomColor: Colors.white,
dividerColor: Colors.grey[300], dividerColor: Colors.grey[300],
appbarColor: Colors.white, // appbarColor: Colors.white,
mycenterTitle: true, mycenterTitle: true,
title: Text( title: Text(
context.translate('Key Features','الميزات الرئيسية'), context.translate('Key Features', 'الميزات الرئيسية'),
style: TextStyle( style: TextStyle(
fontFamily: context.translate( fontFamily: context.translate(
'Roboto', 'Roboto',
@ -41,7 +152,8 @@ class AppFeatures extends StatelessWidget {
), ),
body: Container( body: Container(
width: double.infinity, width: double.infinity,
color: Colors.white, color: isDarkTheme ? Color(0xFF111111) : Colors.white,
// color: Colors.white,
padding: EdgeInsets.all(16), padding: EdgeInsets.all(16),
child: SingleChildScrollView( child: SingleChildScrollView(
child: Column( child: Column(
@ -50,77 +162,101 @@ class AppFeatures extends StatelessWidget {
Align( Align(
alignment: Alignment.topLeft, alignment: Alignment.topLeft,
child: Text( child: Text(
context.translate('App Features','الميزات الرئيسية'), context.translate('App Features', 'الميزات الرئيسية'),
style: style: TextStyle(
TextStyle(
fontFamily: context.translate( fontFamily: context.translate(
'Roboto', 'Roboto',
'NotoKufi', 'NotoKufi',
), ),
fontSize:20, fontSize: 20,
color: Color(0xFF414042), color: isDarkTheme ? Colors.white : Color(0xFF414042),
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
),), ),
),
), ),
SizedBox( SizedBox(
width:MediaQuery.of(context).size.width, width: MediaQuery.of(context).size.width,
height:MediaQuery.of(context).size.height * 0.36, height: MediaQuery.of(context).size.height * 0.36,
child: Image.asset( child: Image.asset(
'assets/user_guide/appFeatures.png', 'assets/user_guide/appFeatures.png',
fit: BoxFit.contain, fit: BoxFit.contain,
), ),
), ),
Text( Text(
context.translate('1. Comprehensive Statistics:','1. رؤى مستندة إلى البيانات '), context.translate('1. Comprehensive Statistics:',
style:TextStyle( '1. رؤى مستندة إلى البيانات '),
style: TextStyle(
fontFamily: context.translate( fontFamily: context.translate(
'Roboto', 'Roboto',
'NotoKufi', 'NotoKufi',
), ),
fontSize:16, fontSize: 16,
color: Color(0xFF414042), color: isDarkTheme ? Colors.white : Color(0xFF414042),
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
), ),
), ),
SizedBox(height: 8), SizedBox(height: 8),
Padding( Padding(
padding: const EdgeInsets.only(left:7.0), padding: const EdgeInsets.only(left: 7.0),
child: Column( child: Column(
children: [ children: [
Row( Row(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Padding( Padding(
padding: const EdgeInsets.only(top : 6.0), padding: const EdgeInsets.only(top: 6.0),
child: Icon(Icons.brightness_1, size: 5), child: Icon(
Icons.brightness_1,
size: 5,
color: isDarkTheme ? Colors.white : Colors.black,
),
), // Bullet point ), // Bullet point
SizedBox(width: 8), // Space between bullet and text SizedBox(width: 8), // Space between bullet and text
Expanded( Expanded(
child: RichText( child: RichText(
text: TextSpan( text: TextSpan(
text:context.translate( text: context.translate(
'Access detailed datasets across categories such as ', 'Access detailed datasets across categories such as ',
'الوصول إلى مجموعات بيانات تفصيلية عبر فئات مثل الاقتصاد، البيئة، الاجتماعية، وغيرها.',), 'الوصول إلى مجموعات بيانات تفصيلية عبر فئات مثل الاقتصاد، البيئة، الاجتماعية، وغيرها.',
),
style: TextStyle( style: TextStyle(
color:Color(0xFF898C81), color: isDarkTheme
fontSize: 16, ? Colors.white
: Color(0xFF898C81),
fontSize: 16,
fontFamily: context.translate( fontFamily: context.translate(
'Roboto', 'Roboto',
'NotoKufi', 'NotoKufi',
), ),
), ),
children: <TextSpan>[ children: <TextSpan>[
TextSpan(text: TextSpan(
context.translate('Economy, Environment, Social, ',''), text: context.translate(
'Economy, Environment, Social, ', ''),
style: TextStyle( style: TextStyle(
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
color: Color(0xFF414042), color: isDarkTheme
? Colors.white
: Color(0xFF414042),
fontFamily: context.translate( fontFamily: context.translate(
'Roboto', 'Roboto',
'NotoKufi', 'NotoKufi',
), ),
),), ),
TextSpan(text:context.translate('and more.','')), ),
TextSpan(
text: context.translate('and more.', ''),
style: TextStyle(
color: isDarkTheme
? Colors.white
: Color(0xFF898C81),
fontSize: 16,
fontFamily: context.translate(
'Roboto',
'NotoKufi',
),
),
),
], ],
), ),
), ),
@ -131,58 +267,29 @@ class AppFeatures extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Padding( Padding(
padding: const EdgeInsets.only(top : 8.0), padding: const EdgeInsets.only(top: 8.0),
child: Icon(Icons.brightness_1, size: 5, color: Color(0xFF414042),), child: Icon(
), // Bullet point Icons.brightness_1,
SizedBox(width: 8), // Space between bullet and text size: 5,
Expanded( color: isDarkTheme
child: Text( context.translate( ? Colors.white
'Explore statistics presented as smart metrics, graphs, and charts for better understanding.', : Color(0xFF414042),
'استكشاف الإحصائيات المقدمة على هيئة مقاييس ذكية ورسوم بيانية ومخططات لتعزيز الفهم.',),
textAlign: TextAlign.justify, // Align the text
softWrap: true,
), ),
),
],
),
],
),
),
SizedBox(height: 8),
Text(
context.translate('2. Drilldown Navigation:','2. التنقل التفصيلي'),
style:TextStyle(
fontFamily: context.translate(
'Roboto',
'NotoKufi',
),
fontSize:16,
color: Color(0xFF414042),
fontWeight: FontWeight.w600,
),
),
SizedBox(height: 8),
Padding(
padding: const EdgeInsets.only(left:7.0),
child: Column(
children: [
Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Padding(
padding: const EdgeInsets.only(top : 8.0),
child: Icon(Icons.brightness_1, size: 5, color: Color(0xFF414042),),
), // Bullet point ), // Bullet point
SizedBox(width: 8), // Space between bullet and text SizedBox(width: 8), // Space between bullet and text
Expanded( Expanded(
child: Text( child: Text(
context.translate( context.translate(
'Start with high-level categories and drill down to specific KPIs and metrics for deeper insights.', 'Explore statistics presented as smart metrics, graphs, and charts for better understanding.',
'البدء بالفئات العامة والتنقل وصولًا إلى مؤشرات الأداء الرئيسية (KPIs) والمقاييس المحددة للحصول على رؤى أعمق.',), 'استكشاف الإحصائيات المقدمة على هيئة مقاييس ذكية ورسوم بيانية ومخططات لتعزيز الفهم.',
textAlign: TextAlign.justify, // Align the text ),
textAlign: TextAlign.justify, // Align the text
softWrap: true, softWrap: true,
style: TextStyle(
color: isDarkTheme
? Colors.white
: Color(0xFF898C81),
),
), ),
), ),
], ],
@ -190,39 +297,52 @@ class AppFeatures extends StatelessWidget {
], ],
), ),
), ),
SizedBox(height: 8), SizedBox(height: 8),
Text( Text(
context.translate('3. Interactive Visualizations:','3. التصورات التفاعلية:'), context.translate(
style:TextStyle( '2. Drilldown Navigation:', '2. التنقل التفصيلي'),
style: TextStyle(
fontFamily: context.translate( fontFamily: context.translate(
'Roboto', 'Roboto',
'NotoKufi', 'NotoKufi',
), ),
fontSize:16, fontSize: 16,
color: Color(0xFF414042), color: isDarkTheme ? Colors.white : Color(0xFF414042),
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
), ),
), ),
SizedBox(height: 8), SizedBox(height: 8),
Padding( Padding(
padding: const EdgeInsets.only(left:7.0), padding: const EdgeInsets.only(left: 7.0),
child: Column( child: Column(
children: [ children: [
Row( Row(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Padding( Padding(
padding: const EdgeInsets.only(top : 8.0), padding: const EdgeInsets.only(top: 8.0),
child: Icon(Icons.brightness_1, size: 5, color: Color(0xFF414042),), child: Icon(
Icons.brightness_1,
size: 5,
color: isDarkTheme
? Colors.white
: Color(0xFF414042),
),
), // Bullet point ), // Bullet point
SizedBox(width: 8), // Space between bullet and text SizedBox(width: 8), // Space between bullet and text
Expanded( Expanded(
child: Text(context.translate( child: Text(
'View trends and relationships with interactive graphs and charts, including bar graphs, line charts, and more.', context.translate(
'عرض الاتجاهات والعلاقات باستخدام الرسوم البيانية التفاعلية مثل المخططات الشريطية، المخططات الخطية، وغيرها.',), 'Start with high-level categories and drill down to specific KPIs and metrics for deeper insights.',
'البدء بالفئات العامة والتنقل وصولًا إلى مؤشرات الأداء الرئيسية (KPIs) والمقاييس المحددة للحصول على رؤى أعمق.',
),
textAlign: TextAlign.justify, // Align the text textAlign: TextAlign.justify, // Align the text
softWrap: true, softWrap: true,
style: TextStyle(
color: isDarkTheme
? Colors.white
: Color(0xFF898C81),
),
), ),
), ),
], ],
@ -230,7 +350,62 @@ class AppFeatures extends StatelessWidget {
], ],
), ),
), ),
SizedBox(height: 20,), SizedBox(height: 8),
Text(
context.translate('3. Interactive Visualizations:',
'3. التصورات التفاعلية:'),
style: TextStyle(
fontFamily: context.translate(
'Roboto',
'NotoKufi',
),
fontSize: 16,
color: isDarkTheme ? Colors.white : Color(0xFF414042),
fontWeight: FontWeight.w600,
),
),
SizedBox(height: 8),
Padding(
padding: const EdgeInsets.only(left: 7.0),
child: Column(
children: [
Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Padding(
padding: const EdgeInsets.only(top: 8.0),
child: Icon(
Icons.brightness_1,
size: 5,
color: isDarkTheme
? Colors.white
: Color(0xFF414042),
),
), // Bullet point
SizedBox(width: 8), // Space between bullet and text
Expanded(
child: Text(
context.translate(
'View trends and relationships with interactive graphs and charts, including bar graphs, line charts, and more.',
'عرض الاتجاهات والعلاقات باستخدام الرسوم البيانية التفاعلية مثل المخططات الشريطية، المخططات الخطية، وغيرها.',
),
textAlign: TextAlign.justify, // Align the text
softWrap: true,
style: TextStyle(
color: isDarkTheme
? Colors.white
: Color(0xFF898C81),
),
),
),
],
),
],
),
),
SizedBox(
height: 20,
),
], ],
), ),
), ),

View File

@ -1,23 +1,136 @@
import 'dart:convert';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:http/http.dart' as http;
import 'package:uae_stat/config/api_config.dart';
import 'package:uae_stat/config/theme/theme_provider.dart';
import 'package:uae_stat/config/toggle_lang_service.dart';
import 'package:uae_stat/domain/use_cases/language.dart'; import 'package:uae_stat/domain/use_cases/language.dart';
import 'package:uae_stat/presentation/Screens/Bottom%20Navigation%20Pages/Country_Profile/country_profile.dart';
import 'package:uae_stat/presentation/routes/drawer_routes/custom_drawer_routes.dart'; import 'package:uae_stat/presentation/routes/drawer_routes/custom_drawer_routes.dart';
class ChangeMyPassword extends StatelessWidget { class ChangeMyPassword extends ConsumerStatefulWidget {
const ChangeMyPassword({super.key}); const ChangeMyPassword({super.key});
@override
ConsumerState<ChangeMyPassword> createState() => _ChangeMyPasswordState();
}
class _ChangeMyPasswordState extends ConsumerState<ChangeMyPassword> {
// class ChangeMyPassword extends StatelessWidget {
// const ChangeMyPassword({super.key});
List<dynamic> homePageData = [];
List<dynamic> filteredData = [];
bool isLoading = true;
late UserService _userService;
late ThemeMode currentTheme;
@override
void initState() {
super.initState();
_userService = UserService();
final locale = ref.read(localeProvider);
currentTheme = ref.read(themeProvider);
print('123456789');
print(currentTheme);
WidgetsBinding.instance.addPostFrameCallback((_) {
final isDark = currentTheme == ThemeMode.dark ||
(currentTheme == ThemeMode.system &&
MediaQuery.of(context).platformBrightness == Brightness.dark);
final themeMode = (isDark ? 'dark' : 'light');
print("ThemeMode - $themeMode");
fetchData(locale?.languageCode ?? 'en', themeMode);
});
}
Future<void> fetchData(locale, themeMode) async {
const baseUrl = '$apiUrl/api/getUAENumbersData';
try {
final response = await http
.get(Uri.parse(baseUrl + '?language=$locale&color_mode=$themeMode'));
if (response.statusCode == 200) {
setState(() {
homePageData = (json.decode(response.body) as List)
.map((e) => Map<String, dynamic>.from(e))
.toList();
filteredData = List.from(homePageData);
isLoading = false;
});
} else {
throw Exception('Failed to load data');
}
} catch (e) {
setState(() {
isLoading = false;
});
print('Error fetching data: $e');
}
}
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
ref.listen<Locale?>(localeProvider, (previous, next) async {
final localeCode = next?.languageCode ?? 'en';
setState(() {
isLoading = true;
});
await _userService.updateLanguage(localeCode);
final currentTheme = ref.read(themeProvider);
final isDark = currentTheme == ThemeMode.dark ||
(currentTheme == ThemeMode.system &&
MediaQuery.of(context).platformBrightness == Brightness.dark);
final themeString = isDark ? 'dark' : 'light';
fetchData(localeCode, themeString);
});
ref.listen<ThemeMode>(themeProvider, (previous, next) async {
final localeCode = ref.watch(localeProvider)?.languageCode ?? 'en';
print(localeCode);
// Default to 'en' if null
setState(() {
isLoading = true;
print('isLoadingref $isLoading');
});
final currentTheme = ref.read(themeProvider);
final isDark = currentTheme == ThemeMode.dark ||
(currentTheme == ThemeMode.system &&
MediaQuery.of(context).platformBrightness == Brightness.dark);
final themeString = isDark ? 'dark' : 'light';
print("themeString- $themeString");
fetchData(localeCode, themeString);
});
final themeMode = ref.read(themeProvider);
final isDarkTheme = themeMode == ThemeMode.dark ||
(themeMode == ThemeMode.system &&
MediaQuery.of(context).platformBrightness == Brightness.dark);
print("isDarkTheme - $isDarkTheme");
return Theme( return Theme(
data: ThemeData( data: ThemeData(
fontFamily: context.translate( fontFamily: context.translate(
'Roboto', 'Roboto',
'NotoKufi', 'NotoKufi',
),// Set default font family for this page ), // Set default font family for this page
textTheme: TextTheme( textTheme: TextTheme(
bodyMedium: TextStyle(fontSize: 16, color: Color(0xFF898C81), bodyMedium: TextStyle(
fontSize: 16,
color: Color(0xFF898C81),
fontFamily: context.translate( fontFamily: context.translate(
'Roboto', 'Roboto',
'NotoKufi', 'NotoKufi',
),), ),
),
), ),
), ),
child: BaseScaffold( child: BaseScaffold(
@ -25,10 +138,12 @@ class ChangeMyPassword extends StatelessWidget {
showBackButton: true, showBackButton: true,
bottomColor: Colors.white, bottomColor: Colors.white,
dividerColor: Colors.grey[300], dividerColor: Colors.grey[300],
appbarColor: Colors.white, // appbarColor: Colors.white,
backgroundColor: isDarkTheme ? Colors.black : Colors.white,
appbarColor: isDarkTheme ? Colors.black : Colors.white,
mycenterTitle: true, mycenterTitle: true,
title: Text( title: Text(
context.translate('Key Features','الميزات الرئيسية'), context.translate('Key Features', 'الميزات الرئيسية'),
style: TextStyle( style: TextStyle(
fontFamily: context.translate( fontFamily: context.translate(
'Roboto', 'Roboto',
@ -42,7 +157,7 @@ class ChangeMyPassword extends StatelessWidget {
), ),
body: Container( body: Container(
width: double.infinity, width: double.infinity,
color: Colors.white, color: isDarkTheme ? Colors.black : Colors.white,
padding: EdgeInsets.all(16), padding: EdgeInsets.all(16),
child: SingleChildScrollView( child: SingleChildScrollView(
child: Column( child: Column(
@ -52,21 +167,23 @@ class ChangeMyPassword extends StatelessWidget {
alignment: Alignment.topLeft, alignment: Alignment.topLeft,
child: Text( child: Text(
context.translate( context.translate(
'How to Change My Password', 'How to Change My Password',
'كيفية تغيير كلمة المرور الخاصة بي',), 'كيفية تغيير كلمة المرور الخاصة بي',
),
style: TextStyle( style: TextStyle(
fontFamily: context.translate( fontFamily: context.translate(
'Roboto', 'Roboto',
'NotoKufi', 'NotoKufi',
), ),
fontSize:20, fontSize: 20,
color: Color(0xFF414042), color: isDarkTheme ? Colors.white : Color(0xFF414042),
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
),), ),
),
), ),
SizedBox( SizedBox(
width:MediaQuery.of(context).size.width, width: MediaQuery.of(context).size.width,
height:MediaQuery.of(context).size.height * 0.36, height: MediaQuery.of(context).size.height * 0.36,
child: Image.asset( child: Image.asset(
'assets/user_guide/changePassword.png', 'assets/user_guide/changePassword.png',
fit: BoxFit.contain, fit: BoxFit.contain,
@ -74,75 +191,105 @@ class ChangeMyPassword extends StatelessWidget {
), ),
Text( Text(
context.translate( context.translate(
'Changing your password helps keep your account secure. Follow these steps to update your password:', 'Changing your password helps keep your account secure. Follow these steps to update your password:',
'يُساعد تغيير كلمة المرور في الحفاظ على أمان حسابك. اتبع هذه الخطوات لتحديث كلمة مرور',), 'يُساعد تغيير كلمة المرور في الحفاظ على أمان حسابك. اتبع هذه الخطوات لتحديث كلمة مرور',
),
style: TextStyle(
color: isDarkTheme ? Colors.white : Color(0xFF898C81)),
), ),
SizedBox(height: 12), SizedBox(height: 12),
Text( Text(
context.translate('Steps to Change Password','خطوات تغيير كلمة المرور '), context.translate(
style:TextStyle( 'Steps to Change Password', 'خطوات تغيير كلمة المرور '),
style: TextStyle(
fontFamily: context.translate( fontFamily: context.translate(
'Roboto', 'Roboto',
'NotoKufi', 'NotoKufi',
), ),
fontSize:22, fontSize: 22,
color: Color(0xFF414042), color: isDarkTheme ? Colors.white : Color(0xFF414042),
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
), ),
), ),
SizedBox(height: 8), SizedBox(height: 8),
Text( Text(
context.translate( context.translate(
'1. Access the Change Password Page:', '1. Access the Change Password Page:',
'1. الدخول إلى صفحة تغيير كلمة المرور:',), '1. الدخول إلى صفحة تغيير كلمة المرور:',
style:TextStyle( ),
style: TextStyle(
fontFamily: context.translate( fontFamily: context.translate(
'Roboto', 'Roboto',
'NotoKufi', 'NotoKufi',
), ),
fontSize:16, fontSize: 16,
color: Color(0xFF414042), color: isDarkTheme ? Colors.white : Color(0xFF414042),
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
), ),
), ),
SizedBox(height: 8), SizedBox(height: 8),
Padding( Padding(
padding: const EdgeInsets.only(left:8.0), padding: const EdgeInsets.only(left: 8.0),
child: Column( child: Column(
children: [ children: [
Row( Row(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Padding( Padding(
padding: const EdgeInsets.only(top : 8.0), padding: const EdgeInsets.only(top: 8.0),
child: Icon(Icons.brightness_1, size: 5, color: Color(0xFF414042),), child: Icon(
Icons.brightness_1,
size: 5,
color: isDarkTheme
? Colors.white
: Color(0xFF414042),
),
), // Bullet point ), // Bullet point
SizedBox(width: 8), // Space between bullet and text SizedBox(width: 8), // Space between bullet and text
Expanded( Expanded(
child: RichText( child: RichText(
text: TextSpan( text: TextSpan(
text: context.translate( text: context.translate(
'From the Profile page, tap on the ', 'From the Profile page, tap on the ',
'من صفحة الملف الشخصي، انقر على رابط ',), 'من صفحة الملف الشخصي، انقر على رابط ',
style: TextStyle(fontSize: 16, color: Color(0xFF898C81), fontFamily: context.translate( ),
'Roboto', style: TextStyle(
'NotoKufi', fontSize: 16,
),), color: isDarkTheme
? Colors.white
: Color(0xFF898C81),
fontFamily: context.translate(
'Roboto',
'NotoKufi',
),
),
children: <TextSpan>[ children: <TextSpan>[
TextSpan(text: context.translate( TextSpan(
'"Change Password"', text: context.translate(
'"تغيير كلمة المرور" ',), '"Change Password"',
'"تغيير كلمة المرور" ',
),
style: TextStyle( style: TextStyle(
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
color: Color(0xFF414042), color: isDarkTheme
? Colors.white
: Color(0xFF414042),
fontFamily: context.translate( fontFamily: context.translate(
'Roboto', 'Roboto',
'NotoKufi', 'NotoKufi',
), ),
),), ),
TextSpan(text:context.translate( ),
' link at the bottom.', TextSpan(
'في الأسفل.',), text: context.translate(
' link at the bottom.',
'في الأسفل.',
),
style: TextStyle(
color: isDarkTheme
? Colors.white
: Color(0xFF898C81),
),
), ),
], ],
), ),
@ -153,195 +300,273 @@ class ChangeMyPassword extends StatelessWidget {
], ],
), ),
), ),
SizedBox(height: 8),
Text(context.translate(
'2. Enter Old Password:',
'2. إدخال كلمة المرور القديمة:',),
style:TextStyle(
fontFamily: context.translate(
'Roboto',
'NotoKufi',
),
fontSize:16,
color: Color(0xFF414042),
fontWeight: FontWeight.w600,
),
),
SizedBox(height: 8),
Padding(
padding: const EdgeInsets.only(left:8.0),
child: Column(
children: [
Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Padding(
padding: const EdgeInsets.only(top : 8.0),
child: Icon(Icons.brightness_1, size: 5),
), // Bullet point
SizedBox(width: 8), // Space between bullet and text
Expanded(
child: Text(
context.translate(
'Enter your current password in the first field.',
'أدخل كلمة المرور الحالية في الحقل الأول.',),
textAlign: TextAlign.justify, // Align the text
softWrap: true,
),
),
],
),
],
),
),
SizedBox(height: 8),
Text(context.translate(
'3. Set a New Password:',
'3. تعيين كلمة مرور جديدة:',),
style:TextStyle(
fontFamily: context.translate(
'Roboto',
'NotoKufi',
),
fontSize:16,
color: Color(0xFF414042),
fontWeight: FontWeight.w600,
),
),
SizedBox(height: 8),
Padding(
padding: const EdgeInsets.only(left:8.0),
child: Column(
children: [
Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Padding(
padding: const EdgeInsets.only(top : 8.0),
child: Icon(Icons.brightness_1, size: 5, color: Color(0xFF414042),),
), // Bullet point
SizedBox(width: 8), // Space between bullet and text
Expanded(
child: Text( context.translate(
'Enter your new password in the second field.',
'أدخل كلمة المرور الجديدة في الحقل الثاني.',),
textAlign: TextAlign.justify, // Align the text
softWrap: true,
),
),
],
),
Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Padding(
padding: const EdgeInsets.only(top : 8.0),
child: Icon(Icons.brightness_1, size: 5, color: Color(0xFF414042),),
), // Bullet point
SizedBox(width: 8), // Space between bullet and text
Expanded(
child: Text(
context.translate(
'Re-enter the new password in the third field for confirmation.',
'أعد إدخال كلمة المرور الجديدة في الحقل الثالث للتأكيد.',),
textAlign: TextAlign.justify, // Align the text
softWrap: true,
),
),
],
),
],
),
),
SizedBox(height: 8),
Text(context.translate(
'4. Password Requirements:','4. متطلبات كلمة المرور:',),
style:TextStyle(
fontFamily: context.translate(
'Roboto',
'NotoKufi',
),
fontSize:16,
color: Color(0xFF414042),
fontWeight: FontWeight.w600,
),
),
SizedBox(height: 8),
Padding(
padding: const EdgeInsets.only(left:8.0),
child: Column(
children: [
Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Padding(
padding: const EdgeInsets.only(top : 8.0),
child: Icon(Icons.brightness_1, size: 5, color: Color(0xFF414042),),
), // Bullet point
SizedBox(width: 8), // Space between bullet and text
Expanded(
child: Text(context.translate(
'Your new password must be different from the previously used password.',
'جب أن تكون كلمة المرور الجديدة مختلفة عن كلمة المرور المستخدمة سابقًا',),
textAlign: TextAlign.justify, // Align the text
softWrap: true,
),
),
],
),
],
),
),
SizedBox(height: 8), SizedBox(height: 8),
Text( Text(
context.translate('5. Save Your Password:','5. حفظ كلمة المرور '), context.translate(
style:TextStyle( '2. Enter Old Password:',
'2. إدخال كلمة المرور القديمة:',
),
style: TextStyle(
fontFamily: context.translate( fontFamily: context.translate(
'Roboto', 'Roboto',
'NotoKufi', 'NotoKufi',
), ),
fontSize:16, fontSize: 16,
color: Color(0xFF414042), color: isDarkTheme ? Colors.white : Color(0xFF414042),
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
), ),
), ),
SizedBox(height: 8), SizedBox(height: 8),
Padding( Padding(
padding: const EdgeInsets.only(left:8.0), padding: const EdgeInsets.only(left: 8.0),
child: Column( child: Column(
children: [ children: [
Row( Row(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Padding( Padding(
padding: const EdgeInsets.only(top : 8.0), padding: const EdgeInsets.only(top: 8.0),
child: Icon(Icons.brightness_1, size: 5, color: Color(0xFF414042),), child: Icon(
Icons.brightness_1,
size: 5,
color: isDarkTheme
? Colors.white
: Color(0xFF414042),
),
), // Bullet point ), // Bullet point
SizedBox(width: 8), // Space between bullet and text SizedBox(width: 8), // Space between bullet and text
Expanded( Expanded(
child: RichText( child: Text(
context.translate(
'Enter your current password in the first field.',
'أدخل كلمة المرور الحالية في الحقل الأول.',
),
style: TextStyle(
color: isDarkTheme
? Colors.white
: Color(0xFF898C81),
),
textAlign: TextAlign.justify, // Align the text
softWrap: true,
),
),
],
),
],
),
),
SizedBox(height: 8),
Text(
context.translate(
'3. Set a New Password:',
'3. تعيين كلمة مرور جديدة:',
),
style: TextStyle(
fontFamily: context.translate(
'Roboto',
'NotoKufi',
),
fontSize: 16,
color: isDarkTheme ? Colors.white : Color(0xFF414042),
fontWeight: FontWeight.w600,
),
),
SizedBox(height: 8),
Padding(
padding: const EdgeInsets.only(left: 8.0),
child: Column(
children: [
Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Padding(
padding: const EdgeInsets.only(top: 8.0),
child: Icon(
Icons.brightness_1,
size: 5,
color: isDarkTheme
? Colors.white
: Color(0xFF414042),
),
), // Bullet point
SizedBox(width: 8), // Space between bullet and text
Expanded(
child: Text(
context.translate(
'Enter your new password in the second field.',
'أدخل كلمة المرور الجديدة في الحقل الثاني.',
),
textAlign: TextAlign.justify, // Align the text
softWrap: true,
style: TextStyle(
color: isDarkTheme
? Colors.white
: Color(0xFF898C81),
),
),
),
],
),
Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Padding(
padding: const EdgeInsets.only(top: 8.0),
child: Icon(
Icons.brightness_1,
size: 5,
color: isDarkTheme
? Colors.white
: Color(0xFF414042),
),
), // Bullet point
SizedBox(width: 8), // Space between bullet and text
Expanded(
child: Text(
context.translate(
'Re-enter the new password in the third field for confirmation.',
'أعد إدخال كلمة المرور الجديدة في الحقل الثالث للتأكيد.',
),
textAlign: TextAlign.justify, // Align the text
softWrap: true,
style: TextStyle(
color: isDarkTheme
? Colors.white
: Color(0xFF898C81),
),
),
),
],
),
],
),
),
SizedBox(height: 8),
Text(
context.translate(
'4. Password Requirements:',
'4. متطلبات كلمة المرور:',
),
style: TextStyle(
fontFamily: context.translate(
'Roboto',
'NotoKufi',
),
fontSize: 16,
color: isDarkTheme ? Colors.white : Color(0xFF414042),
fontWeight: FontWeight.w600,
),
),
SizedBox(height: 8),
Padding(
padding: const EdgeInsets.only(left: 8.0),
child: Column(
children: [
Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Padding(
padding: const EdgeInsets.only(top: 8.0),
child: Icon(
Icons.brightness_1,
size: 5,
color: isDarkTheme
? Colors.white
: Color(0xFF414042),
),
), // Bullet point
SizedBox(width: 8), // Space between bullet and text
Expanded(
child: Text(
context.translate(
'Your new password must be different from the previously used password.',
'جب أن تكون كلمة المرور الجديدة مختلفة عن كلمة المرور المستخدمة سابقًا',
),
textAlign: TextAlign.justify, // Align the text
softWrap: true,
style: TextStyle(
color: isDarkTheme
? Colors.white
: Color(0xFF898C81),
),
),
),
],
),
],
),
),
SizedBox(height: 8),
Text(
context.translate(
'5. Save Your Password:', '5. حفظ كلمة المرور '),
style: TextStyle(
fontFamily: context.translate(
'Roboto',
'NotoKufi',
),
fontSize: 16,
color: isDarkTheme ? Colors.white : Color(0xFF414042),
fontWeight: FontWeight.w600,
),
),
SizedBox(height: 8),
Padding(
padding: const EdgeInsets.only(left: 8.0),
child: Column(
children: [
Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Padding(
padding: const EdgeInsets.only(top: 8.0),
child: Icon(
Icons.brightness_1,
size: 5,
color: isDarkTheme
? Colors.white
: Color(0xFF414042),
),
), // Bullet point
SizedBox(width: 8), // Space between bullet and text
Expanded(
child: RichText(
text: TextSpan( text: TextSpan(
text: context.translate('Tap the ','انقرعلى زر '), text: context.translate(
style: TextStyle(fontSize: 16, color: Color(0xFF898C81), fontFamily: context.translate( 'Tap the ', 'انقرعلى زر '),
'Roboto', style: TextStyle(
'NotoKufi', fontSize: 16,
),), // color: Color(0xFF898C81),
fontFamily: context.translate(
'Roboto',
'NotoKufi',
),
color: isDarkTheme
? Colors.white
: Color(0xFF898C81),
),
children: <TextSpan>[ children: <TextSpan>[
TextSpan(text: TextSpan(
context.translate('Save ','"حفظ".'), text: context.translate('Save ', '"حفظ".'),
style: TextStyle( style: TextStyle(
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
color: Color(0xFF414042), color: isDarkTheme
? Colors.white
: Color(0xFF414042),
fontFamily: context.translate( fontFamily: context.translate(
'Roboto', 'Roboto',
'NotoKufi', 'NotoKufi',
), ),
),), ),
TextSpan(text: context.translate('button',''),), ),
TextSpan(
text: context.translate('button', ''),
style: TextStyle(
color: isDarkTheme
? Colors.white
: Color(0xFF898C81),
),
),
], ],
), ),
), ),
@ -352,16 +577,29 @@ class ChangeMyPassword extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Padding( Padding(
padding: const EdgeInsets.only(top : 8.0), padding: const EdgeInsets.only(top: 8.0),
child: Icon(Icons.brightness_1, size: 5, color: Color(0xFF414042),), child: Icon(
Icons.brightness_1,
size: 5,
color: isDarkTheme
? Colors.white
: Color(0xFF414042),
),
), // Bullet point ), // Bullet point
SizedBox(width: 8), // Space between bullet and text SizedBox(width: 8), // Space between bullet and text
Expanded( Expanded(
child: Text(context.translate( child: Text(
'A confirmation message will appear: “Password has been successfully updated.”', context.translate(
'ستظهر رسالة تأكيد: "تم تحديث كلمة المرور بنجاح".',), 'A confirmation message will appear: “Password has been successfully updated.”',
'ستظهر رسالة تأكيد: "تم تحديث كلمة المرور بنجاح".',
),
textAlign: TextAlign.justify, // Align the text textAlign: TextAlign.justify, // Align the text
softWrap: true, softWrap: true,
style: TextStyle(
color: isDarkTheme
? Colors.white
: Color(0xFF898C81),
),
), ),
), ),
], ],
@ -371,36 +609,49 @@ class ChangeMyPassword extends StatelessWidget {
), ),
SizedBox(height: 8), SizedBox(height: 8),
Text( Text(
context.translate('6. Re-Login:','6. إعادة تسجيل الدخول'), context.translate('6. Re-Login:', '6. إعادة تسجيل الدخول'),
style:TextStyle( style: TextStyle(
fontFamily: context.translate( fontFamily: context.translate(
'Roboto', 'Roboto',
'NotoKufi', 'NotoKufi',
), ),
fontSize:16, fontSize: 16,
color: Color(0xFF414042), color: isDarkTheme ? Colors.white : Color(0xFF414042),
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
), ),
), ),
SizedBox(height: 8), SizedBox(height: 8),
Padding( Padding(
padding: const EdgeInsets.only(left:8.0), padding: const EdgeInsets.only(left: 8.0),
child: Column( child: Column(
children: [ children: [
Row( Row(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Padding( Padding(
padding: const EdgeInsets.only(top : 8.0), padding: const EdgeInsets.only(top: 8.0),
child: Icon(Icons.brightness_1, size: 5, color: Color(0xFF414042),), child: Icon(
Icons.brightness_1,
size: 5,
color: isDarkTheme
? Colors.white
: Color(0xFF414042),
),
), // Bullet point ), // Bullet point
SizedBox(width: 8), // Space between bullet and text SizedBox(width: 8), // Space between bullet and text
Expanded( Expanded(
child: Text(context.translate( child: Text(
'Log in again using your new password to continue using the app', context.translate(
'قم بتسجيل الدخول مرة أخرى باستخدام كلمة المرور الجديدة للاستمرار في استخدام التطبيق.',), 'Log in again using your new password to continue using the app',
'قم بتسجيل الدخول مرة أخرى باستخدام كلمة المرور الجديدة للاستمرار في استخدام التطبيق.',
),
textAlign: TextAlign.justify, // Align the text textAlign: TextAlign.justify, // Align the text
softWrap: true, softWrap: true,
style: TextStyle(
color: isDarkTheme
? Colors.white
: Color(0xFF898C81),
),
), ),
), ),
], ],
@ -408,9 +659,10 @@ class ChangeMyPassword extends StatelessWidget {
], ],
), ),
), ),
SizedBox(height: 20,), SizedBox(
height: 20,
),
], ],
), ),
), ),
), ),

View File

@ -1,14 +1,123 @@
import 'package:flutter/material.dart'; import 'dart:convert';
import 'package:uae_stat/domain/use_cases/language.dart';
import 'package:flutter/material.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:http/http.dart' as http;
import 'package:uae_stat/config/api_config.dart';
import 'package:uae_stat/config/theme/theme_provider.dart';
import 'package:uae_stat/config/toggle_lang_service.dart';
import 'package:uae_stat/domain/use_cases/language.dart';
import 'package:uae_stat/presentation/Screens/Bottom%20Navigation%20Pages/Country_Profile/country_profile.dart';
import 'package:uae_stat/presentation/routes/drawer_routes/custom_drawer_routes.dart'; import 'package:uae_stat/presentation/routes/drawer_routes/custom_drawer_routes.dart';
class HowUseTheApp extends StatelessWidget { class HowUseTheApp extends ConsumerStatefulWidget {
const HowUseTheApp({super.key}); const HowUseTheApp({super.key});
@override
ConsumerState<HowUseTheApp> createState() => _HowUseTheAppState();
}
class _HowUseTheAppState extends ConsumerState<HowUseTheApp> {
//
// class HowUseTheApp extends StatelessWidget {
// const HowUseTheApp({super.key});
List<dynamic> homePageData = [];
List<dynamic> filteredData = [];
bool isLoading = true;
late UserService _userService;
late ThemeMode currentTheme;
@override
void initState() {
super.initState();
_userService = UserService();
final locale = ref.read(localeProvider);
currentTheme = ref.read(themeProvider);
print('123456789');
print(currentTheme);
WidgetsBinding.instance.addPostFrameCallback((_) {
final isDark = currentTheme == ThemeMode.dark ||
(currentTheme == ThemeMode.system &&
MediaQuery.of(context).platformBrightness == Brightness.dark);
final themeMode = (isDark ? 'dark' : 'light');
print("ThemeMode - $themeMode");
fetchData(locale?.languageCode ?? 'en', themeMode);
});
}
Future<void> fetchData(locale, themeMode) async {
const baseUrl = '$apiUrl/api/getUAENumbersData';
try {
final response = await http
.get(Uri.parse(baseUrl + '?language=$locale&color_mode=$themeMode'));
if (response.statusCode == 200) {
setState(() {
homePageData = (json.decode(response.body) as List)
.map((e) => Map<String, dynamic>.from(e))
.toList();
filteredData = List.from(homePageData);
isLoading = false;
});
} else {
throw Exception('Failed to load data');
}
} catch (e) {
setState(() {
isLoading = false;
});
print('Error fetching data: $e');
}
}
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
ref.listen<Locale?>(localeProvider, (previous, next) async {
final localeCode = next?.languageCode ?? 'en';
setState(() {
isLoading = true;
});
await _userService.updateLanguage(localeCode);
final currentTheme = ref.read(themeProvider);
final isDark = currentTheme == ThemeMode.dark ||
(currentTheme == ThemeMode.system &&
MediaQuery.of(context).platformBrightness == Brightness.dark);
final themeString = isDark ? 'dark' : 'light';
fetchData(localeCode, themeString);
});
ref.listen<ThemeMode>(themeProvider, (previous, next) async {
final localeCode = ref.watch(localeProvider)?.languageCode ?? 'en';
print(localeCode);
// Default to 'en' if null
setState(() {
isLoading = true;
print('isLoadingref $isLoading');
});
final currentTheme = ref.read(themeProvider);
final isDark = currentTheme == ThemeMode.dark ||
(currentTheme == ThemeMode.system &&
MediaQuery.of(context).platformBrightness == Brightness.dark);
final themeString = isDark ? 'dark' : 'light';
print("themeString- $themeString");
fetchData(localeCode, themeString);
});
final themeMode = ref.read(themeProvider);
final isDarkTheme = themeMode == ThemeMode.dark ||
(themeMode == ThemeMode.system &&
MediaQuery.of(context).platformBrightness == Brightness.dark);
print("isDarkTheme - $isDarkTheme");
return Theme( return Theme(
data: ThemeData( data: ThemeData(
fontFamily: context.translate( fontFamily: context.translate(
@ -16,21 +125,27 @@ class HowUseTheApp extends StatelessWidget {
'NotoKufi', 'NotoKufi',
), // Set default font family for this page ), // Set default font family for this page
textTheme: TextTheme( textTheme: TextTheme(
bodyMedium: TextStyle(fontSize: 16, color: Color(0xFF898C81),fontFamily: context.translate( bodyMedium: TextStyle(
'Roboto', fontSize: 16,
'NotoKufi', color: Color(0xFF898C81),
),), fontFamily: context.translate(
'Roboto',
'NotoKufi',
),
),
), ),
), ),
child: BaseScaffold( child: BaseScaffold(
backgroundColor: isDarkTheme ? Colors.black : Colors.white,
appbarColor: isDarkTheme ? Colors.black : Colors.white,
showDivider: true, showDivider: true,
showBackButton: true, showBackButton: true,
dividerColor: Colors.grey[300], dividerColor: Colors.grey[300],
appbarColor: Colors.white, // appbarColor: Colors.white,
bottomColor: Colors.white, bottomColor: Colors.white,
mycenterTitle: true, mycenterTitle: true,
title: Text( title: Text(
context.translate('Key Features','الميزات الرئيسية'), context.translate('Key Features', 'الميزات الرئيسية'),
style: TextStyle( style: TextStyle(
fontFamily: context.translate( fontFamily: context.translate(
'Roboto', 'Roboto',
@ -44,7 +159,7 @@ class HowUseTheApp extends StatelessWidget {
), ),
body: Container( body: Container(
width: double.infinity, width: double.infinity,
color: Colors.white, color: isDarkTheme ? Colors.black : Colors.white,
padding: EdgeInsets.all(16), padding: EdgeInsets.all(16),
child: SingleChildScrollView( child: SingleChildScrollView(
child: Column( child: Column(
@ -53,14 +168,15 @@ class HowUseTheApp extends StatelessWidget {
Align( Align(
alignment: Alignment.topLeft, alignment: Alignment.topLeft,
child: Text( child: Text(
context.translate('How to Use the App','كيفية استخدام التطبيق:'), context.translate(
'How to Use the App', 'كيفية استخدام التطبيق:'),
style: TextStyle( style: TextStyle(
fontFamily: context.translate( fontFamily: context.translate(
'Roboto', 'Roboto',
'NotoKufi', 'NotoKufi',
), ),
fontSize: 20, fontSize: 20,
color: Color(0xFF414042), color: isDarkTheme ? Colors.white : Color(0xFF414042),
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
), ),
), ),
@ -75,15 +191,16 @@ class HowUseTheApp extends StatelessWidget {
), ),
Text( Text(
context.translate( context.translate(
'1. Registration and Approval:', '1. Registration and Approval:',
'1. التسجيل والموافقة:',), '1. التسجيل والموافقة:',
),
style: TextStyle( style: TextStyle(
fontFamily: context.translate( fontFamily: context.translate(
'Roboto', 'Roboto',
'NotoKufi', 'NotoKufi',
), ),
fontSize: 16, fontSize: 16,
color: Color(0xFF414042), color: isDarkTheme ? Colors.white : Color(0xFF414042),
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
), ),
), ),
@ -96,17 +213,21 @@ class HowUseTheApp extends StatelessWidget {
child: Icon( child: Icon(
Icons.brightness_1, Icons.brightness_1,
size: 5, size: 5,
color: Color(0xFF414042), color: isDarkTheme ? Colors.white : Color(0xFF414042),
), ),
), // Bullet point ), // Bullet point
SizedBox(width: 8), // Space between bullet and text SizedBox(width: 8), // Space between bullet and text
Expanded( Expanded(
child: Text( child: Text(
context.translate( context.translate(
'Sign up for the app and wait for admin approval.', 'Sign up for the app and wait for admin approval.',
'قم بالتسجيل في التطبيق وانتظر الموافقة من الإدارة.',), 'قم بالتسجيل في التطبيق وانتظر الموافقة من الإدارة.',
),
textAlign: TextAlign.justify, // Align the text textAlign: TextAlign.justify, // Align the text
softWrap: true, softWrap: true,
style: TextStyle(
color:
isDarkTheme ? Colors.white : Color(0xFF898C81)),
), ),
), ),
], ],
@ -114,15 +235,16 @@ class HowUseTheApp extends StatelessWidget {
SizedBox(height: 8), SizedBox(height: 8),
Text( Text(
context.translate( context.translate(
'2. Login and Navigation:', '2. Login and Navigation:',
'2. تسجيل الدخول والتصفح:',), '2. تسجيل الدخول والتصفح:',
),
style: TextStyle( style: TextStyle(
fontFamily: context.translate( fontFamily: context.translate(
'Roboto', 'Roboto',
'NotoKufi', 'NotoKufi',
), ),
fontSize: 16, fontSize: 16,
color: Color(0xFF414042), color: isDarkTheme ? Colors.white : Color(0xFF414042),
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
), ),
), ),
@ -135,17 +257,21 @@ class HowUseTheApp extends StatelessWidget {
child: Icon( child: Icon(
Icons.brightness_1, Icons.brightness_1,
size: 5, size: 5,
color: Color(0xFF414042), color: isDarkTheme ? Colors.white : Color(0xFF414042),
), ),
), // Bullet point ), // Bullet point
SizedBox(width: 8), // Space between bullet and text SizedBox(width: 8), // Space between bullet and text
Expanded( Expanded(
child: Text( child: Text(
context.translate( context.translate(
'Once approved, log in to access the app. Navigate through the categories on the home screen.', 'Once approved, log in to access the app. Navigate through the categories on the home screen.',
'بعد الموافقة، قم بتسجيل الدخول للوصول إلى التطبيق. تصفح الفئات المختلفة على الشاشة الرئيسية.',), 'بعد الموافقة، قم بتسجيل الدخول للوصول إلى التطبيق. تصفح الفئات المختلفة على الشاشة الرئيسية.',
),
textAlign: TextAlign.justify, // Align the text textAlign: TextAlign.justify, // Align the text
softWrap: true, softWrap: true,
style: TextStyle(
color:
isDarkTheme ? Colors.white : Color(0xFF898C81)),
), ),
), ),
], ],
@ -153,15 +279,16 @@ class HowUseTheApp extends StatelessWidget {
SizedBox(height: 8), SizedBox(height: 8),
Text( Text(
context.translate( context.translate(
'3. Access Data:', '3. Access Data:',
'3. الوصول إلى البيانات:',), '3. الوصول إلى البيانات:',
),
style: TextStyle( style: TextStyle(
fontFamily: context.translate( fontFamily: context.translate(
'Roboto', 'Roboto',
'NotoKufi', 'NotoKufi',
), ),
fontSize: 16, fontSize: 16,
color: Color(0xFF414042), color: isDarkTheme ? Colors.white : Color(0xFF414042),
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
), ),
), ),
@ -174,17 +301,21 @@ class HowUseTheApp extends StatelessWidget {
child: Icon( child: Icon(
Icons.brightness_1, Icons.brightness_1,
size: 5, size: 5,
color: Color(0xFF414042), color: isDarkTheme ? Colors.white : Color(0xFF414042),
), ),
), // Bullet point ), // Bullet point
SizedBox(width: 8), // Space between bullet and text SizedBox(width: 8), // Space between bullet and text
Expanded( Expanded(
child: Text( child: Text(
context.translate( context.translate(
'Drill down into specific categories like "Economy" or "Environment" to view detailed KPIs and visual insights.', 'Drill down into specific categories like "Economy" or "Environment" to view detailed KPIs and visual insights.',
'قم بالتعمق في الفئات المحددة مثل "الاقتصاد" أو "البيئة" لعرض مؤشرات الأداء الرئيسية والرؤى المرئية بالتفصيل.',), 'قم بالتعمق في الفئات المحددة مثل "الاقتصاد" أو "البيئة" لعرض مؤشرات الأداء الرئيسية والرؤى المرئية بالتفصيل.',
),
textAlign: TextAlign.justify, // Align the text textAlign: TextAlign.justify, // Align the text
softWrap: true, softWrap: true,
style: TextStyle(
color:
isDarkTheme ? Colors.white : Color(0xFF898C81)),
), ),
), ),
], ],
@ -192,15 +323,16 @@ class HowUseTheApp extends StatelessWidget {
SizedBox(height: 8), SizedBox(height: 8),
Text( Text(
context.translate( context.translate(
'4. Bookmark Metrics:', '4. Bookmark Metrics:',
'4. وضع إشارة مرجعية للمقاييس:',), '4. وضع إشارة مرجعية للمقاييس:',
),
style: TextStyle( style: TextStyle(
fontFamily: context.translate( fontFamily: context.translate(
'Roboto', 'Roboto',
'NotoKufi', 'NotoKufi',
), ),
fontSize: 16, fontSize: 16,
color: Color(0xFF414042), color: isDarkTheme ? Colors.white : Color(0xFF414042),
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
), ),
), ),
@ -213,17 +345,21 @@ class HowUseTheApp extends StatelessWidget {
child: Icon( child: Icon(
Icons.brightness_1, Icons.brightness_1,
size: 5, size: 5,
color: Color(0xFF414042), color: isDarkTheme ? Colors.white : Color(0xFF414042),
), ),
), // Bullet point ), // Bullet point
SizedBox(width: 8), // Space between bullet and text SizedBox(width: 8), // Space between bullet and text
Expanded( Expanded(
child: Text( child: Text(
context.translate( context.translate(
'Drill down into specific categories like "Economy" or "Environment" to view detailed KPIs and visual insights.', 'Drill down into specific categories like "Economy" or "Environment" to view detailed KPIs and visual insights.',
'احفظ الإحصائيات المهمة للرجوع إليها بسهولة.',), 'احفظ الإحصائيات المهمة للرجوع إليها بسهولة.',
),
textAlign: TextAlign.justify, // Align the text textAlign: TextAlign.justify, // Align the text
softWrap: true, softWrap: true,
style: TextStyle(
color:
isDarkTheme ? Colors.white : Color(0xFF898C81)),
), ),
), ),
], ],

View File

@ -1,12 +1,123 @@
import 'dart:convert';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:http/http.dart' as http;
import 'package:uae_stat/config/api_config.dart';
import 'package:uae_stat/config/theme/theme_provider.dart';
import 'package:uae_stat/config/toggle_lang_service.dart';
import 'package:uae_stat/domain/use_cases/language.dart'; import 'package:uae_stat/domain/use_cases/language.dart';
import 'package:uae_stat/presentation/Screens/Bottom%20Navigation%20Pages/Country_Profile/country_profile.dart';
import 'package:uae_stat/presentation/routes/drawer_routes/custom_drawer_routes.dart'; import 'package:uae_stat/presentation/routes/drawer_routes/custom_drawer_routes.dart';
class Purpose extends StatelessWidget { class Purpose extends ConsumerStatefulWidget {
const Purpose({super.key}); const Purpose({super.key});
@override
ConsumerState<Purpose> createState() => _PurposeState();
}
class _PurposeState extends ConsumerState<Purpose> {
//
// class Purpose extends StatelessWidget {
// const Purpose({super.key});
List<dynamic> homePageData = [];
List<dynamic> filteredData = [];
bool isLoading = true;
late UserService _userService;
late ThemeMode currentTheme;
@override
void initState() {
super.initState();
_userService = UserService();
final locale = ref.read(localeProvider);
currentTheme = ref.read(themeProvider);
print('123456789');
print(currentTheme);
WidgetsBinding.instance.addPostFrameCallback((_) {
final isDark = currentTheme == ThemeMode.dark ||
(currentTheme == ThemeMode.system &&
MediaQuery.of(context).platformBrightness == Brightness.dark);
final themeMode = (isDark ? 'dark' : 'light');
print("ThemeMode - $themeMode");
fetchData(locale?.languageCode ?? 'en', themeMode);
});
}
Future<void> fetchData(locale, themeMode) async {
const baseUrl = '$apiUrl/api/getUAENumbersData';
try {
final response = await http
.get(Uri.parse(baseUrl + '?language=$locale&color_mode=$themeMode'));
if (response.statusCode == 200) {
setState(() {
homePageData = (json.decode(response.body) as List)
.map((e) => Map<String, dynamic>.from(e))
.toList();
filteredData = List.from(homePageData);
isLoading = false;
});
} else {
throw Exception('Failed to load data');
}
} catch (e) {
setState(() {
isLoading = false;
});
print('Error fetching data: $e');
}
}
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
ref.listen<Locale?>(localeProvider, (previous, next) async {
final localeCode = next?.languageCode ?? 'en';
setState(() {
isLoading = true;
});
await _userService.updateLanguage(localeCode);
final currentTheme = ref.read(themeProvider);
final isDark = currentTheme == ThemeMode.dark ||
(currentTheme == ThemeMode.system &&
MediaQuery.of(context).platformBrightness == Brightness.dark);
final themeString = isDark ? 'dark' : 'light';
fetchData(localeCode, themeString);
});
ref.listen<ThemeMode>(themeProvider, (previous, next) async {
final localeCode = ref.watch(localeProvider)?.languageCode ?? 'en';
print(localeCode);
// Default to 'en' if null
setState(() {
isLoading = true;
print('isLoadingref $isLoading');
});
final currentTheme = ref.read(themeProvider);
final isDark = currentTheme == ThemeMode.dark ||
(currentTheme == ThemeMode.system &&
MediaQuery.of(context).platformBrightness == Brightness.dark);
final themeString = isDark ? 'dark' : 'light';
print("themeString- $themeString");
fetchData(localeCode, themeString);
});
final themeMode = ref.read(themeProvider);
final isDarkTheme = themeMode == ThemeMode.dark ||
(themeMode == ThemeMode.system &&
MediaQuery.of(context).platformBrightness == Brightness.dark);
print("isDarkTheme - $isDarkTheme");
return Theme( return Theme(
data: ThemeData( data: ThemeData(
fontFamily: context.translate( fontFamily: context.translate(
@ -25,14 +136,16 @@ class Purpose extends StatelessWidget {
), ),
), ),
child: BaseScaffold( child: BaseScaffold(
backgroundColor: isDarkTheme ? Colors.black : Colors.white,
appbarColor: isDarkTheme ? Colors.black : Colors.white,
showDivider: true, showDivider: true,
showBackButton: true, showBackButton: true,
dividerColor: Colors.grey[300], dividerColor: Colors.grey[300],
appbarColor: Colors.white, // appbarColor: Colors.white,
bottomColor: Colors.white, bottomColor: Colors.white,
mycenterTitle: true, mycenterTitle: true,
title: Text( title: Text(
context.translate('Key Features','الميزات الرئيسية'), context.translate('Key Features', 'الميزات الرئيسية'),
style: TextStyle( style: TextStyle(
fontFamily: context.translate( fontFamily: context.translate(
'Roboto', 'Roboto',
@ -46,7 +159,7 @@ class Purpose extends StatelessWidget {
), ),
body: Container( body: Container(
height: double.infinity, height: double.infinity,
color: Colors.white, color: isDarkTheme ? Colors.black : Colors.white,
padding: EdgeInsets.all(16), padding: EdgeInsets.all(16),
child: SingleChildScrollView( child: SingleChildScrollView(
child: Column( child: Column(
@ -55,14 +168,14 @@ class Purpose extends StatelessWidget {
Align( Align(
alignment: Alignment.topLeft, alignment: Alignment.topLeft,
child: Text( child: Text(
context.translate('Purpose of the App','الغرض من التطبيق'), context.translate('Purpose of the App', 'الغرض من التطبيق'),
style: TextStyle( style: TextStyle(
fontFamily: context.translate( fontFamily: context.translate(
'Roboto', 'Roboto',
'NotoKufi', 'NotoKufi',
), ),
fontSize: 20, fontSize: 20,
color: Color(0xFF414042), color: isDarkTheme ? Colors.white : Color(0xFF414042),
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
), ),
), ),
@ -84,35 +197,49 @@ class Purpose extends StatelessWidget {
child: Icon( child: Icon(
Icons.brightness_1, Icons.brightness_1,
size: 5, size: 5,
color: Color(0xFF414042), color: isDarkTheme ? Colors.white : Color(0xFF414042),
), ),
), // Bullet point ), // Bullet point
SizedBox(width: 8), // Space between bullet and text SizedBox(width: 8), // Space between bullet and text
Expanded( Expanded(
child: RichText( child: RichText(
text: TextSpan( text: TextSpan(
text: context.translate('Provide ', text: context.translate(
'توفير الإحصائيات الرسمية لدولة الإمارات بشكل سهل الوصول.',), 'Provide ',
'توفير الإحصائيات الرسمية لدولة الإمارات بشكل سهل الوصول.',
),
style: TextStyle( style: TextStyle(
color: Color(0xFF898C81), color:
fontSize: 16, isDarkTheme ? Colors.white : Color(0xFF898C81),
fontSize: 16,
fontFamily: context.translate( fontFamily: context.translate(
'Roboto', 'Roboto',
'NotoKufi', 'NotoKufi',
),), ),
),
children: <TextSpan>[ children: <TextSpan>[
TextSpan( TextSpan(
text: context.translate('official statistics ',''), text:
context.translate('official statistics ', ''),
style: TextStyle( style: TextStyle(
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
color: Color(0xFF414042), color: isDarkTheme
? Colors.white
: Color(0xFF414042),
fontFamily: context.translate( fontFamily: context.translate(
'Roboto', 'Roboto',
'NotoKufi', 'NotoKufi',
),), ),
),
), ),
TextSpan( TextSpan(
text: context.translate('on the UAE in an accessible format.',''),), text: context.translate(
'on the UAE in an accessible format.', ''),
style: TextStyle(
color: isDarkTheme
? Colors.white
: Color(0xFF898C81)),
),
], ],
), ),
), ),
@ -127,17 +254,21 @@ class Purpose extends StatelessWidget {
child: Icon( child: Icon(
Icons.brightness_1, Icons.brightness_1,
size: 5, size: 5,
color: Color(0xFF414042), color: isDarkTheme ? Colors.white : Color(0xFF414042),
), ),
), // Bullet point ), // Bullet point
SizedBox(width: 8), // Space between bullet and text SizedBox(width: 8), // Space between bullet and text
Expanded( Expanded(
child: Text( child: Text(
context.translate( context.translate(
'Support decision-making and research with reliable, up-to-date data.', 'Support decision-making and research with reliable, up-to-date data.',
'دعم اتخاذ القرارات والبحوث من خلال بيانات موثوقة ومحدثة.',), 'دعم اتخاذ القرارات والبحوث من خلال بيانات موثوقة ومحدثة.',
),
textAlign: TextAlign.justify, // Align the text textAlign: TextAlign.justify, // Align the text
softWrap: true, softWrap: true,
style: TextStyle(
color:
isDarkTheme ? Colors.white : Color(0xFF898C81)),
), ),
), ),
], ],
@ -150,17 +281,21 @@ class Purpose extends StatelessWidget {
child: Icon( child: Icon(
Icons.brightness_1, Icons.brightness_1,
size: 5, size: 5,
color: Color(0xFF414042), color: isDarkTheme ? Colors.white : Color(0xFF414042),
), ),
), // Bullet point ), // Bullet point
SizedBox(width: 8), // Space between bullet and text SizedBox(width: 8), // Space between bullet and text
Expanded( Expanded(
child: Text( child: Text(
context.translate( context.translate(
'Enable users to interact with data visually through graphs and metrics.', 'Enable users to interact with data visually through graphs and metrics.',
'تمكين المستخدمين من التفاعل مع البيانات بصريًا من خلال الرسوم البيانية والمقاييس.',), 'تمكين المستخدمين من التفاعل مع البيانات بصريًا من خلال الرسوم البيانية والمقاييس.',
),
textAlign: TextAlign.justify, // Align the text textAlign: TextAlign.justify, // Align the text
softWrap: true, softWrap: true,
style: TextStyle(
color:
isDarkTheme ? Colors.white : Color(0xFF898C81)),
), ),
), ),
], ],

View File

@ -1,13 +1,121 @@
import 'dart:convert';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:http/http.dart' as http;
import 'package:uae_stat/config/api_config.dart';
import 'package:uae_stat/config/theme/theme_provider.dart';
import 'package:uae_stat/config/toggle_lang_service.dart';
import 'package:uae_stat/domain/use_cases/language.dart'; import 'package:uae_stat/domain/use_cases/language.dart';
import 'package:uae_stat/presentation/Screens/Bottom%20Navigation%20Pages/Country_Profile/country_profile.dart';
import 'package:uae_stat/presentation/routes/drawer_routes/custom_drawer_routes.dart'; import 'package:uae_stat/presentation/routes/drawer_routes/custom_drawer_routes.dart';
class StayUpdate extends StatelessWidget { class StayUpdate extends ConsumerStatefulWidget {
const StayUpdate({super.key}); const StayUpdate({super.key});
@override
ConsumerState<StayUpdate> createState() => _StayUpdateState();
}
class _StayUpdateState extends ConsumerState<StayUpdate> {
// class StayUpdate extends StatelessWidget {
// const StayUpdate({super.key});
List<dynamic> homePageData = [];
List<dynamic> filteredData = [];
bool isLoading = true;
late UserService _userService;
late ThemeMode currentTheme;
@override
void initState() {
super.initState();
_userService = UserService();
final locale = ref.read(localeProvider);
currentTheme = ref.read(themeProvider);
print('123456789');
print(currentTheme);
WidgetsBinding.instance.addPostFrameCallback((_) {
final isDark = currentTheme == ThemeMode.dark ||
(currentTheme == ThemeMode.system &&
MediaQuery.of(context).platformBrightness == Brightness.dark);
final themeMode = (isDark ? 'dark' : 'light');
print("ThemeMode - $themeMode");
fetchData(locale?.languageCode ?? 'en', themeMode);
});
}
Future<void> fetchData(locale, themeMode) async {
const baseUrl = '$apiUrl/api/getUAENumbersData';
try {
final response = await http
.get(Uri.parse(baseUrl + '?language=$locale&color_mode=$themeMode'));
if (response.statusCode == 200) {
setState(() {
homePageData = (json.decode(response.body) as List)
.map((e) => Map<String, dynamic>.from(e))
.toList();
filteredData = List.from(homePageData);
isLoading = false;
});
} else {
throw Exception('Failed to load data');
}
} catch (e) {
setState(() {
isLoading = false;
});
print('Error fetching data: $e');
}
}
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
ref.listen<Locale?>(localeProvider, (previous, next) async {
final localeCode = next?.languageCode ?? 'en';
setState(() {
isLoading = true;
});
await _userService.updateLanguage(localeCode);
final currentTheme = ref.read(themeProvider);
final isDark = currentTheme == ThemeMode.dark ||
(currentTheme == ThemeMode.system &&
MediaQuery.of(context).platformBrightness == Brightness.dark);
final themeString = isDark ? 'dark' : 'light';
fetchData(localeCode, themeString);
});
ref.listen<ThemeMode>(themeProvider, (previous, next) async {
final localeCode = ref.watch(localeProvider)?.languageCode ?? 'en';
print(localeCode);
// Default to 'en' if null
setState(() {
isLoading = true;
print('isLoadingref $isLoading');
});
final currentTheme = ref.read(themeProvider);
final isDark = currentTheme == ThemeMode.dark ||
(currentTheme == ThemeMode.system &&
MediaQuery.of(context).platformBrightness == Brightness.dark);
final themeString = isDark ? 'dark' : 'light';
print("themeString- $themeString");
fetchData(localeCode, themeString);
});
final themeMode = ref.read(themeProvider);
final isDarkTheme = themeMode == ThemeMode.dark ||
(themeMode == ThemeMode.system &&
MediaQuery.of(context).platformBrightness == Brightness.dark);
print("isDarkTheme - $isDarkTheme");
return Theme( return Theme(
data: ThemeData( data: ThemeData(
fontFamily: context.translate( fontFamily: context.translate(
@ -29,11 +137,13 @@ class StayUpdate extends StatelessWidget {
showDivider: true, showDivider: true,
showBackButton: true, showBackButton: true,
dividerColor: Colors.grey[300], dividerColor: Colors.grey[300],
appbarColor: Colors.white, backgroundColor: isDarkTheme ? Colors.black : Colors.white,
appbarColor: isDarkTheme ? Colors.black : Colors.white,
// appbarColor: Colors.white,
bottomColor: Colors.white, bottomColor: Colors.white,
mycenterTitle: true, mycenterTitle: true,
title: Text( title: Text(
context.translate('Key Features','الميزات الرئيسية'), context.translate('Key Features', 'الميزات الرئيسية'),
style: TextStyle( style: TextStyle(
fontFamily: context.translate( fontFamily: context.translate(
'Roboto', 'Roboto',
@ -47,7 +157,7 @@ class StayUpdate extends StatelessWidget {
), ),
body: Container( body: Container(
height: double.infinity, height: double.infinity,
color: Colors.white, color: isDarkTheme ? Colors.black : Colors.white,
padding: EdgeInsets.all(16), padding: EdgeInsets.all(16),
child: SingleChildScrollView( child: SingleChildScrollView(
child: Column( child: Column(
@ -56,14 +166,14 @@ class StayUpdate extends StatelessWidget {
Align( Align(
alignment: Alignment.topLeft, alignment: Alignment.topLeft,
child: Text( child: Text(
context.translate('Stay Updated','ابقَ على اطلاع'), context.translate('Stay Updated', 'ابقَ على اطلاع'),
style: TextStyle( style: TextStyle(
fontFamily: context.translate( fontFamily: context.translate(
'Roboto', 'Roboto',
'NotoKufi', 'NotoKufi',
), ),
fontSize: 20, fontSize: 20,
color: Color(0xFF414042), color: isDarkTheme ? Colors.white : Color(0xFF414042),
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
), ),
), ),
@ -85,17 +195,21 @@ class StayUpdate extends StatelessWidget {
child: Icon( child: Icon(
Icons.brightness_1, Icons.brightness_1,
size: 5, size: 5,
color: Color(0xFF414042), color: isDarkTheme ? Colors.white : Color(0xFF414042),
), ),
), // Bullet point ), // Bullet point
SizedBox(width: 8), // Space between bullet and text SizedBox(width: 8), // Space between bullet and text
Expanded( Expanded(
child: Text( child: Text(
context.translate( context.translate(
'The app regularly updates datasets and features to reflect the latest information. Notifications will alert you about new data or improvements.', 'The app regularly updates datasets and features to reflect the latest information. Notifications will alert you about new data or improvements.',
'يتم تحديث مجموعات البيانات وميزات التطبيق بانتظام لتعكس أحدث المعلومات. ستتلقى إشعارات تنبهك حول البيانات الجديدة والتحسينات.',), 'يتم تحديث مجموعات البيانات وميزات التطبيق بانتظام لتعكس أحدث المعلومات. ستتلقى إشعارات تنبهك حول البيانات الجديدة والتحسينات.',
),
textAlign: TextAlign.justify, // Align the text textAlign: TextAlign.justify, // Align the text
softWrap: true, softWrap: true,
style: TextStyle(
color:
isDarkTheme ? Colors.white : Color(0xFF898C81)),
), ),
), ),
], ],

View File

@ -1,12 +1,121 @@
import 'dart:convert';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:http/http.dart' as http;
import 'package:uae_stat/config/api_config.dart';
import 'package:uae_stat/config/theme/theme_provider.dart';
import 'package:uae_stat/config/toggle_lang_service.dart';
import 'package:uae_stat/domain/use_cases/language.dart'; import 'package:uae_stat/domain/use_cases/language.dart';
import 'package:uae_stat/presentation/Screens/Bottom%20Navigation%20Pages/Country_Profile/country_profile.dart';
import 'package:uae_stat/presentation/routes/drawer_routes/custom_drawer_routes.dart'; import 'package:uae_stat/presentation/routes/drawer_routes/custom_drawer_routes.dart';
class WhoUseTheApp extends StatelessWidget { class WhoUseTheApp extends ConsumerStatefulWidget {
const WhoUseTheApp({super.key}); const WhoUseTheApp({super.key});
@override
ConsumerState<WhoUseTheApp> createState() => _WhoUseTheAppState();
}
class _WhoUseTheAppState extends ConsumerState<WhoUseTheApp> {
// class WhoUseTheApp extends StatelessWidget {
// const WhoUseTheApp({super.key});
List<dynamic> homePageData = [];
List<dynamic> filteredData = [];
bool isLoading = true;
late UserService _userService;
late ThemeMode currentTheme;
@override
void initState() {
super.initState();
_userService = UserService();
final locale = ref.read(localeProvider);
currentTheme = ref.read(themeProvider);
print('123456789');
print(currentTheme);
WidgetsBinding.instance.addPostFrameCallback((_) {
final isDark = currentTheme == ThemeMode.dark ||
(currentTheme == ThemeMode.system &&
MediaQuery.of(context).platformBrightness == Brightness.dark);
final themeMode = (isDark ? 'dark' : 'light');
print("ThemeMode - $themeMode");
fetchData(locale?.languageCode ?? 'en', themeMode);
});
}
Future<void> fetchData(locale, themeMode) async {
const baseUrl = '$apiUrl/api/getUAENumbersData';
try {
final response = await http
.get(Uri.parse(baseUrl + '?language=$locale&color_mode=$themeMode'));
if (response.statusCode == 200) {
setState(() {
homePageData = (json.decode(response.body) as List)
.map((e) => Map<String, dynamic>.from(e))
.toList();
filteredData = List.from(homePageData);
isLoading = false;
});
} else {
throw Exception('Failed to load data');
}
} catch (e) {
setState(() {
isLoading = false;
});
print('Error fetching data: $e');
}
}
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
ref.listen<Locale?>(localeProvider, (previous, next) async {
final localeCode = next?.languageCode ?? 'en';
setState(() {
isLoading = true;
});
await _userService.updateLanguage(localeCode);
final currentTheme = ref.read(themeProvider);
final isDark = currentTheme == ThemeMode.dark ||
(currentTheme == ThemeMode.system &&
MediaQuery.of(context).platformBrightness == Brightness.dark);
final themeString = isDark ? 'dark' : 'light';
fetchData(localeCode, themeString);
});
ref.listen<ThemeMode>(themeProvider, (previous, next) async {
final localeCode = ref.watch(localeProvider)?.languageCode ?? 'en';
print(localeCode);
// Default to 'en' if null
setState(() {
isLoading = true;
print('isLoadingref $isLoading');
});
final currentTheme = ref.read(themeProvider);
final isDark = currentTheme == ThemeMode.dark ||
(currentTheme == ThemeMode.system &&
MediaQuery.of(context).platformBrightness == Brightness.dark);
final themeString = isDark ? 'dark' : 'light';
print("themeString- $themeString");
fetchData(localeCode, themeString);
});
final themeMode = ref.read(themeProvider);
final isDarkTheme = themeMode == ThemeMode.dark ||
(themeMode == ThemeMode.system &&
MediaQuery.of(context).platformBrightness == Brightness.dark);
print("isDarkTheme - $isDarkTheme");
return Theme( return Theme(
data: ThemeData( data: ThemeData(
fontFamily: context.translate( fontFamily: context.translate(
@ -14,22 +123,27 @@ class WhoUseTheApp extends StatelessWidget {
'NotoKufi', 'NotoKufi',
), // Set default font family for this page ), // Set default font family for this page
textTheme: TextTheme( textTheme: TextTheme(
bodyMedium: TextStyle(fontSize: 16, color: Color(0xFF898C81),fontFamily: context.translate( bodyMedium: TextStyle(
'Roboto', fontSize: 16,
'NotoKufi', color: Color(0xFF898C81),
), fontFamily: context.translate(
'Roboto',
'NotoKufi',
),
), ),
), ),
), ),
child: BaseScaffold( child: BaseScaffold(
backgroundColor: isDarkTheme ? Colors.black : Colors.white,
appbarColor: isDarkTheme ? Colors.black : Colors.white,
showDivider: true, showDivider: true,
showBackButton: true, showBackButton: true,
dividerColor: Colors.grey[300], dividerColor: Colors.grey[300],
appbarColor: Colors.white, // appbarColor: Colors.white,
bottomColor: Colors.white, bottomColor: Colors.white,
mycenterTitle: true, mycenterTitle: true,
title: Text( title: Text(
context.translate('Key Features','الميزات الرئيسية'), context.translate('Key Features', 'الميزات الرئيسية'),
style: TextStyle( style: TextStyle(
fontFamily: context.translate( fontFamily: context.translate(
'Roboto', 'Roboto',
@ -43,7 +157,7 @@ class WhoUseTheApp extends StatelessWidget {
), ),
body: Container( body: Container(
height: double.infinity, height: double.infinity,
color: Colors.white, color: isDarkTheme ? Colors.black : Colors.white,
padding: EdgeInsets.all(16), padding: EdgeInsets.all(16),
child: SingleChildScrollView( child: SingleChildScrollView(
child: Column( child: Column(
@ -52,14 +166,15 @@ class WhoUseTheApp extends StatelessWidget {
Align( Align(
alignment: Alignment.topLeft, alignment: Alignment.topLeft,
child: Text( child: Text(
context.translate('Who can use the App?','من يمكنه استخدام التطبيق؟'), context.translate(
'Who can use the App?', 'من يمكنه استخدام التطبيق؟'),
style: TextStyle( style: TextStyle(
fontFamily: context.translate( fontFamily: context.translate(
'Roboto', 'Roboto',
'NotoKufi', 'NotoKufi',
), ),
fontSize: 20, fontSize: 20,
color: Color(0xFF414042), color: isDarkTheme ? Colors.white : Color(0xFF414042),
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
), ),
), ),
@ -73,14 +188,15 @@ class WhoUseTheApp extends StatelessWidget {
), ),
), ),
Text( Text(
context.translate('This app is intended for:','يستهدف هذا التطبيق:'), context.translate(
'This app is intended for:', 'يستهدف هذا التطبيق:'),
style: TextStyle( style: TextStyle(
fontFamily: context.translate( fontFamily: context.translate(
'Roboto', 'Roboto',
'NotoKufi', 'NotoKufi',
), ),
fontSize: 16, fontSize: 16,
color: Color(0xFF414042), color: isDarkTheme ? Colors.white : Color(0xFF414042),
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
), ),
), ),
@ -93,17 +209,21 @@ class WhoUseTheApp extends StatelessWidget {
child: Icon( child: Icon(
Icons.brightness_1, Icons.brightness_1,
size: 5, size: 5,
color: Color(0xFF414042), color: isDarkTheme ? Colors.white : Color(0xFF414042),
), ),
), // Bullet point ), // Bullet point
SizedBox(width: 8), // Space between bullet and text SizedBox(width: 8), // Space between bullet and text
Expanded( Expanded(
child: Text( child: Text(
context.translate( context.translate(
'Government officials requiring UAE statistics for decision-making.', 'Government officials requiring UAE statistics for decision-making.',
'المسؤولين الحكوميين الذين يحتاجون إلى إحصاءات دولة الإمارات العربية المتحدة لاتخاذ القرارات.',), 'المسؤولين الحكوميين الذين يحتاجون إلى إحصاءات دولة الإمارات العربية المتحدة لاتخاذ القرارات.',
textAlign: TextAlign.justify, // Align the text ),
textAlign: TextAlign.justify, // Align the text
softWrap: true, softWrap: true,
style: TextStyle(
color:
isDarkTheme ? Colors.white : Color(0xFF898C81)),
), ),
), ),
], ],
@ -116,17 +236,21 @@ class WhoUseTheApp extends StatelessWidget {
child: Icon( child: Icon(
Icons.brightness_1, Icons.brightness_1,
size: 5, size: 5,
color: Color(0xFF414042), color: isDarkTheme ? Colors.white : Color(0xFF414042),
), ),
), // Bullet point ), // Bullet point
SizedBox(width: 8), // Space between bullet and text SizedBox(width: 8), // Space between bullet and text
Expanded( Expanded(
child: Text( child: Text(
context.translate( context.translate(
'Business professionals and researchers analyzing market trends.', 'Business professionals and researchers analyzing market trends.',
'المتخصصين في مجال الأعمال والباحثين الذين يقومون بتحليل اتجاهات السوق.',), 'المتخصصين في مجال الأعمال والباحثين الذين يقومون بتحليل اتجاهات السوق.',
),
textAlign: TextAlign.justify, // Align the text textAlign: TextAlign.justify, // Align the text
softWrap: true, softWrap: true,
style: TextStyle(
color:
isDarkTheme ? Colors.white : Color(0xFF898C81)),
), ),
), ),
], ],
@ -139,22 +263,25 @@ class WhoUseTheApp extends StatelessWidget {
child: Icon( child: Icon(
Icons.brightness_1, Icons.brightness_1,
size: 5, size: 5,
color: Color(0xFF414042), color: isDarkTheme ? Colors.white : Color(0xFF414042),
), ),
), // Bullet point ), // Bullet point
SizedBox(width: 8), // Space between bullet and text SizedBox(width: 8), // Space between bullet and text
Expanded( Expanded(
child: Text( child: Text(
context.translate( context.translate(
'Students and educators needing reliable data for study and teaching.', 'Students and educators needing reliable data for study and teaching.',
'الطلاب والمعلمين الذين يحتاجون إلى بيانات موثوقة للدراسة والتعليم.',), 'الطلاب والمعلمين الذين يحتاجون إلى بيانات موثوقة للدراسة والتعليم.',
),
textAlign: TextAlign.justify, // Align the text textAlign: TextAlign.justify, // Align the text
softWrap: true, softWrap: true,
style: TextStyle(
color:
isDarkTheme ? Colors.white : Color(0xFF898C81)),
), ),
), ),
], ],
), ),
SizedBox( SizedBox(
height: 20, height: 20,
), ),

View File

@ -1,23 +1,131 @@
import 'dart:convert';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:go_router/go_router.dart'; import 'package:go_router/go_router.dart';
import 'package:http/http.dart' as http;
import 'package:uae_stat/config/api_config.dart';
import 'package:uae_stat/config/theme/theme_provider.dart';
import 'package:uae_stat/config/toggle_lang_service.dart';
import 'package:uae_stat/domain/use_cases/language.dart'; import 'package:uae_stat/domain/use_cases/language.dart';
import 'package:uae_stat/presentation/Screens/Bottom%20Navigation%20Pages/Country_Profile/country_profile.dart';
import 'package:uae_stat/presentation/routes/drawer_routes/custom_drawer_routes.dart'; import 'package:uae_stat/presentation/routes/drawer_routes/custom_drawer_routes.dart';
class aboutTheApp extends ConsumerStatefulWidget {
class aboutTheApp extends StatelessWidget {
const aboutTheApp({super.key}); const aboutTheApp({super.key});
@override
ConsumerState<aboutTheApp> createState() => _aboutTheAppState();
}
class _aboutTheAppState extends ConsumerState<aboutTheApp> {
// class aboutTheApp extends StatelessWidget {
// aboutTheApp({super.key});
List<dynamic> homePageData = [];
List<dynamic> filteredData = [];
bool isLoading = true;
late UserService _userService;
late ThemeMode currentTheme;
@override
void initState() {
super.initState();
_userService = UserService();
final locale = ref.read(localeProvider);
currentTheme = ref.read(themeProvider);
print('123456789');
print(currentTheme);
WidgetsBinding.instance.addPostFrameCallback((_) {
final isDark = currentTheme == ThemeMode.dark ||
(currentTheme == ThemeMode.system &&
MediaQuery.of(context).platformBrightness == Brightness.dark);
final themeMode = (isDark ? 'dark' : 'light');
print("ThemeMode - $themeMode");
fetchData(locale?.languageCode ?? 'en', themeMode);
});
}
Future<void> fetchData(locale, themeMode) async {
const baseUrl = '$apiUrl/api/getUAENumbersData';
try {
final response = await http
.get(Uri.parse(baseUrl + '?language=$locale&color_mode=$themeMode'));
if (response.statusCode == 200) {
setState(() {
homePageData = (json.decode(response.body) as List)
.map((e) => Map<String, dynamic>.from(e))
.toList();
filteredData = List.from(homePageData);
isLoading = false;
});
} else {
throw Exception('Failed to load data');
}
} catch (e) {
setState(() {
isLoading = false;
});
print('Error fetching data: $e');
}
}
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
ref.listen<Locale?>(localeProvider, (previous, next) async {
final localeCode = next?.languageCode ?? 'en';
setState(() {
isLoading = true;
});
await _userService.updateLanguage(localeCode);
final currentTheme = ref.read(themeProvider);
final isDark = currentTheme == ThemeMode.dark ||
(currentTheme == ThemeMode.system &&
MediaQuery.of(context).platformBrightness == Brightness.dark);
final themeString = isDark ? 'dark' : 'light';
fetchData(localeCode, themeString);
});
ref.listen<ThemeMode>(themeProvider, (previous, next) async {
final localeCode = ref.watch(localeProvider)?.languageCode ?? 'en';
print(localeCode);
// Default to 'en' if null
setState(() {
isLoading = true;
print('isLoadingref $isLoading');
});
final currentTheme = ref.read(themeProvider);
final isDark = currentTheme == ThemeMode.dark ||
(currentTheme == ThemeMode.system &&
MediaQuery.of(context).platformBrightness == Brightness.dark);
final themeString = isDark ? 'dark' : 'light';
print("themeString- $themeString");
fetchData(localeCode, themeString);
});
final themeMode = ref.read(themeProvider);
final isDarkTheme = themeMode == ThemeMode.dark ||
(themeMode == ThemeMode.system &&
MediaQuery.of(context).platformBrightness == Brightness.dark);
print("isDarkTheme - $isDarkTheme");
return BaseScaffold( return BaseScaffold(
backgroundColor: isDarkTheme ? Colors.black : Colors.white,
appbarColor: isDarkTheme ? Colors.black : Colors.white,
showDivider: true, showDivider: true,
showBackButton: true, showBackButton: true,
bottomColor: Colors.white, bottomColor: Colors.white,
dividerColor: Colors.grey[300], dividerColor: Colors.grey[300],
appbarColor: Colors.white,
mycenterTitle: true, mycenterTitle: true,
title: Text( title: Text(
context.translate('Getting Started','البدء'), context.translate('Getting Started', 'البدء'),
style: TextStyle( style: TextStyle(
fontSize: 22, fontSize: 22,
fontFamily: context.translate( fontFamily: context.translate(
@ -31,15 +139,16 @@ class aboutTheApp extends StatelessWidget {
), ),
body: Container( body: Container(
width: double.infinity, width: double.infinity,
color: Colors.white, color: isDarkTheme ? Colors.black : Colors.white,
child: Column( child: Column(
children: [ children: [
Container( Container(
decoration: BoxDecoration( decoration: BoxDecoration(
border: Border( border: Border(
bottom: BorderSide( bottom: BorderSide(
color: Colors.grey.shade300, color: Colors.grey.shade300,
width: 0.5,), // Grey bottom line width: 0.5,
), // Grey bottom line
), ),
), ),
child: ListTile( child: ListTile(
@ -48,10 +157,10 @@ class aboutTheApp extends StatelessWidget {
}, },
tileColor: Colors.white, tileColor: Colors.white,
title: Text( title: Text(
context.translate('About FCSC','حول التطبيق'), context.translate('About FCSC', 'حول التطبيق'),
style: TextStyle( style: TextStyle(
fontSize: 16, fontSize: 16,
color: Color(0xFF414042), color: isDarkTheme ? Colors.white : Color(0xFF414042),
fontWeight: FontWeight.w500, fontWeight: FontWeight.w500,
fontFamily: context.translate( fontFamily: context.translate(
'Roboto', 'Roboto',
@ -59,15 +168,19 @@ class aboutTheApp extends StatelessWidget {
), ),
), ),
), ),
trailing: Icon(Icons.keyboard_arrow_right), trailing: Icon(
Icons.keyboard_arrow_right,
color: isDarkTheme ? Colors.white : Color(0xFF414042),
),
), ),
), ),
Container( Container(
decoration: BoxDecoration( decoration: BoxDecoration(
border: Border( border: Border(
bottom: BorderSide( bottom: BorderSide(
color: Colors.grey.shade300, color: Colors.grey.shade300,
width: 0.5,), // Grey bottom line width: 0.5,
), // Grey bottom line
), ),
), ),
child: ListTile( child: ListTile(
@ -76,10 +189,10 @@ class aboutTheApp extends StatelessWidget {
}, },
// tileColor: Colors.white, // tileColor: Colors.white,
title: Text( title: Text(
context.translate('How to Get Started?','كيفية البدء'), context.translate('How to Get Started?', 'كيفية البدء'),
style: TextStyle( style: TextStyle(
fontSize: 16, fontSize: 16,
color: Color(0xFF414042), color: isDarkTheme ? Colors.white : Color(0xFF414042),
fontWeight: FontWeight.w500, fontWeight: FontWeight.w500,
fontFamily: context.translate( fontFamily: context.translate(
'Roboto', 'Roboto',
@ -87,10 +200,15 @@ class aboutTheApp extends StatelessWidget {
), ),
), ),
), ),
trailing: Icon(Icons.keyboard_arrow_right), trailing: Icon(
Icons.keyboard_arrow_right,
color: isDarkTheme ? Colors.white : Color(0xFF414042),
),
shape: Border( shape: Border(
bottom: BorderSide( bottom: BorderSide(
color: Colors.black, width: 3,), // Grey bottom line color: Colors.black,
width: 3,
), // Grey bottom line
), ),
), ),
), ),

View File

@ -1,32 +1,140 @@
import 'dart:convert';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:go_router/go_router.dart'; import 'package:go_router/go_router.dart';
import 'package:http/http.dart' as http;
import 'package:uae_stat/config/api_config.dart';
import 'package:uae_stat/config/theme/theme_provider.dart';
import 'package:uae_stat/config/toggle_lang_service.dart';
import 'package:uae_stat/domain/use_cases/language.dart'; import 'package:uae_stat/domain/use_cases/language.dart';
import 'package:uae_stat/presentation/Screens/Bottom%20Navigation%20Pages/Country_Profile/country_profile.dart';
import 'package:uae_stat/presentation/routes/drawer_routes/custom_drawer_routes.dart'; import 'package:uae_stat/presentation/routes/drawer_routes/custom_drawer_routes.dart';
import 'package:uae_stat/infrastructure/services/img_asset_paths/banner_asset_path.dart'; import 'package:uae_stat/infrastructure/services/img_asset_paths/banner_asset_path.dart';
class UsingFeatures extends StatelessWidget { class UsingFeatures extends ConsumerStatefulWidget {
const UsingFeatures({super.key}); const UsingFeatures({super.key});
@override
ConsumerState<UsingFeatures> createState() => _UsingFeaturesState();
}
class _UsingFeaturesState extends ConsumerState<UsingFeatures> {
// class UsingFeatures extends StatelessWidget {
// const UsingFeatures({super.key});
List<dynamic> homePageData = [];
List<dynamic> filteredData = [];
bool isLoading = true;
late UserService _userService;
late ThemeMode currentTheme;
@override
void initState() {
super.initState();
_userService = UserService();
final locale = ref.read(localeProvider);
currentTheme = ref.read(themeProvider);
print('123456789');
print(currentTheme);
WidgetsBinding.instance.addPostFrameCallback((_) {
final isDark = currentTheme == ThemeMode.dark ||
(currentTheme == ThemeMode.system &&
MediaQuery.of(context).platformBrightness == Brightness.dark);
final themeMode = (isDark ? 'dark' : 'light');
print("ThemeMode - $themeMode");
fetchData(locale?.languageCode ?? 'en', themeMode);
});
}
Future<void> fetchData(locale, themeMode) async {
const baseUrl = '$apiUrl/api/getUAENumbersData';
try {
final response = await http
.get(Uri.parse(baseUrl + '?language=$locale&color_mode=$themeMode'));
if (response.statusCode == 200) {
setState(() {
homePageData = (json.decode(response.body) as List)
.map((e) => Map<String, dynamic>.from(e))
.toList();
filteredData = List.from(homePageData);
isLoading = false;
});
} else {
throw Exception('Failed to load data');
}
} catch (e) {
setState(() {
isLoading = false;
});
print('Error fetching data: $e');
}
}
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
ref.listen<Locale?>(localeProvider, (previous, next) async {
final localeCode = next?.languageCode ?? 'en';
setState(() {
isLoading = true;
});
await _userService.updateLanguage(localeCode);
final currentTheme = ref.read(themeProvider);
final isDark = currentTheme == ThemeMode.dark ||
(currentTheme == ThemeMode.system &&
MediaQuery.of(context).platformBrightness == Brightness.dark);
final themeString = isDark ? 'dark' : 'light';
fetchData(localeCode, themeString);
});
ref.listen<ThemeMode>(themeProvider, (previous, next) async {
final localeCode = ref.watch(localeProvider)?.languageCode ?? 'en';
print(localeCode);
// Default to 'en' if null
setState(() {
isLoading = true;
print('isLoadingref $isLoading');
});
final currentTheme = ref.read(themeProvider);
final isDark = currentTheme == ThemeMode.dark ||
(currentTheme == ThemeMode.system &&
MediaQuery.of(context).platformBrightness == Brightness.dark);
final themeString = isDark ? 'dark' : 'light';
print("themeString- $themeString");
fetchData(localeCode, themeString);
});
final themeMode = ref.read(themeProvider);
final isDarkTheme = themeMode == ThemeMode.dark ||
(themeMode == ThemeMode.system &&
MediaQuery.of(context).platformBrightness == Brightness.dark);
print("isDarkTheme - $isDarkTheme");
return BaseScaffold( return BaseScaffold(
showDivider: true, showDivider: true,
showBackButton: true, showBackButton: true,
dividerColor: Colors.grey[300], dividerColor: Colors.grey[300],
bottomColor: Colors.white, bottomColor: Colors.white,
appbarColor: Colors.white, backgroundColor: isDarkTheme ? Colors.black : Colors.white,
appbarColor: isDarkTheme ? Colors.black : Colors.white,
// appbarColor: Colors.white,
mycenterTitle: true, mycenterTitle: true,
title: Text( title: Text(
context.translate('Key Features','الميزات الرئيسية'), context.translate('Key Features', 'الميزات الرئيسية'),
style: TextStyle( style: TextStyle(
fontSize: 22, fontSize: 22,
fontFamily: context.translate( fontFamily: context.translate(
'Roboto', 'Roboto',
'NotoKufi', 'NotoKufi',
), ),
color: Color(0xFF7DAFBC), color: Color(0xFF7DAFBC),
fontWeight: FontWeight.w500, fontWeight: FontWeight.w500,
// fontWeight: FontWeight.w500, // fontWeight: FontWeight.w500,
@ -34,7 +142,7 @@ class UsingFeatures extends StatelessWidget {
), ),
body: Container( body: Container(
width: double.infinity, width: double.infinity,
color: Colors.white, color: isDarkTheme ? Colors.black : Colors.white,
child: Column( child: Column(
children: [ children: [
Container( Container(
@ -49,12 +157,12 @@ class UsingFeatures extends StatelessWidget {
onTap: () { onTap: () {
context.push('/user-guide/features/appFeatures'); context.push('/user-guide/features/appFeatures');
}, },
tileColor: Colors.white, tileColor: isDarkTheme ? Colors.grey : Colors.white,
title: Text( title: Text(
context.translate('App Features','الميزات الرئيسية '), context.translate('App Features', 'الميزات الرئيسية '),
style: TextStyle( style: TextStyle(
fontSize: 16, fontSize: 16,
color: Color(0xFF414042), color: isDarkTheme ? Colors.white : Color(0xFF414042),
fontWeight: FontWeight.w500, fontWeight: FontWeight.w500,
fontFamily: context.translate( fontFamily: context.translate(
'Roboto', 'Roboto',
@ -62,7 +170,10 @@ class UsingFeatures extends StatelessWidget {
), ),
), ),
), ),
trailing: Icon(Icons.keyboard_arrow_right), trailing: Icon(
Icons.keyboard_arrow_right,
color: isDarkTheme ? Colors.white : Color(0xFF414042),
),
), ),
), ),
Container( Container(
@ -79,10 +190,11 @@ class UsingFeatures extends StatelessWidget {
}, },
// tileColor: Colors.white, // tileColor: Colors.white,
title: Text( title: Text(
context.translate('Who can use The App?','يمكنه استخدام التطبيق?'), context.translate(
'Who can use The App?', 'يمكنه استخدام التطبيق?'),
style: TextStyle( style: TextStyle(
fontSize: 16, fontSize: 16,
color: Color(0xFF414042), color: isDarkTheme ? Colors.white : Color(0xFF414042),
fontWeight: FontWeight.w500, fontWeight: FontWeight.w500,
fontFamily: context.translate( fontFamily: context.translate(
'Roboto', 'Roboto',
@ -90,7 +202,10 @@ class UsingFeatures extends StatelessWidget {
), ),
), ),
), ),
trailing: Icon(Icons.keyboard_arrow_right), trailing: Icon(
Icons.keyboard_arrow_right,
color: isDarkTheme ? Colors.white : Color(0xFF414042),
),
shape: Border( shape: Border(
bottom: BorderSide( bottom: BorderSide(
color: Colors.black, width: 3), // Grey bottom line color: Colors.black, width: 3), // Grey bottom line
@ -111,10 +226,10 @@ class UsingFeatures extends StatelessWidget {
}, },
// tileColor: Colors.white, // tileColor: Colors.white,
title: Text( title: Text(
context.translate('Purpose of the App','ض من التطبيق'), context.translate('Purpose of the App', 'ض من التطبيق'),
style: TextStyle( style: TextStyle(
fontSize: 16, fontSize: 16,
color: Color(0xFF414042), color: isDarkTheme ? Colors.white : Color(0xFF414042),
fontWeight: FontWeight.w500, fontWeight: FontWeight.w500,
fontFamily: context.translate( fontFamily: context.translate(
'Roboto', 'Roboto',
@ -122,7 +237,10 @@ class UsingFeatures extends StatelessWidget {
), ),
), ),
), ),
trailing: Icon(Icons.keyboard_arrow_right), trailing: Icon(
Icons.keyboard_arrow_right,
color: isDarkTheme ? Colors.white : Color(0xFF414042),
),
shape: Border( shape: Border(
bottom: BorderSide( bottom: BorderSide(
color: Colors.black, width: 3), // Grey bottom line color: Colors.black, width: 3), // Grey bottom line
@ -143,10 +261,11 @@ class UsingFeatures extends StatelessWidget {
}, },
// tileColor: Colors.white, // tileColor: Colors.white,
title: Text( title: Text(
context.translate('How to Use the App','كيفية استخدام التطبيق'), context.translate(
'How to Use the App', 'كيفية استخدام التطبيق'),
style: TextStyle( style: TextStyle(
fontSize: 16, fontSize: 16,
color: Color(0xFF414042), color: isDarkTheme ? Colors.white : Color(0xFF414042),
fontWeight: FontWeight.w500, fontWeight: FontWeight.w500,
fontFamily: context.translate( fontFamily: context.translate(
'Roboto', 'Roboto',
@ -154,7 +273,10 @@ class UsingFeatures extends StatelessWidget {
), ),
), ),
), ),
trailing: Icon(Icons.keyboard_arrow_right), trailing: Icon(
Icons.keyboard_arrow_right,
color: isDarkTheme ? Colors.white : Color(0xFF414042),
),
shape: Border( shape: Border(
bottom: BorderSide( bottom: BorderSide(
color: Colors.black, width: 3), // Grey bottom line color: Colors.black, width: 3), // Grey bottom line
@ -175,10 +297,10 @@ class UsingFeatures extends StatelessWidget {
}, },
// tileColor: Colors.white, // tileColor: Colors.white,
title: Text( title: Text(
context.translate('Stay Updated','ابق على اطلاع'), context.translate('Stay Updated', 'ابق على اطلاع'),
style: TextStyle( style: TextStyle(
fontSize: 16, fontSize: 16,
color: Color(0xFF414042), color: isDarkTheme ? Colors.white : Color(0xFF414042),
fontWeight: FontWeight.w500, fontWeight: FontWeight.w500,
fontFamily: context.translate( fontFamily: context.translate(
'Roboto', 'Roboto',
@ -186,7 +308,10 @@ class UsingFeatures extends StatelessWidget {
), ),
), ),
), ),
trailing: Icon(Icons.keyboard_arrow_right), trailing: Icon(
Icons.keyboard_arrow_right,
color: isDarkTheme ? Colors.white : Color(0xFF414042),
),
shape: Border( shape: Border(
bottom: BorderSide( bottom: BorderSide(
color: Colors.black, width: 3), // Grey bottom line color: Colors.black, width: 3), // Grey bottom line
@ -207,10 +332,11 @@ class UsingFeatures extends StatelessWidget {
}, },
// tileColor: Colors.white, // tileColor: Colors.white,
title: Text( title: Text(
context.translate('How to Change My Password','كيفية تغيير كلمة المرور الخاصة بي'), context.translate('How to Change My Password',
'كيفية تغيير كلمة المرور الخاصة بي'),
style: TextStyle( style: TextStyle(
fontSize: 16, fontSize: 16,
color: Color(0xFF414042), color: isDarkTheme ? Colors.white : Color(0xFF414042),
fontWeight: FontWeight.w500, fontWeight: FontWeight.w500,
fontFamily: context.translate( fontFamily: context.translate(
'Roboto', 'Roboto',
@ -218,7 +344,10 @@ class UsingFeatures extends StatelessWidget {
), ),
), ),
), ),
trailing: Icon(Icons.keyboard_arrow_right), trailing: Icon(
Icons.keyboard_arrow_right,
color: isDarkTheme ? Colors.white : Color(0xFF414042),
),
shape: Border( shape: Border(
bottom: BorderSide( bottom: BorderSide(
color: Colors.black, width: 3), // Grey bottom line color: Colors.black, width: 3), // Grey bottom line
@ -239,10 +368,11 @@ class UsingFeatures extends StatelessWidget {
}, },
// tileColor: Colors.white, // tileColor: Colors.white,
title: Text( title: Text(
context.translate('How to Edit My Profile','كيفية تعديل ملفي الشخصي'), context.translate(
'How to Edit My Profile', 'كيفية تعديل ملفي الشخصي'),
style: TextStyle( style: TextStyle(
fontSize: 16, fontSize: 16,
color: Color(0xFF414042), color: isDarkTheme ? Colors.white : Color(0xFF414042),
fontWeight: FontWeight.w500, fontWeight: FontWeight.w500,
fontFamily: context.translate( fontFamily: context.translate(
'Roboto', 'Roboto',
@ -250,7 +380,10 @@ class UsingFeatures extends StatelessWidget {
), ),
), ),
), ),
trailing: Icon(Icons.keyboard_arrow_right), trailing: Icon(
Icons.keyboard_arrow_right,
color: isDarkTheme ? Colors.white : Color(0xFF414042),
),
shape: Border( shape: Border(
bottom: BorderSide( bottom: BorderSide(
color: Colors.black, width: 3), // Grey bottom line color: Colors.black, width: 3), // Grey bottom line

View File

@ -1,25 +1,59 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:go_router/go_router.dart'; import 'package:go_router/go_router.dart';
import 'package:uae_stat/config/theme/theme_provider.dart';
import 'package:uae_stat/config/toggle_lang_service.dart';
import 'package:uae_stat/domain/use_cases/language.dart'; import 'package:uae_stat/domain/use_cases/language.dart';
import 'package:uae_stat/presentation/components/indicators/locale_provider.dart';
// import 'package:uae_stat/presentation/Screens/Bottom%20Navigation%20Pages/Country_Profile/country_profile.dart';
import 'package:uae_stat/presentation/routes/drawer_routes/custom_drawer_routes.dart'; import 'package:uae_stat/presentation/routes/drawer_routes/custom_drawer_routes.dart';
import 'package:iconify_design/iconify_design.dart'; import 'package:iconify_design/iconify_design.dart';
import 'package:flutter_gen/gen_l10n/app_localizations.dart'; import 'package:flutter_gen/gen_l10n/app_localizations.dart';
// import 'package:uae_stat/l10n/app_localizations.dart';
class Userguide extends ConsumerStatefulWidget {
class Userguide extends StatefulWidget {
Userguide({super.key}); Userguide({super.key});
@override @override
State<Userguide> createState() => _UserguideState(); // _UserguideState createState() => _UserguideState();
ConsumerState<Userguide> createState() => _UserguideState();
} }
class _UserguideState extends State<Userguide> { class _UserguideState extends ConsumerState<Userguide> {
late bool isDarkTheme;
final List<Map<String, dynamic>> guideList = [ final List<Map<String, dynamic>> guideList = [
{'routePath':'aboutApp','color': Color(0xFF90B0D5), 'text': 'Getting Started', 'icon': 'cbi:start-tv', 'text-ar': 'البدء' }, {
{'routePath':'features','color': Color(0xFFAA8E83), 'text': 'Features', 'icon': 'pajamas:issue-type-feature', 'text-ar' : 'الميزات'}, 'routePath': 'aboutApp',
{'routePath':'faq','color': Color(0xFF7296BE), 'text': 'FAQs', 'icon': 'mdi:faq', 'text-ar': 'لأسئلة الشائعة'}, 'color': Color(0xFF90B0D5),
'text': 'Getting Started',
'icon': 'cbi:start-tv',
'text-ar': 'البدء'
},
{
'routePath': 'features',
'color': Color(0xFFAA8E83),
'text': 'Features',
'icon': 'pajamas:issue-type-feature',
'text-ar': 'الميزات'
},
{
'routePath': 'faq',
'color': Color(0xFF7296BE),
'text': 'FAQs',
'icon': 'mdi:faq',
'text-ar': 'لأسئلة الشائعة'
},
]; ];
late ThemeMode currentTheme;
@override
initState() {
super.initState();
print('123456789');
}
@override @override
Widget buildDynamicWidget(dynamic icons, Color color) { Widget buildDynamicWidget(dynamic icons, Color color) {
if (icons is IconData) { if (icons is IconData) {
@ -46,15 +80,23 @@ class _UserguideState extends State<Userguide> {
} else { } else {
return Text( return Text(
'Unsupported type', 'Unsupported type',
style: TextStyle(color: Colors.red,fontFamily: context.translate( style: TextStyle(
'Roboto', color: Colors.red,
'NotoKufi', fontFamily: context.translate(
),), 'Roboto',
'NotoKufi',
),
),
); );
} }
} }
Widget build(BuildContext context) { Widget build(BuildContext context) {
final currentTheme = ref.watch(themeProvider);
isDarkTheme = currentTheme == ThemeMode.dark ||
(currentTheme == ThemeMode.system &&
MediaQuery.of(context).platformBrightness == Brightness.dark);
return PopScope( return PopScope(
canPop: false, canPop: false,
onPopInvokedWithResult: (didPop, result) { onPopInvokedWithResult: (didPop, result) {
@ -63,13 +105,13 @@ class _UserguideState extends State<Userguide> {
}, },
child: BaseScaffold( child: BaseScaffold(
showDivider: true, showDivider: true,
bottomColor: Colors.white, bottomColor: isDarkTheme ? Color(0xFF111111) : Colors.white,
dividerColor: Colors.grey[300], dividerColor: isDarkTheme ? Color(0xFF111111) : Colors.grey[300],
appbarColor: Colors.white, appbarColor: isDarkTheme ? Color(0xFF111111) : Colors.white,
title: Text(AppLocalizations.of(context)!.guide_title) , title: Text(AppLocalizations.of(context)!.guide_title,style: TextStyle(color: isDarkTheme ? Colors.white : Color(0xFF414042) ),),
body: Container( body: Container(
color: Colors.white, color: isDarkTheme ? Color(0xFF111111) : Colors.white,
padding: const EdgeInsets.symmetric(horizontal: 16 , vertical: 20), padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 20),
child: GridView.builder( child: GridView.builder(
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount( gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
crossAxisCount: 2, crossAxisCount: 2,
@ -82,7 +124,8 @@ class _UserguideState extends State<Userguide> {
itemBuilder: (context, index) { itemBuilder: (context, index) {
return HoverContainer( return HoverContainer(
iconName: guideList[index]['icon'], iconName: guideList[index]['icon'],
title: context.translate(guideList[index]['text'], guideList[index]['text-ar']), title: context.translate(
guideList[index]['text'], guideList[index]['text-ar']),
routePath: guideList[index]['routePath'], routePath: guideList[index]['routePath'],
); );
}, },
@ -91,83 +134,92 @@ class _UserguideState extends State<Userguide> {
), ),
); );
} }
} }
class HoverContainer extends ConsumerStatefulWidget {
class HoverContainer extends StatefulWidget {
final String iconName; final String iconName;
final String title; final String title;
final String routePath; final String routePath;
const HoverContainer(
const HoverContainer({Key? key, required this.iconName, required this.title, required this.routePath}) : super(key: key); {Key? key,
required this.iconName,
required this.title,
required this.routePath})
: super(key: key);
@override @override
_HoverContainerState createState() => _HoverContainerState(); ConsumerState<HoverContainer> createState() => _HoverContainerState();
} }
class _HoverContainerState extends State<HoverContainer> { class _HoverContainerState extends ConsumerState<HoverContainer> {
bool isHovered = true; bool isHovered = true;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
final double screenWidth= MediaQuery.of(context).size.width; final double screenWidth = MediaQuery.of(context).size.width;
final double screenHeight= MediaQuery.of(context).size.height; final double screenHeight = MediaQuery.of(context).size.height;
final currentTheme = ref.read(themeProvider);
final isDarkTheme = currentTheme == ThemeMode.dark ||
(currentTheme == ThemeMode.system &&
MediaQuery.of(context).platformBrightness == Brightness.dark);
return GestureDetector( return GestureDetector(
onTap: () { context.push('/user-guide/${widget.routePath}');}, onTap: () {
child: MouseRegion( context.push('/user-guide/${widget.routePath}');
},
child: MouseRegion(
onEnter: (_) => setState(() => isHovered = true), onEnter: (_) => setState(() => isHovered = true),
onExit: (_) => setState(() => isHovered = true), onExit: (_) => setState(() => isHovered = true),
child : Container( child: Container(
padding: EdgeInsets.only(top: 4, right: 4, left: 4, bottom: 6), padding: EdgeInsets.only(top: 4, right: 4, left: 4, bottom: 6),
width: screenWidth * 0.30,
width: screenWidth*0.30,
margin: EdgeInsets.all(1), margin: EdgeInsets.all(1),
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.white, color: isDarkTheme ? Color(0xFF111111) : Colors.white,
borderRadius: BorderRadius.circular(10), borderRadius: BorderRadius.circular(10),
boxShadow: isHovered boxShadow: isHovered
? [ ? [
BoxShadow( BoxShadow(
color: Colors.black.withOpacity(0.2), color: Colors.black.withOpacity(0.2),
blurRadius:2, blurRadius: 2,
spreadRadius: 1, spreadRadius: 1,
offset: Offset(0, 4), offset: Offset(0, 4),
), ),
] ]
: [], : [],
border: Border.all( border: Border.all(color: Color(0xFF7DAFBC), width: 1.0),
color: Color(0xFF7DAFBC),
width: 1.0
),
), ),
alignment: Alignment.center, alignment: Alignment.center,
// duration: Duration(milliseconds: 200), // duration: Duration(milliseconds: 200),
child: LayoutBuilder(builder: (context, constraints){ child: LayoutBuilder(builder: (context, constraints) {
double containerWidth = constraints.maxWidth; double containerWidth = constraints.maxWidth;
double containerHeight = constraints.maxHeight; double containerHeight = constraints.maxHeight;
return Column( return Column(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: [ children: [
IconifyIcon(icon: widget.iconName, IconifyIcon(
color: Color((0xFF7DAFBC)), icon: widget.iconName,
size: containerHeight * 0.45,), color: Color(0xFF7DAFBC),
size: containerHeight * 0.45,
),
// buildDynamicWidget(data['icon'], Color(0xFF7DAFBC)), // buildDynamicWidget(data['icon'], Color(0xFF7DAFBC)),
SizedBox(width: 10,height: containerHeight * 0.04,), // Space between icon and text SizedBox(
width: 10,
height: containerHeight * 0.04,
), // Space between icon and text
Container( Container(
width: containerWidth* 0.85, width: containerWidth * 0.85,
padding: EdgeInsets.symmetric(horizontal: 4, vertical: 4), padding: EdgeInsets.symmetric(horizontal: 4, vertical: 4),
margin: EdgeInsets.only(bottom: 3), margin: EdgeInsets.only(bottom: 3),
decoration: BoxDecoration( decoration: BoxDecoration(
color: Color(0xFF7DAFBC), color: Color(0xFF7DAFBC),
borderRadius: BorderRadius.circular(5), borderRadius: BorderRadius.circular(5),
border: Border.all(color: Color(0xFF7DAFBC)) border: Border.all(color: Color(0xFF7DAFBC))),
),
child: Text( child: Text(
widget.title, widget.title,
style: TextStyle( style: TextStyle(
color: Colors.white, // Text color color: Colors.white, // Text color
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
fontFamily: context.translate( fontFamily: context.translate(
'Roboto', 'Roboto',
@ -179,16 +231,8 @@ class _HoverContainerState extends State<HoverContainer> {
), ),
], ],
); );
}) })),
),
), ),
); );
} }
} }

View File

@ -45,10 +45,10 @@ class BaseScaffold extends ConsumerStatefulWidget {
this.showBackButton = false, this.showBackButton = false,
this.colorChange = false, this.colorChange = false,
this.mycenterTitle = false, this.mycenterTitle = false,
this.appbarColor, this.appbarColor = Colors.white,
this.mytitleColor, this.mytitleColor,
this.bottomColor = null, this.bottomColor = null,
this.backgroundColor, this.backgroundColor = Colors.white,
}); });
final Widget body; final Widget body;
final Widget title; final Widget title;
@ -133,7 +133,7 @@ class _BaseScaffoldState extends ConsumerState<BaseScaffold> {
void _calculatetooglePosition() { void _calculatetooglePosition() {
final RenderBox cardRenderBox = final RenderBox cardRenderBox =
toggleKey.currentContext!.findRenderObject() as RenderBox; toggleKey.currentContext!.findRenderObject() as RenderBox;
final Offset cardPosition = cardRenderBox.localToGlobal(Offset.zero); final Offset cardPosition = cardRenderBox.localToGlobal(Offset.zero);
final Size cardSize = cardRenderBox.size; final Size cardSize = cardRenderBox.size;
toggleHeight = cardSize.height; toggleHeight = cardSize.height;
@ -257,7 +257,7 @@ class _BaseScaffoldState extends ConsumerState<BaseScaffold> {
.state = true; .state = true;
ref ref
.read(previousChartsTourProvider .read(previousChartsTourProvider
.notifier) .notifier)
.state = false; .state = false;
context.go( context.go(
'/chartScreen/marriages?bgColor=0xFFAA8E83&mainTopic=null&title=Marriages', '/chartScreen/marriages?bgColor=0xFFAA8E83&mainTopic=null&title=Marriages',
@ -290,7 +290,7 @@ class _BaseScaffoldState extends ConsumerState<BaseScaffold> {
.state = true; .state = true;
ref ref
.read(previousChartsTourProvider .read(previousChartsTourProvider
.notifier) .notifier)
.state = false; .state = false;
context.go( context.go(
'/chartScreen/marriages?bgColor=0xFFAA8E83&mainTopic=اجتماعي&title=الزواج&key=home', '/chartScreen/marriages?bgColor=0xFFAA8E83&mainTopic=اجتماعي&title=الزواج&key=home',
@ -579,8 +579,10 @@ class _BaseScaffoldState extends ConsumerState<BaseScaffold> {
const SizedBox(width: 10), const SizedBox(width: 10),
ElevatedButton( ElevatedButton(
onPressed: () async { onPressed: () async {
final prefs = await SharedPreferences.getInstance(); final prefs =
String? loginCount = prefs.getString('login_count'); await SharedPreferences.getInstance();
String? loginCount =
prefs.getString('login_count');
if (loginCount == '1') { if (loginCount == '1') {
await prefs.setString('login_count', '2'); await prefs.setString('login_count', '2');
} }
@ -590,10 +592,10 @@ class _BaseScaffoldState extends ConsumerState<BaseScaffold> {
.state = true; .state = true;
ref ref
.read( .read(
previousChartsTourProvider.notifier) previousChartsTourProvider.notifier)
.state = true; .state = true;
ref.read(homeTourProvider.notifier).state = ref.read(homeTourProvider.notifier).state =
true; true;
ref ref
.read(previousHomeTourProvider.notifier) .read(previousHomeTourProvider.notifier)
.state = true; .state = true;
@ -602,7 +604,7 @@ class _BaseScaffoldState extends ConsumerState<BaseScaffold> {
.state = true; .state = true;
ref ref
.read(previousScaffoldTourProvider .read(previousScaffoldTourProvider
.notifier) .notifier)
.state = true; .state = true;
tutorialCoachMark.finish(); tutorialCoachMark.finish();
}, },
@ -714,7 +716,8 @@ class _BaseScaffoldState extends ConsumerState<BaseScaffold> {
String recordId = userId; String recordId = userId;
String collectionId = String collectionId =
userDetailsResponse.data['collectionId'] ?? '_pb_users_auth_'; userDetailsResponse.data['collectionId'] ?? '_pb_users_auth_';
List<dynamic> userReadedNotification = userDetailsResponse.data['pushed_notification']; List<dynamic> userReadedNotification =
userDetailsResponse.data['pushed_notification'];
// Convert to List<String> // Convert to List<String>
userReadedNotiOrNot = List<String>.from(userReadedNotification); userReadedNotiOrNot = List<String>.from(userReadedNotification);
@ -755,7 +758,7 @@ class _BaseScaffoldState extends ConsumerState<BaseScaffold> {
print('notifications $notifications'); print('notifications $notifications');
// isLoading = false; // isLoading = false;
}); });
_processNotifications(notifications , userReadedNotiOrNot); _processNotifications(notifications, userReadedNotiOrNot);
} else { } else {
throw Exception('Failed to load data'); throw Exception('Failed to load data');
} }
@ -768,7 +771,8 @@ class _BaseScaffoldState extends ConsumerState<BaseScaffold> {
} }
} }
void _processNotifications(List<Map<String, dynamic>> notification, List<String> push) { void _processNotifications(
List<Map<String, dynamic>> notification, List<String> push) {
print('inside last function ${notification.length}'); print('inside last function ${notification.length}');
print('inside last function ${push.length}'); print('inside last function ${push.length}');
@ -802,7 +806,6 @@ class _BaseScaffoldState extends ConsumerState<BaseScaffold> {
); );
} }
// Future<void> logout() async { // Future<void> logout() async {
// final prefs = await SharedPreferences.getInstance(); // final prefs = await SharedPreferences.getInstance();
// // setState(() { // // setState(() {
@ -819,13 +822,13 @@ class _BaseScaffoldState extends ConsumerState<BaseScaffold> {
final PAuthRepo _authRepo = PAuthRepo(); final PAuthRepo _authRepo = PAuthRepo();
void _routeToIndex() { void _routeToIndex() {
String url=GoRouterState.of(context).uri.toString(); String url = GoRouterState.of(context).uri.toString();
final uri = Uri.parse(url); final uri = Uri.parse(url);
final fromValue = uri.queryParameters['key'] ?? ''; final fromValue = uri.queryParameters['key'] ?? '';
if (fromValue=='home'){ if (fromValue == 'home') {
ref.read(selectedIndexProvider.notifier).state= 0; ref.read(selectedIndexProvider.notifier).state = 0;
}else if (fromValue=='uaenumbers'){ } else if (fromValue == 'uaenumbers') {
ref.read(selectedIndexProvider.notifier).state= 1; ref.read(selectedIndexProvider.notifier).state = 1;
} }
} }
@ -836,7 +839,6 @@ class _BaseScaffoldState extends ConsumerState<BaseScaffold> {
context.go('/login'); // Redirect to login after logout context.go('/login'); // Redirect to login after logout
} }
// void _showThemeDialog(BuildContext context) async { // void _showThemeDialog(BuildContext context) async {
// AppTheme? result = await showDialog<AppTheme>( // AppTheme? result = await showDialog<AppTheme>(
// context: context, // context: context,
@ -905,7 +907,8 @@ class _BaseScaffoldState extends ConsumerState<BaseScaffold> {
// } // }
// } // }
void _openThemeDialog(BuildContext context, WidgetRef ref, String userId) async { void _openThemeDialog(
BuildContext context, WidgetRef ref, String userId) async {
final currentThemeMode = ref.read(themeProvider); // ThemeMode final currentThemeMode = ref.read(themeProvider); // ThemeMode
final platformBrightness = MediaQuery.of(context).platformBrightness; final platformBrightness = MediaQuery.of(context).platformBrightness;
@ -926,7 +929,9 @@ class _BaseScaffoldState extends ConsumerState<BaseScaffold> {
if (selectedTheme != null) { if (selectedTheme != null) {
// Update UI immediately // Update UI immediately
ref.read(themeProvider.notifier).updateTheme(selectedTheme, platformBrightness); ref
.read(themeProvider.notifier)
.updateTheme(selectedTheme, platformBrightness);
// Send only 'light' or 'dark' to PocketBase // Send only 'light' or 'dark' to PocketBase
final themeToSend = selectedTheme == AppTheme.system final themeToSend = selectedTheme == AppTheme.system
@ -937,10 +942,6 @@ class _BaseScaffoldState extends ConsumerState<BaseScaffold> {
} }
} }
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
final locale = ref.watch(localeProvider); final locale = ref.watch(localeProvider);
@ -956,7 +957,8 @@ class _BaseScaffoldState extends ConsumerState<BaseScaffold> {
final String currentRoute1 = ModalRoute.of(context)?.settings.name ?? ''; final String currentRoute1 = ModalRoute.of(context)?.settings.name ?? '';
return Scaffold( return Scaffold(
backgroundColor: Colors.white, backgroundColor: widget.backgroundColor,
// backgroundColor: Colors.white,
appBar: AppBar( appBar: AppBar(
title: Padding( title: Padding(
padding: EdgeInsets.only(top: 10), padding: EdgeInsets.only(top: 10),
@ -980,32 +982,37 @@ class _BaseScaffoldState extends ConsumerState<BaseScaffold> {
), ),
scrolledUnderElevation: 0, scrolledUnderElevation: 0,
titleSpacing: 0, titleSpacing: 0,
flexibleSpace: (isDarkTheme && currentRoute == '/myhomepage') flexibleSpace: Container(
? Container( decoration: BoxDecoration(
decoration: const BoxDecoration( color: isDarkTheme ? Color(0xFF000000) : Color(0xFFFFFFFF),
image: DecorationImage(
image: AssetImage('assets/dark_bg.png'),
fit: BoxFit.cover,
),
), ),
) ),
: (isDarkTheme && currentRoute == '/uaenumbers') // flexibleSpace: (isDarkTheme && currentRoute == '/myhomepage')
? Container( // ? Container(
decoration: const BoxDecoration( // decoration: const BoxDecoration(
color: Color(0xFF333333), // image: DecorationImage(
), // image: AssetImage('assets/dark_bg.png'),
) // fit: BoxFit.cover,
: null, // ),
// ),
// )
// : (isDarkTheme && currentRoute == '/uaenumbers')
// ? Container(
// decoration: const BoxDecoration(
// color: Color(0xFF333333),
// ),
// )
// : null,
backgroundColor: widget.appbarColor ?? Colors.white, backgroundColor: widget.appbarColor ?? Colors.white,
leadingWidth: widget.showBackButton ? mywidth * 0.18 : null, leadingWidth: widget.showBackButton ? mywidth * 0.18 : null,
bottom: widget.showDivider bottom: widget.showDivider
? PreferredSize( ? PreferredSize(
preferredSize: Size.fromHeight(1), // Height of the line preferredSize: Size.fromHeight(1), // Height of the line
child: Container( child: Container(
color: widget.dividerColor, // Line color color: widget.dividerColor, // Line color
height: 1, // Line thickness height: 1, // Line thickness
), ),
) )
: null, : null,
// bottom: widget.showDivider // bottom: widget.showDivider
@ -1048,7 +1055,15 @@ class _BaseScaffoldState extends ConsumerState<BaseScaffold> {
child: IconButton( child: IconButton(
padding: EdgeInsets.zero, padding: EdgeInsets.zero,
constraints: BoxConstraints(), constraints: BoxConstraints(),
color: widget.colorChange ? Colors.white : Colors.black, // color: widget.colorChange ? Colors.white : Colors.black,
color: isDarkTheme
? widget.colorChange
? Colors.black
: Colors.white
: widget.colorChange
? Colors.white
: Colors.black,
icon: const Icon(Icons.arrow_back_ios_new, size: 24), icon: const Icon(Icons.arrow_back_ios_new, size: 24),
onPressed: () { onPressed: () {
if (widget.navBackArrow is Text && if (widget.navBackArrow is Text &&
@ -1087,7 +1102,7 @@ class _BaseScaffoldState extends ConsumerState<BaseScaffold> {
), ),
), ),
drawer: Drawer( drawer: Drawer(
backgroundColor: isDarkTheme ? Color(0xFF111111) : Colors.white, backgroundColor: isDarkTheme ? Color(0xFF111111) : Colors.white,
child: Column(children: [ child: Column(children: [
Expanded( Expanded(
child: ListView( child: ListView(
@ -1120,19 +1135,19 @@ class _BaseScaffoldState extends ConsumerState<BaseScaffold> {
child: ClipOval( child: ClipOval(
child: _avatarUrl.isNotEmpty child: _avatarUrl.isNotEmpty
? Image( ? Image(
image: NetworkImage(_avatarUrl), image: NetworkImage(_avatarUrl),
fit: BoxFit.cover, fit: BoxFit.cover,
width: double.infinity, width: double.infinity,
height: double.infinity, height: double.infinity,
) )
: Image( : Image(
image: AssetImage( image: AssetImage(
'assets/edit_profile/profile.jpg', 'assets/edit_profile/profile.jpg',
), ),
fit: BoxFit.cover, fit: BoxFit.cover,
width: double.infinity, width: double.infinity,
height: double.infinity, height: double.infinity,
), ),
), ),
//child: Image(image: AssetImage('assets/edit_profile/profile.png')) //child: Image(image: AssetImage('assets/edit_profile/profile.png'))
), ),
@ -1167,31 +1182,43 @@ class _BaseScaffoldState extends ConsumerState<BaseScaffold> {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
if (userId == "guest") ...[ if (userId == "guest") ...[
Text(userName ?? 'Guest User', Text(
style: TextStyle( userName ?? 'Guest User',
color: isDarkTheme ? Color(0xFFAAAAAA) : null, style: TextStyle(
),), color: isDarkTheme
? Color(0xFFAAAAAA)
: null,
),
),
] else ...[ ] else ...[
Text(userName ?? 'Loading...', Text(
style: TextStyle( userName ?? 'Loading...',
color: isDarkTheme ? Color(0xFFAAAAAA) : null, style: TextStyle(
),), color: isDarkTheme
? Color(0xFFAAAAAA)
: null,
),
),
Tooltip( Tooltip(
message: userEmail ?? message: userEmail ??
'Loading...', // Shows full email on hover 'Loading...', // Shows full email on hover
child: SizedBox( child: SizedBox(
width: MediaQuery.of(context) width: MediaQuery.of(context)
.size .size
.width * .width *
0.6, // Adjust width as needed 0.6, // Adjust width as needed
child: Text( child: Text(
userEmail ?? 'Loading...', userEmail ?? 'Loading...',
style: TextStyle(fontSize: 12, style: TextStyle(
color: isDarkTheme ? Color(0xFFAAAAAA) : null, fontSize: 12,
fontFamily: context.translate( color: isDarkTheme
'Roboto', ? Color(0xFFAAAAAA)
'NotoKufi', : null,
),), fontFamily: context.translate(
'Roboto',
'NotoKufi',
),
),
// softWrap: true, // softWrap: true,
overflow: TextOverflow.ellipsis, overflow: TextOverflow.ellipsis,
maxLines: 1, maxLines: 1,
@ -1210,20 +1237,25 @@ color: isDarkTheme ? Color(0xFFAAAAAA) : null,
), ),
if (userId != 'guest') if (userId != 'guest')
ListTile( ListTile(
leading: Icon(Icons.notifications_none,color: isDarkTheme ? Color(0xFFFFFFFF) : null), leading: Icon(Icons.notifications_none,
title: Text(AppLocalizations.of(context)!.notification, color: isDarkTheme ? Color(0xFFFFFFFF) : null),
title: Text(
AppLocalizations.of(context)!.notification,
style: TextStyle( style: TextStyle(
color: isDarkTheme ? Color(0xFFAAAAAA) : null, color: isDarkTheme ? Color(0xFFAAAAAA) : null,
fontFamily: context.translate( fontFamily: context.translate(
'Roboto', 'Roboto',
'NotoKufi', 'NotoKufi',
), ), ),
),
), ),
trailing: _buildNotificationBadge(count: notificationCount), trailing:
_buildNotificationBadge(count: notificationCount),
onTap: () => _navigateTo(context, '/notification'), onTap: () => _navigateTo(context, '/notification'),
), ),
ListTile( ListTile(
leading: Icon(Icons.message_outlined,color: isDarkTheme ? Color(0xFFFFFFFF) : null), leading: Icon(Icons.message_outlined,
color: isDarkTheme ? Color(0xFFFFFFFF) : null),
// leading: Image.asset( // leading: Image.asset(
// DrawerAssetIconPath.feedback, // DrawerAssetIconPath.feedback,
// color: Colors.black, // color: Colors.black,
@ -1231,19 +1263,23 @@ color: isDarkTheme ? Color(0xFFAAAAAA) : null,
// height: 20, // height: 20,
// ), // ),
// title: const Text('Feedback'), // title: const Text('Feedback'),
title: Text(AppLocalizations.of(context)!.feedback_title, title: Text(
AppLocalizations.of(context)!.feedback_title,
style: TextStyle( style: TextStyle(
color: isDarkTheme ? Color(0xFFAAAAAA) : null, color: isDarkTheme ? Color(0xFFAAAAAA) : null,
fontFamily: context.translate( fontFamily: context.translate(
'Roboto', 'Roboto',
'NotoKufi', 'NotoKufi',
), ),), ),
),
),
onTap: () => onTap: () =>
_navigateTo(context, '/feedback', extra: userName), _navigateTo(context, '/feedback', extra: userName),
), ),
if (role == 'admin') if (role == 'admin')
ListTile( ListTile(
leading: Icon(Icons.manage_accounts_outlined,color: isDarkTheme ? Color(0xFFFFFFFF) : null), leading: Icon(Icons.manage_accounts_outlined,
color: isDarkTheme ? Color(0xFFFFFFFF) : null),
// leading: Image.asset( // leading: Image.asset(
// DrawerAssetIconPath.manageUser, // DrawerAssetIconPath.manageUser,
// color: Colors.black, // color: Colors.black,
@ -1258,12 +1294,14 @@ color: isDarkTheme ? Color(0xFFAAAAAA) : null,
fontFamily: context.translate( fontFamily: context.translate(
'Roboto', 'Roboto',
'NotoKufi', 'NotoKufi',
), ), ),
),
), ),
onTap: () => _navigateTo(context, '/manageuser'), onTap: () => _navigateTo(context, '/manageuser'),
), ),
ListTile( ListTile(
leading: Icon(Icons.bookmarks_outlined,color: isDarkTheme ? Color(0xFFFFFFFF) : null), leading: Icon(Icons.bookmarks_outlined,
color: isDarkTheme ? Color(0xFFFFFFFF) : null),
// title: const Text('Bookmark'), // title: const Text('Bookmark'),
title: Text( title: Text(
AppLocalizations.of(context)!.bookmark_title, AppLocalizations.of(context)!.bookmark_title,
@ -1272,12 +1310,14 @@ color: isDarkTheme ? Color(0xFFAAAAAA) : null,
fontFamily: context.translate( fontFamily: context.translate(
'Roboto', 'Roboto',
'NotoKufi', 'NotoKufi',
), ), ),
),
), ),
onTap: () => _navigateTo(context, '/bookmark'), onTap: () => _navigateTo(context, '/bookmark'),
), ),
ListTile( ListTile(
leading: Icon(Icons.menu_book_outlined,color: isDarkTheme ? Color(0xFFFFFFFF) : null), leading: Icon(Icons.menu_book_outlined,
color: isDarkTheme ? Color(0xFFFFFFFF) : null),
// leading: Image.asset( // leading: Image.asset(
// DrawerAssetIconPath.guide, // DrawerAssetIconPath.guide,
// color: Colors.black, // color: Colors.black,
@ -1285,80 +1325,100 @@ color: isDarkTheme ? Color(0xFFAAAAAA) : null,
// height: 20, // height: 20,
// ), // ),
// title: const Text('User Guide'), // title: const Text('User Guide'),
title: Text(AppLocalizations.of(context)!.guide_title, title: Text(
AppLocalizations.of(context)!.guide_title,
style: TextStyle( style: TextStyle(
color: isDarkTheme ? Color(0xFFAAAAAA) : null, color: isDarkTheme ? Color(0xFFAAAAAA) : null,
fontFamily: context.translate( fontFamily: context.translate(
'Roboto', 'Roboto',
'NotoKufi', 'NotoKufi',
), ), ),
),
), ),
onTap: () => _navigateTo(context, '/user-guide'), onTap: () => _navigateTo(context, '/user-guide'),
), ),
ListTile( ListTile(
leading: Icon(Icons.mail_outlined,color: isDarkTheme ? Color(0xFFFFFFFF) : null), leading: Icon(Icons.mail_outlined,
title: Text(context.translate('Contact Us', 'اتصل بنا'), color: isDarkTheme ? Color(0xFFFFFFFF) : null),
title: Text(
context.translate('Contact Us', 'اتصل بنا'),
style: TextStyle( style: TextStyle(
color: isDarkTheme ? Color(0xFFAAAAAA) : null, color: isDarkTheme ? Color(0xFFAAAAAA) : null,
fontFamily: context.translate( fontFamily: context.translate(
'Roboto', 'Roboto',
'NotoKufi', 'NotoKufi',
), ),), ),
),
),
onTap: () => context.go('/contact'), onTap: () => context.go('/contact'),
), ),
ListTile(
leading: Icon(Icons.lightbulb_circle_outlined,
color: isDarkTheme ? Color(0xFFFFFFFF) : null),
title: Text(
context.translate('Theme', 'سمة'),
style: TextStyle(
color: isDarkTheme ? Color(0xFFAAAAAA) : null,
fontFamily: context.translate(
'Roboto',
'NotoKufi',
),
),
),
onTap: () => _openThemeDialog(context, ref, userId),
),
if (userId != 'guest') if (userId != 'guest')
ListTile( ListTile(
leading: Icon(Icons.logout,color: isDarkTheme ? Color(0xFFFFFFFF) : null), leading: Icon(Icons.logout,
color: isDarkTheme ? Color(0xFFFFFFFF) : null),
// title: const Text('Logout'), // title: const Text('Logout'),
title: Text(AppLocalizations.of(context)!.logout, title: Text(
AppLocalizations.of(context)!.logout,
style: TextStyle( style: TextStyle(
color: isDarkTheme ? Color(0xFFAAAAAA) : null, color: isDarkTheme ? Color(0xFFAAAAAA) : null,
fontFamily: context.translate( fontFamily: context.translate(
'Roboto', 'Roboto',
'NotoKufi', 'NotoKufi',
), ), ),
),
), ),
onTap: () => _showLogoutConfirmationDialog(context), onTap: () => _showLogoutConfirmationDialog(context),
), ),
if (userId == 'guest') if (userId == 'guest')
ListTile( ListTile(
leading: Icon(Icons.login,color: isDarkTheme ? Color(0xFFFFFFFF) : null), leading: Icon(Icons.login,
color: isDarkTheme ? Color(0xFFFFFFFF) : null),
// title: const Text('Login'), // title: const Text('Login'),
title: Text(AppLocalizations.of(context)!.login_title, title: Text(
AppLocalizations.of(context)!.login_title,
style: TextStyle( style: TextStyle(
color: isDarkTheme ? Color(0xFFAAAAAA) : null, color: isDarkTheme ? Color(0xFFAAAAAA) : null,
fontFamily: context.translate( fontFamily: context.translate(
'Roboto', 'Roboto',
'NotoKufi', 'NotoKufi',
), ), ),
),
), ),
onTap: () => context.go('/login'), onTap: () => context.go('/login'),
), ),
if (userId == 'guest') if (userId == 'guest')
ListTile( ListTile(
leading: Icon(Icons.app_registration,color: isDarkTheme ? Color(0xFFFFFFFF) : null), leading: Icon(Icons.app_registration,
color: isDarkTheme ? Color(0xFFFFFFFF) : null),
// title: const Text('Register'), // title: const Text('Register'),
title: Text(AppLocalizations.of(context)!.register_title, title: Text(
AppLocalizations.of(context)!.register_title,
style: TextStyle( style: TextStyle(
color: isDarkTheme ? Color(0xFFAAAAAA) : null, color: isDarkTheme ? Color(0xFFAAAAAA) : null,
fontFamily: context.translate( fontFamily: context.translate(
'Roboto', 'Roboto',
'NotoKufi', 'NotoKufi',
), ), ),
),
), ),
onTap: () => context.go('/register'), onTap: () => context.go('/register'),
), ),
ListTile(
leading: Icon(Icons.lightbulb_circle_outlined,color: isDarkTheme ? Color(0xFFFFFFFF) : null),
title: Text(context.translate('Theme','سمة'),
style: TextStyle(
color: isDarkTheme ? Color(0xFFAAAAAA) : null,
fontFamily: context.translate(
'Roboto',
'NotoKufi',
), ),),
onTap: () => _openThemeDialog(context, ref, userId),
),
], ],
), ),
), ),
@ -1370,28 +1430,40 @@ color: isDarkTheme ? Color(0xFFAAAAAA) : null,
if (snapshot.connectionState == ConnectionState.waiting) { if (snapshot.connectionState == ConnectionState.waiting) {
return Text( return Text(
'Loading version...', 'Loading version...',
style: TextStyle(fontSize: 12, color: isDarkTheme ? Color(0xFFAAAAAA) : Colors.grey,fontFamily: context.translate( style: TextStyle(
'Roboto', fontSize: 12,
'NotoKufi', color: isDarkTheme ? Color(0xFFAAAAAA) : Colors.grey,
),), fontFamily: context.translate(
'Roboto',
'NotoKufi',
),
),
textAlign: TextAlign.center, textAlign: TextAlign.center,
); );
} else if (snapshot.hasError) { } else if (snapshot.hasError) {
return Text( return Text(
'Error fetching version', 'Error fetching version',
style: TextStyle(fontSize: 12, color: Colors.red,fontFamily: context.translate( style: TextStyle(
'Roboto', fontSize: 12,
'NotoKufi', color: Colors.red,
),), fontFamily: context.translate(
'Roboto',
'NotoKufi',
),
),
textAlign: TextAlign.center, textAlign: TextAlign.center,
); );
} else { } else {
return Text( return Text(
'Version ${snapshot.data}', 'Version ${snapshot.data}',
style: TextStyle(fontSize: 12, color: isDarkTheme ? Color(0xFFAAAAAA) : Colors.grey,fontFamily: context.translate( style: TextStyle(
'Roboto', fontSize: 12,
'NotoKufi', color: isDarkTheme ? Color(0xFFAAAAAA) : Colors.grey,
),), fontFamily: context.translate(
'Roboto',
'NotoKufi',
),
),
textAlign: TextAlign.center, textAlign: TextAlign.center,
); );
} }
@ -1410,104 +1482,104 @@ color: isDarkTheme ? Color(0xFFAAAAAA) : null,
height: kBottomNavigationBarHeight + 0, // Adjust as needed height: kBottomNavigationBarHeight + 0, // Adjust as needed
decoration: BoxDecoration( decoration: BoxDecoration(
image: DecorationImage( image: DecorationImage(
image: AssetImage('assets/dark_bg.png'), // your dark mode image image: AssetImage(
'assets/dark_bg.png'), // your dark mode image
fit: BoxFit.cover, fit: BoxFit.cover,
), ),
), ),
), ),
), ),
BottomNavigationBar( BottomNavigationBar(
backgroundColor: isDarkTheme ? Color(0xFF000000) : Colors.white, backgroundColor: isDarkTheme ? Color(0xFF000000) : Colors.white,
currentIndex: _getSelectedIndex(currentRoute), currentIndex: _getSelectedIndex(currentRoute),
onTap: (index) => _onItemTapped(context, index), onTap: (index) => _onItemTapped(context, index),
type: BottomNavigationBarType.fixed, type: BottomNavigationBarType.fixed,
items: [ items: [
BottomNavigationBarItem( BottomNavigationBarItem(
icon: Padding( icon: Padding(
padding: padding: const EdgeInsets.only(
const EdgeInsets.only(bottom: 4), // Adjust this for spacing bottom: 4), // Adjust this for spacing
child: Image.asset( child: Image.asset(
BottomBarAssetIconPath.home, BottomBarAssetIconPath.home,
color: _getSelectedIndex(currentRoute) == 0 color: _getSelectedIndex(currentRoute) == 0
? (isDarkTheme ? Color(0xFF24B4FB) : Colors.black) ? (isDarkTheme ? Color(0xFF24B4FB) : Colors.black)
: Color(0xFF989898), : Color(0xFF989898),
width: 23.98, width: 23.98,
height: 25, height: 25,
),
), ),
// label: 'Home',
label: AppLocalizations.of(context)!.nav_home,
), ),
BottomNavigationBarItem( // label: 'Home',
// icon: Icon(Icons.map), label: AppLocalizations.of(context)!.nav_home,
icon: Padding(
padding:
const EdgeInsets.only(bottom: 4), // Adjust this for spacing
child: Image.asset(
BottomBarAssetIconPath.uaeMap,
color: _getSelectedIndex(currentRoute) == 1
? (isDarkTheme ? Color(0xFF24B4FB) : Colors.black)
: Color(0xFF989898),
width: 23.98,
height: 25,
),
),
// label: 'UAE Numbers'
label: AppLocalizations.of(context)!.nav_uae,
),
BottomNavigationBarItem(
icon: Padding(
padding:
const EdgeInsets.only(bottom: 4), // Adjust this for spacing
child: Image.asset(
BottomBarAssetIconPath.ranking,
color: _getSelectedIndex(currentRoute) == 2
? (isDarkTheme ? Color(0xFF24B4FB) : Colors.black)
: Color(0xFF989898),
width: 23.98,
height: 25,
),
),
// label: 'Competitiveness',
label: AppLocalizations.of(context)!.nav_competitiveness,
),
BottomNavigationBarItem(
icon: Padding(
padding:
const EdgeInsets.only(bottom: 4), // Adjust this for spacing
child: Image.asset(
BottomBarAssetIconPath.globe,
color: _getSelectedIndex(currentRoute) == 3
? (isDarkTheme ? Color(0xFF24B4FB) : Colors.black)
: Color(0xFF989898),
width: 23.98,
height: 25,
),
),
// label: 'Country Profile',
label: AppLocalizations.of(context)!.country_profile,
),
],
key: bottomNavKey,
selectedItemColor: isDarkTheme ? Color(0xFF24B4FB) : Colors.black,
unselectedItemColor: Colors.grey,
selectedLabelStyle: TextStyle(
fontFamily: context.translate(
'Roboto',
'NotoKufi',
),
fontSize: 10, // Font size for unselected label
), ),
unselectedLabelStyle: TextStyle( BottomNavigationBarItem(
fontFamily: context.translate( // icon: Icon(Icons.map),
'Roboto', icon: Padding(
'NotoKufi', padding: const EdgeInsets.only(
bottom: 4), // Adjust this for spacing
child: Image.asset(
BottomBarAssetIconPath.uaeMap,
color: _getSelectedIndex(currentRoute) == 1
? (isDarkTheme ? Color(0xFF24B4FB) : Colors.black)
: Color(0xFF989898),
width: 23.98,
height: 25,
),
), ),
fontSize: 10, // Font size for unselected label // label: 'UAE Numbers'
label: AppLocalizations.of(context)!.nav_uae,
), ),
showUnselectedLabels: true, BottomNavigationBarItem(
icon: Padding(
padding: const EdgeInsets.only(
bottom: 4), // Adjust this for spacing
child: Image.asset(
BottomBarAssetIconPath.ranking,
color: _getSelectedIndex(currentRoute) == 2
? (isDarkTheme ? Color(0xFF24B4FB) : Colors.black)
: Color(0xFF989898),
width: 23.98,
height: 25,
),
),
// label: 'Competitiveness',
label: AppLocalizations.of(context)!.nav_competitiveness,
),
BottomNavigationBarItem(
icon: Padding(
padding: const EdgeInsets.only(
bottom: 4), // Adjust this for spacing
child: Image.asset(
BottomBarAssetIconPath.globe,
color: _getSelectedIndex(currentRoute) == 3
? (isDarkTheme ? Color(0xFF24B4FB) : Colors.black)
: Color(0xFF989898),
width: 23.98,
height: 25,
),
),
// label: 'Country Profile',
label: AppLocalizations.of(context)!.country_profile,
),
],
key: bottomNavKey,
selectedItemColor: isDarkTheme ? Color(0xFF24B4FB) : Colors.black,
unselectedItemColor: Colors.grey,
selectedLabelStyle: TextStyle(
fontFamily: context.translate(
'Roboto',
'NotoKufi',
),
fontSize: 10, // Font size for unselected label
), ),
unselectedLabelStyle: TextStyle(
fontFamily: context.translate(
'Roboto',
'NotoKufi',
),
fontSize: 10, // Font size for unselected label
),
showUnselectedLabels: true,
),
], ],
), ),
@ -1669,10 +1741,14 @@ void _showLogoutConfirmationDialog(BuildContext context) {
title: Text( title: Text(
context.translate('Log Out Confirmation', 'تأكيد تسجيل الخروج'), context.translate('Log Out Confirmation', 'تأكيد تسجيل الخروج'),
textAlign: TextAlign.center, textAlign: TextAlign.center,
style: TextStyle(fontSize: 20, fontWeight: FontWeight.bold, fontFamily: context.translate( style: TextStyle(
'Roboto', fontSize: 20,
'NotoKufi', fontWeight: FontWeight.bold,
),), fontFamily: context.translate(
'Roboto',
'NotoKufi',
),
),
), ),
content: Padding( content: Padding(
padding: const EdgeInsets.all(20.0), padding: const EdgeInsets.all(20.0),
@ -1697,7 +1773,7 @@ void _showLogoutConfirmationDialog(BuildContext context) {
children: [ children: [
SizedBox( SizedBox(
width: width:
MediaQuery.of(context).size.width * 0.3, // Set button width MediaQuery.of(context).size.width * 0.3, // Set button width
child: TextButton( child: TextButton(
onPressed: () => Navigator.pop(dialogContext), onPressed: () => Navigator.pop(dialogContext),
style: TextButton.styleFrom( style: TextButton.styleFrom(
@ -1725,7 +1801,7 @@ void _showLogoutConfirmationDialog(BuildContext context) {
SizedBox(width: 16), SizedBox(width: 16),
SizedBox( SizedBox(
width: width:
MediaQuery.of(context).size.width * 0.3, // Set button width MediaQuery.of(context).size.width * 0.3, // Set button width
child: TextButton( child: TextButton(
onPressed: () => logout(context), onPressed: () => logout(context),
style: TextButton.styleFrom( style: TextButton.styleFrom(
@ -1740,10 +1816,14 @@ void _showLogoutConfirmationDialog(BuildContext context) {
.scaleDown, // Prevents wrapping while adjusting text size .scaleDown, // Prevents wrapping while adjusting text size
child: Text( child: Text(
context.translate('Log Out', 'تسجيل الخروج'), context.translate('Log Out', 'تسجيل الخروج'),
style: TextStyle(color: Colors.white, fontSize: 16, fontFamily: context.translate( style: TextStyle(
'Roboto', color: Colors.white,
'NotoKufi', fontSize: 16,
),), fontFamily: context.translate(
'Roboto',
'NotoKufi',
),
),
textAlign: TextAlign.center, textAlign: TextAlign.center,
), ),
), ),
@ -1755,4 +1835,4 @@ void _showLogoutConfirmationDialog(BuildContext context) {
], ],
), ),
); );
} }

View File

@ -1,8 +1,8 @@
name: uae_stat name: uae_stat
description: "View statistics about the UAE from the Federal Center for Statistics and Competitiveness." description: "View statistics about the UAE from the Federal Center for Statistics and Competitiveness."
publish_to: "none" publish_to: "none"
#version: 1.0.60+61 #version: 1.0.61+62
version: 1.0.6+7 version: 1.0.7+8
environment: environment:
sdk: ">=3.2.3 <4.0.0" sdk: ">=3.2.3 <4.0.0"