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
) )
], ],
), ),

View File

@ -22,6 +22,7 @@ import 'package:uae_stat/presentation/Screens/charts/services/api_service.dart';
import 'package:uae_stat/presentation/Screens/charts/widgets/chart_widget.dart'; import 'package:uae_stat/presentation/Screens/charts/widgets/chart_widget.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/components/my_toggle.dart'; import 'package:uae_stat/presentation/components/my_toggle.dart';
// import 'package:uae_stat/l10n/app_localizations.dart';
import 'package:flutter_gen/gen_l10n/app_localizations.dart'; import 'package:flutter_gen/gen_l10n/app_localizations.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/presentation/Screens/app_tour/Target_content.dart'; import 'package:uae_stat/presentation/Screens/app_tour/Target_content.dart';
@ -199,8 +200,7 @@ class _ChartScreen1State extends ConsumerState<ChartScreen1> {
fontFamily: context.translate( fontFamily: context.translate(
'Roboto', 'Roboto',
'NotoKufi', 'NotoKufi',
) )),
),
), ),
duration: Duration(seconds: 2), duration: Duration(seconds: 2),
), ),
@ -216,8 +216,7 @@ class _ChartScreen1State extends ConsumerState<ChartScreen1> {
fontFamily: context.translate( fontFamily: context.translate(
'Roboto', 'Roboto',
'NotoKufi', 'NotoKufi',
) )),
),
), ),
// backgroundColor: Color(0xFFEB5F24), // backgroundColor: Color(0xFFEB5F24),
duration: Duration(seconds: 2), duration: Duration(seconds: 2),
@ -252,8 +251,7 @@ class _ChartScreen1State extends ConsumerState<ChartScreen1> {
fontFamily: context.translate( fontFamily: context.translate(
'Roboto', 'Roboto',
'NotoKufi', 'NotoKufi',
) )),
),
), ),
duration: Duration(seconds: 2), duration: Duration(seconds: 2),
), ),
@ -269,8 +267,7 @@ class _ChartScreen1State extends ConsumerState<ChartScreen1> {
fontFamily: context.translate( fontFamily: context.translate(
'Roboto', 'Roboto',
'NotoKufi', 'NotoKufi',
) )),
),
), ),
// backgroundColor: Color(0xFFEB5F24), // backgroundColor: Color(0xFFEB5F24),
duration: Duration(seconds: 2), duration: Duration(seconds: 2),
@ -371,10 +368,14 @@ class _ChartScreen1State extends ConsumerState<ChartScreen1> {
), ),
child: Text( child: Text(
context.translate('Yes', 'نعم'), context.translate('Yes', 'نعم'),
style: TextStyle(color: Colors.white, fontSize: 16, fontFamily: context.translate( style: TextStyle(
color: Colors.white,
fontSize: 16,
fontFamily: context.translate(
'Roboto', 'Roboto',
'NotoKufi', 'NotoKufi',
),), ),
),
), ),
), ),
), ),
@ -475,10 +476,14 @@ class _ChartScreen1State extends ConsumerState<ChartScreen1> {
), ),
child: Text( child: Text(
context.translate('Yes', 'نعم'), context.translate('Yes', 'نعم'),
style: TextStyle(color: Colors.white, fontSize: 16, fontFamily: context.translate( style: TextStyle(
color: Colors.white,
fontSize: 16,
fontFamily: context.translate(
'Roboto', 'Roboto',
'NotoKufi', 'NotoKufi',
),), ),
),
), ),
), ),
), ),
@ -1410,9 +1415,10 @@ class _ChartScreen1State extends ConsumerState<ChartScreen1> {
}); });
} }
Future<void> fetchChartData(String dataSets, locale, kpi, filter_data,themeMode) async { Future<void> fetchChartData(
var data = String dataSets, locale, kpi, filter_data, themeMode) async {
await apiService.fetchChartData(dataSets, locale, kpi, filter_data,themeMode); var data = await apiService.fetchChartData(
dataSets, locale, kpi, filter_data, themeMode);
tabFilteredKpi = kpi; tabFilteredKpi = kpi;
print('FETCH KPI- $kpi'); print('FETCH KPI- $kpi');
@ -1525,8 +1531,7 @@ class _ChartScreen1State extends ConsumerState<ChartScreen1> {
locale, locale,
tabWiseKpi, // Ensure you are passing the correct KPI here tabWiseKpi, // Ensure you are passing the correct KPI here
formattedFilters, // Pass the formatted filter data here formattedFilters, // Pass the formatted filter data here
themeMode themeMode);
);
// Navigator.pop(context); // Navigator.pop(context);
selectedFiltersStorage = List.from(selectedFilters); selectedFiltersStorage = List.from(selectedFilters);
@ -1711,7 +1716,10 @@ class _ChartScreen1State extends ConsumerState<ChartScreen1> {
UaeNumbersAssetPath.filterCharts, UaeNumbersAssetPath.filterCharts,
semanticsLabel: 'Filter', semanticsLabel: 'Filter',
colorFilter: ColorFilter.mode( colorFilter: ColorFilter.mode(
isDarkTheme ? Color(0xFFFFFFFF) : Color(0xFF8E8E8E), BlendMode.srcIn), isDarkTheme
? Color(0xFFFFFFFF)
: Color(0xFF8E8E8E),
BlendMode.srcIn),
width: 25, width: 25,
height: 25, height: 25,
), ),
@ -1722,7 +1730,9 @@ class _ChartScreen1State extends ConsumerState<ChartScreen1> {
'المرشحات', 'المرشحات',
), ),
style: TextStyle( style: TextStyle(
color: isDarkTheme ? Color(0xFFFFFFFF) : Color(0xFF8E8E8E), color: isDarkTheme
? Color(0xFFFFFFFF)
: Color(0xFF8E8E8E),
fontSize: 20, fontSize: 20,
fontWeight: FontWeight.w500, fontWeight: FontWeight.w500,
fontFamily: context.translate( fontFamily: context.translate(
@ -1781,7 +1791,9 @@ class _ChartScreen1State extends ConsumerState<ChartScreen1> {
'Roboto', 'Roboto',
'NotoKufi', 'NotoKufi',
), ),
color: isDarkTheme ? Color(0xFFFFFFFF) : Color(0xFF8E8E8E), color: isDarkTheme
? Color(0xFFFFFFFF)
: Color(0xFF8E8E8E),
), ),
), ),
InkWell( InkWell(
@ -1800,11 +1812,12 @@ class _ChartScreen1State extends ConsumerState<ChartScreen1> {
// "${locale == 'ar' ? 'يختار ' : 'Select '}" // "${locale == 'ar' ? 'يختار ' : 'Select '}"
"${context.translate(filter_text_and_order['en'], filter_text_and_order['ar'])}", "${context.translate(filter_text_and_order['en'], filter_text_and_order['ar'])}",
style: TextStyle( style: TextStyle(
fontFamily: context.translate( fontFamily:
context.translate(
'Roboto', 'Roboto',
'NotoKufi', 'NotoKufi',
) )),
),), ),
content: SingleChildScrollView( content: SingleChildScrollView(
child: ListBody( child: ListBody(
children: filterData children: filterData
@ -1813,11 +1826,12 @@ class _ChartScreen1State extends ConsumerState<ChartScreen1> {
title: Text( title: Text(
value.toString(), value.toString(),
style: TextStyle( style: TextStyle(
fontFamily: context.translate( fontFamily: context
.translate(
'Roboto', 'Roboto',
'NotoKufi', 'NotoKufi',
) )),
),), ),
value: selectedFilter[ value: selectedFilter[
"filter_data"] "filter_data"]
.contains(value), .contains(value),
@ -1853,12 +1867,14 @@ class _ChartScreen1State extends ConsumerState<ChartScreen1> {
'نعم', 'نعم',
), ),
style: TextStyle( style: TextStyle(
fontFamily: context.translate( fontFamily:
context.translate(
'Roboto', 'Roboto',
'NotoKufi', 'NotoKufi',
), ),
color: isDarkTheme ? Color(0xFFFFFFFF) : null, color: isDarkTheme
? Color(0xFFFFFFFF)
: null,
), ),
), ),
), ),
@ -1881,30 +1897,35 @@ class _ChartScreen1State extends ConsumerState<ChartScreen1> {
child: Wrap( child: Wrap(
spacing: 8.0, spacing: 8.0,
runSpacing: 4.0, runSpacing: 4.0,
children: children: selectedFilter["filter_data"]
selectedFilter["filter_data"].isEmpty .isEmpty
? [ ? [
Text( Text(
// "${locale == 'ar' ? 'يختار ' : 'Select '}" // "${locale == 'ar' ? 'يختار ' : 'Select '}"
"${context.translate(filter_text_and_order['en'], filter_text_and_order['ar'])}", "${context.translate(filter_text_and_order['en'], filter_text_and_order['ar'])}",
style: TextStyle( style: TextStyle(
color: isDarkTheme ? Color(0xFFFFFFFF) : Colors.grey, color: isDarkTheme
? Color(0xFFFFFFFF)
: Colors.grey,
fontFamily: context.translate( fontFamily: context.translate(
'Roboto', 'Roboto',
'NotoKufi', 'NotoKufi',
),), ),
),
) )
] ]
: selectedFilter["filter_data"] : selectedFilter["filter_data"]
.map<Widget>((value) { .map<Widget>((value) {
return Chip( return Chip(
label: Text(value, label: Text(
value,
style: TextStyle( style: TextStyle(
fontFamily: context.translate( fontFamily:
context.translate(
'Roboto', 'Roboto',
'NotoKufi', 'NotoKufi',
) )),
),), ),
// backgroundColor: Colors.white, // Default background color // backgroundColor: Colors.white, // Default background color
onDeleted: () { onDeleted: () {
setState(() { setState(() {
@ -1953,7 +1974,8 @@ class _ChartScreen1State extends ConsumerState<ChartScreen1> {
print('locale22- $locale'); print('locale22- $locale');
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'); final themeMode = (isDark ? 'dark' : 'light');
@ -1962,8 +1984,7 @@ class _ChartScreen1State extends ConsumerState<ChartScreen1> {
locale, locale,
tabWiseKpi, // Ensure you are passing the correct KPI here tabWiseKpi, // Ensure you are passing the correct KPI here
formattedFilters, // Pass the formatted filter data here formattedFilters, // Pass the formatted filter data here
themeMode themeMode);
);
Navigator.pop(context); Navigator.pop(context);
}, },
style: ElevatedButton.styleFrom( style: ElevatedButton.styleFrom(
@ -2001,7 +2022,8 @@ class _ChartScreen1State extends ConsumerState<ChartScreen1> {
print( print(
"Selected Filters before applying: $selectedFilters"); "Selected Filters before applying: $selectedFilters");
if (selectedFilters.every((filter) => filter['filter_data'].isEmpty)) { if (selectedFilters.every(
(filter) => filter['filter_data'].isEmpty)) {
setState(() { setState(() {
isLoading = true; isLoading = true;
}); });
@ -2016,12 +2038,15 @@ class _ChartScreen1State extends ConsumerState<ChartScreen1> {
formattedFilters = []; formattedFilters = [];
final locale = final locale =
ref.watch(localeProvider)?.languageCode ?? 'en'; ref.watch(localeProvider)?.languageCode ??
'en';
print('locale22- $locale'); print('locale22- $locale');
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'); final themeMode = (isDark ? 'dark' : 'light');
fetchChartData( fetchChartData(
@ -2029,8 +2054,7 @@ class _ChartScreen1State extends ConsumerState<ChartScreen1> {
locale, locale,
tabWiseKpi, // Ensure you are passing the correct KPI here tabWiseKpi, // Ensure you are passing the correct KPI here
formattedFilters, // Pass the formatted filter data here formattedFilters, // Pass the formatted filter data here
themeMode themeMode);
);
Navigator.pop(context); Navigator.pop(context);
} else { } else {
setState(() { setState(() {
@ -2039,8 +2063,8 @@ class _ChartScreen1State extends ConsumerState<ChartScreen1> {
cardData = originalTabCardData; cardData = originalTabCardData;
}); });
applyFilters(context, filters, chartsData, cardData, applyFilters(context, filters, chartsData,
selectedFilters); cardData, selectedFilters);
// selectedFiltersStorage = List.from(selectedFilters); // selectedFiltersStorage = List.from(selectedFilters);
} }
}, },
@ -2341,7 +2365,6 @@ class _ChartScreen1State extends ConsumerState<ChartScreen1> {
// return 1.0; // Default fallback (should never be reached) // return 1.0; // Default fallback (should never be reached)
// } // }
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
final locale = ref.watch(localeProvider); final locale = ref.watch(localeProvider);
@ -2384,7 +2407,8 @@ class _ChartScreen1State extends ConsumerState<ChartScreen1> {
final List<Map<String, dynamic>> safeFilterData = final List<Map<String, dynamic>> safeFilterData =
widget.filter_data ?? []; widget.filter_data ?? [];
final String safeKpi = widget.kpi ?? ''; final String safeKpi = widget.kpi ?? '';
fetchChartData(widget.dataSets, localeCode, safeKpi, safeFilterData,themeString) fetchChartData(
widget.dataSets, localeCode, safeKpi, safeFilterData, themeString)
.then((_) { .then((_) {
print('DEBUG KPI: $safeKpi'); print('DEBUG KPI: $safeKpi');
@ -2430,7 +2454,8 @@ class _ChartScreen1State extends ConsumerState<ChartScreen1> {
final String safeKpi = widget.kpi ?? ''; final String safeKpi = widget.kpi ?? '';
/// 🔥 Call your API /// 🔥 Call your API
fetchChartData(widget.dataSets, localeCode, safeKpi, safeFilterData, themeString) fetchChartData(
widget.dataSets, localeCode, safeKpi, safeFilterData, themeString)
.then((_) { .then((_) {
print('DEBUG KPI: $safeKpi'); print('DEBUG KPI: $safeKpi');
print('TAB11: $currentTab'); print('TAB11: $currentTab');
@ -2494,13 +2519,14 @@ class _ChartScreen1State extends ConsumerState<ChartScreen1> {
child: BaseScaffold( child: BaseScaffold(
key: _scaffoldKey, key: _scaffoldKey,
title: (pageTitle == 'home') title: (pageTitle == 'home')
? Text(AppLocalizations.of(context)!.nav_home, ? Text(
AppLocalizations.of(context)!.nav_home,
style: TextStyle( style: TextStyle(
fontFamily: context.translate( fontFamily: context.translate(
'Roboto', 'Roboto',
'NotoKufi', 'NotoKufi',
)),
) )
),)
: Text( : Text(
context.translate( context.translate(
'UAE Numbers', 'UAE Numbers',
@ -2510,13 +2536,14 @@ class _ChartScreen1State extends ConsumerState<ChartScreen1> {
fontFamily: context.translate( fontFamily: context.translate(
'Roboto', 'Roboto',
'NotoKufi', 'NotoKufi',
) )),
),
), ),
// appbarColor: Color(int.parse(widget.bgColor)), // Example color // appbarColor: Color(int.parse(widget.bgColor)), // Example color
appbarColor: Color(int.parse( appbarColor:
(chartScreenData['header_color'] ?? '#ffffff') isDarkTheme ? Colors.black : Colors.white, // Example color
.replaceFirst('#', '0xff'))), // appbarColor: Color(int.parse(
// (chartScreenData['header_color'] ?? '#ffffff')
// .replaceFirst('#', '0xff'))),
// Example color // Example color
showBackButton: true, showBackButton: true,
colorChange: true, colorChange: true,
@ -2524,23 +2551,39 @@ class _ChartScreen1State extends ConsumerState<ChartScreen1> {
body: Stack(children: [ body: Stack(children: [
if (!isLoading) if (!isLoading)
Container( Container(
color: color, // color: color,
color: isDarkTheme ? Colors.black54 : Colors.white,
child: Column( child: Column(
children: [ children: [
Container( Container(
// height: myheight / 5, // height: myheight / 5,
width: double.infinity, width: double.infinity,
// color: color, // color: color,
color: Color(int.parse(
(chartScreenData['header_color'] ?? '#898C81') color: isDarkTheme ? Colors.black : Colors.white,
.replaceFirst('#', '0xff'))), // color: Color(int.parse(
// (chartScreenData['header_color'] ?? '#898C81')
// .replaceFirst('#', '0xff'))),
child: Padding( child: Padding(
padding: EdgeInsets.only( padding: EdgeInsets.only(
left: 30, right: 30, top: 8, bottom: 5), left: 30, right: 30, top: 8, bottom: 5),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Text( Container(
decoration: BoxDecoration(
color: Color(int.parse(
(chartScreenData['header_color'] ??
'#898C81')
.replaceFirst('#', '0xff'))),
borderRadius: BorderRadius.only(
topLeft: Radius.circular(12.0),
topRight: Radius.circular(12.0),
),
),
width: double.infinity,
child: Center(
child: Text(
// widget.mainTopic ?? '', // widget.mainTopic ?? '',
// chartScreenData['main_topic'] ?? '', // chartScreenData['main_topic'] ?? '',
mainTopic, mainTopic,
@ -2554,18 +2597,24 @@ class _ChartScreen1State extends ConsumerState<ChartScreen1> {
), ),
), ),
), ),
Container( ),
width: mywidth / 7, ),
height: 1.5, // Container(
child: Divider( // width: mywidth / 7,
thickness: 4, // height: 1.5,
color: Colors.white, // child: Divider(
)), // thickness: 4,
Text( // color: Colors.white,
// )),
Center(
child: Text(
// widget.title, // widget.title,
chartScreenData['data_set_tile_heading'] ?? '', chartScreenData['data_set_tile_heading'] ??
'',
style: TextStyle( style: TextStyle(
color: Colors.white, color: isDarkTheme
? Colors.white
: Colors.black,
fontSize: 20, fontSize: 20,
fontWeight: FontWeight.w500, fontWeight: FontWeight.w500,
fontFamily: context.translate( fontFamily: context.translate(
@ -2574,13 +2623,15 @@ class _ChartScreen1State extends ConsumerState<ChartScreen1> {
), ),
), ),
), ),
),
], ],
), ),
)), )),
Container( Container(
color: Color(int.parse( color: isDarkTheme ? Color(0xFF000000) : Colors.white,
(chartScreenData['header_color'] ?? '#898C81') // color: Color(int.parse(
.replaceFirst('#', '0xff'))), // (chartScreenData['header_color'] ?? '#898C81')
// .replaceFirst('#', '0xff'))),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.end, crossAxisAlignment: CrossAxisAlignment.end,
children: [ children: [
@ -2616,17 +2667,21 @@ class _ChartScreen1State extends ConsumerState<ChartScreen1> {
'إشارة مرجعية', 'إشارة مرجعية',
), ),
style: TextStyle( style: TextStyle(
fontFamily: context.translate( fontFamily:
context.translate(
'Roboto', 'Roboto',
'NotoKufi', 'NotoKufi',
), ),
fontSize: 16, fontSize: 16,
color: Color(int.parse( color: isDarkTheme
(chartScreenData[ ? Colors.grey
'body_color'] ?? : Color(0xFF416587),
'#898C81') // color: Color(int.parse(
.replaceFirst( // (chartScreenData[
'#', '0xff'))), // 'body_color'] ??
// '#898C81')
// .replaceFirst(
// '#', '0xff'))),
), ),
) )
: Text( : Text(
@ -2635,12 +2690,15 @@ class _ChartScreen1State extends ConsumerState<ChartScreen1> {
'إشارة مرجعية', 'إشارة مرجعية',
), ),
style: TextStyle( style: TextStyle(
fontFamily: context.translate( fontFamily:
context.translate(
'Roboto', 'Roboto',
'NotoKufi', 'NotoKufi',
), ),
fontSize: 16, fontSize: 16,
color: Colors.white, color: isDarkTheme
? Colors.grey
: Color(0xFF416587),
), ),
), ),
SizedBox(width: 5), SizedBox(width: 5),
@ -2696,7 +2754,10 @@ class _ChartScreen1State extends ConsumerState<ChartScreen1> {
'NotoKufi', 'NotoKufi',
), ),
fontSize: 16, fontSize: 16,
color: Colors.white, // color: Colors.white,
color: isDarkTheme
? Colors.grey
: Color(0xFF416587),
), ),
), ),
SizedBox(width: 5), SizedBox(width: 5),
@ -2743,7 +2804,10 @@ class _ChartScreen1State extends ConsumerState<ChartScreen1> {
'NotoKufi', 'NotoKufi',
), ),
fontSize: 16, fontSize: 16,
color: Colors.white, // color: Colors.white,
color: isDarkTheme
? Colors.grey
: Color(0xFF416587),
), ),
), ),
SizedBox(width: 10), SizedBox(width: 10),
@ -2774,9 +2838,19 @@ class _ChartScreen1State extends ConsumerState<ChartScreen1> {
), ),
Expanded( Expanded(
child: Container( child: Container(
color: Color(int.parse( // color: isDarkTheme ? Colors.black : Colors.white,
color: isDarkTheme
? Color(int.parse(
(chartScreenData['body_color'] ?? '#898C81')
.replaceFirst('#', '0xff')))
: Color(int.parse(
(chartScreenData['body_color'] ?? '#898C81') (chartScreenData['body_color'] ?? '#898C81')
.replaceFirst('#', '0xff'))), .replaceFirst('#', '0xff'))),
// color: Color(int.parse(
// (chartScreenData['body_color'] ?? '#898C81')
// .replaceFirst('#', '0xff'))),
child: Padding( child: Padding(
padding: const EdgeInsets.all(10.0), padding: const EdgeInsets.all(10.0),
child: ListView( child: ListView(
@ -2860,7 +2934,8 @@ class _ChartScreen1State extends ConsumerState<ChartScreen1> {
child: CardWidget( child: CardWidget(
card: card, card: card,
chartScreenData: chartScreenData:
chartScreenData,themeMode: themeMode))); chartScreenData,
themeMode: themeMode)));
if (tempRow.length == 2) { if (tempRow.length == 2) {
rows.add(Row(children: tempRow)); rows.add(Row(children: tempRow));
tempRow = []; tempRow = [];
@ -2885,20 +2960,32 @@ class _ChartScreen1State extends ConsumerState<ChartScreen1> {
shrinkWrap: true, shrinkWrap: true,
physics: const NeverScrollableScrollPhysics(), physics: const NeverScrollableScrollPhysics(),
itemBuilder: (context, index) { itemBuilder: (context, index) {
final isDarkTheme = themeMode == ThemeMode.dark || final isDarkTheme =
themeMode == ThemeMode.dark ||
(themeMode == ThemeMode.system && (themeMode == ThemeMode.system &&
MediaQuery.of(context).platformBrightness == Brightness.dark); MediaQuery.of(context)
.platformBrightness ==
Brightness.dark);
final Map<String, Color> mainTopicColors = { // final Map<String, Color> mainTopicColors = {
'ECONOMY': Color(0xFF071F3B), // 'ECONOMY': Color(0xFF071F3B),
'SOCIAL': Color(0xFF4F241B), // 'SOCIAL': Color(0xFF4F241B),
'ENVIRONMENT': Color(0xFF16523C), // 'ENVIRONMENT': Color(0xFF16523C),
}; // };
final String mainTopic = chartScreenData['main_topic']; final String mainTopic =
final Color backgroundColor = isDarkTheme chartScreenData['main_topic'];
? (mainTopicColors[mainTopic] ?? Colors.white) // fallback if key not found
: Colors.white; final Color backgroundColor = Color(int.parse(
(chartScreenData['body_color'] ??
'#898C81')
.replaceFirst('#', '0xff')));
// final Color backgroundColor = isDarkTheme
// ? (mainTopicColors[mainTopic] ??
// Colors
// .white) // fallback if key not found
// : Colors.white;
return Card( return Card(
margin: const EdgeInsets.all(10), margin: const EdgeInsets.all(10),
@ -2962,7 +3049,8 @@ class _ChartScreen1State extends ConsumerState<ChartScreen1> {
chartData: chartData:
chartsData[index], chartsData[index],
bodyColor: bodyColor, bodyColor: bodyColor,
chartHeader: chartHeader,isDarkTheme: isDarkTheme), chartHeader: chartHeader,
isDarkTheme: isDarkTheme),
) )
], ],
), ),
@ -2980,7 +3068,16 @@ class _ChartScreen1State extends ConsumerState<ChartScreen1> {
), ),
if (isLoading) if (isLoading)
Container( Container(
color: isDarkTheme ? Colors.transparent : Color(0x98FFFCE5), // Semi-transparent background // color: isDarkTheme
// ? Colors.transparent
// : Color(0x98FFFCE5),
color: isDarkTheme
? Colors.transparent
: Color(int.parse(
(chartScreenData['header_color'] ?? '#898C81')
.replaceFirst(
'#', '0xff'))), // Semi-transparent background
child: Column( child: Column(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: [ children: [
@ -2989,7 +3086,9 @@ class _ChartScreen1State extends ConsumerState<ChartScreen1> {
horizontal: 40), // Left & Right space horizontal: 40), // Left & Right space
child: LinearProgressIndicator( child: LinearProgressIndicator(
minHeight: 5, // Adjust thickness minHeight: 5, // Adjust thickness
backgroundColor: isDarkTheme ? Colors.transparent : Colors.grey[100], // Optional: Background color backgroundColor: isDarkTheme
? Colors.transparent
: Colors.grey[100], // Optional: Background color
valueColor: AlwaysStoppedAnimation<Color>( valueColor: AlwaysStoppedAnimation<Color>(
Color(0xFFAA8E83)), // Loader color Color(0xFFAA8E83)), // Loader color
), ),
@ -3008,10 +3107,15 @@ class _ChartScreen1State extends ConsumerState<ChartScreen1> {
return Container( return Container(
margin: EdgeInsets.symmetric(horizontal: 5.0), margin: EdgeInsets.symmetric(horizontal: 5.0),
width: 30.0, // Set the width of the circle width: 30.0, // Set the width of the circle
height: 30.0, height: 25.0,
decoration: BoxDecoration( decoration: BoxDecoration(
color: onPressed == null ? Colors.grey[400] : Colors.white, // color: onPressed == null ? Colors.grey[400] : Colors.white,
shape: BoxShape.circle, color: onPressed == null
? Color(int.parse((chartScreenData['header_color'] ?? '#898C81')
.replaceFirst('#', '0xff')))
: Colors.grey[400],
shape: BoxShape.rectangle,
borderRadius: BorderRadius.circular(5.0),
// boxShadow: [ // boxShadow: [
// BoxShadow( // BoxShadow(
// color: Colors.black26, // color: Colors.black26,
@ -3022,8 +3126,8 @@ class _ChartScreen1State extends ConsumerState<ChartScreen1> {
), ),
child: IconButton( child: IconButton(
onPressed: onPressed, onPressed: onPressed,
icon: Icon(icon, color: onPressed == null ? Colors.grey : color), icon: Icon(icon, color: onPressed == null ? Colors.white : Colors.grey),
iconSize: 15.0, iconSize: 12.5,
), ),
); );
} }
@ -3039,10 +3143,14 @@ class _ChartScreen1State extends ConsumerState<ChartScreen1> {
}, },
child: Container( child: Container(
margin: EdgeInsets.symmetric(horizontal: 8.0), margin: EdgeInsets.symmetric(horizontal: 8.0),
padding: EdgeInsets.symmetric(vertical: 5.0, horizontal: 16.0), padding: EdgeInsets.symmetric(vertical: 3.0, horizontal: 16.0),
decoration: BoxDecoration( decoration: BoxDecoration(
color: isActive ? Colors.white : Colors.grey[400], // color: isActive ? Colors.white : Colors.grey[400],
borderRadius: BorderRadius.circular(20.0), color: isActive
? Color(int.parse((chartScreenData['header_color'] ?? '#898C81')
.replaceFirst('#', '0xff')))
: Colors.grey[400],
borderRadius: BorderRadius.circular(5.0),
), ),
child: Text( child: Text(
tab['name']!, tab['name']!,
@ -3061,8 +3169,6 @@ class _ChartScreen1State extends ConsumerState<ChartScreen1> {
} }
} }
// Function to convert hex color string to Color // Function to convert hex color string to Color
Color _getColorFromHex(String hexColor) { Color _getColorFromHex(String hexColor) {
hexColor = hexColor.replaceFirst('#', ''); hexColor = hexColor.replaceFirst('#', '');
@ -3078,7 +3184,10 @@ class CardWidget extends StatelessWidget {
final themeMode; final themeMode;
const CardWidget( const CardWidget(
{Key? key, required this.card, required this.chartScreenData,required this.themeMode}) {Key? key,
required this.card,
required this.chartScreenData,
required this.themeMode})
: super(key: key); : super(key: key);
@override @override
@ -3110,11 +3219,14 @@ class CardWidget extends StatelessWidget {
}; };
final String mainTopic = chartScreenData['main_topic']; final String mainTopic = chartScreenData['main_topic'];
final Color backgroundColor = isDarkTheme
? (mainTopicColors[mainTopic] ?? Colors.white) // fallback if key not found
: Colors.white;
// final Color backgroundColor = isDarkTheme
// ? (mainTopicColors[mainTopic] ??
// Colors.white)
final Color backgroundColor = Color(int.parse(
(chartScreenData['body_color'] ?? '#898C81')
.replaceFirst('#', '0xff')));
if (response.isEmpty) { if (response.isEmpty) {
return SizedBox.shrink(); return SizedBox.shrink();
@ -3131,7 +3243,6 @@ class CardWidget extends StatelessWidget {
// Dynamic border color // Dynamic border color
width: 1, // Adjust border thickness width: 1, // Adjust border thickness
), ),
), ),
child: Card( child: Card(
margin: const EdgeInsets.all(0), margin: const EdgeInsets.all(0),
@ -3188,7 +3299,8 @@ class CardWidget extends StatelessWidget {
fontFamily: context.translate( fontFamily: context.translate(
'Roboto', 'Roboto',
'NotoKufi', 'NotoKufi',
),), ),
),
), ),
), ),
), ),
@ -3332,14 +3444,14 @@ class CardWidget extends StatelessWidget {
), ),
child: Text( child: Text(
chart_heading ?? 'NA', chart_heading ?? 'NA',
style: style: TextStyle(
TextStyle(
color: Colors.white, color: Colors.white,
fontSize: 10, fontSize: 10,
fontFamily: context.translate( fontFamily: context.translate(
'Roboto', 'Roboto',
'NotoKufi', 'NotoKufi',
),), ),
),
), ),
), ),
), ),

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';
@ -34,6 +38,9 @@ class _BookMarkState extends ConsumerState<BookMark> {
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 ||
// (currentTheme == ThemeMode.system &&
// MediaQuery.of(context).platformBrightness == Brightness.dark);
WidgetsBinding.instance.addPostFrameCallback((_) {
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'); final themeMode = (isDark ? 'dark' : 'light');
print("ThemeMode - $themeMode");
fetchData(locale?.languageCode ?? 'en', themeMode);
fetchBookmarks(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) {
@ -85,7 +123,11 @@ 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) {
@ -230,8 +272,7 @@ class _BookMarkState extends ConsumerState<BookMark> {
fontFamily: context.translate( fontFamily: context.translate(
'Roboto', 'Roboto',
'NotoKufi', 'NotoKufi',
) )),
),
), ),
duration: Duration(seconds: 2), duration: Duration(seconds: 2),
), ),
@ -243,12 +284,16 @@ class _BookMarkState extends ConsumerState<BookMark> {
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(
color: Color(0xFFEB5F24),
fontWeight: FontWeight.w600,
fontFamily: context.translate(
'Roboto', 'Roboto',
'NotoKufi', '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(() {
@ -431,6 +460,24 @@ class _BookMarkState extends ConsumerState<BookMark> {
(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();
@ -455,6 +502,8 @@ 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(
@ -462,12 +511,12 @@ class _BookMarkState extends ConsumerState<BookMark> {
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: [
@ -495,14 +544,14 @@ class _BookMarkState extends ConsumerState<BookMark> {
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 =
@ -514,7 +563,8 @@ class _BookMarkState extends ConsumerState<BookMark> {
onTap: (int index) { onTap: (int index) {
// 🔹 Expecting an index // 🔹 Expecting an index
setState(() { setState(() {
expandedIndex = (expandedIndex == index) expandedIndex =
(expandedIndex == index)
? null ? null
: index; : index;
}); });
@ -523,13 +573,16 @@ class _BookMarkState extends ConsumerState<BookMark> {
mainTopic['main_topic'] ?? 'No Topic', mainTopic['main_topic'] ?? 'No Topic',
childWidget: Container( childWidget: Container(
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.white, color: isDarkTheme
? Color(0xFF111111)
: 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,
@ -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,
); );
}), }),
), ),
@ -570,7 +625,8 @@ class _BookMarkState extends ConsumerState<BookMark> {
'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,
@ -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,7 +719,8 @@ class _BookMarkState extends ConsumerState<BookMark> {
); );
} }
Widget _buildBox(Map<String, dynamic> data, BuildContext context) { Widget _buildBox(
Map<String, dynamic> data, BuildContext context, bool isDarkTheme) {
// Color borderColor = data['valueColor']; // Color borderColor = data['valueColor'];
return GestureDetector( return GestureDetector(
onTap: () { onTap: () {
@ -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,
), ),
@ -737,7 +804,8 @@ class _BookMarkState extends ConsumerState<BookMark> {
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,7 +836,11 @@ class _BookMarkState extends ConsumerState<BookMark> {
} }
Widget _buildBoxes( Widget _buildBoxes(
Map<String, dynamic> data, BuildContext context, Color styleColor) { Map<String, dynamic> data,
BuildContext context,
Color styleColor,
bool isDarkTheme,
) {
// Color borderColor = data['valueColor']; // Color borderColor = data['valueColor'];
print('inside function $data'); print('inside function $data');
return GestureDetector( return GestureDetector(
@ -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(
fontWeight: FontWeight.w500,
fontFamily: context.translate(
'Roboto', 'Roboto',
'NotoKufi', '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,
color: Colors.grey,
fontFamily: context.translate(
'Roboto', 'Roboto',
'NotoKufi', '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,
style: TextStyle(
fontFamily: context.translate(
'Roboto', 'Roboto',
'NotoKufi', '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
@ -969,7 +1055,9 @@ 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
? Color(0xFF111111)
: Colors
.white, // Ensuring the background outside the rounded container is white .white, // Ensuring the background outside the rounded container is white
), ),
child: Container( child: Container(
@ -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,7 +1098,7 @@ 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(

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,22 +140,50 @@ 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,
body: isLoading
? Container(
// color: Color(0x98FFFCE5), // Semi-transparent background
color: isDarkTheme
? Color(0xFF333333)
: Color(0x98FFFCE5), // Semi-transparent background
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Container(
margin: EdgeInsets.symmetric(
horizontal: 40), // Left & Right space
child: LinearProgressIndicator(
minHeight: 5, // Adjust thickness
backgroundColor:
Colors.grey[100], // Optional: Background color
valueColor: AlwaysStoppedAnimation<Color>(
Color(0xFFAA8E83)), // Loader color
),
),
],
),
)
: Container(
// color: Colors.grey[200],
// color: isDarkTheme ? Color(0xFF3B3C3F) : Colors.grey[200],
color: isDarkTheme ? Color(0xFF333333) : Colors.grey[200],
width: screenWidth, width: screenWidth,
padding: const EdgeInsets.all(16.0), padding: const EdgeInsets.all(16.0),
child: SingleChildScrollView( child: SingleChildScrollView(
child: Column( child: Column(
children: [ children: [
buildContactCard( buildContactCard(context,
context,
title: 'DUBAI - EMIRATES TOWER - 32ND FLOOR', title: 'DUBAI - EMIRATES TOWER - 32ND FLOOR',
titleAr: 'دبي - أبراج الإمارات - الطابق 32', titleAr: 'دبي - أبراج الإمارات - الطابق 32',
details: [ details: [
{ {
'icon': EnquiryAssetIconPath.building, 'icon': EnquiryAssetIconPath.building,
'text': 'Office: Dubai - Emirates Tower - 32nd Floor', 'text':
'textAr': 'المقر الرئيسي: دبي - أبراج الإمارات - الطابق 32' 'Office: Dubai - Emirates Tower - 32nd Floor',
'textAr':
'المقر الرئيسي: دبي - أبراج الإمارات - الطابق 32'
}, },
{ {
'icon': EnquiryAssetIconPath.phone, 'icon': EnquiryAssetIconPath.phone,
@ -97,7 +216,7 @@ class _ContactState extends ConsumerState<Contact> {
'textAr': 'خط الطول: 55.350526' 'textAr': 'خط الطول: 55.350526'
}, },
], ],
), isDarkTheme: isDarkTheme),
const SizedBox(height: 10), const SizedBox(height: 10),
buildContactCard( buildContactCard(
context, context,
@ -140,6 +259,7 @@ class _ContactState extends ConsumerState<Contact> {
'textAr': 'خط الطول: 55.350526' 'textAr': 'خط الطول: 55.350526'
}, },
], ],
isDarkTheme: isDarkTheme,
), ),
const SizedBox(height: 10), const SizedBox(height: 10),
buildContactCard( buildContactCard(
@ -183,6 +303,7 @@ class _ContactState extends ConsumerState<Contact> {
'textAr': 'خط الطول: 55.350526' 'textAr': 'خط الطول: 55.350526'
}, },
], ],
isDarkTheme: isDarkTheme,
), ),
], ],
), ),
@ -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,23 +349,30 @@ 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 {
@ -287,18 +417,28 @@ class _ContactState extends ConsumerState<Contact> {
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(
fontSize: 14,
color: isDarkTheme ? Colors.white : Color(0xFF5F5F5F),
fontFamily: context.translate(
'Roboto', 'Roboto',
'NotoKufi', 'NotoKufi',
),),
children: <TextSpan>[
TextSpan(text: ':',),
TextSpan(text: values[1],
style: TextStyle(fontSize: 14, color:Color(0xFF985400), fontFamily: context.translate(
'Roboto',
'NotoKufi',
),)
), ),
),
children: <TextSpan>[
TextSpan(
text: ':',
),
TextSpan(
text: values[1],
style: TextStyle(
fontSize: 14,
color: Color(0xFF985400),
fontFamily: context.translate(
'Roboto',
'NotoKufi',
),
)),
], ],
), ),
), ),
@ -316,18 +456,30 @@ class _ContactState extends ConsumerState<Contact> {
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(
fontSize: 14,
color:
isDarkTheme ? Colors.white : Color(0xFF5F5F5F),
// color: Color(0xFF5F5F5F),
fontFamily: context.translate(
'Roboto', 'Roboto',
'NotoKufi', 'NotoKufi',
),),
children: <TextSpan>[
TextSpan(text: ':',),
TextSpan(text: values[1],
style: TextStyle(fontSize: 14, color:Color(0xFF985400), fontFamily: context.translate(
'Roboto',
'NotoKufi',
),)
), ),
),
children: <TextSpan>[
TextSpan(
text: ':',
),
TextSpan(
text: values[1],
style: TextStyle(
fontSize: 14,
color: Color(0xFF985400),
fontFamily: context.translate(
'Roboto',
'NotoKufi',
),
)),
], ],
), ),
), ),
@ -341,7 +493,8 @@ class _ContactState extends ConsumerState<Contact> {
'NotoKufi', 'NotoKufi',
), ),
fontSize: 14, fontSize: 14,
color: Color(0xFF5F5F5F), color: isDarkTheme ? Colors.white : Color(0xFF5F5F5F),
// color: Color(0xFF5F5F5F),
), ),
), ),
), ),

View File

@ -13,7 +13,7 @@ import 'package:image_picker/image_picker.dart';
import 'package:intl/intl.dart'; import 'package:intl/intl.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';
import 'package:flutter_gen/gen_l10n/app_localizations.dart'; // import 'package:flutter_gen/gen_l10n/app_localizations.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';
@ -23,6 +23,7 @@ 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/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';
import 'package:flutter_gen/gen_l10n/app_localizations.dart';
class EditProfile extends ConsumerStatefulWidget { class EditProfile extends ConsumerStatefulWidget {
const EditProfile({super.key}); const EditProfile({super.key});
@ -279,13 +280,14 @@ class _EditProfileState extends ConsumerState<EditProfile> {
ScaffoldMessenger.of(context).showSnackBar( ScaffoldMessenger.of(context).showSnackBar(
SnackBar( SnackBar(
content: Text( content: Text(
context.translate('Please select a JPG, JPEG, or PNG file.','يرجى تحديد ملف بصيغة JPG أو JPEG أو PNG.'), context.translate('Please select a JPG, JPEG, or PNG file.',
'يرجى تحديد ملف بصيغة JPG أو JPEG أو PNG.'),
style: TextStyle( style: TextStyle(
fontFamily: context.translate( fontFamily: context.translate(
'Roboto', 'Roboto',
'NotoKufi', 'NotoKufi',
) )),
),)), )),
); );
} }
} }
@ -440,8 +442,7 @@ class _EditProfileState extends ConsumerState<EditProfile> {
fontFamily: context.translate( fontFamily: context.translate(
'Roboto', 'Roboto',
'NotoKufi', 'NotoKufi',
) )),
),
)), )),
); );
}); });
@ -454,13 +455,14 @@ class _EditProfileState extends ConsumerState<EditProfile> {
}); });
ScaffoldMessenger.of(context).showSnackBar( ScaffoldMessenger.of(context).showSnackBar(
SnackBar( SnackBar(
content: Text('Failed to update profile: ${response.statusCode}', content: Text(
'Failed to update profile: ${response.statusCode}',
style: TextStyle( style: TextStyle(
fontFamily: context.translate( fontFamily: context.translate(
'Roboto', 'Roboto',
'NotoKufi', 'NotoKufi',
) )),
),), ),
), ),
); );
} }
@ -469,13 +471,15 @@ class _EditProfileState extends ConsumerState<EditProfile> {
isLoader = false; isLoader = false;
}); });
ScaffoldMessenger.of(context).showSnackBar( ScaffoldMessenger.of(context).showSnackBar(
SnackBar(content: Text('Failed to update profile: $error', SnackBar(
content: Text(
'Failed to update profile: $error',
style: TextStyle( style: TextStyle(
fontFamily: context.translate( fontFamily: context.translate(
'Roboto', 'Roboto',
'NotoKufi', 'NotoKufi',
) )),
),)), )),
); );
} }
} else { } else {
@ -547,12 +551,17 @@ class _EditProfileState extends ConsumerState<EditProfile> {
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,
title: Text( title: Text(
AppLocalizations.of(context)!.my_profile, AppLocalizations.of(context)!.my_profile,
style: TextStyle(color: Color(0xFF985400), fontFamily: context.translate( style: TextStyle(
color: isDarkTheme ? Colors.white : Color(0xFF985400),
fontFamily: context.translate(
'Roboto', 'Roboto',
'NotoKufi', 'NotoKufi',
),), ),
),
), ),
body: isLoader body: isLoader
? Container( ? Container(
@ -588,7 +597,10 @@ class _EditProfileState extends ConsumerState<EditProfile> {
child: Padding( child: Padding(
// padding: const EdgeInsets.all(20.0), // padding: const EdgeInsets.all(20.0),
padding: const EdgeInsets.only( padding: const EdgeInsets.only(
top: 20.0, bottom: 20.0, left: 25, right: 25), top: 20.0,
bottom: 20.0,
left: 25,
right: 25),
child: Column( child: Column(
children: [ children: [
// CircleAvatar( // CircleAvatar(
@ -673,7 +685,8 @@ class _EditProfileState extends ConsumerState<EditProfile> {
children: [ children: [
CircleAvatar( CircleAvatar(
radius: 50, radius: 50,
backgroundImage: _profileImage != null backgroundImage: _profileImage !=
null
? FileImage( ? FileImage(
_profileImage!) // If a local file is selected _profileImage!) // If a local file is selected
: _avatarUrl.isNotEmpty : _avatarUrl.isNotEmpty
@ -684,11 +697,14 @@ class _EditProfileState extends ConsumerState<EditProfile> {
as ImageProvider, as ImageProvider,
child: _avatarUrl.isNotEmpty child: _avatarUrl.isNotEmpty
? FutureBuilder( ? FutureBuilder(
future: _loadImage(_avatarUrl), future:
builder: (context, snapshot) { _loadImage(_avatarUrl),
builder:
(context, snapshot) {
if (snapshot if (snapshot
.connectionState == .connectionState ==
ConnectionState.waiting) { ConnectionState
.waiting) {
return Center( return Center(
child: child:
CircularProgressIndicator(), CircularProgressIndicator(),
@ -696,13 +712,15 @@ class _EditProfileState extends ConsumerState<EditProfile> {
} else if (snapshot } else if (snapshot
.hasError) { .hasError) {
return Center( return Center(
child: Icon(Icons.error), child:
Icon(Icons.error),
); );
} else { } else {
return Align( return Align(
alignment: alignment: Alignment
Alignment.bottomRight, .bottomRight,
child: GestureDetector( child:
GestureDetector(
onTap: onTap:
_pickImage, // Call `_pickImage` on tap _pickImage, // Call `_pickImage` on tap
child: CircleAvatar( child: CircleAvatar(
@ -710,9 +728,11 @@ class _EditProfileState extends ConsumerState<EditProfile> {
backgroundColor: backgroundColor:
Colors.white, Colors.white,
child: Icon( child: Icon(
Icons.camera_alt, Icons
.camera_alt,
size: 15, size: 15,
color: Colors.grey, color:
Colors.grey,
), ),
), ),
), ),
@ -744,7 +764,8 @@ class _EditProfileState extends ConsumerState<EditProfile> {
SizedBox(height: 20), SizedBox(height: 20),
Row( Row(
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment:
MainAxisAlignment.start,
children: [ children: [
Text( Text(
AppLocalizations.of(context)! AppLocalizations.of(context)!
@ -767,22 +788,28 @@ class _EditProfileState extends ConsumerState<EditProfile> {
focusNode: _focusNodes[0], focusNode: _focusNodes[0],
decoration: InputDecoration( decoration: InputDecoration(
// hintText: _showHints[0] ? 'Mohammad Hassan' : null, // hintText: _showHints[0] ? 'Mohammad Hassan' : null,
hintStyle: TextStyle(color: Colors.grey, fontFamily: context.translate( hintStyle: TextStyle(
color: Colors.grey,
fontFamily: context.translate(
'Roboto', 'Roboto',
'NotoKufi', 'NotoKufi',
),), ),
),
border: OutlineInputBorder( border: OutlineInputBorder(
borderRadius: BorderRadius.circular(8), borderRadius:
BorderRadius.circular(8),
), ),
enabled: false, enabled: false,
), ),
), ),
SizedBox(height: 10), SizedBox(height: 10),
Row( Row(
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment:
MainAxisAlignment.start,
children: [ children: [
Text( Text(
AppLocalizations.of(context)!.email_id, AppLocalizations.of(context)!
.email_id,
style: TextStyle( style: TextStyle(
fontFamily: context.translate( fontFamily: context.translate(
'Roboto', 'Roboto',
@ -802,17 +829,20 @@ class _EditProfileState extends ConsumerState<EditProfile> {
decoration: InputDecoration( decoration: InputDecoration(
// hintText: _showHints[1]? 'mohammad.hassan@fcsc.gov.ae': null, // hintText: _showHints[1]? 'mohammad.hassan@fcsc.gov.ae': null,
border: OutlineInputBorder( border: OutlineInputBorder(
borderRadius: BorderRadius.circular(8), borderRadius:
BorderRadius.circular(8),
), ),
enabled: false, enabled: false,
), ),
), ),
SizedBox(height: 10), SizedBox(height: 10),
Row( Row(
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment:
MainAxisAlignment.start,
children: [ children: [
Text( Text(
AppLocalizations.of(context)!.full_name, AppLocalizations.of(context)!
.full_name,
style: TextStyle( style: TextStyle(
fontFamily: context.translate( fontFamily: context.translate(
'Roboto', 'Roboto',
@ -848,13 +878,16 @@ class _EditProfileState extends ConsumerState<EditProfile> {
focusNode: _focusNodes[2], focusNode: _focusNodes[2],
decoration: InputDecoration( decoration: InputDecoration(
// hintText: _showHints[2] ? 'Mohammad' : null, // hintText: _showHints[2] ? 'Mohammad' : null,
hintStyle: TextStyle(color: Colors.grey, hintStyle: TextStyle(
color: Colors.grey,
fontFamily: context.translate( fontFamily: context.translate(
'Roboto', 'Roboto',
'NotoKufi', 'NotoKufi',
),), ),
),
border: OutlineInputBorder( border: OutlineInputBorder(
borderRadius: BorderRadius.circular(8), borderRadius:
BorderRadius.circular(8),
), ),
// counterText: '', // counterText: '',
enabled: !_isProfileCompleted, enabled: !_isProfileCompleted,
@ -866,7 +899,8 @@ class _EditProfileState extends ConsumerState<EditProfile> {
), ),
SizedBox(height: 10), SizedBox(height: 10),
Row( Row(
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment:
MainAxisAlignment.start,
children: [ children: [
Text( Text(
AppLocalizations.of(context)!.dob, AppLocalizations.of(context)!.dob,
@ -888,13 +922,17 @@ class _EditProfileState extends ConsumerState<EditProfile> {
focusNode: _focusNodes[3], focusNode: _focusNodes[3],
decoration: InputDecoration( decoration: InputDecoration(
border: OutlineInputBorder( border: OutlineInputBorder(
borderRadius: BorderRadius.circular(8), borderRadius:
BorderRadius.circular(8),
), ),
// hintText: _showHints[3] ? 'Select your Date of Birth' : null, // hintText: _showHints[3] ? 'Select your Date of Birth' : null,
hintStyle: TextStyle(color: Colors.grey, fontFamily: context.translate( hintStyle: TextStyle(
color: Colors.grey,
fontFamily: context.translate(
'Roboto', 'Roboto',
'NotoKufi', 'NotoKufi',
),), ),
),
suffixIcon: Container( suffixIcon: Container(
width: 45, width: 45,
padding: EdgeInsets.only(right: 1), padding: EdgeInsets.only(right: 1),
@ -913,10 +951,12 @@ class _EditProfileState extends ConsumerState<EditProfile> {
), ),
SizedBox(height: 10), SizedBox(height: 10),
Row( Row(
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment:
MainAxisAlignment.start,
children: [ children: [
Text( Text(
AppLocalizations.of(context)!.region, AppLocalizations.of(context)!
.region,
style: TextStyle( style: TextStyle(
fontFamily: context.translate( fontFamily: context.translate(
'Roboto', 'Roboto',
@ -951,7 +991,8 @@ class _EditProfileState extends ConsumerState<EditProfile> {
BorderRadius.circular(10), BorderRadius.circular(10),
borderSide: BorderSide( borderSide: BorderSide(
color: MyTheme.topicColor( color: MyTheme.topicColor(
IndicatorTopic.economy) IndicatorTopic
.economy)
.shade400, .shade400,
width: 1), // Enabled border width: 1), // Enabled border
), ),
@ -971,15 +1012,18 @@ class _EditProfileState extends ConsumerState<EditProfile> {
: Colors.grey), : Colors.grey),
items: _countries items: _countries
.map( .map(
(item) => DropdownMenuItem<String>( (item) =>
DropdownMenuItem<String>(
value: item, value: item,
child: Text(item, child: Text(
item,
style: TextStyle( style: TextStyle(
fontFamily: context.translate( fontFamily:
context.translate(
'Roboto', 'Roboto',
'NotoKufi', 'NotoKufi',
) )),
),), ),
), ),
) )
.toList(), .toList(),
@ -992,7 +1036,8 @@ class _EditProfileState extends ConsumerState<EditProfile> {
), ),
), ),
Row( Row(
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment:
MainAxisAlignment.start,
children: [ children: [
Text( Text(
AppLocalizations.of(context)! AppLocalizations.of(context)!
@ -1009,10 +1054,10 @@ class _EditProfileState extends ConsumerState<EditProfile> {
), ),
SizedBox(height: 10), SizedBox(height: 10),
MouseRegion( MouseRegion(
onEnter: (_) => setState( onEnter: (_) => setState(() =>
() => _isHoveringPreferredLang = true), _isHoveringPreferredLang = true),
onExit: (_) => setState( onExit: (_) => setState(() =>
() => _isHoveringPreferredLang = false), _isHoveringPreferredLang = false),
child: DropdownButtonFormField<String>( child: DropdownButtonFormField<String>(
style: TextStyle( style: TextStyle(
fontFamily: context.translate( fontFamily: context.translate(
@ -1030,7 +1075,8 @@ class _EditProfileState extends ConsumerState<EditProfile> {
BorderRadius.circular(10), BorderRadius.circular(10),
borderSide: BorderSide( borderSide: BorderSide(
color: MyTheme.topicColor( color: MyTheme.topicColor(
IndicatorTopic.economy) IndicatorTopic
.economy)
.shade400, .shade400,
width: 1), // Enabled border width: 1), // Enabled border
), ),
@ -1050,15 +1096,18 @@ class _EditProfileState extends ConsumerState<EditProfile> {
: Colors.grey), : Colors.grey),
items: preferred_language items: preferred_language
.map( .map(
(item) => DropdownMenuItem<String>( (item) =>
DropdownMenuItem<String>(
value: item, value: item,
child: Text(item, child: Text(
item,
style: TextStyle( style: TextStyle(
fontFamily: context.translate( fontFamily:
context.translate(
'Roboto', 'Roboto',
'NotoKufi', 'NotoKufi',
) )),
),), ),
), ),
) )
.toList(), .toList(),
@ -1084,7 +1133,8 @@ class _EditProfileState extends ConsumerState<EditProfile> {
value: isChecked, value: isChecked,
onChanged: (value) { onChanged: (value) {
setState(() { setState(() {
isChecked = value ?? false; isChecked =
value ?? false;
showError = false; showError = false;
}); });
}, },
@ -1103,20 +1153,23 @@ class _EditProfileState extends ConsumerState<EditProfile> {
mainAxisAlignment: mainAxisAlignment:
MainAxisAlignment.start, MainAxisAlignment.start,
crossAxisAlignment: crossAxisAlignment:
CrossAxisAlignment.start, CrossAxisAlignment
.start,
children: [ children: [
SizedBox(height: 10), SizedBox(height: 10),
Text.rich( Text.rich(
TextSpan( TextSpan(
text: AppLocalizations.of( text: AppLocalizations
context)! .of(context)!
.agree, .agree,
style: TextStyle( style: TextStyle(
fontFamily: context.translate( fontFamily: context
.translate(
'Roboto', 'Roboto',
'NotoKufi', 'NotoKufi',
), ),
color: Colors.black), color:
Colors.black),
children: [ children: [
TextSpan( TextSpan(
text: AppLocalizations text: AppLocalizations
@ -1125,7 +1178,8 @@ class _EditProfileState extends ConsumerState<EditProfile> {
)! )!
.terms_conditions, .terms_conditions,
style: TextStyle( style: TextStyle(
fontFamily: context.translate( fontFamily: context
.translate(
'Roboto', 'Roboto',
'NotoKufi', 'NotoKufi',
), ),
@ -1136,24 +1190,26 @@ class _EditProfileState extends ConsumerState<EditProfile> {
TextDecoration TextDecoration
.underline, .underline,
), ),
recognizer: recognizer: TapGestureRecognizer()
TapGestureRecognizer()
..onTap = () => ..onTap = () =>
context.push( context.push(
'/termsandconditions'), '/termsandconditions'),
), ),
TextSpan( TextSpan(
text: AppLocalizations text:
AppLocalizations
.of( .of(
context, context,
)! )!
.t_and, .t_and,
style: TextStyle( style: TextStyle(
fontFamily: context.translate( fontFamily: context
.translate(
'Roboto', 'Roboto',
'NotoKufi', 'NotoKufi',
), ),
color: Colors.black, color: Colors
.black,
), ),
), ),
TextSpan( TextSpan(
@ -1163,7 +1219,8 @@ class _EditProfileState extends ConsumerState<EditProfile> {
)! )!
.privacy_policy, .privacy_policy,
style: TextStyle( style: TextStyle(
fontFamily: context.translate( fontFamily: context
.translate(
'Roboto', 'Roboto',
'NotoKufi', 'NotoKufi',
), ),
@ -1174,8 +1231,7 @@ class _EditProfileState extends ConsumerState<EditProfile> {
TextDecoration TextDecoration
.underline, .underline,
), ),
recognizer: recognizer: TapGestureRecognizer()
TapGestureRecognizer()
..onTap = () => ..onTap = () =>
context.push( context.push(
'/privacy_policy'), '/privacy_policy'),
@ -1187,19 +1243,22 @@ class _EditProfileState extends ConsumerState<EditProfile> {
)! )!
.conditions, .conditions,
style: TextStyle( style: TextStyle(
fontFamily: context.translate( fontFamily: context
.translate(
'Roboto', 'Roboto',
'NotoKufi', 'NotoKufi',
), ),
color: Colors.black, color: Colors
.black,
), ),
), ),
], ],
), ),
textAlign: TextAlign.start, textAlign:
TextAlign.start,
maxLines: 2, maxLines: 2,
overflow: overflow: TextOverflow
TextOverflow.visible, .visible,
softWrap: true, softWrap: true,
), ),
], ],
@ -1213,12 +1272,14 @@ class _EditProfileState extends ConsumerState<EditProfile> {
MainAxisAlignment.start, MainAxisAlignment.start,
children: [ children: [
Padding( Padding(
padding: const EdgeInsets.only( padding:
const EdgeInsets.only(
left: 10.0), left: 10.0),
child: Text( child: Text(
'Please agree to terms and conditions', 'Please agree to terms and conditions',
style: TextStyle( style: TextStyle(
fontFamily: context.translate( fontFamily:
context.translate(
'Roboto', 'Roboto',
'NotoKufi', 'NotoKufi',
), ),
@ -1243,7 +1304,7 @@ class _EditProfileState extends ConsumerState<EditProfile> {
.change_password, .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(
@ -1288,10 +1349,12 @@ class _EditProfileState extends ConsumerState<EditProfile> {
// } // }
}, },
style: ElevatedButton.styleFrom( style: ElevatedButton.styleFrom(
backgroundColor: Color(0xFF92722A), backgroundColor: isDarkTheme ? Color(0xFF24B4FB) : Color(0xFF92722A),
minimumSize: Size(double.infinity, 50), minimumSize:
Size(double.infinity, 50),
shape: RoundedRectangleBorder( shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(8), borderRadius:
BorderRadius.circular(8),
), ),
), ),
child: Row( child: Row(
@ -1299,11 +1362,15 @@ class _EditProfileState extends ConsumerState<EditProfile> {
.center, // Center the content .center, // Center the content
children: [ children: [
Text( Text(
AppLocalizations.of(context)!.save, AppLocalizations.of(context)!
style: TextStyle(color: Colors.white, fontFamily: context.translate( .save,
style: TextStyle(
color: Colors.white,
fontFamily: context.translate(
'Roboto', 'Roboto',
'NotoKufi', 'NotoKufi',
),), ),
),
), ),
SizedBox( SizedBox(
width: width:
@ -1328,7 +1395,6 @@ class _EditProfileState extends ConsumerState<EditProfile> {
), ),
) )
//bottomNavigationBar: MyBottomNavBar(), //bottomNavigationBar: MyBottomNavBar(),
)); ));
} }
@ -1371,11 +1437,13 @@ class ConfirmationDialog extends StatelessWidget {
children: [ children: [
TextSpan( TextSpan(
text: 'Country', text: 'Country',
style: style: TextStyle(
TextStyle(fontWeight: FontWeight.w500, fontFamily: context.translate( fontWeight: FontWeight.w500,
fontFamily: context.translate(
'Roboto', 'Roboto',
'NotoKufi', 'NotoKufi',
),), // Bold for "name" ),
), // Bold for "name"
), ),
TextSpan( TextSpan(
text: ' or ', text: ' or ',
@ -1422,10 +1490,13 @@ class ConfirmationDialog extends StatelessWidget {
), ),
child: Text( child: Text(
'Cancel', 'Cancel',
style: TextStyle(color: Color(0xFF92722A), fontFamily: context.translate( style: TextStyle(
color: Color(0xFF92722A),
fontFamily: context.translate(
'Roboto', 'Roboto',
'NotoKufi', 'NotoKufi',
),), ),
),
), ),
), ),
ElevatedButton( ElevatedButton(

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,10 +295,53 @@ 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';
await _userService.updateLanguage(localeCode); 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");
final userName = GoRouterState.of(context).extra as String? ?? 'Guest User'; final userName = GoRouterState.of(context).extra as String? ?? 'Guest User';
return PopScope( return PopScope(
@ -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(
color: Color(0xFFD83731),
fontSize: 14,
fontFamily: context.translate(
'Roboto', 'Roboto',
'NotoKufi', '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,
(rating) {
setState(() { setState(() {
_easeOfUseRating = rating; _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(
color: isDarkTheme ? Colors.white : Color(0xFF898C81),
fontFamily: context.translate(
'Roboto', 'Roboto',
'NotoKufi', '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(
color: isDarkTheme ? Colors.white : Color(0xFF898C81),
fontFamily: context.translate(
'Roboto', 'Roboto',
'NotoKufi', '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,
), ),
@ -551,13 +665,15 @@ class _FeedbackFormState extends ConsumerState<FeedbackForm>
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(
fontSize: 24,
fontWeight: FontWeight.bold,
fontFamily: context.translate(
'Roboto', 'Roboto',
'NotoKufi', '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(
fontSize: 16,
color: isDarkTheme ? Colors.white : Color(0xFF898C81),
fontFamily: context.translate(
'Roboto', 'Roboto',
'NotoKufi', '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(
fontSize: 16,
color: isDarkTheme ? Colors.white : Color(0xFF898C81),
fontFamily: context.translate(
'Roboto', 'Roboto',
'NotoKufi', '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,
@ -843,8 +978,7 @@ class _FeedbackFormState extends ConsumerState<FeedbackForm>
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(() {
@ -907,8 +1042,7 @@ class _FeedbackFormState extends ConsumerState<FeedbackForm>
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,14 +171,14 @@ 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(
context.translate(
'Error updating status: $e', '$e خطأ في تحديث الحالة: '), 'Error updating status: $e', '$e خطأ في تحديث الحالة: '),
style: TextStyle( style: TextStyle(
fontFamily: context.translate( fontFamily: context.translate(
'Roboto', 'Roboto',
'NotoKufi', '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',
@ -359,8 +363,7 @@ class _ManageUserRouterState extends ConsumerState<ManageUserRouter> {
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,
@ -538,8 +543,7 @@ class _ManageUserRouterState extends ConsumerState<ManageUserRouter> {
fontFamily: context.translate( fontFamily: context.translate(
'Roboto', 'Roboto',
'NotoKufi', 'NotoKufi',
) )),
),
), ),
onSort: (columnIndex, ascending) { onSort: (columnIndex, ascending) {
_sort( _sort(
@ -556,8 +560,7 @@ class _ManageUserRouterState extends ConsumerState<ManageUserRouter> {
fontFamily: context.translate( fontFamily: context.translate(
'Roboto', 'Roboto',
'NotoKufi', 'NotoKufi',
) )),
),
), ),
onSort: (columnIndex, ascending) { onSort: (columnIndex, ascending) {
_sort( _sort(
@ -574,8 +577,7 @@ class _ManageUserRouterState extends ConsumerState<ManageUserRouter> {
fontFamily: context.translate( fontFamily: context.translate(
'Roboto', 'Roboto',
'NotoKufi', 'NotoKufi',
) )),
),
), ),
onSort: (columnIndex, ascending) { onSort: (columnIndex, ascending) {
_sort( _sort(
@ -593,8 +595,7 @@ class _ManageUserRouterState extends ConsumerState<ManageUserRouter> {
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',
), ),
@ -637,35 +639,31 @@ class _ManageUserRouterState extends ConsumerState<ManageUserRouter> {
Text( Text(
user.userName, user.userName,
style: TextStyle( style: TextStyle(
fontFamily: context.translate( fontFamily:
context.translate(
'Roboto', 'Roboto',
'NotoKufi', 'NotoKufi',
) )),
), ),
), ),
DataCell(Text(
),
DataCell(
Text(
user.emailId, user.emailId,
style: TextStyle( style: TextStyle(
fontFamily: context.translate( fontFamily:
context.translate(
'Roboto', 'Roboto',
'NotoKufi', 'NotoKufi',
)
),
)), )),
DataCell( )),
Text( DataCell(Text(
user.registrationDate, user.registrationDate,
style: TextStyle( style: TextStyle(
fontFamily: context.translate( fontFamily:
context.translate(
'Roboto', 'Roboto',
'NotoKufi', '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
@ -28,11 +30,15 @@ class _NotificationPageState extends ConsumerState<NotificationPage> {
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,16 +56,55 @@ 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'); await fetchNotifications(locale?.languageCode ?? 'en');
_processNotifications(notifications, userReadedNotiOrNot); _processNotifications(notifications, userReadedNotiOrNot);
} }
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}');
@ -71,8 +116,10 @@ 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',
@ -219,12 +312,14 @@ class _NotificationPageState extends ConsumerState<NotificationPage> {
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,
color: Colors.grey,
fontFamily: context.translate(
'Roboto', 'Roboto',
'NotoKufi', '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',
@ -145,14 +232,15 @@ class _NotificationDetailsState extends ConsumerState<NotificationDetails> {
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,12 +296,12 @@ 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(
@ -222,12 +309,13 @@ class _NotificationDetailsState extends ConsumerState<NotificationDetails> {
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,18 +1,128 @@
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(
@ -33,7 +143,7 @@ class aboutFCSC extends StatelessWidget {
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,
@ -44,7 +154,7 @@ class aboutFCSC extends StatelessWidget {
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',
@ -66,35 +176,55 @@ class aboutFCSC extends StatelessWidget {
), ),
RichText( RichText(
text: TextSpan( text: TextSpan(
text: context.translate('The ', text: context.translate(
'تم تصميم تطبيق المركز الاتحادي للتنافسية والإحصاء (FCSC) لتوفير وصول المستخدمين المسجلين والمعتمدين إلى إحصائيات دقيقة وشاملة حول دولة الإمارات. يعمل التطبيق كمنصة مركزية لاستكشاف البيانات الرئيسية والاتجاهات والرؤى عبر مختلف القطاعات، مما يسهل الوصول إلى المعلومات الضرورية لدعم اتخاذ القرارات والتحليلات.',), 'The ',
'تم تصميم تطبيق المركز الاتحادي للتنافسية والإحصاء (FCSC) لتوفير وصول المستخدمين المسجلين والمعتمدين إلى إحصائيات دقيقة وشاملة حول دولة الإمارات. يعمل التطبيق كمنصة مركزية لاستكشاف البيانات الرئيسية والاتجاهات والرؤى عبر مختلف القطاعات، مما يسهل الوصول إلى المعلومات الضرورية لدعم اتخاذ القرارات والتحليلات.',
),
style: TextStyle( style: TextStyle(
color: Colors.grey, fontSize: 16, fontFamily: context.translate( color: isDarkTheme ? Colors.white : Colors.grey,
'Roboto', fontSize: 16,
'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( fontFamily: context.translate(
'Roboto', 'Roboto',
'NotoKufi', '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( TextSpan(
text: text: context.translate(
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.',''),), ' 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,17 +123,23 @@ 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(
fontSize: 16,
color: Color(0xFF898C81),
fontFamily: context.translate(
'Roboto', 'Roboto',
'NotoKufi', '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(
@ -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,17 +165,18 @@ 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,
@ -72,7 +186,6 @@ class GetStarted extends StatelessWidget {
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.',
@ -80,19 +193,30 @@ class GetStarted extends StatelessWidget {
), ),
textAlign: TextAlign.justify, // Align the text textAlign: TextAlign.justify, // Align the text
softWrap: true, softWrap: true,
style: TextStyle(
color: isDarkTheme ? Colors.white : Colors.black54,
),
),
SizedBox(
height: 2,
), ),
SizedBox(height: 2,),
Text( Text(
context.translate( context.translate(
'2. Log in to access advanced features', '2. Log in to access advanced features',
'2 .قم بتسجيل الدخول لفتح الميزات المتقدمة.',), '2 .قم بتسجيل الدخول لفتح الميزات المتقدمة.',
),
textAlign: TextAlign.justify, // Align the text textAlign: TextAlign.justify, // Align the text
softWrap: true, softWrap: true,
style: TextStyle(
color: isDarkTheme ? Colors.white : Colors.black54,
),
), ),
SizedBox( SizedBox(
height: MediaQuery.of(context).size.height * 0.12, 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,11 +129,13 @@ 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', 'الميزات الرئيسية'),
@ -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(
@ -51,16 +163,16 @@ class AppFeatures extends StatelessWidget {
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,
@ -71,14 +183,15 @@ class AppFeatures extends StatelessWidget {
), ),
), ),
Text( Text(
context.translate('1. Comprehensive Statistics:','1. رؤى مستندة إلى البيانات '), context.translate('1. Comprehensive Statistics:',
'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,
), ),
), ),
@ -92,7 +205,11 @@ class AppFeatures extends StatelessWidget {
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(
@ -100,9 +217,12 @@ class AppFeatures extends StatelessWidget {
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
? Colors.white
: Color(0xFF898C81),
fontSize: 16, fontSize: 16,
fontFamily: context.translate( fontFamily: context.translate(
'Roboto', 'Roboto',
@ -110,17 +230,33 @@ class AppFeatures extends StatelessWidget {
), ),
), ),
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',
),
),
),
], ],
), ),
), ),
@ -132,15 +268,28 @@ class AppFeatures extends StatelessWidget {
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(
context.translate(
'Explore statistics presented as smart metrics, graphs, and charts for better understanding.', 'Explore statistics presented as smart metrics, graphs, and charts for better understanding.',
'استكشاف الإحصائيات المقدمة على هيئة مقاييس ذكية ورسوم بيانية ومخططات لتعزيز الفهم.',), 'استكشاف الإحصائيات المقدمة على هيئة مقاييس ذكية ورسوم بيانية ومخططات لتعزيز الفهم.',
),
textAlign: TextAlign.justify, // Align the text textAlign: TextAlign.justify, // Align the text
softWrap: true, softWrap: true,
style: TextStyle(
color: isDarkTheme
? Colors.white
: Color(0xFF898C81),
),
), ),
), ),
], ],
@ -148,18 +297,17 @@ class AppFeatures extends StatelessWidget {
], ],
), ),
), ),
SizedBox(height: 8), SizedBox(height: 8),
Text( Text(
context.translate('2. Drilldown Navigation:','2. التنقل التفصيلي'), context.translate(
'2. Drilldown Navigation:', '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,
), ),
), ),
@ -173,16 +321,28 @@ class AppFeatures extends StatelessWidget {
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( child: Text(
context.translate( context.translate(
'Start with high-level categories and drill down to specific KPIs and metrics for deeper insights.', 'Start with high-level categories and drill down to specific KPIs and metrics for deeper insights.',
'البدء بالفئات العامة والتنقل وصولًا إلى مؤشرات الأداء الرئيسية (KPIs) والمقاييس المحددة للحصول على رؤى أعمق.',), 'البدء بالفئات العامة والتنقل وصولًا إلى مؤشرات الأداء الرئيسية (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,17 +350,17 @@ class AppFeatures extends StatelessWidget {
], ],
), ),
), ),
SizedBox(height: 8), SizedBox(height: 8),
Text( Text(
context.translate('3. Interactive Visualizations:','3. التصورات التفاعلية:'), context.translate('3. Interactive Visualizations:',
'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,
), ),
), ),
@ -214,15 +374,28 @@ class AppFeatures extends StatelessWidget {
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(
context.translate(
'View trends and relationships with interactive graphs and charts, including bar graphs, line charts, and more.', 'View trends and relationships with interactive graphs and charts, including bar graphs, line charts, and more.',
'عرض الاتجاهات والعلاقات باستخدام الرسوم البيانية التفاعلية مثل المخططات الشريطية، المخططات الخطية، وغيرها.',), 'عرض الاتجاهات والعلاقات باستخدام الرسوم البيانية التفاعلية مثل المخططات الشريطية، المخططات الخطية، وغيرها.',
),
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 +403,9 @@ class AppFeatures extends StatelessWidget {
], ],
), ),
), ),
SizedBox(height: 20,), SizedBox(
height: 20,
),
], ],
), ),
), ),

View File

@ -1,11 +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 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(
@ -13,11 +123,14 @@ class ChangeMyPassword 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), bodyMedium: TextStyle(
fontSize: 16,
color: Color(0xFF898C81),
fontFamily: context.translate( fontFamily: context.translate(
'Roboto', 'Roboto',
'NotoKufi', 'NotoKufi',
),), ),
),
), ),
), ),
child: BaseScaffold( child: BaseScaffold(
@ -25,7 +138,9 @@ 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', 'الميزات الرئيسية'),
@ -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(
@ -53,16 +168,18 @@ class ChangeMyPassword extends StatelessWidget {
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,
@ -75,18 +192,22 @@ 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(
'Steps to Change Password', 'خطوات تغيير كلمة المرور '),
style: TextStyle( 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,
), ),
), ),
@ -94,14 +215,15 @@ class ChangeMyPassword extends StatelessWidget {
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,
), ),
), ),
@ -115,7 +237,13 @@ class ChangeMyPassword extends StatelessWidget {
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(
@ -123,26 +251,45 @@ class ChangeMyPassword extends StatelessWidget {
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',
'NotoKufi',
),),
children: <TextSpan>[
TextSpan(text: context.translate(
'"Change Password"',
'"تغيير كلمة المرور" ',),
style: TextStyle( style: TextStyle(
fontWeight: FontWeight.w600, fontSize: 16,
color: Color(0xFF414042), color: isDarkTheme
? Colors.white
: Color(0xFF898C81),
fontFamily: context.translate( fontFamily: context.translate(
'Roboto', 'Roboto',
'NotoKufi', 'NotoKufi',
), ),
),), ),
TextSpan(text:context.translate( children: <TextSpan>[
TextSpan(
text: context.translate(
'"Change Password"',
'"تغيير كلمة المرور" ',
),
style: TextStyle(
fontWeight: FontWeight.w600,
color: isDarkTheme
? Colors.white
: Color(0xFF414042),
fontFamily: context.translate(
'Roboto',
'NotoKufi',
),
),
),
TextSpan(
text: context.translate(
' link at the bottom.', ' link at the bottom.',
'في الأسفل.',), 'في الأسفل.',
),
style: TextStyle(
color: isDarkTheme
? Colors.white
: Color(0xFF898C81),
),
), ),
], ],
), ),
@ -153,18 +300,19 @@ class ChangeMyPassword extends StatelessWidget {
], ],
), ),
), ),
SizedBox(height: 8), SizedBox(height: 8),
Text(context.translate( Text(
context.translate(
'2. Enter Old Password:', '2. Enter Old Password:',
'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,
), ),
), ),
@ -178,14 +326,26 @@ class ChangeMyPassword extends StatelessWidget {
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), 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( child: Text(
context.translate( context.translate(
'Enter your current password in the first field.', 'Enter your current password in the first field.',
'أدخل كلمة المرور الحالية في الحقل الأول.',), 'أدخل كلمة المرور الحالية في الحقل الأول.',
),
style: TextStyle(
color: isDarkTheme
? Colors.white
: Color(0xFF898C81),
),
textAlign: TextAlign.justify, // Align the text textAlign: TextAlign.justify, // Align the text
softWrap: true, softWrap: true,
), ),
@ -195,18 +355,19 @@ class ChangeMyPassword extends StatelessWidget {
], ],
), ),
), ),
SizedBox(height: 8), SizedBox(height: 8),
Text(context.translate( Text(
context.translate(
'3. Set a New Password:', '3. Set a New Password:',
'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,
), ),
), ),
@ -220,15 +381,28 @@ class ChangeMyPassword extends StatelessWidget {
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(
context.translate(
'Enter your new password in the second field.', 'Enter your new password in the second field.',
'أدخل كلمة المرور الجديدة في الحقل الثاني.',), 'أدخل كلمة المرور الجديدة في الحقل الثاني.',
),
textAlign: TextAlign.justify, // Align the text textAlign: TextAlign.justify, // Align the text
softWrap: true, softWrap: true,
style: TextStyle(
color: isDarkTheme
? Colors.white
: Color(0xFF898C81),
),
), ),
), ),
], ],
@ -238,16 +412,28 @@ class ChangeMyPassword extends StatelessWidget {
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( child: Text(
context.translate( context.translate(
'Re-enter the new password in the third field for confirmation.', 'Re-enter the new password in the third field for confirmation.',
'أعد إدخال كلمة المرور الجديدة في الحقل الثالث للتأكيد.',), 'أعد إدخال كلمة المرور الجديدة في الحقل الثالث للتأكيد.',
),
textAlign: TextAlign.justify, // Align the text textAlign: TextAlign.justify, // Align the text
softWrap: true, softWrap: true,
style: TextStyle(
color: isDarkTheme
? Colors.white
: Color(0xFF898C81),
),
), ),
), ),
], ],
@ -255,17 +441,19 @@ class ChangeMyPassword extends StatelessWidget {
], ],
), ),
), ),
SizedBox(height: 8), SizedBox(height: 8),
Text(context.translate( Text(
'4. Password Requirements:','4. متطلبات كلمة المرور:',), context.translate(
'4. Password Requirements:',
'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,
), ),
), ),
@ -279,15 +467,28 @@ class ChangeMyPassword extends StatelessWidget {
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(
context.translate(
'Your new password must be different from the previously used password.', 'Your new password must be different from the previously used password.',
'جب أن تكون كلمة المرور الجديدة مختلفة عن كلمة المرور المستخدمة سابقًا',), 'جب أن تكون كلمة المرور الجديدة مختلفة عن كلمة المرور المستخدمة سابقًا',
),
textAlign: TextAlign.justify, // Align the text textAlign: TextAlign.justify, // Align the text
softWrap: true, softWrap: true,
style: TextStyle(
color: isDarkTheme
? Colors.white
: Color(0xFF898C81),
),
), ),
), ),
], ],
@ -295,17 +496,17 @@ class ChangeMyPassword extends StatelessWidget {
], ],
), ),
), ),
SizedBox(height: 8), SizedBox(height: 8),
Text( Text(
context.translate('5. Save Your Password:','5. حفظ كلمة المرور '), context.translate(
'5. Save Your Password:', '5. حفظ كلمة المرور '),
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,
), ),
), ),
@ -319,29 +520,53 @@ class ChangeMyPassword extends StatelessWidget {
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('Tap the ','انقرعلى زر '), text: context.translate(
style: TextStyle(fontSize: 16, color: Color(0xFF898C81), fontFamily: context.translate( 'Tap the ', 'انقرعلى زر '),
'Roboto',
'NotoKufi',
),),
children: <TextSpan>[
TextSpan(text:
context.translate('Save ','"حفظ".'),
style: TextStyle( style: TextStyle(
fontWeight: FontWeight.w600, fontSize: 16,
color: Color(0xFF414042), // color: Color(0xFF898C81),
fontFamily: context.translate( fontFamily: context.translate(
'Roboto', 'Roboto',
'NotoKufi', 'NotoKufi',
), ),
),), color: isDarkTheme
TextSpan(text: context.translate('button',''),), ? Colors.white
: Color(0xFF898C81),
),
children: <TextSpan>[
TextSpan(
text: context.translate('Save ', '"حفظ".'),
style: TextStyle(
fontWeight: FontWeight.w600,
color: isDarkTheme
? Colors.white
: Color(0xFF414042),
fontFamily: context.translate(
'Roboto',
'NotoKufi',
),
),
),
TextSpan(
text: context.translate('button', ''),
style: TextStyle(
color: isDarkTheme
? Colors.white
: Color(0xFF898C81),
),
),
], ],
), ),
), ),
@ -353,15 +578,28 @@ class ChangeMyPassword extends StatelessWidget {
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(
context.translate(
'A confirmation message will appear: “Password has been successfully updated.”', '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),
),
), ),
), ),
], ],
@ -378,7 +616,7 @@ class ChangeMyPassword extends StatelessWidget {
'NotoKufi', 'NotoKufi',
), ),
fontSize: 16, fontSize: 16,
color: Color(0xFF414042), color: isDarkTheme ? Colors.white : Color(0xFF414042),
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
), ),
), ),
@ -392,15 +630,28 @@ class ChangeMyPassword extends StatelessWidget {
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(
context.translate(
'Log in again using your new password to continue using the app', '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,17 +125,23 @@ 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(
fontSize: 16,
color: Color(0xFF898C81),
fontFamily: context.translate(
'Roboto', 'Roboto',
'NotoKufi', '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(
@ -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,
), ),
), ),
@ -76,14 +192,15 @@ 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,7 +213,7 @@ 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
@ -104,9 +221,13 @@ class HowUseTheApp extends StatelessWidget {
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)),
), ),
), ),
], ],
@ -115,14 +236,15 @@ class HowUseTheApp extends StatelessWidget {
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,7 +257,7 @@ 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
@ -143,9 +265,13 @@ class HowUseTheApp extends StatelessWidget {
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)),
), ),
), ),
], ],
@ -154,14 +280,15 @@ class HowUseTheApp extends StatelessWidget {
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,7 +301,7 @@ 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
@ -182,9 +309,13 @@ class HowUseTheApp extends StatelessWidget {
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)),
), ),
), ),
], ],
@ -193,14 +324,15 @@ class HowUseTheApp extends StatelessWidget {
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,7 +345,7 @@ 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
@ -221,9 +353,13 @@ class HowUseTheApp extends StatelessWidget {
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,10 +136,12 @@ 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(
@ -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(
@ -62,7 +175,7 @@ class Purpose extends StatelessWidget {
'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:
isDarkTheme ? Colors.white : Color(0xFF898C81),
fontSize: 16, 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,7 +254,7 @@ 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
@ -135,9 +262,13 @@ class Purpose extends StatelessWidget {
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,7 +281,7 @@ 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
@ -158,9 +289,13 @@ class Purpose extends StatelessWidget {
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,7 +137,9 @@ 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(
@ -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(
@ -63,7 +173,7 @@ class StayUpdate extends StatelessWidget {
'NotoKufi', 'NotoKufi',
), ),
fontSize: 20, fontSize: 20,
color: Color(0xFF414042), color: isDarkTheme ? Colors.white : Color(0xFF414042),
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
), ),
), ),
@ -85,7 +195,7 @@ 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
@ -93,9 +203,13 @@ class StayUpdate extends StatelessWidget {
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,7 +123,10 @@ 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(
fontSize: 16,
color: Color(0xFF898C81),
fontFamily: context.translate(
'Roboto', 'Roboto',
'NotoKufi', 'NotoKufi',
), ),
@ -22,10 +134,12 @@ class WhoUseTheApp 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(
@ -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,7 +209,7 @@ 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
@ -101,9 +217,13 @@ class WhoUseTheApp extends StatelessWidget {
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,7 +236,7 @@ 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
@ -124,9 +244,13 @@ class WhoUseTheApp extends StatelessWidget {
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,7 +263,7 @@ 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
@ -147,14 +271,17 @@ class WhoUseTheApp extends StatelessWidget {
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,20 +1,128 @@
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', 'البدء'),
@ -31,7 +139,7 @@ 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(
@ -39,7 +147,8 @@ class aboutTheApp extends StatelessWidget {
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(
@ -51,7 +160,7 @@ class aboutTheApp extends StatelessWidget {
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,7 +168,10 @@ class aboutTheApp extends StatelessWidget {
), ),
), ),
), ),
trailing: Icon(Icons.keyboard_arrow_right), trailing: Icon(
Icons.keyboard_arrow_right,
color: isDarkTheme ? Colors.white : Color(0xFF414042),
),
), ),
), ),
Container( Container(
@ -67,7 +179,8 @@ class aboutTheApp extends StatelessWidget {
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(
@ -79,7 +192,7 @@ class aboutTheApp extends StatelessWidget {
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,22 +1,125 @@
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 FAQPage extends StatefulWidget { class FAQPage extends ConsumerStatefulWidget {
const FAQPage({super.key}); const FAQPage({super.key});
@override @override
State<FAQPage> createState() => _FAQPageState(); ConsumerState<FAQPage> createState() => _FAQPageState();
} }
class _FAQPageState extends State<FAQPage> { class _FAQPageState extends ConsumerState<FAQPage> {
// class _FAQPageState extends State<FAQPage> {
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(
dividerColor: Colors.grey[300], dividerColor: Colors.grey[300],
showBackButton: true, showBackButton: true,
appbarColor: Colors.white, // appbarColor: Colors.white,
backgroundColor: isDarkTheme ? Colors.black : Colors.white,
appbarColor: isDarkTheme ? Colors.black : Colors.white,
bottomColor: Colors.white, bottomColor: Colors.white,
mycenterTitle: true, mycenterTitle: true,
title: Text( title: Text(
@ -35,14 +138,16 @@ class _FAQPageState extends State<FAQPage> {
body: SafeArea( body: SafeArea(
child: Container( child: Container(
height: double.infinity, height: double.infinity,
color: Colors.white, color: isDarkTheme ? Colors.black : Colors.white,
child: Scrollbar( child: Scrollbar(
thumbVisibility: true, thumbVisibility: true,
thickness: 8, thickness: 8,
radius: Radius.circular(10), radius: Radius.circular(10),
interactive: true, interactive: true,
child: SingleChildScrollView( child: SingleChildScrollView(
child: QuestionAnswerScrollView(), child: QuestionAnswerScrollView(
isDarkTheme: isDarkTheme,
),
), ),
), ),
), ),
@ -52,7 +157,9 @@ class _FAQPageState extends State<FAQPage> {
} }
class QuestionAnswerScrollView extends StatelessWidget { class QuestionAnswerScrollView extends StatelessWidget {
const QuestionAnswerScrollView({super.key}); final bool isDarkTheme;
const QuestionAnswerScrollView({super.key, required this.isDarkTheme});
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -62,7 +169,8 @@ class QuestionAnswerScrollView extends StatelessWidget {
'question-ar': 'ما هو الغرض من هذا التطبيق؟', 'question-ar': 'ما هو الغرض من هذا التطبيق؟',
'answer': 'answer':
'The app provides official UAE statistics across categories like Economy, Environment, and Social. It allows users to explore datasets, view trends, and access detailed metrics to make informed decisions.', 'The app provides official UAE statistics across categories like Economy, Environment, and Social. It allows users to explore datasets, view trends, and access detailed metrics to make informed decisions.',
'answer-ar':'يوفر التطبيق الإحصائيات الرسمية لدولة الإمارات العربية المتحدة عبر فئات مثل الاقتصاد والبيئة والاجتماعية . يتيح للمستخدمين استكشاف مجموعات البيانات، عرض الاتجاهات، والوصول إلى المقاييس التفصيلية لاتخاذ قرارات مستنيرة.', 'answer-ar':
'يوفر التطبيق الإحصائيات الرسمية لدولة الإمارات العربية المتحدة عبر فئات مثل الاقتصاد والبيئة والاجتماعية . يتيح للمستخدمين استكشاف مجموعات البيانات، عرض الاتجاهات، والوصول إلى المقاييس التفصيلية لاتخاذ قرارات مستنيرة.',
}, },
{ {
'question': 'Do I need to create an account to use the app?', 'question': 'Do I need to create an account to use the app?',
@ -74,36 +182,48 @@ class QuestionAnswerScrollView extends StatelessWidget {
text: text:
'Yes, the app is strictly for registered and approved users. To access the data:\n\n', 'Yes, the app is strictly for registered and approved users. To access the data:\n\n',
style: TextStyle( style: TextStyle(
color: Colors.grey, fontSize: 16, fontFamily: context.translate( color: isDarkTheme ? Colors.white : Colors.grey,
fontSize: 16,
fontFamily: context.translate(
'Roboto', 'Roboto',
'NotoKufi', 'NotoKufi',
),), ),
),
), ),
TextSpan( TextSpan(
text: text:
' 1. You need to sign up using the Register Now option on the login screen.\n', ' 1. You need to sign up using the Register Now option on the login screen.\n',
style: TextStyle( style: TextStyle(
color: Colors.grey, fontSize: 16, fontFamily: context.translate( color: isDarkTheme ? Colors.white : Colors.grey,
fontSize: 16,
fontFamily: context.translate(
'Roboto', 'Roboto',
'NotoKufi', 'NotoKufi',
),), ),
),
), ),
TextSpan( TextSpan(
text: ' 2. Your registration must be approved by the admin.\n', text: ' 2. Your registration must be approved by the admin.\n',
style: TextStyle( style: TextStyle(
color: Colors.grey, fontSize: 16, fontFamily: context.translate( color: isDarkTheme ? Colors.white : Colors.grey,
fontSize: 16,
fontFamily: context.translate(
'Roboto', 'Roboto',
'NotoKufi', 'NotoKufi',
),), ),
),
), ),
TextSpan( TextSpan(
text: text:
" 3. Once approved, you can log in to access the app's features and datasets.\n\nGuest access is not available for this application.\n ", " 3. Once approved, you can log in to access the app's features and datasets.\n\nGuest access is not available for this application.\n ",
style: TextStyle( style: TextStyle(
color: Colors.grey, fontSize: 16, fontFamily: context.translate( color: isDarkTheme ? Colors.white : Colors.grey,
fontSize: 16,
fontFamily: context.translate(
'Roboto', 'Roboto',
'NotoKufi', 'NotoKufi',
),), ),
),
), ),
], ],
), ),
@ -115,36 +235,48 @@ class QuestionAnswerScrollView extends StatelessWidget {
text: text:
'نعم، التطبيق مخصص فقط للمستخدمين المسجلين والمعتمدين. للوصول إلى البيانات:\n\n', 'نعم، التطبيق مخصص فقط للمستخدمين المسجلين والمعتمدين. للوصول إلى البيانات:\n\n',
style: TextStyle( style: TextStyle(
color: Colors.grey, fontSize: 16, fontFamily: context.translate( color: isDarkTheme ? Colors.white : Colors.grey,
fontSize: 16,
fontFamily: context.translate(
'Roboto', 'Roboto',
'NotoKufi', 'NotoKufi',
),), ),
),
), ),
TextSpan( TextSpan(
text: text:
' 1. يجب عليك التسجيل باستخدام خيار "التسجيل الآن" في شاشة تسجيل الدخول.\n', ' 1. يجب عليك التسجيل باستخدام خيار "التسجيل الآن" في شاشة تسجيل الدخول.\n',
style: TextStyle( style: TextStyle(
color: Colors.grey, fontSize: 16, fontFamily: context.translate( color: isDarkTheme ? Colors.white : Colors.grey,
fontSize: 16,
fontFamily: context.translate(
'Roboto', 'Roboto',
'NotoKufi', 'NotoKufi',
),), ),
),
), ),
TextSpan( TextSpan(
text: ' 2. يجب أن يتم الموافقة على تسجيلك من قبل المسؤول.\n', text: ' 2. يجب أن يتم الموافقة على تسجيلك من قبل المسؤول.\n',
style: TextStyle( style: TextStyle(
color: Colors.grey, fontSize: 16, fontFamily: context.translate( color: isDarkTheme ? Colors.white : Colors.grey,
fontSize: 16,
fontFamily: context.translate(
'Roboto', 'Roboto',
'NotoKufi', 'NotoKufi',
),), ),
),
), ),
TextSpan( TextSpan(
text: text:
' بعد الموافقة، يمكنك تسجيل الدخول للوصول إلى ميزات التطبيق وبياناته.\n\n لا يتوفر الوصول للزوار في هذا التطبيق.\n', ' بعد الموافقة، يمكنك تسجيل الدخول للوصول إلى ميزات التطبيق وبياناته.\n\n لا يتوفر الوصول للزوار في هذا التطبيق.\n',
style: TextStyle( style: TextStyle(
color: Colors.grey, fontSize: 16, fontFamily: context.translate( color: isDarkTheme ? Colors.white : Colors.grey,
fontSize: 16,
fontFamily: context.translate(
'Roboto', 'Roboto',
'NotoKufi', 'NotoKufi',
),), ),
),
), ),
], ],
), ),
@ -155,7 +287,8 @@ class QuestionAnswerScrollView extends StatelessWidget {
'question-ar': 'كيف يمكنني التنقل عبر التطبيق؟', 'question-ar': 'كيف يمكنني التنقل عبر التطبيق؟',
'answer': 'answer':
'• Use the main categories on the homepage (e.g., Economy, Environment) to access subcategories and detailed KPIs.\n• Drill down into specific metrics or graphical views by tapping on a KPI.\n• Access additional features like Bookmarks or Profile through the navigation bar.\n', '• Use the main categories on the homepage (e.g., Economy, Environment) to access subcategories and detailed KPIs.\n• Drill down into specific metrics or graphical views by tapping on a KPI.\n• Access additional features like Bookmarks or Profile through the navigation bar.\n',
'answer-ar': '•استخدم الفئات الرئيسية الموجودة على الصفحة الرئيسية (مثل: الاقتصاد، البيئة) للوصول إلى الفئات الفرعية ومؤشرات الأداء الرئيسية التفصيلية •\n قم بالتعمق في مؤشرات معينة أو عرض الرسوم البيانية من خلال النقر على مؤشر الأداء الرئيسي (KPI). \n • للوصول إلى ميزات إضافية مثل الإشارات المرجعية أو الملف الشخصي، استخدم شريط التنقل.\n', 'answer-ar':
'•استخدم الفئات الرئيسية الموجودة على الصفحة الرئيسية (مثل: الاقتصاد، البيئة) للوصول إلى الفئات الفرعية ومؤشرات الأداء الرئيسية التفصيلية •\n قم بالتعمق في مؤشرات معينة أو عرض الرسوم البيانية من خلال النقر على مؤشر الأداء الرئيسي (KPI). \n • للوصول إلى ميزات إضافية مثل الإشارات المرجعية أو الملف الشخصي، استخدم شريط التنقل.\n',
}, },
{ {
'question': 'What types of data are available?', 'question': 'What types of data are available?',
@ -166,10 +299,13 @@ class QuestionAnswerScrollView extends StatelessWidget {
TextSpan( TextSpan(
text: 'The app offers data on:\n\n', text: 'The app offers data on:\n\n',
style: TextStyle( style: TextStyle(
color: Colors.grey, fontSize: 16, fontFamily: context.translate( color: isDarkTheme ? Colors.white : Colors.grey,
fontSize: 16,
fontFamily: context.translate(
'Roboto', 'Roboto',
'NotoKufi', 'NotoKufi',
),), ),
),
), ),
TextSpan( TextSpan(
text: ' • Economy:', text: ' • Economy:',
@ -178,17 +314,20 @@ class QuestionAnswerScrollView extends StatelessWidget {
'Roboto', 'Roboto',
'NotoKufi', 'NotoKufi',
), ),
color: Color(0xFF414042), color: isDarkTheme ? Colors.white : Color(0xFF414042),
fontWeight: FontWeight.w500, fontWeight: FontWeight.w500,
fontSize: 16), fontSize: 16),
), ),
TextSpan( TextSpan(
text: ' GDP, growth rates, and economic trends\n', text: ' GDP, growth rates, and economic trends\n',
style: TextStyle( style: TextStyle(
color: Colors.grey, fontSize: 16, fontFamily: context.translate( color: isDarkTheme ? Colors.white : Colors.grey,
fontSize: 16,
fontFamily: context.translate(
'Roboto', 'Roboto',
'NotoKufi', 'NotoKufi',
),), ),
),
), ),
TextSpan( TextSpan(
text: ' • Environment:', text: ' • Environment:',
@ -197,17 +336,20 @@ class QuestionAnswerScrollView extends StatelessWidget {
'Roboto', 'Roboto',
'NotoKufi', 'NotoKufi',
), ),
color: Color(0xFF414042), color: isDarkTheme ? Colors.white : Color(0xFF414042),
fontWeight: FontWeight.w500, fontWeight: FontWeight.w500,
fontSize: 16), fontSize: 16),
), ),
TextSpan( TextSpan(
text: ' Electricity production, water consumption, and more.\n', text: ' Electricity production, water consumption, and more.\n',
style: TextStyle( style: TextStyle(
color: Colors.grey, fontSize: 16, fontFamily: context.translate( color: isDarkTheme ? Colors.white : Colors.grey,
fontSize: 16,
fontFamily: context.translate(
'Roboto', 'Roboto',
'NotoKufi', 'NotoKufi',
),), ),
),
), ),
TextSpan( TextSpan(
text: ' • Social:', text: ' • Social:',
@ -216,7 +358,7 @@ class QuestionAnswerScrollView extends StatelessWidget {
'Roboto', 'Roboto',
'NotoKufi', 'NotoKufi',
), ),
color: Color(0xFF414042), color: isDarkTheme ? Colors.white : Color(0xFF414042),
fontWeight: FontWeight.w500, fontWeight: FontWeight.w500,
fontSize: 16), fontSize: 16),
), ),
@ -224,10 +366,13 @@ class QuestionAnswerScrollView extends StatelessWidget {
text: text:
' Labor force distribution, participation rates, and demographic data.\n', ' Labor force distribution, participation rates, and demographic data.\n',
style: TextStyle( style: TextStyle(
color: Colors.grey, fontSize: 16, fontFamily: context.translate( color: isDarkTheme ? Colors.white : Colors.grey,
fontSize: 16,
fontFamily: context.translate(
'Roboto', 'Roboto',
'NotoKufi', 'NotoKufi',
),), ),
),
), ),
], ],
), ),
@ -238,10 +383,13 @@ class QuestionAnswerScrollView extends StatelessWidget {
TextSpan( TextSpan(
text: 'يوفر التطبيق بيانات عن:\n\n', text: 'يوفر التطبيق بيانات عن:\n\n',
style: TextStyle( style: TextStyle(
color: Colors.grey, fontSize: 16, fontFamily: context.translate( color: isDarkTheme ? Colors.white : Colors.grey,
fontSize: 16,
fontFamily: context.translate(
'Roboto', 'Roboto',
'NotoKufi', 'NotoKufi',
),), ),
),
), ),
TextSpan( TextSpan(
text: ' • الاقتصاد:', text: ' • الاقتصاد:',
@ -250,17 +398,21 @@ class QuestionAnswerScrollView extends StatelessWidget {
'Roboto', 'Roboto',
'NotoKufi', 'NotoKufi',
), ),
color: Color(0xFF414042), color: isDarkTheme ? Colors.white : Color(0xFF414042),
fontWeight: FontWeight.w500, fontWeight: FontWeight.w500,
fontSize: 16), fontSize: 16),
), ),
TextSpan( TextSpan(
text: ' الناتج المحلي الإجمالي (GDP)، معدلات النمو، والاتجاهات الاقتصادية.\n', text:
' الناتج المحلي الإجمالي (GDP)، معدلات النمو، والاتجاهات الاقتصادية.\n',
style: TextStyle( style: TextStyle(
color: Colors.grey, fontSize: 16, fontFamily: context.translate( color: isDarkTheme ? Colors.white : Colors.grey,
fontSize: 16,
fontFamily: context.translate(
'Roboto', 'Roboto',
'NotoKufi', 'NotoKufi',
),), ),
),
), ),
TextSpan( TextSpan(
text: ' • البيئة:', text: ' • البيئة:',
@ -269,17 +421,20 @@ class QuestionAnswerScrollView extends StatelessWidget {
'Roboto', 'Roboto',
'NotoKufi', 'NotoKufi',
), ),
color: Color(0xFF414042), color: isDarkTheme ? Colors.white : Color(0xFF414042),
fontWeight: FontWeight.w500, fontWeight: FontWeight.w500,
fontSize: 16), fontSize: 16),
), ),
TextSpan( TextSpan(
text: ' إنتاج الكهرباء، استهلاك المياه، وغيرها.\n', text: ' إنتاج الكهرباء، استهلاك المياه، وغيرها.\n',
style: TextStyle( style: TextStyle(
color: Colors.grey, fontSize: 16, fontFamily: context.translate( color: isDarkTheme ? Colors.white : Colors.grey,
fontSize: 16,
fontFamily: context.translate(
'Roboto', 'Roboto',
'NotoKufi', 'NotoKufi',
),), ),
),
), ),
TextSpan( TextSpan(
text: ' • الاجتماعية:', text: ' • الاجتماعية:',
@ -288,7 +443,7 @@ class QuestionAnswerScrollView extends StatelessWidget {
'Roboto', 'Roboto',
'NotoKufi', 'NotoKufi',
), ),
color: Color(0xFF414042), color: isDarkTheme ? Colors.white : Color(0xFF414042),
fontWeight: FontWeight.w500, fontWeight: FontWeight.w500,
fontSize: 16), fontSize: 16),
), ),
@ -296,10 +451,13 @@ class QuestionAnswerScrollView extends StatelessWidget {
text: text:
' توزيع القوى العاملة، معدلات المشاركة، والبيانات الديموغرافية.\n', ' توزيع القوى العاملة، معدلات المشاركة، والبيانات الديموغرافية.\n',
style: TextStyle( style: TextStyle(
color: Colors.grey, fontSize: 16, fontFamily: context.translate( color: isDarkTheme ? Colors.white : Colors.grey,
fontSize: 16,
fontFamily: context.translate(
'Roboto', 'Roboto',
'NotoKufi', 'NotoKufi',
),), ),
),
), ),
], ],
), ),
@ -314,10 +472,13 @@ class QuestionAnswerScrollView extends StatelessWidget {
TextSpan( TextSpan(
text: 'When viewing a metric, tap on the', text: 'When viewing a metric, tap on the',
style: TextStyle( style: TextStyle(
color: Colors.grey, fontSize: 16, fontFamily: context.translate( color: isDarkTheme ? Colors.white : Colors.grey,
fontSize: 16,
fontFamily: context.translate(
'Roboto', 'Roboto',
'NotoKufi', 'NotoKufi',
),), ),
),
), ),
TextSpan( TextSpan(
text: ' Bookmark ', text: ' Bookmark ',
@ -326,17 +487,20 @@ class QuestionAnswerScrollView extends StatelessWidget {
'Roboto', 'Roboto',
'NotoKufi', 'NotoKufi',
), ),
color: Color(0xFF414042), color: isDarkTheme ? Colors.white : Color(0xFF414042),
fontWeight: FontWeight.w500, fontWeight: FontWeight.w500,
fontSize: 16), fontSize: 16),
), ),
TextSpan( TextSpan(
text: 'icon. Your bookmarks are accessible from the', text: 'icon. Your bookmarks are accessible from the',
style: TextStyle( style: TextStyle(
color: Colors.grey, fontSize: 16, fontFamily: context.translate( color: isDarkTheme ? Colors.white : Colors.grey,
fontSize: 16,
fontFamily: context.translate(
'Roboto', 'Roboto',
'NotoKufi', 'NotoKufi',
),), ),
),
), ),
TextSpan( TextSpan(
text: 'My Bookmarks', text: 'My Bookmarks',
@ -345,17 +509,20 @@ class QuestionAnswerScrollView extends StatelessWidget {
'Roboto', 'Roboto',
'NotoKufi', 'NotoKufi',
), ),
color: Color(0xFF414042), color: isDarkTheme ? Colors.white : Color(0xFF414042),
fontWeight: FontWeight.w500, fontWeight: FontWeight.w500,
fontSize: 16), fontSize: 16),
), ),
TextSpan( TextSpan(
text: 'section in the navigation bar.\n', text: 'section in the navigation bar.\n',
style: TextStyle( style: TextStyle(
color: Colors.grey, fontSize: 16, fontFamily: context.translate( color: isDarkTheme ? Colors.white : Colors.grey,
fontSize: 16,
fontFamily: context.translate(
'Roboto', 'Roboto',
'NotoKufi', 'NotoKufi',
),), ),
),
), ),
], ],
), ),
@ -364,14 +531,17 @@ class QuestionAnswerScrollView extends StatelessWidget {
text: TextSpan( text: TextSpan(
children: [ children: [
TextSpan( TextSpan(
text: 'عند عرض المؤشر، اضغط على أيقونة الإشارة المرجعية. يمكنك الوصول إلى الإشارات المرجعية الخاصة بك من قسم "إشاراتي المرجعية" في شريط التنقل.', text:
'عند عرض المؤشر، اضغط على أيقونة الإشارة المرجعية. يمكنك الوصول إلى الإشارات المرجعية الخاصة بك من قسم "إشاراتي المرجعية" في شريط التنقل.',
style: TextStyle( style: TextStyle(
color: Colors.grey, fontSize: 16, fontFamily: context.translate( color: isDarkTheme ? Colors.white : Colors.grey,
fontSize: 16,
fontFamily: context.translate(
'Roboto', 'Roboto',
'NotoKufi', 'NotoKufi',
),),
), ),
),
),
], ],
), ),
), ),
@ -385,10 +555,13 @@ class QuestionAnswerScrollView extends StatelessWidget {
TextSpan( TextSpan(
text: 'Yes, the app supports both ', text: 'Yes, the app supports both ',
style: TextStyle( style: TextStyle(
color: Colors.grey, fontSize: 16, fontFamily: context.translate( color: isDarkTheme ? Colors.white : Colors.grey,
fontSize: 16,
fontFamily: context.translate(
'Roboto', 'Roboto',
'NotoKufi', 'NotoKufi',
),), ),
),
), ),
TextSpan( TextSpan(
text: 'English ', text: 'English ',
@ -397,17 +570,20 @@ class QuestionAnswerScrollView extends StatelessWidget {
'Roboto', 'Roboto',
'NotoKufi', 'NotoKufi',
), ),
color: Color(0xFF414042), color: isDarkTheme ? Colors.white : Color(0xFF414042),
fontWeight: FontWeight.w500, fontWeight: FontWeight.w500,
fontSize: 16), fontSize: 16),
), ),
TextSpan( TextSpan(
text: 'and', text: 'and',
style: TextStyle( style: TextStyle(
color: Colors.grey, fontSize: 16, fontFamily: context.translate( color: isDarkTheme ? Colors.white : Colors.grey,
fontSize: 16,
fontFamily: context.translate(
'Roboto', 'Roboto',
'NotoKufi', 'NotoKufi',
),), ),
),
), ),
TextSpan( TextSpan(
text: ' Arabic ', text: ' Arabic ',
@ -416,7 +592,7 @@ class QuestionAnswerScrollView extends StatelessWidget {
'Roboto', 'Roboto',
'NotoKufi', 'NotoKufi',
), ),
color: Color(0xFF414042), color: isDarkTheme ? Colors.white : Color(0xFF414042),
fontWeight: FontWeight.w500, fontWeight: FontWeight.w500,
fontSize: 16), fontSize: 16),
), ),
@ -424,10 +600,13 @@ class QuestionAnswerScrollView extends StatelessWidget {
text: text:
'. You can toggle the language using the switch in the top-right corner of the app.\n', '. You can toggle the language using the switch in the top-right corner of the app.\n',
style: TextStyle( style: TextStyle(
color: Colors.grey, fontSize: 16, fontFamily: context.translate( color: isDarkTheme ? Colors.white : Colors.grey,
fontSize: 16,
fontFamily: context.translate(
'Roboto', 'Roboto',
'NotoKufi', 'NotoKufi',
),), ),
),
), ),
], ],
), ),
@ -436,12 +615,16 @@ class QuestionAnswerScrollView extends StatelessWidget {
text: TextSpan( text: TextSpan(
children: [ children: [
TextSpan( TextSpan(
text: 'نعم، التطبيق يدعم اللغتين الإنجليزية والعربية. يمكنك تبديل اللغة باستخدام المفتاح الموجود في الزاوية العلوية اليمنى من التطبيق.', text:
'نعم، التطبيق يدعم اللغتين الإنجليزية والعربية. يمكنك تبديل اللغة باستخدام المفتاح الموجود في الزاوية العلوية اليمنى من التطبيق.',
style: TextStyle( style: TextStyle(
color: Colors.grey, fontSize: 16, fontFamily: context.translate( color: isDarkTheme ? Colors.white : Colors.grey,
fontSize: 16,
fontFamily: context.translate(
'Roboto', 'Roboto',
'NotoKufi', 'NotoKufi',
),), ),
),
), ),
], ],
), ),
@ -452,28 +635,32 @@ class QuestionAnswerScrollView extends StatelessWidget {
'question-ar': 'ماذا يحدث إذا نسيت كلمة المرور الخاصة بي؟', 'question-ar': 'ماذا يحدث إذا نسيت كلمة المرور الخاصة بي؟',
'answer': 'answer':
'Tap on the Forgot Password? link on the login page. Follow the steps to reset your password via your registered email address.\n', 'Tap on the Forgot Password? link on the login page. Follow the steps to reset your password via your registered email address.\n',
'answer-ar':'انقر على رابط "نسيت كلمة المرور؟" في صفحة تسجيل الدخول. اتبع الخطوات لإعادة تعيين كلمة المرور الخاصة بك عبر عنوان بريدك الإلكتروني المسجل.', 'answer-ar':
'انقر على رابط "نسيت كلمة المرور؟" في صفحة تسجيل الدخول. اتبع الخطوات لإعادة تعيين كلمة المرور الخاصة بك عبر عنوان بريدك الإلكتروني المسجل.',
}, },
{ {
'question': 'Can I edit my profile details?', 'question': 'Can I edit my profile details?',
'question-ar': 'هل يمكنني تعديل تفاصيل الملف الشخصي؟', 'question-ar': 'هل يمكنني تعديل تفاصيل الملف الشخصي؟',
'answer': 'answer':
'Yes, you can edit specific fields such as Date of Birth and User Image. However, certain fields like Username and Email are non-editable for security reasons.\n', 'Yes, you can edit specific fields such as Date of Birth and User Image. However, certain fields like Username and Email are non-editable for security reasons.\n',
'answer-ar':'يتم تحديث مجموعات البيانات في التطبيق بشكل منتظم لضمان وصول المستخدمين إلى أحدث الإحصاءات. يتم إرسال إشعارات عند إجراء تحديثات مهمة.', 'answer-ar':
'يتم تحديث مجموعات البيانات في التطبيق بشكل منتظم لضمان وصول المستخدمين إلى أحدث الإحصاءات. يتم إرسال إشعارات عند إجراء تحديثات مهمة.',
}, },
{ {
'question': 'How often is the data updated?', 'question': 'How often is the data updated?',
'question-ar': 'كم مرة يتم تحديث البيانات؟ ', 'question-ar': 'كم مرة يتم تحديث البيانات؟ ',
'answer': 'answer':
'The app updates its datasets regularly to ensure users have access to the latest statistics. Notifications are sent whenever significant updates are made.\n', 'The app updates its datasets regularly to ensure users have access to the latest statistics. Notifications are sent whenever significant updates are made.\n',
'answer-ar':'يتم تحديث مجموعات البيانات في التطبيق بشكل منتظم لضمان وصول المستخدمين إلى أحدث الإحصاءات. يتم إرسال إشعارات عند إجراء تحديثات مهمة.', 'answer-ar':
'يتم تحديث مجموعات البيانات في التطبيق بشكل منتظم لضمان وصول المستخدمين إلى أحدث الإحصاءات. يتم إرسال إشعارات عند إجراء تحديثات مهمة.',
}, },
{ {
'question': 'What types of graphs and charts are available?', 'question': 'What types of graphs and charts are available?',
'question-ar': 'ما أنواع الرسوم البيانية والمخططات المتوفرة؟ ', 'question-ar': 'ما أنواع الرسوم البيانية والمخططات المتوفرة؟ ',
'answer': 'answer':
'The app provides a variety of visualizations, including:\n • Line charts for trends.\n • Bar and column charts for comparisons.\n • Stacked charts for multi-layered data views.\n', 'The app provides a variety of visualizations, including:\n • Line charts for trends.\n • Bar and column charts for comparisons.\n • Stacked charts for multi-layered data views.\n',
'answer-ar':'يوفر التطبيق مجموعة متنوعة من التصورات البيانية، بما في ذلك:\n• المخططات الخطية لعرض الاتجاهات.\n• المخططات الشريطية والعمودية للمقارنات.\n• المخططات المكدسة لعرض البيانات متعددة الطبقات.\n', 'answer-ar':
'يوفر التطبيق مجموعة متنوعة من التصورات البيانية، بما في ذلك:\n• المخططات الخطية لعرض الاتجاهات.\n• المخططات الشريطية والعمودية للمقارنات.\n• المخططات المكدسة لعرض البيانات متعددة الطبقات.\n',
}, },
{ {
'question': 'Can I share the data or charts?', 'question': 'Can I share the data or charts?',
@ -485,10 +672,13 @@ class QuestionAnswerScrollView extends StatelessWidget {
text: text:
'Yes, you can share data or charts directly from the app by tapping the ', 'Yes, you can share data or charts directly from the app by tapping the ',
style: TextStyle( style: TextStyle(
color: Colors.grey, fontSize: 16, fontFamily: context.translate( color: isDarkTheme ? Colors.white : Colors.grey,
fontSize: 16,
fontFamily: context.translate(
'Roboto', 'Roboto',
'NotoKufi', 'NotoKufi',
),), ),
),
), ),
TextSpan( TextSpan(
text: 'Share ', text: 'Share ',
@ -497,17 +687,20 @@ class QuestionAnswerScrollView extends StatelessWidget {
'Roboto', 'Roboto',
'NotoKufi', 'NotoKufi',
), ),
color: Color(0xFF414042), color: isDarkTheme ? Colors.white : Color(0xFF414042),
fontWeight: FontWeight.w500, fontWeight: FontWeight.w500,
fontSize: 16), fontSize: 16),
), ),
TextSpan( TextSpan(
text: 'button available on most pages.\n', text: 'button available on most pages.\n',
style: TextStyle( style: TextStyle(
color: Colors.grey, fontSize: 16, fontFamily: context.translate( color: isDarkTheme ? Colors.white : Colors.grey,
fontSize: 16,
fontFamily: context.translate(
'Roboto', 'Roboto',
'NotoKufi', 'NotoKufi',
),), ),
),
), ),
], ],
), ),
@ -519,10 +712,13 @@ class QuestionAnswerScrollView extends StatelessWidget {
text: text:
'نعم، يمكنك مشاركة البيانات أو الرسوم البيانية مباشرة من التطبيق من خلال النقر على زر "مشاركة" المتوفر في معظم الصفحات.', 'نعم، يمكنك مشاركة البيانات أو الرسوم البيانية مباشرة من التطبيق من خلال النقر على زر "مشاركة" المتوفر في معظم الصفحات.',
style: TextStyle( style: TextStyle(
color: Colors.grey, fontSize: 16, fontFamily: context.translate( color: isDarkTheme ? Colors.white : Colors.grey,
fontSize: 16,
fontFamily: context.translate(
'Roboto', 'Roboto',
'NotoKufi', 'NotoKufi',
),), ),
),
), ),
], ],
), ),
@ -537,10 +733,13 @@ class QuestionAnswerScrollView extends StatelessWidget {
TextSpan( TextSpan(
text: 'For technical support or feedback, navigate to the ', text: 'For technical support or feedback, navigate to the ',
style: TextStyle( style: TextStyle(
color: Colors.grey, fontSize: 16, fontFamily: context.translate( color: isDarkTheme ? Colors.white : Colors.grey,
fontSize: 16,
fontFamily: context.translate(
'Roboto', 'Roboto',
'NotoKufi', 'NotoKufi',
),), ),
),
), ),
TextSpan( TextSpan(
text: 'Help ', text: 'Help ',
@ -549,17 +748,20 @@ class QuestionAnswerScrollView extends StatelessWidget {
'Roboto', 'Roboto',
'NotoKufi', 'NotoKufi',
), ),
color: Color(0xFF414042), color: isDarkTheme ? Colors.white : Color(0xFF414042),
fontWeight: FontWeight.w500, fontWeight: FontWeight.w500,
fontSize: 16), fontSize: 16),
), ),
TextSpan( TextSpan(
text: 'section in the app and contact the support team.\n', text: 'section in the app and contact the support team.\n',
style: TextStyle( style: TextStyle(
color: Colors.grey, fontSize: 16, fontFamily: context.translate( color: isDarkTheme ? Colors.white : Colors.grey,
fontSize: 16,
fontFamily: context.translate(
'Roboto', 'Roboto',
'NotoKufi', 'NotoKufi',
),), ),
),
), ),
], ],
), ),
@ -568,12 +770,16 @@ class QuestionAnswerScrollView extends StatelessWidget {
text: TextSpan( text: TextSpan(
children: [ children: [
TextSpan( TextSpan(
text: 'للحصول على الدعم الفني أو تقديم ملاحظات، انتقل إلى قسم "المساعدة" في التطبيق وتواصل مع فريق الدعم.\n', text:
'للحصول على الدعم الفني أو تقديم ملاحظات، انتقل إلى قسم "المساعدة" في التطبيق وتواصل مع فريق الدعم.\n',
style: TextStyle( style: TextStyle(
color: Colors.grey, fontSize: 16, fontFamily: context.translate( color: isDarkTheme ? Colors.white : Colors.grey,
fontSize: 16,
fontFamily: context.translate(
'Roboto', 'Roboto',
'NotoKufi', 'NotoKufi',
),), ),
),
), ),
], ],
), ),
@ -588,10 +794,13 @@ class QuestionAnswerScrollView extends StatelessWidget {
TextSpan( TextSpan(
text: 'Go to the ', text: 'Go to the ',
style: TextStyle( style: TextStyle(
color: Colors.grey, fontSize: 16, fontFamily: context.translate( color: isDarkTheme ? Colors.white : Colors.grey,
fontSize: 16,
fontFamily: context.translate(
'Roboto', 'Roboto',
'NotoKufi', 'NotoKufi',
),), ),
),
), ),
TextSpan( TextSpan(
text: 'Profile ', text: 'Profile ',
@ -600,17 +809,20 @@ class QuestionAnswerScrollView extends StatelessWidget {
'Roboto', 'Roboto',
'NotoKufi', 'NotoKufi',
), ),
color: Color(0xFF414042), color: isDarkTheme ? Colors.white : Color(0xFF414042),
fontWeight: FontWeight.w500, fontWeight: FontWeight.w500,
fontSize: 16), fontSize: 16),
), ),
TextSpan( TextSpan(
text: 'section and tap the ', text: 'section and tap the ',
style: TextStyle( style: TextStyle(
color: Colors.grey, fontSize: 16, fontFamily: context.translate( color: isDarkTheme ? Colors.white : Colors.grey,
fontSize: 16,
fontFamily: context.translate(
'Roboto', 'Roboto',
'NotoKufi', 'NotoKufi',
),), ),
),
), ),
TextSpan( TextSpan(
text: 'Logout ', text: 'Logout ',
@ -619,17 +831,20 @@ class QuestionAnswerScrollView extends StatelessWidget {
'Roboto', 'Roboto',
'NotoKufi', 'NotoKufi',
), ),
color: Color(0xFF414042), color: isDarkTheme ? Colors.white : Color(0xFF414042),
fontWeight: FontWeight.w500, fontWeight: FontWeight.w500,
fontSize: 16), fontSize: 16),
), ),
TextSpan( TextSpan(
text: 'option in the top-right corner.\n', text: 'option in the top-right corner.\n',
style: TextStyle( style: TextStyle(
color: Colors.grey, fontSize: 16, fontFamily: context.translate( color: isDarkTheme ? Colors.white70 : Colors.grey,
fontSize: 16,
fontFamily: context.translate(
'Roboto', 'Roboto',
'NotoKufi', 'NotoKufi',
),), ),
),
) )
], ],
), ),
@ -638,12 +853,16 @@ class QuestionAnswerScrollView extends StatelessWidget {
text: TextSpan( text: TextSpan(
children: [ children: [
TextSpan( TextSpan(
text: 'انتقل إلى قسم "الملف الشخصي" واضغط على خيار "تسجيل الخروج" في الزاوية العلوية اليسرى.\n', text:
'انتقل إلى قسم "الملف الشخصي" واضغط على خيار "تسجيل الخروج" في الزاوية العلوية اليسرى.\n',
style: TextStyle( style: TextStyle(
color: Colors.grey, fontSize: 16, fontFamily: context.translate( color: isDarkTheme ? Colors.white70 : Colors.grey,
fontSize: 16,
fontFamily: context.translate(
'Roboto', 'Roboto',
'NotoKufi', 'NotoKufi',
),), ),
),
) )
], ],
), ),
@ -654,7 +873,12 @@ class QuestionAnswerScrollView extends StatelessWidget {
return SingleChildScrollView( return SingleChildScrollView(
child: Column( child: Column(
children: questionsAndAnswers children: questionsAndAnswers
.map((qa) => QuestionAnswerCard(qa: qa)) .map(
(qa) => QuestionAnswerCard(
qa: qa,
isDarkTheme: isDarkTheme,
),
)
.toList(), .toList(),
), ),
); );
@ -664,8 +888,10 @@ class QuestionAnswerScrollView extends StatelessWidget {
class QuestionAnswerCard extends StatefulWidget { class QuestionAnswerCard extends StatefulWidget {
// Use dynamic to accommodate RichText // Use dynamic to accommodate RichText
const QuestionAnswerCard({super.key, required this.qa}); const QuestionAnswerCard(
{super.key, required this.qa, required this.isDarkTheme});
final Map<String, dynamic> qa; final Map<String, dynamic> qa;
final bool isDarkTheme;
@override @override
_QuestionAnswerCardState createState() => _QuestionAnswerCardState(); _QuestionAnswerCardState createState() => _QuestionAnswerCardState();
@ -677,7 +903,8 @@ class _QuestionAnswerCardState extends State<QuestionAnswerCard> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Card( return Card(
color: Colors.white, // color: Colors.white,
color: widget.isDarkTheme ? Colors.black : Colors.white,
shape: Border( shape: Border(
bottom: BorderSide(width: 0.5, color: Colors.grey.shade300), bottom: BorderSide(width: 0.5, color: Colors.grey.shade300),
), ),
@ -689,10 +916,14 @@ class _QuestionAnswerCardState extends State<QuestionAnswerCard> {
children: [ children: [
ListTile( ListTile(
dense: true, dense: true,
textColor: Color(0xFF414042), textColor: widget.isDarkTheme ? Colors.white : Color(0xFF414042),
title: Text( title: Text(
context.translate(widget.qa['question'],widget.qa['question-ar'])!, context.translate(
style: TextStyle(fontWeight: FontWeight.w500, fontSize: 16,fontFamily: context.translate( widget.qa['question'], widget.qa['question-ar'])!,
style: TextStyle(
fontWeight: FontWeight.w500,
fontSize: 16,
fontFamily: context.translate(
'Roboto', 'Roboto',
'NotoKufi', 'NotoKufi',
), ),
@ -701,6 +932,7 @@ class _QuestionAnswerCardState extends State<QuestionAnswerCard> {
trailing: Icon(isExpanded trailing: Icon(isExpanded
? Icons.keyboard_arrow_up ? Icons.keyboard_arrow_up
: Icons.keyboard_arrow_down), : Icons.keyboard_arrow_down),
iconColor: widget.isDarkTheme ? Colors.white : Color(0xFF414042),
onTap: () { onTap: () {
setState(() { setState(() {
isExpanded = !isExpanded; isExpanded = !isExpanded;
@ -712,16 +944,19 @@ class _QuestionAnswerCardState extends State<QuestionAnswerCard> {
padding: const EdgeInsets.only( padding: const EdgeInsets.only(
left: 16, right: 16, bottom: 16, top: 0), left: 16, right: 16, bottom: 16, top: 0),
child: widget.qa['answer'] is RichText child: widget.qa['answer'] is RichText
? context.translate(widget.qa['answer'],widget.qa['answer-ar']) ? context.translate(
widget.qa['answer'], widget.qa['answer-ar'])
: Text( : Text(
context.translate(widget.qa['answer'] ?? '',widget.qa['answer-ar']), context.translate(
widget.qa['answer'] ?? '', widget.qa['answer-ar']),
style: TextStyle( style: TextStyle(
color: Colors.grey, color: widget.isDarkTheme ? Colors.white : Colors.grey,
fontSize: 16, fontSize: 16,
fontFamily: context.translate( fontFamily: context.translate(
'Roboto', 'Roboto',
'NotoKufi', 'NotoKufi',
),), ),
),
), ),
), ),
], ],

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: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', 'الميزات الرئيسية'),
@ -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
@ -114,7 +229,7 @@ class UsingFeatures extends StatelessWidget {
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
@ -178,7 +300,7 @@ class UsingFeatures extends StatelessWidget {
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(
color: Colors.red,
fontFamily: context.translate(
'Roboto', 'Roboto',
'NotoKufi', '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,12 +105,12 @@ 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(
@ -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,40 +134,48 @@ 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: () {
context.push('/user-guide/${widget.routePath}');
},
child: MouseRegion( 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
? [ ? [
@ -136,10 +187,7 @@ class _HoverContainerState extends State<HoverContainer> {
), ),
] ]
: [], : [],
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),
@ -150,11 +198,16 @@ class _HoverContainerState extends State<HoverContainer> {
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),
@ -162,8 +215,7 @@ class _HoverContainerState extends State<HoverContainer> {
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(
@ -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;
@ -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');
} }
@ -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);
@ -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(() {
@ -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,22 +982,27 @@ 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,
), ),
), ),
) // flexibleSpace: (isDarkTheme && currentRoute == '/myhomepage')
: (isDarkTheme && currentRoute == '/uaenumbers') // ? Container(
? Container( // decoration: const BoxDecoration(
decoration: const BoxDecoration( // image: DecorationImage(
color: Color(0xFF333333), // 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
@ -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 &&
@ -1167,15 +1182,23 @@ class _BaseScaffoldState extends ConsumerState<BaseScaffold> {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
if (userId == "guest") ...[ if (userId == "guest") ...[
Text(userName ?? 'Guest User', Text(
userName ?? 'Guest User',
style: TextStyle( style: TextStyle(
color: isDarkTheme ? Color(0xFFAAAAAA) : null, color: isDarkTheme
),), ? Color(0xFFAAAAAA)
: null,
),
),
] else ...[ ] else ...[
Text(userName ?? 'Loading...', Text(
userName ?? 'Loading...',
style: TextStyle( style: TextStyle(
color: isDarkTheme ? Color(0xFFAAAAAA) : null, color: isDarkTheme
),), ? Color(0xFFAAAAAA)
: null,
),
),
Tooltip( Tooltip(
message: userEmail ?? message: userEmail ??
'Loading...', // Shows full email on hover 'Loading...', // Shows full email on hover
@ -1186,12 +1209,16 @@ class _BaseScaffoldState extends ConsumerState<BaseScaffold> {
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,
color: isDarkTheme
? Color(0xFFAAAAAA)
: null,
fontFamily: context.translate( fontFamily: context.translate(
'Roboto', 'Roboto',
'NotoKufi', '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(
fontSize: 12,
color: isDarkTheme ? Color(0xFFAAAAAA) : Colors.grey,
fontFamily: context.translate(
'Roboto', 'Roboto',
'NotoKufi', '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(
fontSize: 12,
color: Colors.red,
fontFamily: context.translate(
'Roboto', 'Roboto',
'NotoKufi', '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(
fontSize: 12,
color: isDarkTheme ? Color(0xFFAAAAAA) : Colors.grey,
fontFamily: context.translate(
'Roboto', 'Roboto',
'NotoKufi', 'NotoKufi',
),), ),
),
textAlign: TextAlign.center, textAlign: TextAlign.center,
); );
} }
@ -1410,7 +1482,8 @@ 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,
), ),
), ),
@ -1424,8 +1497,8 @@ color: isDarkTheme ? Color(0xFFAAAAAA) : null,
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
@ -1441,8 +1514,8 @@ color: isDarkTheme ? Color(0xFFAAAAAA) : null,
BottomNavigationBarItem( BottomNavigationBarItem(
// icon: Icon(Icons.map), // icon: Icon(Icons.map),
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.uaeMap, BottomBarAssetIconPath.uaeMap,
color: _getSelectedIndex(currentRoute) == 1 color: _getSelectedIndex(currentRoute) == 1
@ -1457,8 +1530,8 @@ color: isDarkTheme ? Color(0xFFAAAAAA) : null,
), ),
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.ranking, BottomBarAssetIconPath.ranking,
color: _getSelectedIndex(currentRoute) == 2 color: _getSelectedIndex(currentRoute) == 2
@ -1473,8 +1546,8 @@ color: isDarkTheme ? Color(0xFFAAAAAA) : null,
), ),
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.globe, BottomBarAssetIconPath.globe,
color: _getSelectedIndex(currentRoute) == 3 color: _getSelectedIndex(currentRoute) == 3
@ -1507,7 +1580,6 @@ color: isDarkTheme ? Color(0xFFAAAAAA) : null,
), ),
showUnselectedLabels: true, 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(
fontSize: 20,
fontWeight: FontWeight.bold,
fontFamily: context.translate(
'Roboto', 'Roboto',
'NotoKufi', 'NotoKufi',
),), ),
),
), ),
content: Padding( content: Padding(
padding: const EdgeInsets.all(20.0), padding: const EdgeInsets.all(20.0),
@ -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(
color: Colors.white,
fontSize: 16,
fontFamily: context.translate(
'Roboto', 'Roboto',
'NotoKufi', 'NotoKufi',
),), ),
),
textAlign: TextAlign.center, textAlign: TextAlign.center,
), ),
), ),

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"