dark/light added
@ -2,27 +2,27 @@ C/C++ Structured Log}
|
||||
{
|
||||
y/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/Debug/4y161to1/arm64-v8a/additional_project_files.txtC
|
||||
A
|
||||
?com.android.build.gradle.internal.cxx.io.EncodedFileFingerPrint <EFBFBD>ùÓÁ÷2 ¡¹ñÀ÷2z
|
||||
?com.android.build.gradle.internal.cxx.io.EncodedFileFingerPrint ãÄ¹Žƒ3 ¡¹ñÀ÷2z
|
||||
x
|
||||
v/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/Debug/4y161to1/arm64-v8a/android_gradle_build.json ƒùÓÁ÷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
|
||||
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
|
||||
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
|
||||
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
|
||||
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
|
||||
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
|
||||
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
|
||||
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
|
||||
_/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
|
||||
@ -2,27 +2,27 @@ C/C++ Structured Log
|
||||
}
|
||||
{/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/Debug/4y161to1/armeabi-v7a/additional_project_files.txtC
|
||||
A
|
||||
?com.android.build.gradle.internal.cxx.io.EncodedFileFingerPrint <EFBFBD>ùÓÁ÷2 ¸ïòÀ÷2|
|
||||
?com.android.build.gradle.internal.cxx.io.EncodedFileFingerPrint éÅ¹Žƒ3 ¸ïòÀ÷2|
|
||||
z
|
||||
x/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/Debug/4y161to1/armeabi-v7a/android_gradle_build.json <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
|
||||
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
|
||||
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
|
||||
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
|
||||
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
|
||||
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
|
||||
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
|
||||
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
|
||||
_/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
|
||||
@ -2,27 +2,27 @@ C/C++ Structured Logw
|
||||
u
|
||||
s/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/Debug/4y161to1/x86/additional_project_files.txtC
|
||||
A
|
||||
?com.android.build.gradle.internal.cxx.io.EncodedFileFingerPrint ˜ùÓÁ÷2 „òòÀ÷2t
|
||||
?com.android.build.gradle.internal.cxx.io.EncodedFileFingerPrint ôÅ¹Žƒ3 „òòÀ÷2t
|
||||
r
|
||||
p/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/Debug/4y161to1/x86/android_gradle_build.json ˜ùÓÁ÷2ô „òòÀ÷2y
|
||||
p/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/Debug/4y161to1/x86/android_gradle_build.json ôÅ¹Žƒ3ô „òòÀ÷2y
|
||||
w
|
||||
u/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/Debug/4y161to1/x86/android_gradle_build_mini.json ˜ùÓÁ÷2÷ …òòÀ÷2f
|
||||
u/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/Debug/4y161to1/x86/android_gradle_build_mini.json ôÅ¹Žƒ3÷ …òòÀ÷2f
|
||||
d
|
||||
b/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/Debug/4y161to1/x86/build.ninja ˜ùÓÁ÷2ÆÌ ûñòÀ÷2j
|
||||
b/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/Debug/4y161to1/x86/build.ninja ôÅ¹Žƒ3ÆÌ ûñòÀ÷2j
|
||||
h
|
||||
f/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/Debug/4y161to1/x86/build.ninja.txt ˜ùÓÁ÷2o
|
||||
f/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/Debug/4y161to1/x86/build.ninja.txt ôÅ¹Žƒ3o
|
||||
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
|
||||
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
|
||||
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
|
||||
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
|
||||
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
|
||||
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
|
||||
_/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
|
||||
@ -2,27 +2,27 @@ C/C++ Structured Logz
|
||||
x
|
||||
v/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/Debug/4y161to1/x86_64/additional_project_files.txtC
|
||||
A
|
||||
?com.android.build.gradle.internal.cxx.io.EncodedFileFingerPrint žùÓÁ÷2 •ôòÀ÷2w
|
||||
?com.android.build.gradle.internal.cxx.io.EncodedFileFingerPrint ýÅ¹Žƒ3 •ôòÀ÷2w
|
||||
u
|
||||
s/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/Debug/4y161to1/x86_64/android_gradle_build.json žùÓÁ÷2ú •ôòÀ÷2|
|
||||
s/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/Debug/4y161to1/x86_64/android_gradle_build.json ýÅ¹Žƒ3ú •ôòÀ÷2|
|
||||
z
|
||||
x/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/Debug/4y161to1/x86_64/android_gradle_build_mini.json žùÓÁ÷2ý –ôòÀ÷2i
|
||||
x/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/Debug/4y161to1/x86_64/android_gradle_build_mini.json ýÅ¹Žƒ3ý –ôòÀ÷2i
|
||||
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
|
||||
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
|
||||
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
|
||||
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
|
||||
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
|
||||
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
|
||||
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
|
||||
_/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
|
||||
@ -2,27 +2,27 @@ C/C++ Structured Log
|
||||
…
|
||||
‚/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/RelWithDebInfo/574gs2w4/arm64-v8a/additional_project_files.txtC
|
||||
A
|
||||
?com.android.build.gradle.internal.cxx.io.EncodedFileFingerPrint µ§Ä‚ú2 ™ªÇŸô2„
|
||||
?com.android.build.gradle.internal.cxx.io.EncodedFileFingerPrint ©¥‘<EFBFBD>û2 ™ªÇŸô2„
|
||||
<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
|
||||
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
|
||||
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>
|
||||
/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|
|
||||
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
|
||||
_/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
|
||||
@ -2,27 +2,27 @@ C/C++ Structured Log
|
||||
‡
|
||||
„/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/RelWithDebInfo/574gs2w4/armeabi-v7a/additional_project_files.txtC
|
||||
A
|
||||
?com.android.build.gradle.internal.cxx.io.EncodedFileFingerPrint Õ§Ä‚ú2 £¼ÇŸô2‡
|
||||
?com.android.build.gradle.internal.cxx.io.EncodedFileFingerPrint º¥‘<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
|
||||
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
|
||||
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~
|
||||
|
|
||||
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>
|
||||
/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
|
||||
_/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
|
||||
@ -2,27 +2,27 @@ C/C++ Structured Log
|
||||
~
|
||||
|/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/RelWithDebInfo/574gs2w4/x86/additional_project_files.txtC
|
||||
A
|
||||
?com.android.build.gradle.internal.cxx.io.EncodedFileFingerPrint Þ§Ä‚ú2 µÂÇŸô2}
|
||||
?com.android.build.gradle.internal.cxx.io.EncodedFileFingerPrint Ã¥‘<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
|
||||
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
|
||||
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
|
||||
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
|
||||
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>
|
||||
/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
|
||||
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
|
||||
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
|
||||
_/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
|
||||
@ -2,27 +2,27 @@ C/C++ Structured Log
|
||||
<EFBFBD>
|
||||
/Users/venbateam/Documents/UAE_Stats/FCSC/frontend/android/app/.cxx/RelWithDebInfo/574gs2w4/x86_64/additional_project_files.txtC
|
||||
A
|
||||
?com.android.build.gradle.internal.cxx.io.EncodedFileFingerPrint Œ¨Ä‚ú2 ·ÆÇŸô2€
|
||||
?com.android.build.gradle.internal.cxx.io.EncodedFileFingerPrint Ê¥‘<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
|
||||
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
|
||||
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
|
||||
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
|
||||
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
|
||||
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
|
||||
_/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
|
||||
@ -20,12 +20,12 @@ if (project.hasProperty('google-services.json')) {
|
||||
|
||||
def flutterVersionCode = localProperties.getProperty("flutter.versionCode")
|
||||
if (flutterVersionCode == null) {
|
||||
flutterVersionCode = "61"
|
||||
flutterVersionCode = "62"
|
||||
}
|
||||
|
||||
def flutterVersionName = localProperties.getProperty("flutter.versionName")
|
||||
if (flutterVersionName == null) {
|
||||
flutterVersionName = "1.0.60"
|
||||
flutterVersionName = "1.0.61"
|
||||
}
|
||||
|
||||
def keystorePropertiesFile = rootProject.file("key.properties")
|
||||
|
||||
|
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 7.6 KiB |
BIN
assets/banners/FCSCLogo_dark1.png
Normal file
|
After Width: | Height: | Size: 11 KiB |
|
Before Width: | Height: | Size: 19 KiB After Width: | Height: | Size: 11 KiB |
BIN
assets/banners/FCSCLogo_light1.png
Normal file
|
After Width: | Height: | Size: 19 KiB |
BIN
assets/icons/misc/lock.png
Normal file
|
After Width: | Height: | Size: 509 B |
BIN
assets/icons/misc/person.png
Normal file
|
After Width: | Height: | Size: 764 B |
BIN
assets/icons/misc/signInWithApple.png
Normal file
|
After Width: | Height: | Size: 319 B |
BIN
assets/icons/misc/signInWithGoogle.png
Normal file
|
After Width: | Height: | Size: 801 B |
BIN
assets/icons/misc/signInWithUAEPass.png
Normal file
|
After Width: | Height: | Size: 1.4 KiB |
|
Before Width: | Height: | Size: 557 B After Width: | Height: | Size: 679 B |
BIN
assets/icons/misc/vector1.png
Normal file
|
After Width: | Height: | Size: 557 B |
@ -506,7 +506,7 @@
|
||||
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
|
||||
CODE_SIGN_IDENTITY = "Apple Development";
|
||||
CODE_SIGN_STYLE = Automatic;
|
||||
CURRENT_PROJECT_VERSION = 7;
|
||||
CURRENT_PROJECT_VERSION = 8;
|
||||
DEVELOPMENT_ASSET_PATHS = Runner/Assets.xcassets;
|
||||
DEVELOPMENT_TEAM = 9N5SRFUGK2;
|
||||
ENABLE_BITCODE = NO;
|
||||
@ -517,7 +517,7 @@
|
||||
"$(inherited)",
|
||||
"@executable_path/Frameworks",
|
||||
);
|
||||
MARKETING_VERSION = 1.0.6;
|
||||
MARKETING_VERSION = 1.0.7;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = ae.gov.fcsc.frontend.ios;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
PROVISIONING_PROFILE_SPECIFIER = "";
|
||||
@ -705,7 +705,7 @@
|
||||
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
|
||||
CODE_SIGN_IDENTITY = "Apple Development";
|
||||
CODE_SIGN_STYLE = Automatic;
|
||||
CURRENT_PROJECT_VERSION = 7;
|
||||
CURRENT_PROJECT_VERSION = 8;
|
||||
DEVELOPMENT_ASSET_PATHS = Runner/Assets.xcassets;
|
||||
DEVELOPMENT_TEAM = 9N5SRFUGK2;
|
||||
ENABLE_BITCODE = NO;
|
||||
@ -716,7 +716,7 @@
|
||||
"$(inherited)",
|
||||
"@executable_path/Frameworks",
|
||||
);
|
||||
MARKETING_VERSION = 1.0.6;
|
||||
MARKETING_VERSION = 1.0.7;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = ae.gov.fcsc.frontend.ios;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
PROVISIONING_PROFILE_SPECIFIER = "";
|
||||
@ -742,7 +742,7 @@
|
||||
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
|
||||
CODE_SIGN_IDENTITY = "Apple Development";
|
||||
CODE_SIGN_STYLE = Automatic;
|
||||
CURRENT_PROJECT_VERSION = 7;
|
||||
CURRENT_PROJECT_VERSION = 8;
|
||||
DEVELOPMENT_ASSET_PATHS = Runner/Assets.xcassets;
|
||||
DEVELOPMENT_TEAM = 9N5SRFUGK2;
|
||||
ENABLE_BITCODE = NO;
|
||||
@ -753,7 +753,7 @@
|
||||
"$(inherited)",
|
||||
"@executable_path/Frameworks",
|
||||
);
|
||||
MARKETING_VERSION = 1.0.6;
|
||||
MARKETING_VERSION = 1.0.7;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = ae.gov.fcsc.frontend.ios;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
PROVISIONING_PROFILE_SPECIFIER = "";
|
||||
|
||||
@ -2,9 +2,14 @@ abstract class MiscIconAssetPath {
|
||||
static const _basePath = 'assets/icons/misc';
|
||||
static const rightChevronInSemiCircle =
|
||||
'$_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 lockLight = '$_basePath/lockLight.png';
|
||||
static const menu = '$_basePath/menu.png';
|
||||
static const person = '$_basePath/person.png';
|
||||
static const personDark = '$_basePath/personDark.png';
|
||||
static const personLight = '$_basePath/personLight.png';
|
||||
static const back = '$_basePath/back.png';
|
||||
|
||||
@ -4,6 +4,7 @@ import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
import 'package:shared_preferences/shared_preferences.dart';
|
||||
import 'package:go_router/go_router.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/infrastructure/services/img_asset_paths/icons/misc_icon_asset_path.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);
|
||||
}
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
final currentTheme = ref.read(themeProvider); // should return ThemeMode
|
||||
print(currentTheme); // ThemeMode.dark, ThemeMode.light, etc.
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final locale = AppLocalizations.of(context)!;
|
||||
|
||||
@ -265,7 +265,7 @@ class _UaenumberWidgetState extends ConsumerState<uaenumberWidget> {
|
||||
}
|
||||
|
||||
return Container(
|
||||
color: isDarkTheme ? Color(0xFF333333) : Color(0xFFFFFFFF), // Set background here
|
||||
color: isDarkTheme ? Color(0xFF000000) : Color(0xFFFFFFFF), // Set background here
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.only(left: 16.0, right: 16.0, top: 5.0, bottom: 5.0),
|
||||
child: Column(
|
||||
@ -274,11 +274,11 @@ class _UaenumberWidgetState extends ConsumerState<uaenumberWidget> {
|
||||
height: 40,
|
||||
decoration: BoxDecoration(
|
||||
color: isDarkTheme ? Color(0xFF000000) : Colors.white,
|
||||
borderRadius: BorderRadius.circular(30.0),
|
||||
border: Border.all(width: 1, color: Color(0xFFAA8E83)),
|
||||
borderRadius: BorderRadius.circular(5.0),
|
||||
border: Border.all(width: 2, color: Color(0xFFA0A0A0)),
|
||||
),
|
||||
child: Padding(
|
||||
padding: EdgeInsets.only(left: 12.0),
|
||||
padding: EdgeInsets.only(left: 5.0),
|
||||
child: TextField(
|
||||
controller: _searchController,
|
||||
onChanged: (value) {
|
||||
@ -287,9 +287,9 @@ class _UaenumberWidgetState extends ConsumerState<uaenumberWidget> {
|
||||
decoration: InputDecoration(
|
||||
hintText: AppLocalizations.of(context)!.search,
|
||||
hintStyle: TextStyle(
|
||||
color: isDarkTheme ? Color(0xFFBBBBBB) : Color(0xFFAA8E83),
|
||||
color: isDarkTheme ? Color(0xFF898C81) : Color(0xFF898C81),
|
||||
fontFamily: context.translate('Roboto', 'NotoKufi'),
|
||||
fontSize: 14,
|
||||
fontSize: 18,
|
||||
// height: 1.8,
|
||||
),
|
||||
prefixIconConstraints: BoxConstraints(
|
||||
@ -320,7 +320,7 @@ class _UaenumberWidgetState extends ConsumerState<uaenumberWidget> {
|
||||
},
|
||||
)
|
||||
: null,
|
||||
contentPadding: EdgeInsets.symmetric(vertical: 15, horizontal: 18.0),
|
||||
contentPadding: EdgeInsets.symmetric(vertical: 12, horizontal: 18.0),
|
||||
border: InputBorder.none,
|
||||
// contentPadding:
|
||||
// EdgeInsets.symmetric(vertical: 9, horizontal: 18.0),
|
||||
@ -502,9 +502,9 @@ class _UaenumberWidgetState extends ConsumerState<uaenumberWidget> {
|
||||
color: isDarkTheme ? Color(0xFF111111) : Colors.white,
|
||||
border: Border.all(
|
||||
color: bordercolor,
|
||||
width: 1,
|
||||
width: 2,
|
||||
),
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
borderRadius: BorderRadius.circular(5),
|
||||
),
|
||||
padding: const EdgeInsets.only(
|
||||
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),
|
||||
child: Container(
|
||||
decoration: BoxDecoration(
|
||||
color: isDarkTheme ? Color(0xFF333333) : Colors.white,
|
||||
color: isDarkTheme ? Color(0xFF000000) : Color(0xFFFFFFFF),
|
||||
),
|
||||
child: Container(
|
||||
decoration: BoxDecoration(
|
||||
color: widget.titleBackgroundColor,
|
||||
borderRadius: BorderRadius.all(Radius.circular(35))),
|
||||
borderRadius: BorderRadius.only(topLeft: Radius.circular(20),topRight: Radius.circular(20))
|
||||
),
|
||||
padding: const EdgeInsets.only(
|
||||
left: 16, bottom: 5, top: 5, right: 10),
|
||||
child: Row(
|
||||
@ -645,13 +646,13 @@ class _CustomExpandableTileState extends ConsumerState<CustomExpandableTile> {
|
||||
duration: Duration(milliseconds: 300),
|
||||
curve: Curves.easeInOut,
|
||||
width: double.infinity,
|
||||
color: isDarkTheme ? Color(0xFF333333) : Colors.white,
|
||||
color: isDarkTheme ? Color(0xFF000000) : Color(0xFFFFFFFF),
|
||||
height: widget.isExpanded ? myheight * 0.52 : 0,
|
||||
child: widget.isExpanded
|
||||
? SingleChildScrollView(
|
||||
child: Container(
|
||||
decoration: BoxDecoration(
|
||||
color: isDarkTheme ? Color(0xFF333333) : Colors.white,
|
||||
color: isDarkTheme ? Color(0xFF000000) : Color(0xFFFFFFFF),
|
||||
// borderRadius: BorderRadius.all(Radius.circular(20))
|
||||
),
|
||||
padding: const EdgeInsets.all(1),
|
||||
|
||||
@ -7,6 +7,7 @@ import 'package:shared_preferences/shared_preferences.dart';
|
||||
import 'package:uae_stat/config/api_config.dart';
|
||||
import 'package:uae_stat/config/connectivity_provider.dart';
|
||||
import 'package:uae_stat/config/my_router.dart';
|
||||
import 'package:uae_stat/config/theme/theme_provider.dart';
|
||||
import 'package:uae_stat/domain/use_cases/language.dart';
|
||||
import 'package:uae_stat/infrastructure/data/p_auth_repo.dart';
|
||||
import 'package:uae_stat/infrastructure/services/img_asset_paths/banner_asset_path.dart';
|
||||
@ -253,6 +254,13 @@ class _CreateNewPwState extends ConsumerState<CreateNewPw> {
|
||||
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(
|
||||
canPop: false, // Allow back navigation only if not login screen
|
||||
onPopInvokedWithResult: (didPop, result) {
|
||||
@ -260,7 +268,7 @@ class _CreateNewPwState extends ConsumerState<CreateNewPw> {
|
||||
logout(context);// Show exit confirmation dialog
|
||||
},
|
||||
child: Scaffold(
|
||||
backgroundColor: Colors.white,
|
||||
backgroundColor: isDarkTheme ? Color(0xFF111111) : Colors.white,
|
||||
body: Stack(children: [
|
||||
SingleChildScrollView(
|
||||
child: SafeArea(
|
||||
@ -298,6 +306,10 @@ class _CreateNewPwState extends ConsumerState<CreateNewPw> {
|
||||
Widget _buildPasswordForm(
|
||||
WidgetRef ref, double screenHeight, double screenWidth) {
|
||||
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(
|
||||
key: _formKey,
|
||||
child: Padding(
|
||||
@ -322,7 +334,7 @@ class _CreateNewPwState extends ConsumerState<CreateNewPw> {
|
||||
// Icons.close,
|
||||
Icons.arrow_back_ios,
|
||||
size: 24, // Icon size
|
||||
color: Colors.black, // Icon color
|
||||
color: isDarkTheme ? Colors.white : Colors.black, // Icon color
|
||||
),
|
||||
),
|
||||
), // Left icon
|
||||
@ -363,6 +375,7 @@ class _CreateNewPwState extends ConsumerState<CreateNewPw> {
|
||||
),
|
||||
fontSize: passwordLocale?.languageCode == 'ar' ? 24 : 26,
|
||||
fontWeight: FontWeight.w300,
|
||||
color: isDarkTheme ? Colors.white : null,
|
||||
),
|
||||
),
|
||||
SizedBox(height: 10),
|
||||
@ -410,7 +423,7 @@ class _CreateNewPwState extends ConsumerState<CreateNewPw> {
|
||||
hintText: AppLocalizations.of(context)!.old_password,
|
||||
// prefixIcon: Icon(Icons.lock, color: Colors.blue),
|
||||
hintStyle: TextStyle(
|
||||
color: Color(0xFFC3C6CB),
|
||||
color: isDarkTheme ? Colors.white : Color(0xFFC3C6CB),
|
||||
fontWeight: FontWeight.w400,
|
||||
fontFamily: context.translate(
|
||||
'Roboto',
|
||||
@ -426,11 +439,11 @@ class _CreateNewPwState extends ConsumerState<CreateNewPw> {
|
||||
end: 10,
|
||||
),
|
||||
child: Image.asset(
|
||||
MiscIconAssetPath.lockLight,
|
||||
isDarkTheme ? MiscIconAssetPath.lockDark : MiscIconAssetPath.lockLight,
|
||||
fit: BoxFit.fitHeight,
|
||||
height: 25,
|
||||
width: 25,
|
||||
color: MyTheme.topicColor(IndicatorTopic.economy).shade300,
|
||||
color: isDarkTheme ? Colors.white : MyTheme.topicColor(IndicatorTopic.economy).shade300,
|
||||
),
|
||||
),
|
||||
suffixIcon: IconButton(
|
||||
|
||||
@ -635,7 +635,7 @@ class _RegisterScreenState extends ConsumerState<RegisterScreen> {
|
||||
),
|
||||
fontSize: 32,
|
||||
fontWeight: FontWeight.w400,
|
||||
color: isDarkTheme ? Color(0xFFFFFFFF) : null,
|
||||
color: isDarkTheme ? Color(0xFFFFFFFF) : Color(0xFF000000),
|
||||
),
|
||||
),
|
||||
SizedBox(height: 10),
|
||||
@ -649,7 +649,7 @@ class _RegisterScreenState extends ConsumerState<RegisterScreen> {
|
||||
),
|
||||
fontSize:
|
||||
context.translate(18.0, 14.0),
|
||||
color: isDarkTheme ? Color(0xFFFFFFFF) : Color(0xff898C81),
|
||||
color: isDarkTheme ? Color(0xFFFFFFFF) : Color(0xFF898C81),
|
||||
fontWeight: FontWeight.w600,
|
||||
),
|
||||
),
|
||||
@ -694,14 +694,10 @@ class _RegisterScreenState extends ConsumerState<RegisterScreen> {
|
||||
end: 10,
|
||||
),
|
||||
child: Image.asset(
|
||||
MiscIconAssetPath.personLight,
|
||||
MiscIconAssetPath.person,
|
||||
fit: BoxFit.fitHeight,
|
||||
height: 25,
|
||||
width: 25,
|
||||
color: MyTheme.topicColor(
|
||||
IndicatorTopic
|
||||
.economy)
|
||||
.shade300,
|
||||
),
|
||||
),
|
||||
|
||||
@ -715,7 +711,7 @@ class _RegisterScreenState extends ConsumerState<RegisterScreen> {
|
||||
borderRadius:
|
||||
BorderRadius.circular(10),
|
||||
borderSide: BorderSide(
|
||||
color: isDarkTheme ? Colors.white : MyTheme.topicColor(IndicatorTopic.economy).shade400, // ✅ border
|
||||
color: Color(0xFFB68A34), // ✅ border
|
||||
width: 1), // Enabled border
|
||||
),
|
||||
focusedBorder: OutlineInputBorder(
|
||||
@ -729,7 +725,7 @@ class _RegisterScreenState extends ConsumerState<RegisterScreen> {
|
||||
borderRadius:
|
||||
BorderRadius.circular(10),
|
||||
borderSide: BorderSide(
|
||||
color: isDarkTheme ? Color(0xFFFFA100) : Color(0xFFb22222),
|
||||
color: Color(0xFFD83731),
|
||||
width: 1), // Error border
|
||||
),
|
||||
focusedErrorBorder:
|
||||
@ -737,7 +733,7 @@ class _RegisterScreenState extends ConsumerState<RegisterScreen> {
|
||||
borderRadius:
|
||||
BorderRadius.circular(10),
|
||||
borderSide: BorderSide(
|
||||
color: isDarkTheme ? Color(0xFFFFA100) : Color(0xFFb22222),
|
||||
color: Color(0xFFD83731),
|
||||
width:
|
||||
1), // Match the error color
|
||||
),
|
||||
@ -747,7 +743,7 @@ class _RegisterScreenState extends ConsumerState<RegisterScreen> {
|
||||
'Roboto',
|
||||
'NotoKufi',
|
||||
),
|
||||
color: isDarkTheme ? const Color(0xFFEEEEEE) : const Color(0xFFC3C6CB),
|
||||
color: const Color(0xFFC3C6CB),
|
||||
fontSize: registerLocale
|
||||
?.languageCode ==
|
||||
'ar'
|
||||
@ -804,12 +800,8 @@ class _RegisterScreenState extends ConsumerState<RegisterScreen> {
|
||||
child: Image.asset(
|
||||
MiscIconAssetPath.vector,
|
||||
fit: BoxFit.fitHeight,
|
||||
height: 20,
|
||||
height: 25,
|
||||
width: 25,
|
||||
color: MyTheme.topicColor(
|
||||
IndicatorTopic
|
||||
.economy)
|
||||
.shade100,
|
||||
),
|
||||
),
|
||||
|
||||
@ -818,7 +810,7 @@ class _RegisterScreenState extends ConsumerState<RegisterScreen> {
|
||||
borderRadius:
|
||||
BorderRadius.circular(10),
|
||||
borderSide: BorderSide(
|
||||
color: isDarkTheme ? Colors.white : MyTheme.topicColor(IndicatorTopic.economy).shade400,
|
||||
color: Color(0xFFB68A34),
|
||||
width: 1),
|
||||
),
|
||||
focusedBorder: OutlineInputBorder(
|
||||
@ -832,7 +824,7 @@ class _RegisterScreenState extends ConsumerState<RegisterScreen> {
|
||||
borderRadius:
|
||||
BorderRadius.circular(10),
|
||||
borderSide: BorderSide(
|
||||
color: isDarkTheme ? Color(0xFFFFA100) : Color(0xFFb22222),
|
||||
color: Color(0xFFD83731),
|
||||
width: 1), // Error border
|
||||
),
|
||||
focusedErrorBorder:
|
||||
@ -840,7 +832,7 @@ class _RegisterScreenState extends ConsumerState<RegisterScreen> {
|
||||
borderRadius:
|
||||
BorderRadius.circular(10),
|
||||
borderSide: BorderSide(
|
||||
color: isDarkTheme ? Color(0xFFFFA100) : Color(0xFFb22222),
|
||||
color: Color(0xFFD83731),
|
||||
width:
|
||||
1), // Match the error color
|
||||
),
|
||||
@ -850,7 +842,7 @@ class _RegisterScreenState extends ConsumerState<RegisterScreen> {
|
||||
'Roboto',
|
||||
'NotoKufi',
|
||||
),
|
||||
color: isDarkTheme ? const Color(0xFFEEEEEE) : const Color(0xFFC3C6CB),
|
||||
color: const Color(0xFFC3C6CB),
|
||||
fontSize: registerLocale
|
||||
?.languageCode ==
|
||||
'ar'
|
||||
@ -908,14 +900,10 @@ class _RegisterScreenState extends ConsumerState<RegisterScreen> {
|
||||
end: 10,
|
||||
),
|
||||
child: Image.asset(
|
||||
MiscIconAssetPath.lockLight,
|
||||
MiscIconAssetPath.lock,
|
||||
fit: BoxFit.fitHeight,
|
||||
height: 25,
|
||||
width: 25,
|
||||
color: MyTheme.topicColor(
|
||||
IndicatorTopic
|
||||
.economy)
|
||||
.shade300,
|
||||
),
|
||||
),
|
||||
|
||||
@ -956,7 +944,7 @@ class _RegisterScreenState extends ConsumerState<RegisterScreen> {
|
||||
borderRadius:
|
||||
BorderRadius.circular(10),
|
||||
borderSide: BorderSide(
|
||||
color: isDarkTheme ? Colors.white : MyTheme.topicColor(IndicatorTopic.economy).shade400,
|
||||
color: Color(0xFFB68A34),
|
||||
width: 1),
|
||||
),
|
||||
focusedBorder: OutlineInputBorder(
|
||||
@ -970,7 +958,7 @@ class _RegisterScreenState extends ConsumerState<RegisterScreen> {
|
||||
borderRadius:
|
||||
BorderRadius.circular(10),
|
||||
borderSide: BorderSide(
|
||||
color: isDarkTheme ? Color(0xFFFFA100) : Color(0xFFb22222),
|
||||
color: Color(0xFFD83731),
|
||||
width: 1), // Error border
|
||||
),
|
||||
focusedErrorBorder:
|
||||
@ -978,7 +966,7 @@ class _RegisterScreenState extends ConsumerState<RegisterScreen> {
|
||||
borderRadius:
|
||||
BorderRadius.circular(10),
|
||||
borderSide: BorderSide(
|
||||
color: isDarkTheme ? Color(0xFFFFA100) : Color(0xFFb22222),
|
||||
color: Color(0xFFD83731),
|
||||
width:
|
||||
1), // Match the error color
|
||||
),
|
||||
@ -989,7 +977,7 @@ class _RegisterScreenState extends ConsumerState<RegisterScreen> {
|
||||
'Roboto',
|
||||
'NotoKufi',
|
||||
),
|
||||
color: isDarkTheme ? const Color(0xFFEEEEEE) : const Color(0xFFC3C6CB),
|
||||
color: const Color(0xFFC3C6CB),
|
||||
fontSize: registerLocale
|
||||
?.languageCode ==
|
||||
'ar'
|
||||
@ -1045,14 +1033,10 @@ class _RegisterScreenState extends ConsumerState<RegisterScreen> {
|
||||
end: 10,
|
||||
),
|
||||
child: Image.asset(
|
||||
MiscIconAssetPath.lockLight,
|
||||
MiscIconAssetPath.lock,
|
||||
fit: BoxFit.fitHeight,
|
||||
height: 25,
|
||||
width: 25,
|
||||
color: MyTheme.topicColor(
|
||||
IndicatorTopic
|
||||
.economy)
|
||||
.shade300,
|
||||
),
|
||||
),
|
||||
|
||||
@ -1083,7 +1067,7 @@ class _RegisterScreenState extends ConsumerState<RegisterScreen> {
|
||||
borderRadius:
|
||||
BorderRadius.circular(10),
|
||||
borderSide: BorderSide(
|
||||
color: isDarkTheme ? Colors.white : MyTheme.topicColor(IndicatorTopic.economy).shade400,
|
||||
color: Color(0xFFB68A34),
|
||||
width: 1),
|
||||
),
|
||||
focusedBorder: OutlineInputBorder(
|
||||
@ -1097,7 +1081,7 @@ class _RegisterScreenState extends ConsumerState<RegisterScreen> {
|
||||
borderRadius:
|
||||
BorderRadius.circular(10),
|
||||
borderSide: BorderSide(
|
||||
color: isDarkTheme ? Color(0xFFFFA100) : Color(0xFFb22222),
|
||||
color: Color(0xFFD83731),
|
||||
width: 1), // Error border
|
||||
),
|
||||
focusedErrorBorder:
|
||||
@ -1105,7 +1089,7 @@ class _RegisterScreenState extends ConsumerState<RegisterScreen> {
|
||||
borderRadius:
|
||||
BorderRadius.circular(10),
|
||||
borderSide: BorderSide(
|
||||
color: isDarkTheme ? Color(0xFFFFA100) : Color(0xFFb22222),
|
||||
color: Color(0xFFD83731),
|
||||
width:
|
||||
1), // Match the error color
|
||||
),
|
||||
@ -1115,7 +1099,7 @@ class _RegisterScreenState extends ConsumerState<RegisterScreen> {
|
||||
'Roboto',
|
||||
'NotoKufi',
|
||||
),
|
||||
color: isDarkTheme ? const Color(0xFFEEEEEE) : const Color(0xFFC3C6CB),
|
||||
color: const Color(0xFFC3C6CB),
|
||||
fontSize: registerLocale
|
||||
?.languageCode ==
|
||||
'ar'
|
||||
@ -1156,8 +1140,8 @@ class _RegisterScreenState extends ConsumerState<RegisterScreen> {
|
||||
},
|
||||
side: BorderSide(
|
||||
color: showError
|
||||
? isDarkTheme ? Color(0xFFFFA200) : Color(0xFFb22222)
|
||||
: isDarkTheme ? Colors.white : MyTheme.topicColor(IndicatorTopic.economy).shade400,
|
||||
? Color(0xFFD83731)
|
||||
: Color(0xFFB68A34),
|
||||
width: 1,
|
||||
),
|
||||
),
|
||||
@ -1186,7 +1170,7 @@ class _RegisterScreenState extends ConsumerState<RegisterScreen> {
|
||||
'ar'
|
||||
? 12
|
||||
: 14,
|
||||
color: isDarkTheme ? Color(0xFFEEEEEE) : Color(0xFF898C81), // Change to your desired color
|
||||
color: isDarkTheme ? Color(0xFFFFFFFF) : Color(0xFF898C81), // Change to your desired color
|
||||
),
|
||||
children: [
|
||||
TextSpan(
|
||||
@ -1213,7 +1197,7 @@ class _RegisterScreenState extends ConsumerState<RegisterScreen> {
|
||||
fontWeight:
|
||||
FontWeight
|
||||
.bold,
|
||||
color:isDarkTheme ? Color(0xFF9EB3E4) : Color(0xFF985400),
|
||||
color:isDarkTheme ? Color(0xFFB68A35) : Color(0xFF985400),
|
||||
// Makes the text bold
|
||||
// decoration:
|
||||
// TextDecoration.underline,
|
||||
@ -1232,7 +1216,7 @@ class _RegisterScreenState extends ConsumerState<RegisterScreen> {
|
||||
'Roboto',
|
||||
'NotoKufi',
|
||||
),
|
||||
color: isDarkTheme ? Color(0xFFEEEEEE) : Color(0xFF898C81),
|
||||
color: isDarkTheme ? Color(0xFFFFFFFF) : Color(0xFF898C81),
|
||||
),
|
||||
),
|
||||
TextSpan(
|
||||
@ -1258,7 +1242,7 @@ class _RegisterScreenState extends ConsumerState<RegisterScreen> {
|
||||
'ar'
|
||||
? 12
|
||||
: 14,
|
||||
color: isDarkTheme ? Color(0xFF9EB3E4) : Color(0xFF985400),
|
||||
color: isDarkTheme ? Color(0xFFB68A35) : Color(0xFF985400),
|
||||
// decoration:
|
||||
// TextDecoration.underline,
|
||||
decorationColor:
|
||||
@ -1283,7 +1267,7 @@ class _RegisterScreenState extends ConsumerState<RegisterScreen> {
|
||||
'ar'
|
||||
? 12
|
||||
: 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',
|
||||
'NotoKufi',
|
||||
),
|
||||
color: isDarkTheme ? Color(0xFFFFA200) : Color(0xFFb22222),
|
||||
color: Color(0xFFD83731),
|
||||
fontSize: registerLocale
|
||||
?.languageCode ==
|
||||
'ar'
|
||||
@ -1345,7 +1329,7 @@ class _RegisterScreenState extends ConsumerState<RegisterScreen> {
|
||||
? null
|
||||
: _registerUser,
|
||||
style: ElevatedButton.styleFrom(
|
||||
backgroundColor: isDarkTheme ? Color(0xFF9EB3E4) : Color(0xFFA7887A), // Brownish color for Register
|
||||
backgroundColor: Color(0xFFB68A34), // Brownish color for Register
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius:
|
||||
BorderRadius.circular(10),
|
||||
@ -1369,14 +1353,14 @@ class _RegisterScreenState extends ConsumerState<RegisterScreen> {
|
||||
'ar'
|
||||
? 14
|
||||
: 16,
|
||||
color: isDarkTheme ? Color(0xFF000000) : Colors.white
|
||||
color: Colors.white
|
||||
),
|
||||
),
|
||||
SizedBox(width: 8),
|
||||
Icon(
|
||||
Icons
|
||||
.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'
|
||||
? 12
|
||||
: 14,
|
||||
color: isDarkTheme ? Color(0xFFEEEEEE) : Color(0xFF898C81),
|
||||
color: isDarkTheme ? Color(0xFFFFFFFF) : Color(0xFF898C81),
|
||||
),
|
||||
),
|
||||
SizedBox(height: 15),
|
||||
@ -1415,7 +1399,7 @@ class _RegisterScreenState extends ConsumerState<RegisterScreen> {
|
||||
context.pop();
|
||||
},
|
||||
style: ElevatedButton.styleFrom(
|
||||
backgroundColor: isDarkTheme ? Color(0xFF24B4FB) : Color(0xFF82AFCB), // Blueish color for Login
|
||||
backgroundColor: Color(0xFFB68A34), // Blueish color for Login
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius:
|
||||
BorderRadius.circular(10),
|
||||
@ -1438,13 +1422,13 @@ class _RegisterScreenState extends ConsumerState<RegisterScreen> {
|
||||
'ar'
|
||||
? 14
|
||||
: 16,
|
||||
color: isDarkTheme ? Color(0xFF000000) : Colors.white),
|
||||
color: Colors.white),
|
||||
),
|
||||
SizedBox(width: 8),
|
||||
Icon(
|
||||
Icons
|
||||
.chevron_right_outlined,
|
||||
color: isDarkTheme ? Color(0xFF000000) : Colors.white, // Set your desired color here
|
||||
color: Colors.white, // Set your desired color here
|
||||
)
|
||||
],
|
||||
),
|
||||
|
||||
@ -15,6 +15,7 @@ import 'package:shared_preferences/shared_preferences.dart';
|
||||
import 'package:uae_stat/config/api_config.dart';
|
||||
import 'package:uae_stat/config/connectivity_provider.dart';
|
||||
import 'package:uae_stat/config/my_theme.dart';
|
||||
import 'package:uae_stat/config/theme/theme_provider.dart';
|
||||
import 'package:uae_stat/domain/use_cases/language.dart';
|
||||
import 'package:uae_stat/infrastructure/data/p_auth_repo.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;
|
||||
final _picker = ImagePicker();
|
||||
File? _profileImage;
|
||||
late bool isDarkTheme;
|
||||
|
||||
// Regular expression to validate Full Name (no special characters)
|
||||
final RegExp _nameRegExp = RegExp(r"^[a-zA-Z\s]+$");
|
||||
@ -96,6 +98,11 @@ class _ProfileScreenState extends ConsumerState<ProfileScreen> {
|
||||
super.initState();
|
||||
// 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
|
||||
for (int i = 0; i < _focusNodes.length; i++) {
|
||||
_focusNodes[i].addListener(() {
|
||||
@ -515,6 +522,12 @@ class _ProfileScreenState extends ConsumerState<ProfileScreen> {
|
||||
}
|
||||
});
|
||||
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(
|
||||
canPop: false, // Allow back navigation only if not login screen
|
||||
onPopInvokedWithResult: (didPop, result) {
|
||||
@ -580,7 +593,7 @@ class _ProfileScreenState extends ConsumerState<ProfileScreen> {
|
||||
),
|
||||
body: SingleChildScrollView(
|
||||
child: Container(
|
||||
color: Colors.white,
|
||||
color: isDarkTheme ? Color(0xFF111111) : null,
|
||||
child: Form(
|
||||
key: _formKey,
|
||||
child: Padding(
|
||||
@ -716,7 +729,7 @@ class _ProfileScreenState extends ConsumerState<ProfileScreen> {
|
||||
'Roboto',
|
||||
'NotoKufi',
|
||||
),
|
||||
color: Color(0xFFC3C6CB),
|
||||
color: isDarkTheme ? Colors.white : Color(0xFFC3C6CB),
|
||||
fontSize: 14,
|
||||
),
|
||||
border: OutlineInputBorder(
|
||||
@ -763,7 +776,7 @@ class _ProfileScreenState extends ConsumerState<ProfileScreen> {
|
||||
enabledBorder: OutlineInputBorder(
|
||||
borderRadius: BorderRadius.circular(10),
|
||||
borderSide: BorderSide(
|
||||
color: MyTheme.topicColor(IndicatorTopic.economy)
|
||||
color: isDarkTheme ? Colors.white : MyTheme.topicColor(IndicatorTopic.economy)
|
||||
.shade400,
|
||||
width: 1), // Enabled border
|
||||
),
|
||||
@ -773,12 +786,12 @@ class _ProfileScreenState extends ConsumerState<ProfileScreen> {
|
||||
'Roboto',
|
||||
'NotoKufi',
|
||||
),
|
||||
color: Color(0xFFC3C6CB),
|
||||
color: isDarkTheme ? Colors.white : Color(0xFFC3C6CB),
|
||||
fontSize: 14,
|
||||
),
|
||||
border: OutlineInputBorder(
|
||||
borderSide: BorderSide(
|
||||
color: Color(0xFF7296BE),
|
||||
color: isDarkTheme ? Colors.white : Color(0xFF7296BE),
|
||||
),
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
),
|
||||
@ -798,7 +811,9 @@ class _ProfileScreenState extends ConsumerState<ProfileScreen> {
|
||||
'Roboto',
|
||||
'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(
|
||||
borderRadius: BorderRadius.circular(10),
|
||||
borderSide: BorderSide(
|
||||
color:
|
||||
color:isDarkTheme ? Colors.white :
|
||||
MyTheme.topicColor(IndicatorTopic.economy)
|
||||
.shade400,
|
||||
width: 1), // Enabled border
|
||||
),
|
||||
border: OutlineInputBorder(
|
||||
borderSide: BorderSide(
|
||||
color: Color(0xFF7296BE),
|
||||
color:isDarkTheme ? Colors.white : Color(0xFF7296BE),
|
||||
),
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
),
|
||||
@ -831,7 +846,7 @@ class _ProfileScreenState extends ConsumerState<ProfileScreen> {
|
||||
'Roboto',
|
||||
'NotoKufi',
|
||||
),
|
||||
color: Color(0xFFC3C6CB),
|
||||
color: isDarkTheme ? Colors.white : Color(0xFFC3C6CB),
|
||||
fontSize: 14,
|
||||
),
|
||||
|
||||
@ -863,7 +878,9 @@ class _ProfileScreenState extends ConsumerState<ProfileScreen> {
|
||||
'Roboto',
|
||||
'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(
|
||||
borderRadius: BorderRadius.circular(10),
|
||||
borderSide: BorderSide(
|
||||
color:
|
||||
color: isDarkTheme ? Colors.white :
|
||||
MyTheme.topicColor(IndicatorTopic.economy)
|
||||
.shade400,
|
||||
width: 1), // Enabled border
|
||||
),
|
||||
border: OutlineInputBorder(
|
||||
borderSide: BorderSide(
|
||||
color: Color(0xFF7296BE),
|
||||
color: isDarkTheme ? Colors.white : Color(0xFF7296BE),
|
||||
),
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
),
|
||||
@ -903,7 +920,8 @@ class _ProfileScreenState extends ConsumerState<ProfileScreen> {
|
||||
fontFamily: context.translate(
|
||||
'Roboto',
|
||||
'NotoKufi',
|
||||
)
|
||||
),
|
||||
color: isDarkTheme ? Colors.white : null,
|
||||
),),
|
||||
))
|
||||
.toList(),
|
||||
@ -926,7 +944,9 @@ class _ProfileScreenState extends ConsumerState<ProfileScreen> {
|
||||
'Roboto',
|
||||
'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(
|
||||
borderRadius: BorderRadius.circular(10),
|
||||
borderSide: BorderSide(
|
||||
color:
|
||||
color: isDarkTheme ? Colors.white :
|
||||
MyTheme.topicColor(IndicatorTopic.economy)
|
||||
.shade400,
|
||||
width: 1), // Enabled border
|
||||
),
|
||||
border: OutlineInputBorder(
|
||||
borderSide: BorderSide(
|
||||
color: Color(0xFF7296BE),
|
||||
color: isDarkTheme ? Colors.white : Color(0xFF7296BE),
|
||||
),
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
),
|
||||
@ -966,7 +986,8 @@ class _ProfileScreenState extends ConsumerState<ProfileScreen> {
|
||||
fontFamily: context.translate(
|
||||
'Roboto',
|
||||
'NotoKufi',
|
||||
)
|
||||
),
|
||||
color: isDarkTheme ? Colors.white : null,
|
||||
),),
|
||||
))
|
||||
.toList(),
|
||||
@ -991,8 +1012,9 @@ class _ProfileScreenState extends ConsumerState<ProfileScreen> {
|
||||
},
|
||||
side: BorderSide(
|
||||
color: showError
|
||||
? Color(0xFFb22222)
|
||||
: Color(0xFF7296BE),
|
||||
? isDarkTheme ? Color(0xFFFFA200) : Color(0xFFb22222)
|
||||
: isDarkTheme ? Colors.white : Color(0xFF7296BE),
|
||||
|
||||
width: 1,
|
||||
),
|
||||
),
|
||||
@ -1012,9 +1034,7 @@ class _ProfileScreenState extends ConsumerState<ProfileScreen> {
|
||||
),
|
||||
fontWeight: FontWeight.w500,
|
||||
fontSize: 14,
|
||||
color: Color(
|
||||
0xFF898C81,
|
||||
), // Change to your desired color
|
||||
color: isDarkTheme ? Colors.white : Color(0xFF898C81), // Change to your desired color
|
||||
),
|
||||
children: [
|
||||
TextSpan(
|
||||
@ -1031,7 +1051,7 @@ class _ProfileScreenState extends ConsumerState<ProfileScreen> {
|
||||
),
|
||||
fontSize: 14,
|
||||
fontWeight: FontWeight.bold,
|
||||
color: Color(0xFF985400),
|
||||
color: isDarkTheme ? Color(0xFF9EB3E4) : Color(0xFF985400),
|
||||
// Makes the text bold
|
||||
// decoration:
|
||||
// TextDecoration.underline,
|
||||
@ -1045,7 +1065,7 @@ class _ProfileScreenState extends ConsumerState<ProfileScreen> {
|
||||
'Roboto',
|
||||
'NotoKufi',
|
||||
),
|
||||
color: Color(
|
||||
color: isDarkTheme ? Colors.white : Color(
|
||||
0xFF898C81), // Change to your desired color
|
||||
),
|
||||
),
|
||||
@ -1062,7 +1082,7 @@ class _ProfileScreenState extends ConsumerState<ProfileScreen> {
|
||||
'Roboto',
|
||||
'NotoKufi',
|
||||
),
|
||||
color: Color(0xFF985400),
|
||||
color: isDarkTheme ? Color(0xFF9EB3E4) : Color(0xFF985400),
|
||||
// decoration:
|
||||
// TextDecoration.underline,
|
||||
decorationColor: Color(0xFF648CBA),
|
||||
@ -1078,7 +1098,7 @@ class _ProfileScreenState extends ConsumerState<ProfileScreen> {
|
||||
),
|
||||
fontWeight: FontWeight.w500,
|
||||
fontSize: 14,
|
||||
color: Color(
|
||||
color: isDarkTheme ? Colors.white : Color(
|
||||
0xFF898C81), // Change to your desired color
|
||||
),
|
||||
),
|
||||
@ -1127,7 +1147,7 @@ class _ProfileScreenState extends ConsumerState<ProfileScreen> {
|
||||
AppLocalizations.of(context)!.change_password,
|
||||
style: TextStyle(
|
||||
// color: Color(0xFF648CBA),
|
||||
color: Color(0xFF985400),
|
||||
color: isDarkTheme ? Color(0xFF9EB3E4) : Color(0xFF985400),
|
||||
fontSize: 14,
|
||||
fontWeight: FontWeight.w700,
|
||||
fontFamily: context.translate(
|
||||
@ -1158,7 +1178,7 @@ class _ProfileScreenState extends ConsumerState<ProfileScreen> {
|
||||
}
|
||||
},
|
||||
style: ElevatedButton.styleFrom(
|
||||
backgroundColor: Color(0xFF92722A),
|
||||
backgroundColor: isDarkTheme ? Color(0xFF7296BE) :Color(0xFF92722A),
|
||||
minimumSize: Size(double.infinity, 50),
|
||||
shape: RoundedRectangleBorder(
|
||||
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);
|
||||
@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(
|
||||
content: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
@ -1208,7 +1233,7 @@ class ConfirmationDialog extends StatelessWidget {
|
||||
AppLocalizations.of(context)!.sure_save_page,
|
||||
style: TextStyle(
|
||||
fontSize: 14,
|
||||
color: Color(0xFF898C81),
|
||||
color: isDarkTheme ? Colors.white : Color(0xFF898C81),
|
||||
fontFamily: context.translate(
|
||||
'Roboto',
|
||||
'NotoKufi',
|
||||
@ -1223,7 +1248,7 @@ class ConfirmationDialog extends StatelessWidget {
|
||||
text: AppLocalizations.of(context)!.not_able_to_change,
|
||||
style: TextStyle(
|
||||
fontSize: 14,
|
||||
color: Color(0xFF898C81),
|
||||
color: isDarkTheme ? Colors.white : Color(0xFF898C81),
|
||||
fontFamily: context.translate(
|
||||
'Roboto',
|
||||
'NotoKufi',
|
||||
@ -1237,10 +1262,13 @@ class ConfirmationDialog extends StatelessWidget {
|
||||
TextStyle(fontWeight: FontWeight.w700,fontFamily: context.translate(
|
||||
'Roboto',
|
||||
'NotoKufi',
|
||||
),), // Bold for "name"
|
||||
),color: isDarkTheme ? Colors.white : null), // Bold for "name"
|
||||
),
|
||||
TextSpan(
|
||||
text: context.translate(' or ', 'أو'),
|
||||
style: TextStyle(
|
||||
color: isDarkTheme ? Colors.white : null,
|
||||
)
|
||||
),
|
||||
TextSpan(
|
||||
text: AppLocalizations.of(context)!.dob,
|
||||
@ -1249,10 +1277,15 @@ class ConfirmationDialog extends StatelessWidget {
|
||||
'Roboto',
|
||||
'NotoKufi',
|
||||
),
|
||||
fontWeight: FontWeight.w700), // Bold for "date of birth"
|
||||
fontWeight: FontWeight.w700,
|
||||
color: isDarkTheme ? Colors.white : null,
|
||||
), // Bold for "date of birth"
|
||||
),
|
||||
TextSpan(
|
||||
text: ".",
|
||||
style: TextStyle(
|
||||
color: isDarkTheme ? Colors.white : null,
|
||||
)
|
||||
),
|
||||
],
|
||||
),
|
||||
@ -1276,14 +1309,14 @@ class ConfirmationDialog extends StatelessWidget {
|
||||
Navigator.of(context).pop(false);
|
||||
},
|
||||
style: OutlinedButton.styleFrom(
|
||||
side: BorderSide(color: Color(0xFF92722A)),
|
||||
side: BorderSide(color: isDarkTheme ? Color(0xFF7296BE) : Color(0xFF92722A)),
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.all(Radius.circular(7)),
|
||||
), // Set the border color here
|
||||
),
|
||||
child: Text(
|
||||
"Cancel",
|
||||
style: TextStyle(color: Color(0xFF92722A),fontFamily: context.translate(
|
||||
style: TextStyle(color: isDarkTheme ? Color(0xFF7296BE) : Color(0xFF92722A),fontFamily: context.translate(
|
||||
'Roboto',
|
||||
'NotoKufi',
|
||||
),),
|
||||
@ -1292,7 +1325,7 @@ class ConfirmationDialog extends StatelessWidget {
|
||||
ElevatedButton(
|
||||
onPressed: () => Navigator.of(context).pop(true),
|
||||
style: ElevatedButton.styleFrom(
|
||||
backgroundColor: const Color(0xFF92722A), // Brown color
|
||||
backgroundColor: isDarkTheme ? Color(0xFF7296BE) : Color(0xFF92722A), // Brown color
|
||||
foregroundColor: Colors.white,
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
|
||||
@ -59,19 +59,19 @@ class ThemedFormField extends HookWidget {
|
||||
'Roboto',
|
||||
'NotoKufi',
|
||||
),
|
||||
color: errorTextColor ?? const Color(0xFFB22222),
|
||||
color: const Color(0xFFD83731),
|
||||
),
|
||||
errorBorder: OutlineInputBorder(
|
||||
borderRadius: BorderRadius.circular(10),
|
||||
borderSide: BorderSide(
|
||||
color: errorBorderColor ?? const Color(0xFFB22222),
|
||||
color: const Color(0xFFD83731),
|
||||
width: 1,
|
||||
),
|
||||
),
|
||||
focusedErrorBorder: OutlineInputBorder(
|
||||
borderRadius: BorderRadius.circular(10),
|
||||
borderSide: BorderSide(
|
||||
color: errorBorderColor ?? const Color(0xFFB22222),
|
||||
color: const Color(0xFFD83731),
|
||||
width: 1,
|
||||
),
|
||||
),
|
||||
@ -81,18 +81,18 @@ class ThemedFormField extends HookWidget {
|
||||
border: OutlineInputBorder(
|
||||
borderRadius: BorderRadius.circular(10),
|
||||
borderSide: BorderSide(
|
||||
color: borderColor ?? MyTheme.topicColor(IndicatorTopic.economy).shade300,
|
||||
color: Color(0xFFB68A34),
|
||||
),
|
||||
),
|
||||
enabledBorder: OutlineInputBorder(
|
||||
borderRadius: BorderRadius.circular(10),
|
||||
borderSide: BorderSide(
|
||||
color: borderColor ?? MyTheme.topicColor(IndicatorTopic.economy).shade300,
|
||||
color: Color(0xFFB68A34),
|
||||
),
|
||||
),
|
||||
hintText: hintText,
|
||||
hintStyle: TextStyle( // ✅ dynamic hint color
|
||||
color: hintColor ?? const Color(0xffC3C6CB),
|
||||
color: const Color(0xFFC3C6CB),
|
||||
),
|
||||
prefixIconConstraints: const BoxConstraints(
|
||||
maxWidth: 25 + 16 + 10,
|
||||
@ -108,7 +108,7 @@ class ThemedFormField extends HookWidget {
|
||||
fit: BoxFit.fitHeight,
|
||||
height: 25,
|
||||
width: 25,
|
||||
color: MyTheme.topicColor(IndicatorTopic.economy).shade300,
|
||||
// color: MyTheme.topicColor(IndicatorTopic.economy).shade300,
|
||||
),
|
||||
),
|
||||
suffixIcon: isObscurable ? obscureBtn : null,
|
||||
|
||||
@ -553,7 +553,7 @@ class LoginRoute extends HookConsumerWidget {
|
||||
),
|
||||
fontWeight: FontWeight.bold,
|
||||
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(
|
||||
isDarkTheme ? Color(0xFF24B4FB) : Color(0xFFAA8E83),
|
||||
// isDarkTheme ? Color(0xFFB68A34) : Color(0xFFB68A34),
|
||||
Color(0xFFB68A34),
|
||||
// MyTheme.topicColor(IndicatorTopic.social),
|
||||
),
|
||||
// surfaceTintColor: MaterialStatePropertyAll(
|
||||
@ -781,11 +782,11 @@ class LoginRoute extends HookConsumerWidget {
|
||||
'Email',
|
||||
'بريد إلكتروني',
|
||||
),
|
||||
hintColor: isDarkTheme ? Color(0XFFEEEEEE) : Color(0xFFC3C6CB),
|
||||
// hintColor: isDarkTheme ? Color(0XFFEEEEEE) : Color(0xFFC3C6CB),
|
||||
backgroundColor: isDarkTheme ? Color(0xFF000000) : Colors.white,
|
||||
borderColor: isDarkTheme ? Colors.white : MyTheme.topicColor(IndicatorTopic.economy).shade300,
|
||||
errorBorderColor: isDarkTheme ? const Color(0xFFFFA100) : const Color(0xFFB22222),
|
||||
errorTextColor: isDarkTheme ? const Color(0xFFFFA100) : const Color(0xFFB22222),
|
||||
// borderColor: Color(0xFFB68A34),
|
||||
// errorBorderColor: isDarkTheme ? const Color(0xFFFFA100) : const Color(0xFFB22222),
|
||||
// errorTextColor: isDarkTheme ? const Color(0xFFFFA100) : const Color(0xFFB22222),
|
||||
validator: (value) {
|
||||
final emailRegex =
|
||||
r'^[a-zA-Z0-9àèìòùÀÈÌÒÙéàç~!#$%^&*()_+=-{}|;,.?<>]+@[a-zA-Z0-9àèìòùÀÈÌÒÙéàç~!#$%^&*()_+=-{}|;,.?<>]+\.[a-zA-Z]{2,}$';
|
||||
@ -796,7 +797,8 @@ class LoginRoute extends HookConsumerWidget {
|
||||
}
|
||||
return null;
|
||||
},
|
||||
imgPath: isDarkTheme ? MiscIconAssetPath.personDark : MiscIconAssetPath.personLight,
|
||||
// imgPath: isDarkTheme ? MiscIconAssetPath.personDark : MiscIconAssetPath.personLight,
|
||||
imgPath: MiscIconAssetPath.person,
|
||||
controller: emailCtl,
|
||||
),
|
||||
15.verticalSpace,
|
||||
@ -813,12 +815,13 @@ class LoginRoute extends HookConsumerWidget {
|
||||
'Password',
|
||||
'كلمة المرور',
|
||||
),
|
||||
hintColor: isDarkTheme ? Color(0XFFEEEEEE) : Color(0xFFC3C6CB),
|
||||
// hintColor: isDarkTheme ? Color(0XFFEEEEEE) : Color(0xFFC3C6CB),
|
||||
backgroundColor: isDarkTheme ? Color(0xFF000000) : Colors.white,
|
||||
borderColor: isDarkTheme ? Colors.white : MyTheme.topicColor(IndicatorTopic.economy).shade300,
|
||||
errorBorderColor: isDarkTheme ? const Color(0xFFFFA100) : const Color(0xFFB22222),
|
||||
errorTextColor: isDarkTheme ? const Color(0xFFFFA100) : const Color(0xFFB22222),
|
||||
imgPath: isDarkTheme ? MiscIconAssetPath.lockDark : MiscIconAssetPath.lockLight,
|
||||
// borderColor: isDarkTheme ? Colors.white : MyTheme.topicColor(IndicatorTopic.economy).shade300,
|
||||
// errorBorderColor: isDarkTheme ? const Color(0xFFFFA100) : const Color(0xFFB22222),
|
||||
// errorTextColor: isDarkTheme ? const Color(0xFFFFA100) : const Color(0xFFB22222),
|
||||
// imgPath: isDarkTheme ? MiscIconAssetPath.lockDark : MiscIconAssetPath.lockLight,
|
||||
imgPath: MiscIconAssetPath.lock,
|
||||
controller: pwCtl,
|
||||
isObscurable: true,
|
||||
),
|
||||
@ -865,7 +868,7 @@ class LoginRoute extends HookConsumerWidget {
|
||||
'NotoKufi',
|
||||
),
|
||||
fontSize: context.translate(18.0, 14.0),
|
||||
color: isDarkTheme ? Color(0xFFEEEEEE) : Color(0xff898C81),
|
||||
color: isDarkTheme ? Color(0xFFFFFFFF) : Color(0xFF898C81),
|
||||
fontWeight: FontWeight.w600,
|
||||
),
|
||||
),
|
||||
@ -894,7 +897,7 @@ class LoginRoute extends HookConsumerWidget {
|
||||
),
|
||||
style: TextStyle(
|
||||
fontSize: locale?.languageCode == 'ar' ? 12 : 14,
|
||||
color: isDarkTheme ? Color(0xFFCCCCCC) : Color(0xff898C81),
|
||||
color: isDarkTheme ? Color(0xFFFFFFFF) : Color(0xFF898C81),
|
||||
),
|
||||
),
|
||||
const TextSpan(
|
||||
@ -907,7 +910,7 @@ class LoginRoute extends HookConsumerWidget {
|
||||
),
|
||||
style: TextStyle(
|
||||
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,
|
||||
// child: ElevatedButton(
|
||||
// onPressed: () async {
|
||||
// final prefs = await SharedPreferences.getInstance();
|
||||
// prefs.clear();
|
||||
// final userId = 'guest';
|
||||
// if (userId.isNotEmpty) {
|
||||
// await saveUserId(userId);
|
||||
// }
|
||||
// context.go('/myhomepage');
|
||||
// // final prefs = await SharedPreferences.getInstance();
|
||||
// // prefs.clear();
|
||||
// // final userId = 'guest';
|
||||
// // if (userId.isNotEmpty) {
|
||||
// // await saveUserId(userId);
|
||||
// // }
|
||||
// // context.go('/myhomepage');
|
||||
// //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(
|
||||
isDarkTheme
|
||||
? BannerAssetPath.fcscLogoDark
|
||||
@ -1010,11 +1127,16 @@ class LoginRoute extends HookConsumerWidget {
|
||||
helloAndPleaseLoginTexts,
|
||||
40.verticalSpace,
|
||||
form,
|
||||
15.verticalSpace,
|
||||
25.verticalSpace,
|
||||
dontHaveAnAccountRegisterBtn,
|
||||
// continueAsGuestBtn,
|
||||
// Spacer(),
|
||||
25.verticalSpace,
|
||||
signInWithGoogleBtn,
|
||||
15.verticalSpace,
|
||||
signInWithAppleBtn,
|
||||
15.verticalSpace,
|
||||
signInWithUAEPassBtn,
|
||||
25.verticalSpace,
|
||||
fcscBanner,
|
||||
],
|
||||
),
|
||||
@ -1034,7 +1156,7 @@ class LoginRoute extends HookConsumerWidget {
|
||||
// _showExitConfirmation(context); // Show exit confirmation dialog
|
||||
},
|
||||
child: Scaffold(
|
||||
backgroundColor: isDarkTheme ? Color(0xFF111111) : Colors.white,
|
||||
backgroundColor: isDarkTheme ? Color(0xFF000000) : Colors.white,
|
||||
body: SafeArea(child: scaffoldBody),
|
||||
),
|
||||
);
|
||||
|
||||
@ -1284,14 +1284,15 @@ class EconomyStatsState extends ConsumerState<EconomyStatsWidget> {
|
||||
}
|
||||
String firstMainTopic = data.first['main_topic'] ?? '';
|
||||
return Container(
|
||||
decoration: isDarkTheme
|
||||
? BoxDecoration(
|
||||
image: DecorationImage(
|
||||
image: AssetImage('assets/dark_bg.png'),
|
||||
fit: BoxFit.cover,
|
||||
),
|
||||
)
|
||||
: null,
|
||||
color: isDarkTheme ? Color(0xFF000000) : Color(0xFFFFFFFF),
|
||||
// decoration: isDarkTheme
|
||||
// ? BoxDecoration(
|
||||
// image: DecorationImage(
|
||||
// image: AssetImage('assets/dark_bg.png'),
|
||||
// fit: BoxFit.cover,
|
||||
// ),
|
||||
// )
|
||||
// : null,
|
||||
height: myheight,
|
||||
// color: Colors.cyan,
|
||||
child: Padding(
|
||||
@ -1523,7 +1524,7 @@ class RoundedCornerContainer extends StatelessWidget {
|
||||
return Container(
|
||||
decoration: BoxDecoration(
|
||||
color: backgroundColor,
|
||||
borderRadius: BorderRadius.circular(16), // Rounded corners
|
||||
borderRadius: BorderRadius.only(topRight: Radius.circular(20),topLeft: Radius.circular(20)), // Rounded corners
|
||||
),
|
||||
child: Center(
|
||||
child: Text(
|
||||
@ -1603,7 +1604,7 @@ class InfoCard extends StatelessWidget {
|
||||
decoration: BoxDecoration(
|
||||
color: isDarkTheme ? Color(0xFF111111) : null,
|
||||
border: Border.all(color: bordercolor),
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
borderRadius: BorderRadius.circular(10),
|
||||
),
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
@ -1634,7 +1635,7 @@ class InfoCard extends StatelessWidget {
|
||||
title,
|
||||
style: TextStyle(
|
||||
fontSize: 13,
|
||||
fontWeight: FontWeight.w400,
|
||||
fontWeight: FontWeight.w700,
|
||||
letterSpacing: 0,
|
||||
// color: Colors.black,
|
||||
fontFamily: context.translate(
|
||||
|
||||
@ -1,8 +1,11 @@
|
||||
import 'dart:convert';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
import 'package:flutter_svg/svg.dart';
|
||||
import 'package:go_router/go_router.dart';
|
||||
import 'package:dio/dio.dart';
|
||||
import 'package:http/http.dart' as http;
|
||||
import 'package:flutter_gen/gen_l10n/app_localizations.dart';
|
||||
import 'package:pocketbase/pocketbase.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/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/l10n/app_localizations.dart';
|
||||
import 'package:uae_stat/presentation/components/indicators/locale_provider.dart';
|
||||
import 'package:uae_stat/presentation/routes/drawer_routes/custom_drawer_routes.dart';
|
||||
|
||||
@ -29,11 +33,14 @@ class _BookMarkState extends ConsumerState<BookMark> {
|
||||
bool isLoading = true;
|
||||
Map<String, Map<String, dynamic>> groupedMap = {};
|
||||
int? expandedIndex = 0;
|
||||
// Current selected tab index
|
||||
// Current selected tab index
|
||||
int selectedTabIndex = 0;
|
||||
late UserService _userService;
|
||||
late ThemeMode currentTheme;
|
||||
|
||||
List<dynamic> homePageData = [];
|
||||
List<dynamic> filteredData = [];
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
@ -42,13 +49,44 @@ class _BookMarkState extends ConsumerState<BookMark> {
|
||||
currentTheme = ref.read(themeProvider);
|
||||
print('123456789');
|
||||
print(currentTheme);
|
||||
final isDark = currentTheme == ThemeMode.dark ||
|
||||
(currentTheme == ThemeMode.system &&
|
||||
MediaQuery.of(context).platformBrightness == Brightness.dark);
|
||||
// final isDark = currentTheme == ThemeMode.dark ||
|
||||
// (currentTheme == ThemeMode.system &&
|
||||
// MediaQuery.of(context).platformBrightness == Brightness.dark);
|
||||
|
||||
final themeMode = (isDark ? 'dark' : 'light');
|
||||
WidgetsBinding.instance.addPostFrameCallback((_) {
|
||||
final isDark = currentTheme == ThemeMode.dark ||
|
||||
(currentTheme == ThemeMode.system &&
|
||||
MediaQuery.of(context).platformBrightness == Brightness.dark);
|
||||
|
||||
fetchBookmarks(locale?.languageCode ?? 'en',themeMode);
|
||||
final themeMode = (isDark ? 'dark' : 'light');
|
||||
print("ThemeMode - $themeMode");
|
||||
fetchData(locale?.languageCode ?? 'en', themeMode);
|
||||
fetchBookmarks(locale?.languageCode ?? 'en', themeMode);
|
||||
});
|
||||
}
|
||||
|
||||
Future<void> fetchData(locale, themeMode) async {
|
||||
const baseUrl = '$apiUrl/api/getUAENumbersData';
|
||||
try {
|
||||
final response = await http
|
||||
.get(Uri.parse(baseUrl + '?language=$locale&color_mode=$themeMode'));
|
||||
if (response.statusCode == 200) {
|
||||
setState(() {
|
||||
homePageData = (json.decode(response.body) as List)
|
||||
.map((e) => Map<String, dynamic>.from(e))
|
||||
.toList();
|
||||
filteredData = List.from(homePageData);
|
||||
isLoading = false;
|
||||
});
|
||||
} else {
|
||||
throw Exception('Failed to load data');
|
||||
}
|
||||
} catch (e) {
|
||||
setState(() {
|
||||
isLoading = false;
|
||||
});
|
||||
print('Error fetching data: $e');
|
||||
}
|
||||
}
|
||||
|
||||
String colorToHex(Color color) {
|
||||
@ -57,7 +95,7 @@ class _BookMarkState extends ConsumerState<BookMark> {
|
||||
'${color.blue.toRadixString(16).padLeft(2, '0').toUpperCase()}';
|
||||
}
|
||||
|
||||
// Function to convert hex color string to int
|
||||
// Function to convert hex color string to int
|
||||
Color _parseColor(String? colorString) {
|
||||
if (colorString == null || colorString.isEmpty) {
|
||||
return const Color(0xFF80A8CD); // Default color
|
||||
@ -71,7 +109,7 @@ class _BookMarkState extends ConsumerState<BookMark> {
|
||||
}
|
||||
}
|
||||
|
||||
Future<void> fetchBookmarks(locale,themeMode) async {
|
||||
Future<void> fetchBookmarks(locale, themeMode) async {
|
||||
try {
|
||||
final prefs = await SharedPreferences.getInstance();
|
||||
final userID = prefs.getString('userId') ?? '';
|
||||
@ -85,13 +123,17 @@ class _BookMarkState extends ConsumerState<BookMark> {
|
||||
|
||||
final response = await Dio().get(
|
||||
'$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.data is Map<String, dynamic> &&
|
||||
response.data.containsKey("error")) {
|
||||
// API returned an error message instead of bookmark data
|
||||
// API returned an error message instead of bookmark data
|
||||
setState(() {
|
||||
dataList = []; // Clear the list
|
||||
});
|
||||
@ -117,24 +159,24 @@ class _BookMarkState extends ConsumerState<BookMark> {
|
||||
|
||||
List<Map<String, dynamic>> transformAndStore(
|
||||
List<Map<String, dynamic>> fetchedData) {
|
||||
// Define the required order
|
||||
// Define the required order
|
||||
List<String> order = [
|
||||
context.translate('ECONOMY', 'الاقتصاد'),
|
||||
context.translate('SOCIAL', 'الاجتماعي'),
|
||||
context.translate('ENVIRONMENT', 'البيئة')
|
||||
];
|
||||
|
||||
// Create a list to store sorted data
|
||||
// Create a list to store sorted data
|
||||
List<Map<String, dynamic>> sortedList = [];
|
||||
|
||||
// Group data based on categories
|
||||
// Group data based on categories
|
||||
Map<String, List<Map<String, dynamic>>> groupedData = {
|
||||
context.translate('ECONOMY', 'الاقتصاد'): [],
|
||||
context.translate('SOCIAL', 'الاجتماعي'): [],
|
||||
context.translate('ENVIRONMENT', 'البيئة'): []
|
||||
};
|
||||
|
||||
// Categorize data
|
||||
// Categorize data
|
||||
for (var item in fetchedData) {
|
||||
String mainTopic = item["main_topic"]?.toString() ?? "";
|
||||
if (groupedData.containsKey(mainTopic)) {
|
||||
@ -142,14 +184,14 @@ class _BookMarkState extends ConsumerState<BookMark> {
|
||||
}
|
||||
}
|
||||
|
||||
// Store sorted data in the correct order
|
||||
// Store sorted data in the correct order
|
||||
for (String topic in order) {
|
||||
if (groupedData.containsKey(topic)) {
|
||||
sortedList.addAll(groupedData[topic]!);
|
||||
}
|
||||
}
|
||||
|
||||
// Store the sorted list (replace this with your storage method)
|
||||
// Store the sorted list (replace this with your storage method)
|
||||
return sortedList;
|
||||
}
|
||||
|
||||
@ -158,10 +200,10 @@ class _BookMarkState extends ConsumerState<BookMark> {
|
||||
String? mainTopic = item['main_topic'];
|
||||
String subtitle = item['subtitle'];
|
||||
|
||||
// Ignore if main_topic is null
|
||||
// Ignore if main_topic is null
|
||||
if (mainTopic == null) continue;
|
||||
|
||||
// If main_topic doesn't exist in groupedMap, create a new entry
|
||||
// If main_topic doesn't exist in groupedMap, create a new entry
|
||||
if (!groupedMap.containsKey(mainTopic)) {
|
||||
groupedMap[mainTopic] = {
|
||||
'main_topic': mainTopic,
|
||||
@ -170,7 +212,7 @@ class _BookMarkState extends ConsumerState<BookMark> {
|
||||
};
|
||||
}
|
||||
|
||||
// Add subtitle as a key with its corresponding map value
|
||||
// Add subtitle as a key with its corresponding map value
|
||||
groupedMap[mainTopic]!['SubTopic'].add({
|
||||
'subtitle': subtitle,
|
||||
'isBookmark': item['isBookmark'],
|
||||
@ -208,9 +250,9 @@ class _BookMarkState extends ConsumerState<BookMark> {
|
||||
'Authorization': adminToken,
|
||||
});
|
||||
|
||||
// currentTheme = ref.read(themeProvider);
|
||||
// print('123456789');
|
||||
// print(currentTheme);
|
||||
// currentTheme = ref.read(themeProvider);
|
||||
// print('123456789');
|
||||
// print(currentTheme);
|
||||
final isDark = currentTheme == ThemeMode.dark ||
|
||||
(currentTheme == ThemeMode.system &&
|
||||
MediaQuery.of(context).platformBrightness == Brightness.dark);
|
||||
@ -219,8 +261,8 @@ class _BookMarkState extends ConsumerState<BookMark> {
|
||||
|
||||
final locale = ref.read(localeProvider);
|
||||
|
||||
fetchBookmarks(locale?.languageCode ?? 'en',themeMode);
|
||||
// ToastUtil.showSuccessToast("Removed from Bookmark.");
|
||||
fetchBookmarks(locale?.languageCode ?? 'en', themeMode);
|
||||
// ToastUtil.showSuccessToast("Removed from Bookmark.");
|
||||
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
SnackBar(
|
||||
@ -228,10 +270,9 @@ class _BookMarkState extends ConsumerState<BookMark> {
|
||||
AppLocalizations.of(context)!.removed_from_Bookmark,
|
||||
style: TextStyle(
|
||||
fontFamily: context.translate(
|
||||
'Roboto',
|
||||
'NotoKufi',
|
||||
)
|
||||
),
|
||||
'Roboto',
|
||||
'NotoKufi',
|
||||
)),
|
||||
),
|
||||
duration: Duration(seconds: 2),
|
||||
),
|
||||
@ -242,13 +283,17 @@ class _BookMarkState extends ConsumerState<BookMark> {
|
||||
SnackBar(
|
||||
content: Text(
|
||||
context.translate(
|
||||
'Unable to remove from bookmarks. Please try again',
|
||||
'تعذر الإزالة من الإشارات المرجعية. يرجى المحاولة مرة أخرى.',),
|
||||
style:
|
||||
TextStyle(color: Color(0xFFEB5F24), fontWeight: FontWeight.w600, fontFamily: context.translate(
|
||||
'Roboto',
|
||||
'NotoKufi',
|
||||
),),
|
||||
'Unable to remove from bookmarks. Please try again',
|
||||
'تعذر الإزالة من الإشارات المرجعية. يرجى المحاولة مرة أخرى.',
|
||||
),
|
||||
style: TextStyle(
|
||||
color: Color(0xFFEB5F24),
|
||||
fontWeight: FontWeight.w600,
|
||||
fontFamily: context.translate(
|
||||
'Roboto',
|
||||
'NotoKufi',
|
||||
),
|
||||
),
|
||||
),
|
||||
backgroundColor: Color(0xFFD6E9C6),
|
||||
duration: Duration(seconds: 2),
|
||||
@ -349,11 +394,14 @@ class _BookMarkState extends ConsumerState<BookMark> {
|
||||
),
|
||||
child: Text(
|
||||
context.translate('Yes', 'نعم'),
|
||||
style: TextStyle(color: Colors.white, fontSize: 16,
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 16,
|
||||
fontFamily: context.translate(
|
||||
'Roboto',
|
||||
'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 {
|
||||
final localeCode = next?.languageCode ?? 'en'; // Default to 'en' if null
|
||||
setState(() {
|
||||
@ -405,14 +434,14 @@ class _BookMarkState extends ConsumerState<BookMark> {
|
||||
|
||||
final themeString = isDark ? 'dark' : 'light';
|
||||
|
||||
fetchBookmarks(localeCode,themeString);
|
||||
fetchBookmarks(localeCode, themeString);
|
||||
});
|
||||
|
||||
ref.listen<ThemeMode>(themeProvider, (previous, next) async {
|
||||
final localeCode = ref.watch(localeProvider)?.languageCode ?? 'en';
|
||||
print(localeCode);
|
||||
|
||||
// Default to 'en' if null
|
||||
// Default to 'en' if null
|
||||
setState(() {
|
||||
isLoading = true;
|
||||
print('isLoadingref $isLoading');
|
||||
@ -424,13 +453,31 @@ class _BookMarkState extends ConsumerState<BookMark> {
|
||||
MediaQuery.of(context).platformBrightness == Brightness.dark);
|
||||
|
||||
final themeString = isDark ? 'dark' : 'light';
|
||||
fetchBookmarks(localeCode,themeString);
|
||||
fetchBookmarks(localeCode, themeString);
|
||||
});
|
||||
|
||||
final isDarkTheme = ref.watch(themeProvider) == ThemeMode.dark ||
|
||||
(ref.watch(themeProvider) == ThemeMode.system &&
|
||||
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 =
|
||||
dataList.where((item) => item['isBookmark'] == true).toList();
|
||||
@ -439,13 +486,13 @@ class _BookMarkState extends ConsumerState<BookMark> {
|
||||
String selectedTabTitle =
|
||||
tabs[selectedTabIndex]['title'].toString().trim().toLowerCase();
|
||||
|
||||
// Debugging prints
|
||||
// Debugging prints
|
||||
print(
|
||||
"main_topic: '$mainTopic', selected_tab_title: '$selectedTabTitle'");
|
||||
|
||||
return mainTopic == selectedTabTitle;
|
||||
}).toList();
|
||||
// print( 'filtered one :${filteredBookmarks['main_topic']} , Tabs : ${tabs[selectedTabIndex]["title"]}');
|
||||
// print( 'filtered one :${filteredBookmarks['main_topic']} , Tabs : ${tabs[selectedTabIndex]["title"]}');
|
||||
List<Map<String, dynamic>> transformedList = groupedMap.values.toList();
|
||||
print('filtered $filteredBookmarks');
|
||||
return PopScope(
|
||||
@ -455,19 +502,21 @@ class _BookMarkState extends ConsumerState<BookMark> {
|
||||
context.go('/myhomepage');
|
||||
},
|
||||
child: BaseScaffold(
|
||||
backgroundColor: isDarkTheme ? Color(0xFF111111) : Colors.white,
|
||||
appbarColor: isDarkTheme ? Color(0xFF111111) : Colors.white,
|
||||
title: Text(
|
||||
AppLocalizations.of(context)!.bookmarks,
|
||||
style: TextStyle(
|
||||
color: isDarkTheme ? Colors.white : Colors.black,
|
||||
color: isDarkTheme ? Colors.white : Colors.black,
|
||||
fontFamily: context.translate(
|
||||
'Roboto',
|
||||
'NotoKufi',
|
||||
)
|
||||
),
|
||||
)),
|
||||
),
|
||||
body: isLoading
|
||||
? Container(
|
||||
color: Color(0x98FFFCE5), // Semi-transparent background
|
||||
color: isDarkTheme ? Color(0xFF111111) : Colors.white,
|
||||
// color: Color(0x98FFFCE5), // Semi-transparent background
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
@ -488,21 +537,21 @@ class _BookMarkState extends ConsumerState<BookMark> {
|
||||
: Column(
|
||||
children: [
|
||||
TabBarHeader(
|
||||
tabs: tabs,
|
||||
selectedIndex: selectedTabIndex,
|
||||
onTabSelected: (index) {
|
||||
setState(() {
|
||||
selectedTabIndex = index;
|
||||
});
|
||||
},
|
||||
),
|
||||
tabs: tabs,
|
||||
selectedIndex: selectedTabIndex,
|
||||
onTabSelected: (index) {
|
||||
setState(() {
|
||||
selectedTabIndex = index;
|
||||
});
|
||||
},
|
||||
isDarkTheme: isDarkTheme),
|
||||
Expanded(
|
||||
child: selectedTabIndex == 0
|
||||
? (bookmarks.isNotEmpty
|
||||
? SingleChildScrollView(
|
||||
child: Column(
|
||||
children:
|
||||
List.generate(transformedList.length, (i) {
|
||||
children: List.generate(
|
||||
transformedList.length, (i) {
|
||||
final mainTopic = transformedList[i];
|
||||
print('oustside1 $mainTopic');
|
||||
final list =
|
||||
@ -512,24 +561,28 @@ class _BookMarkState extends ConsumerState<BookMark> {
|
||||
index: i,
|
||||
isExpanded: expandedIndex == i,
|
||||
onTap: (int index) {
|
||||
// 🔹 Expecting an index
|
||||
// 🔹 Expecting an index
|
||||
setState(() {
|
||||
expandedIndex = (expandedIndex == index)
|
||||
? null
|
||||
: index;
|
||||
expandedIndex =
|
||||
(expandedIndex == index)
|
||||
? null
|
||||
: index;
|
||||
});
|
||||
},
|
||||
title:
|
||||
mainTopic['main_topic'] ?? 'No Topic',
|
||||
childWidget: Container(
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white,
|
||||
// borderRadius: BorderRadius.all(Radius.circular(20))
|
||||
color: isDarkTheme
|
||||
? Color(0xFF111111)
|
||||
: Colors.white,
|
||||
// borderRadius: BorderRadius.all(Radius.circular(20))
|
||||
),
|
||||
padding: const EdgeInsets.all(16),
|
||||
child: GridView.builder(
|
||||
shrinkWrap: true,
|
||||
physics: NeverScrollableScrollPhysics(),
|
||||
physics:
|
||||
NeverScrollableScrollPhysics(),
|
||||
gridDelegate:
|
||||
const SliverGridDelegateWithFixedCrossAxisCount(
|
||||
crossAxisCount: 2,
|
||||
@ -542,15 +595,17 @@ class _BookMarkState extends ConsumerState<BookMark> {
|
||||
return _buildBoxes(
|
||||
mainTopic['SubTopic'][index],
|
||||
context,
|
||||
mainTopic['valueColor']);
|
||||
mainTopic['valueColor'],
|
||||
isDarkTheme);
|
||||
},
|
||||
),
|
||||
),
|
||||
filteredBookmarks:
|
||||
List.from(mainTopic['SubTopic'] ?? []),
|
||||
filteredBookmarks: List.from(
|
||||
mainTopic['SubTopic'] ?? []),
|
||||
titleBackgroundColor:
|
||||
mainTopic['valueColor'],
|
||||
// Ensure it's a new list
|
||||
// Ensure it's a new list
|
||||
isDarkTheme: isDarkTheme,
|
||||
);
|
||||
}),
|
||||
),
|
||||
@ -566,11 +621,12 @@ class _BookMarkState extends ConsumerState<BookMark> {
|
||||
context.translate('No BookMark Added',
|
||||
'لم يتم إضافة أي علامة مرجعية'),
|
||||
style: TextStyle(
|
||||
fontFamily: context.translate(
|
||||
'Roboto',
|
||||
'NotoKufi',
|
||||
fontFamily: context.translate(
|
||||
'Roboto',
|
||||
'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',
|
||||
'لم يتم إضافة أي علامة مرجعية'),
|
||||
style: TextStyle(
|
||||
fontSize: 16, color: Colors.grey,
|
||||
fontSize: 16,
|
||||
color: Colors.grey,
|
||||
fontFamily: context.translate(
|
||||
'Roboto',
|
||||
'NotoKufi',
|
||||
@ -603,11 +660,15 @@ class _BookMarkState extends ConsumerState<BookMark> {
|
||||
children: [
|
||||
Container(
|
||||
decoration: BoxDecoration(
|
||||
color: tabs[selectedTabIndex]['color'],
|
||||
color: tabs[selectedTabIndex]
|
||||
['color'],
|
||||
borderRadius: BorderRadius.all(
|
||||
Radius.circular(35))),
|
||||
padding: const EdgeInsets.only(
|
||||
left: 16, bottom: 5, top: 5, right: 10),
|
||||
left: 16,
|
||||
bottom: 5,
|
||||
top: 5,
|
||||
right: 10),
|
||||
child: Row(
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.spaceBetween,
|
||||
@ -619,7 +680,7 @@ class _BookMarkState extends ConsumerState<BookMark> {
|
||||
'Roboto',
|
||||
'NotoKufi',
|
||||
),
|
||||
color: Colors.white,
|
||||
color: Colors.white,
|
||||
fontWeight: FontWeight.w600,
|
||||
fontSize: 20,
|
||||
),
|
||||
@ -642,7 +703,9 @@ class _BookMarkState extends ConsumerState<BookMark> {
|
||||
itemCount: filteredBookmarks.length,
|
||||
itemBuilder: (context, index) {
|
||||
return _buildBox(
|
||||
filteredBookmarks[index], context);
|
||||
filteredBookmarks[index],
|
||||
context,
|
||||
isDarkTheme);
|
||||
},
|
||||
),
|
||||
),
|
||||
@ -656,8 +719,9 @@ class _BookMarkState extends ConsumerState<BookMark> {
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildBox(Map<String, dynamic> data, BuildContext context) {
|
||||
// Color borderColor = data['valueColor'];
|
||||
Widget _buildBox(
|
||||
Map<String, dynamic> data, BuildContext context, bool isDarkTheme) {
|
||||
// Color borderColor = data['valueColor'];
|
||||
return GestureDetector(
|
||||
onTap: () {
|
||||
final data_set = data['data_set'];
|
||||
@ -677,7 +741,7 @@ class _BookMarkState extends ConsumerState<BookMark> {
|
||||
height: 100,
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white,
|
||||
color: isDarkTheme ? Color(0xFF111111) : Colors.white,
|
||||
borderRadius: BorderRadius.circular(10),
|
||||
border: Border.all(color: data['valueColor']),
|
||||
),
|
||||
@ -698,11 +762,14 @@ class _BookMarkState extends ConsumerState<BookMark> {
|
||||
alignment: Alignment.center,
|
||||
child: Text(
|
||||
data['title'] ?? '',
|
||||
style: TextStyle(fontWeight: FontWeight.w500,
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.w500,
|
||||
fontFamily: context.translate(
|
||||
'Roboto',
|
||||
'NotoKufi',
|
||||
),),
|
||||
),
|
||||
color: isDarkTheme ? Colors.white : null,
|
||||
),
|
||||
overflow: TextOverflow.ellipsis,
|
||||
maxLines: 1,
|
||||
),
|
||||
@ -712,7 +779,7 @@ class _BookMarkState extends ConsumerState<BookMark> {
|
||||
onTap: () {
|
||||
debugPrint("Icon clicked in: ${data['title']}");
|
||||
showRemoveBookmarkDialog(data['id']);
|
||||
// removeBookmark(data['id']);
|
||||
// removeBookmark(data['id']);
|
||||
},
|
||||
child: SvgPicture.asset(
|
||||
BookmarkAssetPath.delete,
|
||||
@ -721,23 +788,24 @@ class _BookMarkState extends ConsumerState<BookMark> {
|
||||
height: 20,
|
||||
)),
|
||||
|
||||
// GestureDetector(
|
||||
// onTap: () {
|
||||
// debugPrint("Icon clicked in: ${data['title']}");
|
||||
// // showRemoveBookmarkDialog(data['id']);
|
||||
// },
|
||||
// child: const Icon(
|
||||
// Icons.bookmarks_rounded,
|
||||
// color: Colors.black,
|
||||
// size: 20,
|
||||
// ),
|
||||
// ),
|
||||
// GestureDetector(
|
||||
// onTap: () {
|
||||
// debugPrint("Icon clicked in: ${data['title']}");
|
||||
// // showRemoveBookmarkDialog(data['id']);
|
||||
// },
|
||||
// child: const Icon(
|
||||
// Icons.bookmarks_rounded,
|
||||
// color: Colors.black,
|
||||
// size: 20,
|
||||
// ),
|
||||
// ),
|
||||
],
|
||||
),
|
||||
Text(
|
||||
data['value_source'] ?? '',
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.w500, color: Colors.grey,
|
||||
fontWeight: FontWeight.w500,
|
||||
color: Colors.grey,
|
||||
fontFamily: context.translate(
|
||||
'Roboto',
|
||||
'NotoKufi',
|
||||
@ -768,14 +836,18 @@ class _BookMarkState extends ConsumerState<BookMark> {
|
||||
}
|
||||
|
||||
Widget _buildBoxes(
|
||||
Map<String, dynamic> data, BuildContext context, Color styleColor) {
|
||||
// Color borderColor = data['valueColor'];
|
||||
Map<String, dynamic> data,
|
||||
BuildContext context,
|
||||
Color styleColor,
|
||||
bool isDarkTheme,
|
||||
) {
|
||||
// Color borderColor = data['valueColor'];
|
||||
print('inside function $data');
|
||||
return GestureDetector(
|
||||
onTap: () {
|
||||
final data_set = data['data_set'];
|
||||
|
||||
// final Color colorPattern = data['valueColor'];
|
||||
// final Color colorPattern = data['valueColor'];
|
||||
final encodedMainTopic = data['main_topic'];
|
||||
final encodedTitle = data['title'];
|
||||
String hexColor = colorToHex(styleColor);
|
||||
@ -783,10 +855,10 @@ class _BookMarkState extends ConsumerState<BookMark> {
|
||||
debugPrint(
|
||||
'/chartScreen/$data_set?bgColor=$hexColor&mainTopic=$encodedMainTopic&title=$encodedTitle');
|
||||
|
||||
// String hexColor = colorToHex(colorPattern); // Get hex string
|
||||
// print(hexColor); // Prints: 0xFFAA8E83
|
||||
// String hexColor = colorToHex(colorPattern); // Get hex string
|
||||
// print(hexColor); // Prints: 0xFFAA8E83
|
||||
|
||||
// debugPrint("Box clicked: ${data['title']}");
|
||||
// debugPrint("Box clicked: ${data['title']}");
|
||||
context.push(
|
||||
'/chartScreen/$data_set?bgColor=$hexColor&mainTopic=$encodedMainTopic&title=$encodedTitle');
|
||||
},
|
||||
@ -795,7 +867,7 @@ class _BookMarkState extends ConsumerState<BookMark> {
|
||||
height: 100,
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white,
|
||||
color: isDarkTheme ? Color(0xFF111111) : Colors.white,
|
||||
borderRadius: BorderRadius.circular(10),
|
||||
border: Border.all(color: styleColor),
|
||||
),
|
||||
@ -814,10 +886,14 @@ class _BookMarkState extends ConsumerState<BookMark> {
|
||||
alignment: Alignment.center,
|
||||
child: Text(
|
||||
data['title'] ?? '',
|
||||
style: TextStyle(fontWeight: FontWeight.w500, fontFamily: context.translate(
|
||||
'Roboto',
|
||||
'NotoKufi',
|
||||
),),
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.w500,
|
||||
fontFamily: context.translate(
|
||||
'Roboto',
|
||||
'NotoKufi',
|
||||
),
|
||||
color: isDarkTheme ? Colors.white : null,
|
||||
),
|
||||
overflow: TextOverflow.ellipsis,
|
||||
maxLines: 1,
|
||||
),
|
||||
@ -839,10 +915,13 @@ class _BookMarkState extends ConsumerState<BookMark> {
|
||||
Text(
|
||||
data['value_source'] ?? '',
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.w500, color: Colors.grey, fontFamily: context.translate(
|
||||
'Roboto',
|
||||
'NotoKufi',
|
||||
),),
|
||||
fontWeight: FontWeight.w500,
|
||||
color: Colors.grey,
|
||||
fontFamily: context.translate(
|
||||
'Roboto',
|
||||
'NotoKufi',
|
||||
),
|
||||
),
|
||||
overflow: TextOverflow.ellipsis,
|
||||
maxLines: 1,
|
||||
),
|
||||
@ -870,17 +949,18 @@ class TabBarHeader extends StatelessWidget {
|
||||
final List<Map<String, dynamic>> tabs;
|
||||
final int selectedIndex;
|
||||
final ValueChanged<int> onTabSelected;
|
||||
bool isDarkTheme;
|
||||
|
||||
const TabBarHeader({
|
||||
required this.tabs,
|
||||
required this.selectedIndex,
|
||||
required this.onTabSelected,
|
||||
});
|
||||
TabBarHeader(
|
||||
{required this.tabs,
|
||||
required this.selectedIndex,
|
||||
required this.onTabSelected,
|
||||
required this.isDarkTheme});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Container(
|
||||
color: Colors.white,
|
||||
color: isDarkTheme ? Color(0xFF111111) : Colors.white,
|
||||
padding: const EdgeInsets.symmetric(vertical: 8),
|
||||
child: SingleChildScrollView(
|
||||
scrollDirection: Axis.horizontal,
|
||||
@ -901,11 +981,15 @@ class TabBarHeader extends StatelessWidget {
|
||||
: Colors.grey[700];
|
||||
}),
|
||||
),
|
||||
child: Text(text,
|
||||
style: TextStyle( fontFamily: context.translate(
|
||||
'Roboto',
|
||||
'NotoKufi',
|
||||
),),),
|
||||
child: Text(
|
||||
text,
|
||||
style: TextStyle(
|
||||
fontFamily: context.translate(
|
||||
'Roboto',
|
||||
'NotoKufi',
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
if (index < tabs.length - 1) buildDivider(),
|
||||
],
|
||||
@ -936,6 +1020,7 @@ class CustomExpandableTile extends StatefulWidget {
|
||||
final bool isExpanded;
|
||||
final ValueChanged<int> onTap;
|
||||
final Widget childWidget;
|
||||
final bool isDarkTheme;
|
||||
|
||||
const CustomExpandableTile({
|
||||
required this.title,
|
||||
@ -945,6 +1030,7 @@ class CustomExpandableTile extends StatefulWidget {
|
||||
required this.isExpanded,
|
||||
required this.onTap,
|
||||
required this.childWidget,
|
||||
required this.isDarkTheme,
|
||||
});
|
||||
|
||||
@override
|
||||
@ -960,7 +1046,7 @@ class _CustomExpandableTileState extends State<CustomExpandableTile> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
double myheight = MediaQuery.of(context).size.height;
|
||||
// print(widget.filteredBookmarks);
|
||||
// print(widget.filteredBookmarks);
|
||||
return Card(
|
||||
elevation: 0,
|
||||
child: Column(
|
||||
@ -969,8 +1055,10 @@ class _CustomExpandableTileState extends State<CustomExpandableTile> {
|
||||
onTap: () => widget.onTap(widget.index),
|
||||
child: Container(
|
||||
decoration: BoxDecoration(
|
||||
color: Colors
|
||||
.white, // Ensuring the background outside the rounded container is white
|
||||
color: widget.isDarkTheme
|
||||
? Color(0xFF111111)
|
||||
: Colors
|
||||
.white, // Ensuring the background outside the rounded container is white
|
||||
),
|
||||
child: Container(
|
||||
decoration: BoxDecoration(
|
||||
@ -997,7 +1085,7 @@ class _CustomExpandableTileState extends State<CustomExpandableTile> {
|
||||
widget.isExpanded
|
||||
? Icons.keyboard_arrow_up
|
||||
: Icons.keyboard_arrow_down,
|
||||
color: Colors.white,
|
||||
color: widget.isDarkTheme ? Colors.black : Colors.white,
|
||||
size: 28.0,
|
||||
),
|
||||
],
|
||||
@ -1010,35 +1098,35 @@ class _CustomExpandableTileState extends State<CustomExpandableTile> {
|
||||
duration: Duration(milliseconds: 300),
|
||||
curve: Curves.easeInOut,
|
||||
width: double.infinity,
|
||||
color: Colors.white,
|
||||
// height: widget.isExpanded ? myheight * 0.4 : 0,
|
||||
color: widget.isDarkTheme ? Colors.black : Colors.white,
|
||||
// height: widget.isExpanded ? myheight * 0.4 : 0,
|
||||
child: widget.isExpanded
|
||||
? SingleChildScrollView(
|
||||
child: Column(
|
||||
children: [
|
||||
widget.childWidget,
|
||||
// Container(
|
||||
// decoration: BoxDecoration(
|
||||
// color: Colors.white,
|
||||
// // borderRadius: BorderRadius.all(Radius.circular(20))
|
||||
// ),
|
||||
// padding: const EdgeInsets.all(16),
|
||||
// child: GridView.builder(
|
||||
// shrinkWrap: true,
|
||||
// physics: NeverScrollableScrollPhysics(),
|
||||
// gridDelegate:
|
||||
// const SliverGridDelegateWithFixedCrossAxisCount(
|
||||
// crossAxisCount: 2,
|
||||
// crossAxisSpacing: 10.0,
|
||||
// mainAxisSpacing: 10.0,
|
||||
// mainAxisExtent: 100,
|
||||
// ),
|
||||
// itemCount: widget.filteredBookmarks.length,
|
||||
// itemBuilder: (context, index) {
|
||||
// return _buildBox(widget.filteredBookmarks[index], context,widget.titleBackgroundColor);
|
||||
// },
|
||||
// ),
|
||||
// ),
|
||||
// Container(
|
||||
// decoration: BoxDecoration(
|
||||
// color: Colors.white,
|
||||
// // borderRadius: BorderRadius.all(Radius.circular(20))
|
||||
// ),
|
||||
// padding: const EdgeInsets.all(16),
|
||||
// child: GridView.builder(
|
||||
// shrinkWrap: true,
|
||||
// physics: NeverScrollableScrollPhysics(),
|
||||
// gridDelegate:
|
||||
// const SliverGridDelegateWithFixedCrossAxisCount(
|
||||
// crossAxisCount: 2,
|
||||
// crossAxisSpacing: 10.0,
|
||||
// mainAxisSpacing: 10.0,
|
||||
// mainAxisExtent: 100,
|
||||
// ),
|
||||
// itemCount: widget.filteredBookmarks.length,
|
||||
// itemBuilder: (context, index) {
|
||||
// return _buildBox(widget.filteredBookmarks[index], context,widget.titleBackgroundColor);
|
||||
// },
|
||||
// ),
|
||||
// ),
|
||||
],
|
||||
),
|
||||
)
|
||||
|
||||
@ -1,7 +1,12 @@
|
||||
import 'dart:convert';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_riverpod/flutter_riverpod.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/theme/theme_provider.dart';
|
||||
import 'package:uae_stat/config/toggle_lang_service.dart';
|
||||
import 'package:uae_stat/domain/use_cases/language.dart';
|
||||
import 'package:uae_stat/infrastructure/services/img_asset_paths/icons/enquiry_asset_icon_path.dart';
|
||||
@ -20,10 +25,53 @@ class Contact extends ConsumerStatefulWidget {
|
||||
class _ContactState extends ConsumerState<Contact> {
|
||||
late UserService _userService;
|
||||
|
||||
List<dynamic> homePageData = [];
|
||||
List<dynamic> filteredData = [];
|
||||
late ThemeMode currentTheme;
|
||||
bool isLoading = true;
|
||||
|
||||
@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
|
||||
@ -42,6 +90,49 @@ class _ContactState extends ConsumerState<Contact> {
|
||||
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(
|
||||
canPop: false,
|
||||
onPopInvokedWithResult: (didPop, result) {
|
||||
@ -49,145 +140,175 @@ class _ContactState extends ConsumerState<Contact> {
|
||||
context.go('/myhomepage');
|
||||
},
|
||||
child: BaseScaffold(
|
||||
body: Container(
|
||||
color: Colors.grey[200],
|
||||
width: screenWidth,
|
||||
padding: const EdgeInsets.all(16.0),
|
||||
child: SingleChildScrollView(
|
||||
child: Column(
|
||||
children: [
|
||||
buildContactCard(
|
||||
context,
|
||||
title: 'DUBAI - EMIRATES TOWER - 32ND FLOOR',
|
||||
titleAr: 'دبي - أبراج الإمارات - الطابق 32',
|
||||
details: [
|
||||
{
|
||||
'icon': EnquiryAssetIconPath.building,
|
||||
'text': 'Office: Dubai - Emirates Tower - 32nd Floor',
|
||||
'textAr': 'المقر الرئيسي: دبي - أبراج الإمارات - الطابق 32'
|
||||
},
|
||||
{
|
||||
'icon': EnquiryAssetIconPath.phone,
|
||||
'text': 'Tel: 00971 4608 0000',
|
||||
'textAr': 'الهاتف: 0097146080000'
|
||||
},
|
||||
{
|
||||
'icon': EnquiryAssetIconPath.fax,
|
||||
'text': 'Fax: 00971 4327 3535',
|
||||
'textAr': 'فاكس: 0097143273535'
|
||||
},
|
||||
{
|
||||
'icon': EnquiryAssetIconPath.map,
|
||||
'text': 'P.O.Box: 127000 Dubai',
|
||||
'textAr': 'ص.ب: 127000 دبي'
|
||||
},
|
||||
{
|
||||
'icon': EnquiryAssetIconPath.at,
|
||||
'text': 'Email Address: info@fcsc.gov.ae',
|
||||
'textAr': 'البريد الإلكتروني: info@fcsc.gov.ae'
|
||||
},
|
||||
{
|
||||
'icon': EnquiryAssetIconPath.map,
|
||||
'text': 'Latitude: 25.223926',
|
||||
'textAr': 'خط العرض: 25.223926'
|
||||
},
|
||||
{
|
||||
'icon': EnquiryAssetIconPath.map,
|
||||
'text': 'Longitude: 55.350526',
|
||||
'textAr': 'خط الطول: 55.350526'
|
||||
},
|
||||
backgroundColor: isDarkTheme ? Color(0xFF333333) : Colors.white,
|
||||
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
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
buildContactCard(
|
||||
context,
|
||||
title: 'MEDIA SECTION',
|
||||
titleAr: 'قسم الاعلام',
|
||||
details: [
|
||||
{
|
||||
'icon': EnquiryAssetIconPath.building,
|
||||
'text': 'Office: Media Section',
|
||||
'textAr': 'المقر الرئيسي: قسم الاعلام'
|
||||
},
|
||||
{
|
||||
'icon': EnquiryAssetIconPath.phone,
|
||||
'text': 'Tel: 00971 4608 0000',
|
||||
'textAr': 'الهاتف: 0097146080000'
|
||||
},
|
||||
{
|
||||
'icon': EnquiryAssetIconPath.fax,
|
||||
'text': 'Fax: 00971 4327 3535',
|
||||
'textAr': 'فاكس: 0097143273535'
|
||||
},
|
||||
{
|
||||
'icon': EnquiryAssetIconPath.map,
|
||||
'text': 'P.O.Box: 127000 Dubai',
|
||||
'textAr': 'ص.ب: 127000 دبي'
|
||||
},
|
||||
{
|
||||
'icon': EnquiryAssetIconPath.at,
|
||||
'text': 'Email Address: GCO@fcsc.gov.ae',
|
||||
'textAr': 'البريد الإلكتروني: GCO@fcsc.gov.ae'
|
||||
},
|
||||
{
|
||||
'icon': EnquiryAssetIconPath.map,
|
||||
'text': 'Latitude: 25.223926',
|
||||
'textAr': 'خط العرض: 25.223926'
|
||||
},
|
||||
{
|
||||
'icon': EnquiryAssetIconPath.map,
|
||||
'text': 'Longitude: 55.350526',
|
||||
'textAr': 'خط الطول: 55.350526'
|
||||
},
|
||||
],
|
||||
)
|
||||
: Container(
|
||||
// color: Colors.grey[200],
|
||||
// color: isDarkTheme ? Color(0xFF3B3C3F) : Colors.grey[200],
|
||||
color: isDarkTheme ? Color(0xFF333333) : Colors.grey[200],
|
||||
width: screenWidth,
|
||||
padding: const EdgeInsets.all(16.0),
|
||||
child: SingleChildScrollView(
|
||||
child: Column(
|
||||
children: [
|
||||
buildContactCard(context,
|
||||
title: 'DUBAI - EMIRATES TOWER - 32ND FLOOR',
|
||||
titleAr: 'دبي - أبراج الإمارات - الطابق 32',
|
||||
details: [
|
||||
{
|
||||
'icon': EnquiryAssetIconPath.building,
|
||||
'text':
|
||||
'Office: Dubai - Emirates Tower - 32nd Floor',
|
||||
'textAr':
|
||||
'المقر الرئيسي: دبي - أبراج الإمارات - الطابق 32'
|
||||
},
|
||||
{
|
||||
'icon': EnquiryAssetIconPath.phone,
|
||||
'text': 'Tel: 00971 4608 0000',
|
||||
'textAr': 'الهاتف: 0097146080000'
|
||||
},
|
||||
{
|
||||
'icon': EnquiryAssetIconPath.fax,
|
||||
'text': 'Fax: 00971 4327 3535',
|
||||
'textAr': 'فاكس: 0097143273535'
|
||||
},
|
||||
{
|
||||
'icon': EnquiryAssetIconPath.map,
|
||||
'text': 'P.O.Box: 127000 Dubai',
|
||||
'textAr': 'ص.ب: 127000 دبي'
|
||||
},
|
||||
{
|
||||
'icon': EnquiryAssetIconPath.at,
|
||||
'text': 'Email Address: info@fcsc.gov.ae',
|
||||
'textAr': 'البريد الإلكتروني: info@fcsc.gov.ae'
|
||||
},
|
||||
{
|
||||
'icon': EnquiryAssetIconPath.map,
|
||||
'text': 'Latitude: 25.223926',
|
||||
'textAr': 'خط العرض: 25.223926'
|
||||
},
|
||||
{
|
||||
'icon': EnquiryAssetIconPath.map,
|
||||
'text': 'Longitude: 55.350526',
|
||||
'textAr': 'خط الطول: 55.350526'
|
||||
},
|
||||
],
|
||||
isDarkTheme: isDarkTheme),
|
||||
const SizedBox(height: 10),
|
||||
buildContactCard(
|
||||
context,
|
||||
title: 'MEDIA SECTION',
|
||||
titleAr: 'قسم الاعلام',
|
||||
details: [
|
||||
{
|
||||
'icon': EnquiryAssetIconPath.building,
|
||||
'text': 'Office: Media Section',
|
||||
'textAr': 'المقر الرئيسي: قسم الاعلام'
|
||||
},
|
||||
{
|
||||
'icon': EnquiryAssetIconPath.phone,
|
||||
'text': 'Tel: 00971 4608 0000',
|
||||
'textAr': 'الهاتف: 0097146080000'
|
||||
},
|
||||
{
|
||||
'icon': EnquiryAssetIconPath.fax,
|
||||
'text': 'Fax: 00971 4327 3535',
|
||||
'textAr': 'فاكس: 0097143273535'
|
||||
},
|
||||
{
|
||||
'icon': EnquiryAssetIconPath.map,
|
||||
'text': 'P.O.Box: 127000 Dubai',
|
||||
'textAr': 'ص.ب: 127000 دبي'
|
||||
},
|
||||
{
|
||||
'icon': EnquiryAssetIconPath.at,
|
||||
'text': 'Email Address: GCO@fcsc.gov.ae',
|
||||
'textAr': 'البريد الإلكتروني: GCO@fcsc.gov.ae'
|
||||
},
|
||||
{
|
||||
'icon': EnquiryAssetIconPath.map,
|
||||
'text': 'Latitude: 25.223926',
|
||||
'textAr': 'خط العرض: 25.223926'
|
||||
},
|
||||
{
|
||||
'icon': EnquiryAssetIconPath.map,
|
||||
'text': 'Longitude: 55.350526',
|
||||
'textAr': 'خط الطول: 55.350526'
|
||||
},
|
||||
],
|
||||
isDarkTheme: isDarkTheme,
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
buildContactCard(
|
||||
context,
|
||||
title: 'SGDS',
|
||||
titleAr: 'أهداف التنمية المستدامة',
|
||||
details: [
|
||||
{
|
||||
'icon': EnquiryAssetIconPath.building,
|
||||
'text': 'Office: SDGs',
|
||||
'textAr': 'المقر الرئيسي: أهداف التنمية المستدامة'
|
||||
},
|
||||
{
|
||||
'icon': EnquiryAssetIconPath.phone,
|
||||
'text': 'Tel: 00971 4608 0000',
|
||||
'textAr': 'الهاتف: 0097146080000'
|
||||
},
|
||||
{
|
||||
'icon': EnquiryAssetIconPath.fax,
|
||||
'text': 'Fax: 00971 4327 3535',
|
||||
'textAr': 'فاكس : 0097143273535'
|
||||
},
|
||||
{
|
||||
'icon': EnquiryAssetIconPath.map,
|
||||
'text': 'P.O.Box: 127000 Dubai',
|
||||
'textAr': 'ص.ب: 127000 دبي'
|
||||
},
|
||||
{
|
||||
'icon': EnquiryAssetIconPath.at,
|
||||
'text': 'Email Address: sdgs@fcsc.gov.ae',
|
||||
'textAr': 'البريد الإلكتروني: sdgs@fcsc.gov.ae'
|
||||
},
|
||||
{
|
||||
'icon': EnquiryAssetIconPath.map,
|
||||
'text': 'Latitude: 25.223926',
|
||||
'textAr': 'خط العرض: 25.223926'
|
||||
},
|
||||
{
|
||||
'icon': EnquiryAssetIconPath.map,
|
||||
'text': 'Longitude: 55.350526',
|
||||
'textAr': 'خط الطول: 55.350526'
|
||||
},
|
||||
],
|
||||
isDarkTheme: isDarkTheme,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
buildContactCard(
|
||||
context,
|
||||
title: 'SGDS',
|
||||
titleAr: 'أهداف التنمية المستدامة',
|
||||
details: [
|
||||
{
|
||||
'icon': EnquiryAssetIconPath.building,
|
||||
'text': 'Office: SDGs',
|
||||
'textAr': 'المقر الرئيسي: أهداف التنمية المستدامة'
|
||||
},
|
||||
{
|
||||
'icon': EnquiryAssetIconPath.phone,
|
||||
'text': 'Tel: 00971 4608 0000',
|
||||
'textAr': 'الهاتف: 0097146080000'
|
||||
},
|
||||
{
|
||||
'icon': EnquiryAssetIconPath.fax,
|
||||
'text': 'Fax: 00971 4327 3535',
|
||||
'textAr': 'فاكس : 0097143273535'
|
||||
},
|
||||
{
|
||||
'icon': EnquiryAssetIconPath.map,
|
||||
'text': 'P.O.Box: 127000 Dubai',
|
||||
'textAr': 'ص.ب: 127000 دبي'
|
||||
},
|
||||
{
|
||||
'icon': EnquiryAssetIconPath.at,
|
||||
'text': 'Email Address: sdgs@fcsc.gov.ae',
|
||||
'textAr': 'البريد الإلكتروني: sdgs@fcsc.gov.ae'
|
||||
},
|
||||
{
|
||||
'icon': EnquiryAssetIconPath.map,
|
||||
'text': 'Latitude: 25.223926',
|
||||
'textAr': 'خط العرض: 25.223926'
|
||||
},
|
||||
{
|
||||
'icon': EnquiryAssetIconPath.map,
|
||||
'text': 'Longitude: 55.350526',
|
||||
'textAr': 'خط الطول: 55.350526'
|
||||
},
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
title: Text(context.translate('Contact Us', 'اتصل بنا')),
|
||||
),
|
||||
);
|
||||
@ -196,11 +317,13 @@ class _ContactState extends ConsumerState<Contact> {
|
||||
Widget buildContactCard(BuildContext context,
|
||||
{required String title,
|
||||
required String titleAr,
|
||||
required List<Map<String, String>> details}) {
|
||||
required List<Map<String, String>> details,
|
||||
isDarkTheme}) {
|
||||
return Container(
|
||||
padding: const EdgeInsets.symmetric(vertical: 10, horizontal: 12),
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white,
|
||||
// color: Colors.white,
|
||||
color: isDarkTheme ? Color(0xFF030303) : Colors.white,
|
||||
borderRadius: BorderRadius.circular(6.0),
|
||||
boxShadow: [
|
||||
BoxShadow(
|
||||
@ -226,31 +349,38 @@ class _ContactState extends ConsumerState<Contact> {
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 8),
|
||||
...details.map((item) => buildTextRow(item['icon']!,
|
||||
context.translate(item['text']!, item['textAr']!))),
|
||||
...details.map((item) => buildTextRow(
|
||||
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, '');
|
||||
String cleanText = '';
|
||||
|
||||
if (text.toLowerCase().contains('tel:') || text.toLowerCase().contains('الهاتف:')) {
|
||||
if (text.toLowerCase().contains('tel:') ||
|
||||
text.toLowerCase().contains('الهاتف:')) {
|
||||
values = text.split(':');
|
||||
print ('List of values----- :$values');
|
||||
print ('value 1 ${values[0]}');
|
||||
cleanText=values[1].replaceAll(' ', '');
|
||||
} else if(text.toLowerCase().contains('email address:') || text.toLowerCase().contains('البريد الإلكتروني:')){
|
||||
print('List of values----- :$values');
|
||||
print('value 1 ${values[0]}');
|
||||
cleanText = values[1].replaceAll(' ', '');
|
||||
} else if (text.toLowerCase().contains('email address:') ||
|
||||
text.toLowerCase().contains('البريد الإلكتروني:')) {
|
||||
values = text.split(':');
|
||||
cleanText = values[1].replaceAll(' ', '');
|
||||
} else{
|
||||
} else {
|
||||
cleanText = text;
|
||||
}
|
||||
|
||||
Future<void> sendEmail(String emailAddress) async {
|
||||
print ('before email : $emailAddress');
|
||||
print('before email : $emailAddress');
|
||||
final uri = Uri(
|
||||
scheme: 'mailto',
|
||||
path: emailAddress,
|
||||
@ -275,76 +405,99 @@ class _ContactState extends ConsumerState<Contact> {
|
||||
const SizedBox(width: 10),
|
||||
iconName == EnquiryAssetIconPath.phone
|
||||
? InkWell(
|
||||
onTap: () async{
|
||||
print('clean test : $cleanText');
|
||||
final uri = Uri(scheme: 'tel', path: cleanText);
|
||||
if (await canLaunchUrl(uri)) {
|
||||
await launchUrl(uri);
|
||||
} else {
|
||||
debugPrint('Could not launch $uri');
|
||||
}
|
||||
},
|
||||
child: RichText(
|
||||
text: TextSpan(
|
||||
text: values[0],
|
||||
style: TextStyle(fontSize: 14, color: Color(0xFF5F5F5F), 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',
|
||||
),)
|
||||
onTap: () async {
|
||||
print('clean test : $cleanText');
|
||||
final uri = Uri(scheme: 'tel', path: cleanText);
|
||||
if (await canLaunchUrl(uri)) {
|
||||
await launchUrl(uri);
|
||||
} else {
|
||||
debugPrint('Could not launch $uri');
|
||||
}
|
||||
},
|
||||
child: RichText(
|
||||
text: TextSpan(
|
||||
text: values[0],
|
||||
style: TextStyle(
|
||||
fontSize: 14,
|
||||
color: isDarkTheme ? Colors.white : Color(0xFF5F5F5F),
|
||||
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',
|
||||
),
|
||||
)),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
// child: Text(
|
||||
// text,
|
||||
// style: const TextStyle(
|
||||
// fontSize: 14,
|
||||
// color: Color(0xFF5F5F5F),
|
||||
// ),
|
||||
// ),
|
||||
)
|
||||
// child: Text(
|
||||
// text,
|
||||
// style: const TextStyle(
|
||||
// fontSize: 14,
|
||||
// color: Color(0xFF5F5F5F),
|
||||
// ),
|
||||
// ),
|
||||
)
|
||||
: iconName == EnquiryAssetIconPath.at
|
||||
? InkWell(
|
||||
onTap: () => sendEmail(cleanText),
|
||||
child: RichText(
|
||||
text: TextSpan(
|
||||
text: values[0],
|
||||
style: TextStyle(fontSize: 14, color: Color(0xFF5F5F5F), 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',
|
||||
),)
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
)
|
||||
:Expanded(
|
||||
child: Text(
|
||||
text,
|
||||
style: TextStyle(
|
||||
fontFamily: context.translate(
|
||||
'Roboto',
|
||||
'NotoKufi',
|
||||
),
|
||||
fontSize: 14,
|
||||
color: Color(0xFF5F5F5F),
|
||||
),
|
||||
),
|
||||
),
|
||||
? InkWell(
|
||||
onTap: () => sendEmail(cleanText),
|
||||
child: RichText(
|
||||
text: TextSpan(
|
||||
text: values[0],
|
||||
style: TextStyle(
|
||||
fontSize: 14,
|
||||
color:
|
||||
isDarkTheme ? Colors.white : Color(0xFF5F5F5F),
|
||||
// color: Color(0xFF5F5F5F),
|
||||
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',
|
||||
),
|
||||
)),
|
||||
],
|
||||
),
|
||||
),
|
||||
)
|
||||
: Expanded(
|
||||
child: Text(
|
||||
text,
|
||||
style: TextStyle(
|
||||
fontFamily: context.translate(
|
||||
'Roboto',
|
||||
'NotoKufi',
|
||||
),
|
||||
fontSize: 14,
|
||||
color: isDarkTheme ? Colors.white : Color(0xFF5F5F5F),
|
||||
// color: Color(0xFF5F5F5F),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
|
||||
@ -1,9 +1,13 @@
|
||||
import 'dart:convert';
|
||||
|
||||
import 'package:external_repos/external_repos.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_rating_bar/flutter_rating_bar.dart';
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
import 'package:go_router/go_router.dart';
|
||||
import 'package:http/http.dart' as http;
|
||||
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:pocketbase/pocketbase.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
|
||||
|
||||
final TextEditingController _feedbackController = TextEditingController();
|
||||
List<dynamic> homePageData = [];
|
||||
List<dynamic> filteredData = [];
|
||||
|
||||
double _easeOfUseRating = 0;
|
||||
double _qualityRating = 0;
|
||||
@ -107,18 +113,59 @@ class _FeedbackFormState extends ConsumerState<FeedbackForm>
|
||||
bool _hasError = false;
|
||||
String _errorMessage = '';
|
||||
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);
|
||||
});
|
||||
|
||||
WidgetsBinding.instance.addObserver(this);
|
||||
_loadFeedbackText();
|
||||
_feedbackController.addListener(_handleTextChange);
|
||||
// fetchEmailConfiguration();
|
||||
|
||||
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 {
|
||||
final prefs = await SharedPreferences.getInstance();
|
||||
return prefs.getString('userId'); // Retrieve the userId
|
||||
@ -248,11 +295,54 @@ class _FeedbackFormState extends ConsumerState<FeedbackForm>
|
||||
}
|
||||
});
|
||||
|
||||
// ref.listen<Locale?>(localeProvider, (previous, next) async {
|
||||
// final localeCode = next?.languageCode ?? 'en'; // Default to 'en' if null
|
||||
// await _userService.updateLanguage(localeCode);
|
||||
// });
|
||||
|
||||
ref.listen<Locale?>(localeProvider, (previous, next) async {
|
||||
final localeCode = next?.languageCode ?? 'en'; // Default to 'en' if null
|
||||
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");
|
||||
|
||||
final userName = GoRouterState.of(context).extra as String? ?? 'Guest User';
|
||||
return PopScope(
|
||||
canPop: false, // Allow back navigation only if not login screen
|
||||
@ -261,6 +351,11 @@ class _FeedbackFormState extends ConsumerState<FeedbackForm>
|
||||
context.go('/myhomepage'); // Show exit confirmation dialog
|
||||
},
|
||||
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(
|
||||
AppLocalizations.of(context)!.feedback_title,
|
||||
@ -292,7 +387,9 @@ class _FeedbackFormState extends ConsumerState<FeedbackForm>
|
||||
// ),
|
||||
body: isLoading
|
||||
? Container(
|
||||
color: Color(0x98FFFCE5), // Semi-transparent background
|
||||
// color: Color(0x98FFFCE5), // Semi-transparent background
|
||||
|
||||
color: isDarkTheme ? Color(0xFF000000) : Colors.white,
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
@ -315,16 +412,16 @@ class _FeedbackFormState extends ConsumerState<FeedbackForm>
|
||||
top: 8.0, bottom: 16.0, left: 23.0, right: 23.0),
|
||||
child: SingleChildScrollView(
|
||||
child: _isFeedbackSubmitted
|
||||
? _buildThankYouMessage(userName)
|
||||
? _buildThankYouMessage(userName, isDarkTheme)
|
||||
: _isFeedbackFailed
|
||||
? _buildFailureMessage()
|
||||
: _buildFeedbackForm(),
|
||||
? _buildFailureMessage(isDarkTheme)
|
||||
: _buildFeedbackForm(isDarkTheme),
|
||||
),
|
||||
),
|
||||
));
|
||||
}
|
||||
|
||||
Widget _buildFeedbackForm() {
|
||||
Widget _buildFeedbackForm(bool isDarkTheme) {
|
||||
return Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: <Widget>[
|
||||
@ -335,7 +432,7 @@ class _FeedbackFormState extends ConsumerState<FeedbackForm>
|
||||
),
|
||||
style: TextStyle(
|
||||
fontSize: 18,
|
||||
color: Color(0xFF898C81),
|
||||
color: isDarkTheme ? Colors.white : Color(0xFF898C81),
|
||||
fontFamily: context.translate(
|
||||
'Roboto',
|
||||
'NotoKufi',
|
||||
@ -359,7 +456,8 @@ class _FeedbackFormState extends ConsumerState<FeedbackForm>
|
||||
'NotoKufi',
|
||||
),
|
||||
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"],
|
||||
label: _emojiOptions[index]["label"],
|
||||
index: index,
|
||||
isDarkTheme: isDarkTheme,
|
||||
);
|
||||
}),
|
||||
),
|
||||
@ -398,10 +497,14 @@ class _FeedbackFormState extends ConsumerState<FeedbackForm>
|
||||
'Please rate your experience before submitting your feedback.',
|
||||
'يرجى تقييم تجربتك قبل تقديم ملاحظاتك.',
|
||||
),
|
||||
style: TextStyle(color: Color(0xFFD83731), fontSize: 14, fontFamily: context.translate(
|
||||
'Roboto',
|
||||
'NotoKufi',
|
||||
),),
|
||||
style: TextStyle(
|
||||
color: Color(0xFFD83731),
|
||||
fontSize: 14,
|
||||
fontFamily: context.translate(
|
||||
'Roboto',
|
||||
'NotoKufi',
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
@ -421,19 +524,17 @@ class _FeedbackFormState extends ConsumerState<FeedbackForm>
|
||||
'NotoKufi',
|
||||
),
|
||||
fontWeight: FontWeight.w400,
|
||||
color: Color(0xFF898C81),
|
||||
// color: Color(0xFF898C81),
|
||||
color: isDarkTheme ? Colors.white : Color(0xff898C81),
|
||||
),
|
||||
)),
|
||||
const SizedBox(height: 15),
|
||||
_buildRatingRow(
|
||||
context.translate('Ease of use', 'سهولة الاستخدام'),
|
||||
_easeOfUseRating,
|
||||
(rating) {
|
||||
setState(() {
|
||||
_easeOfUseRating = rating;
|
||||
});
|
||||
},
|
||||
),
|
||||
_buildRatingRow(context.translate('Ease of use', 'سهولة الاستخدام'),
|
||||
_easeOfUseRating, (rating) {
|
||||
setState(() {
|
||||
_easeOfUseRating = rating;
|
||||
});
|
||||
}, isDarkTheme),
|
||||
_buildRatingRow(
|
||||
context.translate('Quality', 'الجودة'),
|
||||
_qualityRating,
|
||||
@ -442,6 +543,7 @@ class _FeedbackFormState extends ConsumerState<FeedbackForm>
|
||||
_qualityRating = rating;
|
||||
});
|
||||
},
|
||||
isDarkTheme,
|
||||
),
|
||||
_buildRatingRow(
|
||||
context.translate('Design', 'التصميم'),
|
||||
@ -451,6 +553,7 @@ class _FeedbackFormState extends ConsumerState<FeedbackForm>
|
||||
_designRating = rating;
|
||||
});
|
||||
},
|
||||
isDarkTheme,
|
||||
),
|
||||
_buildRatingRow(
|
||||
context.translate('Redundant', 'مكرر'),
|
||||
@ -460,6 +563,7 @@ class _FeedbackFormState extends ConsumerState<FeedbackForm>
|
||||
_redundancyRating = rating;
|
||||
});
|
||||
},
|
||||
isDarkTheme,
|
||||
),
|
||||
const SizedBox(height: 20),
|
||||
TextField(
|
||||
@ -467,42 +571,51 @@ class _FeedbackFormState extends ConsumerState<FeedbackForm>
|
||||
minLines: 5, // Start with 5 lines
|
||||
maxLines: null, // Allows the field to expand automatically
|
||||
maxLength: _characterLimit,
|
||||
style: TextStyle(color: Color(0xFF898C81), fontFamily: context.translate(
|
||||
'Roboto',
|
||||
'NotoKufi',
|
||||
),),
|
||||
style: TextStyle(
|
||||
color: isDarkTheme ? Colors.white : Color(0xFF898C81),
|
||||
fontFamily: context.translate(
|
||||
'Roboto',
|
||||
'NotoKufi',
|
||||
),
|
||||
),
|
||||
decoration: InputDecoration(
|
||||
hintText: context.translate(
|
||||
'Tell us how we can improve', 'أخبرنا كيف يمكننا التحسين'),
|
||||
hintStyle: TextStyle(color: Color(0xFF898C81), fontFamily: context.translate(
|
||||
'Roboto',
|
||||
'NotoKufi',
|
||||
),),
|
||||
hintStyle: TextStyle(
|
||||
color: isDarkTheme ? Colors.white : Color(0xFF898C81),
|
||||
fontFamily: context.translate(
|
||||
'Roboto',
|
||||
'NotoKufi',
|
||||
),
|
||||
),
|
||||
border: OutlineInputBorder(
|
||||
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
|
||||
enabledBorder: OutlineInputBorder(
|
||||
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
|
||||
errorBorder: OutlineInputBorder(
|
||||
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
|
||||
focusedErrorBorder: OutlineInputBorder(
|
||||
borderRadius: BorderRadius.circular(10.0),
|
||||
borderSide: BorderSide(color: Color(0xFFD83731), width: 1),
|
||||
borderSide: BorderSide(color: Color(0xFFD83731), width: 2),
|
||||
),
|
||||
|
||||
errorText:
|
||||
_hasError ? _errorMessage : null, // Show error below field
|
||||
errorStyle: TextStyle(
|
||||
color: Color(0xFFD83731),
|
||||
),
|
||||
),
|
||||
onChanged: (text) {
|
||||
// Trigger re-validation and character limit on each change
|
||||
@ -532,9 +645,10 @@ class _FeedbackFormState extends ConsumerState<FeedbackForm>
|
||||
fontWeight: FontWeight.w600,
|
||||
),
|
||||
),
|
||||
backgroundColor: WidgetStatePropertyAll(
|
||||
MyTheme.topicColor(IndicatorTopic.environment),
|
||||
),
|
||||
backgroundColor: WidgetStatePropertyAll(Color(0xFFB68A34)),
|
||||
// backgroundColor: WidgetStatePropertyAll(
|
||||
// MyTheme.topicColor(IndicatorTopic.environment),
|
||||
// ),
|
||||
foregroundColor: const WidgetStatePropertyAll(
|
||||
Colors.white,
|
||||
),
|
||||
@ -548,16 +662,18 @@ class _FeedbackFormState extends ConsumerState<FeedbackForm>
|
||||
'إرسال',
|
||||
),
|
||||
style: TextStyle(
|
||||
fontFamily: context.translate(
|
||||
'Roboto',
|
||||
'NotoKufi',
|
||||
)
|
||||
fontFamily: context.translate(
|
||||
'Roboto',
|
||||
'NotoKufi',
|
||||
),
|
||||
color: isDarkTheme ? Colors.black : Colors.white,
|
||||
),
|
||||
),
|
||||
6.horizontalSpace,
|
||||
const Icon(
|
||||
Icon(
|
||||
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;
|
||||
return Center(
|
||||
child: Column(
|
||||
@ -612,18 +728,26 @@ class _FeedbackFormState extends ConsumerState<FeedbackForm>
|
||||
|
||||
Text(
|
||||
'${AppLocalizations.of(context)!.thankYou} $userName !',
|
||||
style: TextStyle(fontSize: 24, fontWeight: FontWeight.bold, fontFamily: context.translate(
|
||||
'Roboto',
|
||||
'NotoKufi',
|
||||
),),
|
||||
style: TextStyle(
|
||||
fontSize: 24,
|
||||
fontWeight: FontWeight.bold,
|
||||
fontFamily: context.translate(
|
||||
'Roboto',
|
||||
'NotoKufi',
|
||||
),
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 15),
|
||||
Text(
|
||||
AppLocalizations.of(context)!.feedback_message,
|
||||
style: TextStyle(fontSize: 16, color: Color(0xFF898C81), fontFamily: context.translate(
|
||||
'Roboto',
|
||||
'NotoKufi',
|
||||
),),
|
||||
style: TextStyle(
|
||||
fontSize: 16,
|
||||
color: isDarkTheme ? Colors.white : Color(0xFF898C81),
|
||||
fontFamily: context.translate(
|
||||
'Roboto',
|
||||
'NotoKufi',
|
||||
),
|
||||
),
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
// const SizedBox(height: 30),
|
||||
@ -638,7 +762,7 @@ class _FeedbackFormState extends ConsumerState<FeedbackForm>
|
||||
}
|
||||
|
||||
// New widget for failure message
|
||||
Widget _buildFailureMessage() {
|
||||
Widget _buildFailureMessage(bool isDarkTheme) {
|
||||
double screenHeight = MediaQuery.of(context).size.height;
|
||||
double screenWidth = MediaQuery.of(context).size.width;
|
||||
return Center(
|
||||
@ -682,14 +806,18 @@ class _FeedbackFormState extends ConsumerState<FeedbackForm>
|
||||
),
|
||||
fontSize: 24,
|
||||
fontWeight: FontWeight.bold,
|
||||
color: Color(0xFF414042)),
|
||||
color: isDarkTheme ? Colors.white : Color(0xFF414042)),
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
Text(AppLocalizations.of(context)!.feedback_failed_msg,
|
||||
style: TextStyle(fontSize: 16, color: Color(0xFF898C81), fontFamily: context.translate(
|
||||
'Roboto',
|
||||
'NotoKufi',
|
||||
),),
|
||||
style: TextStyle(
|
||||
fontSize: 16,
|
||||
color: isDarkTheme ? Colors.white : Color(0xFF898C81),
|
||||
fontFamily: context.translate(
|
||||
'Roboto',
|
||||
'NotoKufi',
|
||||
),
|
||||
),
|
||||
textAlign: TextAlign.center),
|
||||
// const SizedBox(height: 30),
|
||||
// ElevatedButton(
|
||||
@ -710,6 +838,7 @@ class _FeedbackFormState extends ConsumerState<FeedbackForm>
|
||||
required Widget icon,
|
||||
required String label,
|
||||
required int index,
|
||||
required bool isDarkTheme,
|
||||
}) {
|
||||
bool isSelected = _selectedEmojiIndex == index;
|
||||
return GestureDetector(
|
||||
@ -746,7 +875,11 @@ class _FeedbackFormState extends ConsumerState<FeedbackForm>
|
||||
),
|
||||
fontWeight: FontWeight.w400,
|
||||
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,
|
||||
),
|
||||
),
|
||||
@ -785,6 +918,7 @@ class _FeedbackFormState extends ConsumerState<FeedbackForm>
|
||||
String label,
|
||||
double rating,
|
||||
Function(double) onRatingUpdate,
|
||||
bool isDarkTheme,
|
||||
) {
|
||||
return Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
@ -797,7 +931,8 @@ class _FeedbackFormState extends ConsumerState<FeedbackForm>
|
||||
'NotoKufi',
|
||||
),
|
||||
fontWeight: FontWeight.w400,
|
||||
color: Color(0xFF898C81),
|
||||
// color: Color(0xFF898C81),
|
||||
color: isDarkTheme ? Colors.white : Color(0xff898C81),
|
||||
)),
|
||||
RatingBar.builder(
|
||||
initialRating: rating,
|
||||
@ -839,12 +974,11 @@ class _FeedbackFormState extends ConsumerState<FeedbackForm>
|
||||
SnackBar(
|
||||
content: Text(
|
||||
AppLocalizations.of(context)!.formError,
|
||||
style: TextStyle(
|
||||
fontFamily: context.translate(
|
||||
'Roboto',
|
||||
'NotoKufi',
|
||||
)
|
||||
),
|
||||
style: TextStyle(
|
||||
fontFamily: context.translate(
|
||||
'Roboto',
|
||||
'NotoKufi',
|
||||
)),
|
||||
// "Please correct the errors before submitting."
|
||||
)),
|
||||
);
|
||||
@ -881,13 +1015,14 @@ class _FeedbackFormState extends ConsumerState<FeedbackForm>
|
||||
await _removeFeedbackText();
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
SnackBar(
|
||||
content: Text(AppLocalizations.of(context)!.feedback_submitted,
|
||||
content: Text(
|
||||
AppLocalizations.of(context)!.feedback_submitted,
|
||||
style: TextStyle(
|
||||
fontFamily: context.translate(
|
||||
'Roboto',
|
||||
'NotoKufi',
|
||||
)
|
||||
),),
|
||||
'Roboto',
|
||||
'NotoKufi',
|
||||
)),
|
||||
),
|
||||
),
|
||||
);
|
||||
setState(() {
|
||||
@ -903,12 +1038,11 @@ class _FeedbackFormState extends ConsumerState<FeedbackForm>
|
||||
content: Text(
|
||||
// "Failed to submit feedback: $e"
|
||||
AppLocalizations.of(context)!.feedback_failed(e.toString()),
|
||||
style: TextStyle(
|
||||
fontFamily: context.translate(
|
||||
'Roboto',
|
||||
'NotoKufi',
|
||||
)
|
||||
),
|
||||
style: TextStyle(
|
||||
fontFamily: context.translate(
|
||||
'Roboto',
|
||||
'NotoKufi',
|
||||
)),
|
||||
)),
|
||||
);
|
||||
setState(() {
|
||||
|
||||
@ -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/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';
|
||||
|
||||
class ManageUserRouter extends ConsumerStatefulWidget {
|
||||
late final Widget title;
|
||||
@ -153,13 +154,14 @@ class _ManageUserRouterState extends ConsumerState<ManageUserRouter> {
|
||||
});
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
SnackBar(
|
||||
content: Text(AppLocalizations.of(context)!.status_success,
|
||||
content: Text(
|
||||
AppLocalizations.of(context)!.status_success,
|
||||
style: TextStyle(
|
||||
fontFamily: context.translate(
|
||||
'Roboto',
|
||||
'NotoKufi',
|
||||
)
|
||||
),),
|
||||
'Roboto',
|
||||
'NotoKufi',
|
||||
)),
|
||||
),
|
||||
),
|
||||
);
|
||||
} catch (e) {
|
||||
@ -169,15 +171,15 @@ class _ManageUserRouterState extends ConsumerState<ManageUserRouter> {
|
||||
Navigator.of(context).pop();
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
SnackBar(
|
||||
content: Text(context.translate(
|
||||
'Error updating status: $e', '$e خطأ في تحديث الحالة: '),
|
||||
style: TextStyle(
|
||||
fontFamily: context.translate(
|
||||
'Roboto',
|
||||
'NotoKufi',
|
||||
)
|
||||
),
|
||||
)),
|
||||
content: Text(
|
||||
context.translate(
|
||||
'Error updating status: $e', '$e خطأ في تحديث الحالة: '),
|
||||
style: TextStyle(
|
||||
fontFamily: context.translate(
|
||||
'Roboto',
|
||||
'NotoKufi',
|
||||
)),
|
||||
)),
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -307,7 +309,9 @@ class _ManageUserRouterState extends ConsumerState<ManageUserRouter> {
|
||||
child: Text(
|
||||
// 'Yes',
|
||||
AppLocalizations.of(context)!.yes,
|
||||
style: TextStyle(color: Colors.white, fontSize: 16,
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 16,
|
||||
fontFamily: context.translate(
|
||||
'Roboto',
|
||||
'NotoKufi',
|
||||
@ -357,10 +361,9 @@ class _ManageUserRouterState extends ConsumerState<ManageUserRouter> {
|
||||
AppLocalizations.of(context)!.manage_user,
|
||||
style: TextStyle(
|
||||
fontFamily: context.translate(
|
||||
'Roboto',
|
||||
'NotoKufi',
|
||||
)
|
||||
),
|
||||
'Roboto',
|
||||
'NotoKufi',
|
||||
)),
|
||||
),
|
||||
body: isLoading
|
||||
? Container(
|
||||
@ -440,7 +443,8 @@ class _ManageUserRouterState extends ConsumerState<ManageUserRouter> {
|
||||
hintText: AppLocalizations.of(context)!.search,
|
||||
hintStyle: TextStyle(
|
||||
color: Color(0xFFAA8E83),
|
||||
fontFamily: context.translate('Roboto', 'NotoKufi'),
|
||||
fontFamily:
|
||||
context.translate('Roboto', 'NotoKufi'),
|
||||
fontSize: 14,
|
||||
height: 2.5, // Helps with vertical alignment
|
||||
),
|
||||
@ -460,7 +464,8 @@ class _ManageUserRouterState extends ConsumerState<ManageUserRouter> {
|
||||
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,
|
||||
),
|
||||
onChanged: filterUsers,
|
||||
@ -536,10 +541,9 @@ class _ManageUserRouterState extends ConsumerState<ManageUserRouter> {
|
||||
AppLocalizations.of(context)!.user_name,
|
||||
style: TextStyle(
|
||||
fontFamily: context.translate(
|
||||
'Roboto',
|
||||
'NotoKufi',
|
||||
)
|
||||
),
|
||||
'Roboto',
|
||||
'NotoKufi',
|
||||
)),
|
||||
),
|
||||
onSort: (columnIndex, ascending) {
|
||||
_sort(
|
||||
@ -554,10 +558,9 @@ class _ManageUserRouterState extends ConsumerState<ManageUserRouter> {
|
||||
AppLocalizations.of(context)!.email_id,
|
||||
style: TextStyle(
|
||||
fontFamily: context.translate(
|
||||
'Roboto',
|
||||
'NotoKufi',
|
||||
)
|
||||
),
|
||||
'Roboto',
|
||||
'NotoKufi',
|
||||
)),
|
||||
),
|
||||
onSort: (columnIndex, ascending) {
|
||||
_sort(
|
||||
@ -572,10 +575,9 @@ class _ManageUserRouterState extends ConsumerState<ManageUserRouter> {
|
||||
AppLocalizations.of(context)!.reg_date,
|
||||
style: TextStyle(
|
||||
fontFamily: context.translate(
|
||||
'Roboto',
|
||||
'NotoKufi',
|
||||
)
|
||||
),
|
||||
'Roboto',
|
||||
'NotoKufi',
|
||||
)),
|
||||
),
|
||||
onSort: (columnIndex, ascending) {
|
||||
_sort(
|
||||
@ -591,10 +593,9 @@ class _ManageUserRouterState extends ConsumerState<ManageUserRouter> {
|
||||
AppLocalizations.of(context)!.status,
|
||||
style: TextStyle(
|
||||
fontFamily: context.translate(
|
||||
'Roboto',
|
||||
'NotoKufi',
|
||||
)
|
||||
),
|
||||
'Roboto',
|
||||
'NotoKufi',
|
||||
)),
|
||||
),
|
||||
onSort: (columnIndex, ascending) {
|
||||
_sort(
|
||||
@ -616,7 +617,8 @@ class _ManageUserRouterState extends ConsumerState<ManageUserRouter> {
|
||||
context)!
|
||||
.no_result_found,
|
||||
style: TextStyle(
|
||||
fontFamily: context.translate(
|
||||
fontFamily: context
|
||||
.translate(
|
||||
'Roboto',
|
||||
'NotoKufi',
|
||||
),
|
||||
@ -634,38 +636,34 @@ class _ManageUserRouterState extends ConsumerState<ManageUserRouter> {
|
||||
return DataRow(
|
||||
cells: [
|
||||
DataCell(
|
||||
Text(
|
||||
user.userName,
|
||||
style: TextStyle(
|
||||
fontFamily: context.translate(
|
||||
'Roboto',
|
||||
'NotoKufi',
|
||||
)
|
||||
),
|
||||
),
|
||||
|
||||
),
|
||||
DataCell(
|
||||
Text(
|
||||
user.emailId,
|
||||
style: TextStyle(
|
||||
fontFamily: context.translate(
|
||||
'Roboto',
|
||||
'NotoKufi',
|
||||
)
|
||||
),
|
||||
Text(
|
||||
user.userName,
|
||||
style: TextStyle(
|
||||
fontFamily:
|
||||
context.translate(
|
||||
'Roboto',
|
||||
'NotoKufi',
|
||||
)),
|
||||
DataCell(
|
||||
Text(
|
||||
user.registrationDate,
|
||||
style: TextStyle(
|
||||
fontFamily: context.translate(
|
||||
'Roboto',
|
||||
'NotoKufi',
|
||||
)
|
||||
),
|
||||
)
|
||||
),
|
||||
),
|
||||
DataCell(Text(
|
||||
user.emailId,
|
||||
style: TextStyle(
|
||||
fontFamily:
|
||||
context.translate(
|
||||
'Roboto',
|
||||
'NotoKufi',
|
||||
)),
|
||||
)),
|
||||
DataCell(Text(
|
||||
user.registrationDate,
|
||||
style: TextStyle(
|
||||
fontFamily:
|
||||
context.translate(
|
||||
'Roboto',
|
||||
'NotoKufi',
|
||||
)),
|
||||
)),
|
||||
DataCell(
|
||||
DropdownButton<String>(
|
||||
value: user.status,
|
||||
@ -677,7 +675,8 @@ class _ManageUserRouterState extends ConsumerState<ManageUserRouter> {
|
||||
child: Text(
|
||||
status.value,
|
||||
style: TextStyle(
|
||||
fontFamily: context.translate(
|
||||
fontFamily:
|
||||
context.translate(
|
||||
'Roboto',
|
||||
'NotoKufi',
|
||||
),
|
||||
|
||||
@ -8,12 +8,14 @@ import 'package:pocketbase/pocketbase.dart';
|
||||
import 'package:shared_preferences/shared_preferences.dart';
|
||||
import 'package:uae_stat/config/api_config.dart';
|
||||
import 'package:uae_stat/config/connectivity_provider.dart';
|
||||
import 'package:uae_stat/config/theme/theme_provider.dart';
|
||||
import 'package:uae_stat/config/toggle_lang_service.dart';
|
||||
import 'package:uae_stat/domain/use_cases/language.dart';
|
||||
import 'package:uae_stat/presentation/components/indicators/locale_provider.dart';
|
||||
import '../../custom_drawer_routes.dart';
|
||||
import 'package:http/http.dart' as http;
|
||||
import 'package:flutter_gen/gen_l10n/app_localizations.dart';
|
||||
// import 'package:uae_stat/l10n/app_localizations.dart';
|
||||
|
||||
class NotificationPage extends ConsumerStatefulWidget {
|
||||
@override
|
||||
@ -26,13 +28,17 @@ class _NotificationPageState extends ConsumerState<NotificationPage> {
|
||||
bool isLoading = true;
|
||||
List<Map<String, dynamic>> notifications = [];
|
||||
List<String> userReadedNotiOrNot = [];
|
||||
String notificationCount='';
|
||||
String notificationCount = '';
|
||||
|
||||
List<dynamic> homePageData = [];
|
||||
List<dynamic> filteredData = [];
|
||||
|
||||
// Current selected tab index
|
||||
int selectedTabIndex = 0;
|
||||
late final Locale locale;
|
||||
dynamic userID;
|
||||
late UserService _userService;
|
||||
late ThemeMode currentTheme;
|
||||
|
||||
// Tab categories
|
||||
// final List<String> tabs = [
|
||||
@ -50,17 +56,56 @@ class _NotificationPageState extends ConsumerState<NotificationPage> {
|
||||
locale = ref.read(localeProvider) ?? const Locale('en');
|
||||
_userService = UserService();
|
||||
_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 {
|
||||
_userService = UserService();
|
||||
await _fetchUserData();();
|
||||
await fetchNotifications(locale?.languageCode ?? 'en');
|
||||
_processNotifications(notifications , userReadedNotiOrNot);
|
||||
await _fetchUserData();
|
||||
();
|
||||
await fetchNotifications(locale?.languageCode ?? 'en');
|
||||
_processNotifications(notifications, userReadedNotiOrNot);
|
||||
}
|
||||
|
||||
void _processNotifications( List<Map<String, dynamic>> notification ,List<String> push ){
|
||||
print ('inside last function ${notification.length}');
|
||||
void _processNotifications(
|
||||
List<Map<String, dynamic>> notification, List<String> push) {
|
||||
print('inside last function ${notification.length}');
|
||||
print('inside last function ${push.length}');
|
||||
|
||||
int count = 0;
|
||||
@ -70,9 +115,11 @@ class _NotificationPageState extends ConsumerState<NotificationPage> {
|
||||
}
|
||||
}
|
||||
print('count is $count');
|
||||
if(count>0){
|
||||
notificationCount='($count)';}
|
||||
else{notificationCount='';}
|
||||
if (count > 0) {
|
||||
notificationCount = '($count)';
|
||||
} else {
|
||||
notificationCount = '';
|
||||
}
|
||||
}
|
||||
|
||||
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 {
|
||||
final localeCode = next?.languageCode ?? 'en'; // Default to 'en' if null
|
||||
final localeCode = next?.languageCode ?? 'en';
|
||||
setState(() {
|
||||
isLoading = true;
|
||||
});
|
||||
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 = [
|
||||
{'title': AppLocalizations.of(context)!.all_updates},
|
||||
{'title': AppLocalizations.of(context)!.app_updates},
|
||||
@ -210,6 +301,8 @@ class _NotificationPageState extends ConsumerState<NotificationPage> {
|
||||
context.go('/myhomepage');
|
||||
},
|
||||
child: BaseScaffold(
|
||||
backgroundColor: isDarkTheme ? Color(0xFF111111) : Colors.white,
|
||||
appbarColor: isDarkTheme ? Color(0xFF111111) : Colors.white,
|
||||
title: Text(
|
||||
context.translate(
|
||||
'Notification $notificationCount',
|
||||
@ -217,14 +310,16 @@ class _NotificationPageState extends ConsumerState<NotificationPage> {
|
||||
),
|
||||
style: TextStyle(
|
||||
fontFamily: context.translate(
|
||||
'Roboto',
|
||||
'NotoKufi',
|
||||
)
|
||||
),
|
||||
'Roboto',
|
||||
'NotoKufi',
|
||||
)),
|
||||
),
|
||||
body: isLoading
|
||||
? Container(
|
||||
color: Color(0x98FFFCE5), // Semi-transparent background
|
||||
// color: Color(0x98FFFCE5), // Semi-transparent background
|
||||
color: isDarkTheme
|
||||
? Color(0xFF111111)
|
||||
: Color(0x98FFFCE5), // Semi-transparent background
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
@ -247,6 +342,7 @@ class _NotificationPageState extends ConsumerState<NotificationPage> {
|
||||
TabBarHeader(
|
||||
tabs: tabs.map((tab) => tab['title'] as String).toList(),
|
||||
selectedIndex: selectedTabIndex,
|
||||
isDarkTheme: isDarkTheme,
|
||||
onTabSelected: (index) {
|
||||
setState(() {
|
||||
selectedTabIndex = index;
|
||||
@ -265,10 +361,13 @@ class _NotificationPageState extends ConsumerState<NotificationPage> {
|
||||
Text(
|
||||
'No notifications available.',
|
||||
style: TextStyle(
|
||||
fontSize: 16, color: Colors.grey, fontFamily: context.translate(
|
||||
'Roboto',
|
||||
'NotoKufi',
|
||||
),),
|
||||
fontSize: 16,
|
||||
color: Colors.grey,
|
||||
fontFamily: context.translate(
|
||||
'Roboto',
|
||||
'NotoKufi',
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
@ -295,6 +394,7 @@ class _NotificationPageState extends ConsumerState<NotificationPage> {
|
||||
id: notification['id'],
|
||||
userReadedNotiOrNot: userReadedNotiOrNot,
|
||||
userID: userID,
|
||||
isDarkTheme: isDarkTheme,
|
||||
),
|
||||
);
|
||||
},
|
||||
@ -311,17 +411,19 @@ class TabBarHeader extends StatelessWidget {
|
||||
final List<String> tabs;
|
||||
final int selectedIndex;
|
||||
final ValueChanged<int> onTabSelected;
|
||||
bool isDarkTheme;
|
||||
|
||||
const TabBarHeader({
|
||||
TabBarHeader({
|
||||
required this.tabs,
|
||||
required this.selectedIndex,
|
||||
required this.onTabSelected,
|
||||
required this.isDarkTheme,
|
||||
});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Container(
|
||||
color: Colors.grey[200],
|
||||
color: isDarkTheme ? Color(0xFF111111) : Colors.grey[200],
|
||||
padding: const EdgeInsets.symmetric(vertical: 8),
|
||||
child: SingleChildScrollView(
|
||||
scrollDirection: Axis.horizontal,
|
||||
@ -342,12 +444,14 @@ class TabBarHeader extends StatelessWidget {
|
||||
: Colors.grey[700];
|
||||
}),
|
||||
),
|
||||
child: Text(text,
|
||||
child: Text(
|
||||
text,
|
||||
style: TextStyle(
|
||||
fontFamily: context.translate(
|
||||
'Roboto',
|
||||
'NotoKufi',
|
||||
), ),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
if (index < tabs.length - 1) buildDivider(),
|
||||
@ -379,8 +483,9 @@ class NotificationTile extends StatelessWidget {
|
||||
final String id;
|
||||
final String userID;
|
||||
final List<String> userReadedNotiOrNot;
|
||||
bool isDarkTheme;
|
||||
|
||||
const NotificationTile({
|
||||
NotificationTile({
|
||||
required this.title,
|
||||
required this.message,
|
||||
required this.date,
|
||||
@ -388,6 +493,7 @@ class NotificationTile extends StatelessWidget {
|
||||
required this.id,
|
||||
required this.userID,
|
||||
required this.userReadedNotiOrNot,
|
||||
required this.isDarkTheme,
|
||||
});
|
||||
|
||||
@override
|
||||
@ -411,11 +517,19 @@ class NotificationTile extends StatelessWidget {
|
||||
child: ListTile(
|
||||
leading: isPushed
|
||||
? 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,
|
||||
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,
|
||||
fontFamily: context.translate(
|
||||
'Roboto',
|
||||
@ -426,7 +540,13 @@ class NotificationTile extends StatelessWidget {
|
||||
subtitle: Text(
|
||||
date,
|
||||
style: TextStyle(
|
||||
color: isPushed ? const Color(0xFF8E8E8E) : const Color(0x998E8E8E),
|
||||
color: isPushed
|
||||
? isDarkTheme
|
||||
? Colors.white
|
||||
: Color(0xFF8E8E8E)
|
||||
: isDarkTheme
|
||||
? Colors.white
|
||||
: Color(0x998E8E8E),
|
||||
fontSize: 12,
|
||||
fontWeight: FontWeight.w400,
|
||||
fontFamily: context.translate(
|
||||
|
||||
@ -7,6 +7,7 @@ import 'package:pocketbase/pocketbase.dart';
|
||||
import 'package:shared_preferences/shared_preferences.dart';
|
||||
import 'package:uae_stat/config/api_config.dart';
|
||||
import 'package:uae_stat/config/connectivity_provider.dart';
|
||||
import 'package:uae_stat/config/theme/theme_provider.dart';
|
||||
import 'package:uae_stat/config/toggle_lang_service.dart';
|
||||
import 'package:uae_stat/domain/use_cases/language.dart';
|
||||
import 'package:uae_stat/presentation/components/indicators/locale_provider.dart';
|
||||
@ -42,6 +43,10 @@ class _NotificationDetailsState extends ConsumerState<NotificationDetails> {
|
||||
bool isLoading = true;
|
||||
late UserService _userService;
|
||||
|
||||
late ThemeMode currentTheme;
|
||||
List<dynamic> homePageData = [];
|
||||
List<dynamic> filteredData = [];
|
||||
|
||||
// Current selected tab index
|
||||
int selectedTabIndex = 0;
|
||||
late final Locale locale;
|
||||
@ -54,6 +59,19 @@ class _NotificationDetailsState extends ConsumerState<NotificationDetails> {
|
||||
locale = ref.read(localeProvider) ?? const Locale('en');
|
||||
_userService = UserService();
|
||||
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) {
|
||||
@ -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 {
|
||||
notificationID = widget.id;
|
||||
final baseUrl = apiUrl + '/api/getNotification';
|
||||
@ -129,6 +171,49 @@ class _NotificationDetailsState extends ConsumerState<NotificationDetails> {
|
||||
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(
|
||||
canPop: false,
|
||||
onPopInvokedWithResult: (didPop, result) {
|
||||
@ -136,6 +221,8 @@ class _NotificationDetailsState extends ConsumerState<NotificationDetails> {
|
||||
context.go('/notification');
|
||||
},
|
||||
child: BaseScaffold(
|
||||
backgroundColor: isDarkTheme ? Color(0xFF111111) : Colors.white,
|
||||
appbarColor: isDarkTheme ? Color(0xFF111111) : Colors.white,
|
||||
title: Text(
|
||||
context.translate(
|
||||
'Notification',
|
||||
@ -143,16 +230,17 @@ class _NotificationDetailsState extends ConsumerState<NotificationDetails> {
|
||||
),
|
||||
style: TextStyle(
|
||||
fontFamily: context.translate(
|
||||
'Roboto',
|
||||
'NotoKufi',
|
||||
)
|
||||
),
|
||||
'Roboto',
|
||||
'NotoKufi',
|
||||
)),
|
||||
),
|
||||
showBackButton: true,
|
||||
navBackArrow: Text(widget.backNavigation ?? 'Default Value'),
|
||||
body: isLoading
|
||||
? Container(
|
||||
color: Color(0x98FFFCE5), // Semi-transparent background
|
||||
color: isDarkTheme
|
||||
? Color(0xFF111111)
|
||||
: Color(0x98FFFCE5), // Semi-transparent background
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
@ -180,13 +268,12 @@ class _NotificationDetailsState extends ConsumerState<NotificationDetails> {
|
||||
style: TextStyle(
|
||||
fontSize: 18,
|
||||
fontWeight: FontWeight.w500,
|
||||
color: Color(0xFF414042),
|
||||
color:
|
||||
isDarkTheme ? Colors.white : Color(0xFF414042),
|
||||
fontFamily: context.translate(
|
||||
'Roboto',
|
||||
'NotoKufi',
|
||||
)
|
||||
),
|
||||
|
||||
)),
|
||||
),
|
||||
const SizedBox(height: 20),
|
||||
Center(
|
||||
@ -209,25 +296,26 @@ class _NotificationDetailsState extends ConsumerState<NotificationDetails> {
|
||||
style: TextStyle(
|
||||
fontSize: 14,
|
||||
fontWeight: FontWeight.w400,
|
||||
color: Color(0xFF414042),
|
||||
color:
|
||||
isDarkTheme ? Colors.white : Color(0xFF414042),
|
||||
fontFamily: context.translate(
|
||||
'Roboto',
|
||||
'NotoKufi',
|
||||
)
|
||||
),
|
||||
)),
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
Text(
|
||||
"Date: ${notification != null ? formatDate(notification!['created'] ?? '') : 'N/A'}",
|
||||
style: TextStyle(
|
||||
fontSize: 12,
|
||||
fontWeight: FontWeight.w400,
|
||||
color: Color(0xFF8E8E8E),
|
||||
fontSize: 12,
|
||||
fontWeight: FontWeight.w400,
|
||||
color: isDarkTheme
|
||||
? Colors.white
|
||||
: Color(0xFF8E8E8E),
|
||||
fontFamily: context.translate(
|
||||
'Roboto',
|
||||
'NotoKufi',
|
||||
)
|
||||
),
|
||||
)),
|
||||
),
|
||||
],
|
||||
),
|
||||
|
||||
@ -1,22 +1,132 @@
|
||||
import 'dart:convert';
|
||||
|
||||
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';
|
||||
|
||||
class aboutFCSC extends StatelessWidget {
|
||||
class aboutFCSC extends ConsumerStatefulWidget {
|
||||
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
|
||||
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(
|
||||
backgroundColor: isDarkTheme ? Colors.black : Colors.white,
|
||||
appbarColor: isDarkTheme ? Colors.black : Colors.white,
|
||||
showDivider: true,
|
||||
showBackButton: true,
|
||||
dividerColor: Colors.grey[300],
|
||||
appbarColor: Colors.white,
|
||||
// appbarColor: Colors.white,
|
||||
bottomColor: Colors.white,
|
||||
mycenterTitle: true,
|
||||
title: Text(
|
||||
context.translate('Getting Started','البدء'),
|
||||
context.translate('Getting Started', 'البدء'),
|
||||
style: TextStyle(
|
||||
fontFamily: context.translate(
|
||||
'Roboto',
|
||||
@ -31,70 +141,90 @@ class aboutFCSC extends StatelessWidget {
|
||||
body: SingleChildScrollView(
|
||||
physics: ClampingScrollPhysics(),
|
||||
child: Container(
|
||||
width: MediaQuery.of(context).size.width,
|
||||
height: MediaQuery.of(context).size.height,
|
||||
color: Colors.white,
|
||||
width: MediaQuery.of(context).size.width,
|
||||
height: MediaQuery.of(context).size.height,
|
||||
color: isDarkTheme ? Colors.black : Colors.white,
|
||||
padding: EdgeInsets.all(16),
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
Align(
|
||||
alignment: Alignment.topLeft,
|
||||
child: Text(
|
||||
context.translate('About FCSC','حول التطبيق'),
|
||||
style: TextStyle(
|
||||
fontSize: 20,
|
||||
color: Color(0xFF414042),
|
||||
fontWeight: FontWeight.w600,
|
||||
fontFamily: context.translate(
|
||||
'Roboto',
|
||||
'NotoKufi',
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
Align(
|
||||
alignment: Alignment.topLeft,
|
||||
child: Text(
|
||||
context.translate('About FCSC', 'حول التطبيق'),
|
||||
style: TextStyle(
|
||||
fontSize: 20,
|
||||
color: isDarkTheme ? Colors.white : Color(0xFF414042),
|
||||
fontWeight: FontWeight.w600,
|
||||
fontFamily: context.translate(
|
||||
'Roboto',
|
||||
'NotoKufi',
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
width: MediaQuery.of(context).size.width,
|
||||
height: MediaQuery.of(context).size.height * 0.36,
|
||||
child: Image.asset(
|
||||
'assets/user_guide/AboutFCSC.png',
|
||||
fit: BoxFit.contain,
|
||||
SizedBox(
|
||||
width: MediaQuery.of(context).size.width,
|
||||
height: MediaQuery.of(context).size.height * 0.36,
|
||||
child: Image.asset(
|
||||
'assets/user_guide/AboutFCSC.png',
|
||||
fit: BoxFit.contain,
|
||||
),
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
height: 5,
|
||||
),
|
||||
RichText(
|
||||
text: TextSpan(
|
||||
text: context.translate('The ',
|
||||
'تم تصميم تطبيق المركز الاتحادي للتنافسية والإحصاء (FCSC) لتوفير وصول المستخدمين المسجلين والمعتمدين إلى إحصائيات دقيقة وشاملة حول دولة الإمارات. يعمل التطبيق كمنصة مركزية لاستكشاف البيانات الرئيسية والاتجاهات والرؤى عبر مختلف القطاعات، مما يسهل الوصول إلى المعلومات الضرورية لدعم اتخاذ القرارات والتحليلات.',),
|
||||
style: TextStyle(
|
||||
color: Colors.grey, fontSize: 16, fontFamily: context.translate(
|
||||
'Roboto',
|
||||
'NotoKufi',
|
||||
), height: 1.4,),
|
||||
children: <TextSpan>[
|
||||
TextSpan(
|
||||
text:
|
||||
context.translate(' Federal Competitiveness and Statistics Centre (FCSC),',''),
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.bold,
|
||||
color: Color(0xFF414042),
|
||||
fontFamily: context.translate(
|
||||
'Roboto',
|
||||
'NotoKufi',
|
||||
),),
|
||||
SizedBox(
|
||||
height: 5,
|
||||
),
|
||||
RichText(
|
||||
text: TextSpan(
|
||||
text: context.translate(
|
||||
'The ',
|
||||
'تم تصميم تطبيق المركز الاتحادي للتنافسية والإحصاء (FCSC) لتوفير وصول المستخدمين المسجلين والمعتمدين إلى إحصائيات دقيقة وشاملة حول دولة الإمارات. يعمل التطبيق كمنصة مركزية لاستكشاف البيانات الرئيسية والاتجاهات والرؤى عبر مختلف القطاعات، مما يسهل الوصول إلى المعلومات الضرورية لدعم اتخاذ القرارات والتحليلات.',
|
||||
),
|
||||
TextSpan(
|
||||
text:
|
||||
context.translate(' in your App is designed to provide registered and approved users with access to accurate and comprehensive statistics about the UAE. The app serves as a centralized platform for exploring key datasets, trends, and insights across various sectors.',''),),
|
||||
],
|
||||
style: TextStyle(
|
||||
color: isDarkTheme ? Colors.white : Colors.grey,
|
||||
fontSize: 16,
|
||||
fontFamily: context.translate(
|
||||
'Roboto',
|
||||
'NotoKufi',
|
||||
),
|
||||
height: 1.4,
|
||||
),
|
||||
children: <TextSpan>[
|
||||
TextSpan(
|
||||
text: context.translate(
|
||||
' Federal Competitiveness and Statistics Centre (FCSC),',
|
||||
''),
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.bold,
|
||||
color: isDarkTheme ? Colors.white : Color(0xFF414042),
|
||||
fontFamily: context.translate(
|
||||
'Roboto',
|
||||
'NotoKufi',
|
||||
),
|
||||
),
|
||||
),
|
||||
TextSpan(
|
||||
text: context.translate(
|
||||
' in your App is designed to provide registered and approved users with access to accurate and comprehensive statistics about the UAE. The app serves as a centralized platform for exploring key datasets, trends, and insights across various sectors.',
|
||||
''),
|
||||
style: TextStyle(
|
||||
color: isDarkTheme ? Colors.white : Colors.grey,
|
||||
// fontSize: 16,
|
||||
fontFamily: context.translate(
|
||||
'Roboto',
|
||||
'NotoKufi',
|
||||
),
|
||||
height: 1.4,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
height: 20,
|
||||
),
|
||||
],),
|
||||
SizedBox(
|
||||
height: 20,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
@ -1,14 +1,121 @@
|
||||
import 'dart:convert';
|
||||
|
||||
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';
|
||||
|
||||
|
||||
class GetStarted extends StatelessWidget {
|
||||
class GetStarted extends ConsumerStatefulWidget {
|
||||
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
|
||||
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(
|
||||
data: ThemeData(
|
||||
fontFamily: context.translate(
|
||||
@ -16,21 +123,27 @@ class GetStarted extends StatelessWidget {
|
||||
'NotoKufi',
|
||||
), // Set default font family for this page
|
||||
textTheme: TextTheme(
|
||||
bodyMedium: TextStyle(fontSize: 16, color: Color(0xFF898C81),fontFamily: context.translate(
|
||||
'Roboto',
|
||||
'NotoKufi',
|
||||
),),
|
||||
bodyMedium: TextStyle(
|
||||
fontSize: 16,
|
||||
color: Color(0xFF898C81),
|
||||
fontFamily: context.translate(
|
||||
'Roboto',
|
||||
'NotoKufi',
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
child: BaseScaffold(
|
||||
backgroundColor: isDarkTheme ? Colors.black : Colors.white,
|
||||
appbarColor: isDarkTheme ? Colors.black : Colors.white,
|
||||
showDivider: true,
|
||||
showBackButton: true,
|
||||
dividerColor: Colors.grey[300],
|
||||
appbarColor: Colors.white,
|
||||
// appbarColor: Colors.white,
|
||||
bottomColor: Colors.white,
|
||||
mycenterTitle: true,
|
||||
title: Text(
|
||||
context.translate('Getting Started','البدء'),
|
||||
context.translate('Getting Started', 'البدء'),
|
||||
style: TextStyle(
|
||||
fontFamily: context.translate(
|
||||
'Roboto',
|
||||
@ -44,7 +157,7 @@ class GetStarted extends StatelessWidget {
|
||||
),
|
||||
body: Container(
|
||||
height: double.infinity,
|
||||
color: Colors.white,
|
||||
color: isDarkTheme ? Colors.black : Colors.white,
|
||||
padding: EdgeInsets.all(16),
|
||||
child: SingleChildScrollView(
|
||||
child: Column(
|
||||
@ -52,47 +165,58 @@ class GetStarted extends StatelessWidget {
|
||||
children: [
|
||||
Align(
|
||||
alignment: Alignment.topLeft,
|
||||
child: Text(context.translate('How to Get Started','كيفية البدء'),
|
||||
style:
|
||||
TextStyle(
|
||||
child: Text(
|
||||
context.translate('How to Get Started', 'كيفية البدء'),
|
||||
style: TextStyle(
|
||||
fontFamily: context.translate(
|
||||
'Roboto',
|
||||
'NotoKufi',
|
||||
),
|
||||
fontSize:20,
|
||||
color: Color(0xFF414042),
|
||||
fontSize: 20,
|
||||
color: isDarkTheme ? Colors.white : Color(0xFF414042),
|
||||
fontWeight: FontWeight.w600,
|
||||
),),
|
||||
),
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
width:MediaQuery.of(context).size.width,
|
||||
height:MediaQuery.of(context).size.height * 0.36,
|
||||
width: MediaQuery.of(context).size.width,
|
||||
height: MediaQuery.of(context).size.height * 0.36,
|
||||
child: Image.asset(
|
||||
'assets/user_guide/getStarted.png',
|
||||
fit: BoxFit.contain,
|
||||
),
|
||||
),
|
||||
|
||||
Text(
|
||||
context.translate(
|
||||
'1. Download the app from the App Store or Google Play Store.',
|
||||
'1 .قم بتحميل التطبيق من متجر التطبيقات (Appstore) أو متجر جوجل بلاي (Google Play)..',
|
||||
'1. Download the app from the App Store or Google Play Store.',
|
||||
'1 .قم بتحميل التطبيق من متجر التطبيقات (Appstore) أو متجر جوجل بلاي (Google Play)..',
|
||||
),
|
||||
textAlign: TextAlign.justify, // Align the text
|
||||
softWrap: true,
|
||||
),
|
||||
SizedBox(height: 2,),
|
||||
Text(
|
||||
context.translate(
|
||||
'2. Log in to access advanced features',
|
||||
'2 .قم بتسجيل الدخول لفتح الميزات المتقدمة.',),
|
||||
textAlign: TextAlign.justify, // Align the text
|
||||
softWrap: true,
|
||||
style: TextStyle(
|
||||
color: isDarkTheme ? Colors.white : Colors.black54,
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
height:MediaQuery.of(context).size.height * 0.12,
|
||||
height: 2,
|
||||
),
|
||||
Text(
|
||||
context.translate(
|
||||
'2. Log in to access advanced features',
|
||||
'2 .قم بتسجيل الدخول لفتح الميزات المتقدمة.',
|
||||
),
|
||||
textAlign: TextAlign.justify, // Align the text
|
||||
softWrap: true,
|
||||
style: TextStyle(
|
||||
color: isDarkTheme ? Colors.white : Colors.black54,
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
height: MediaQuery.of(context).size.height * 0.12,
|
||||
),
|
||||
SizedBox(
|
||||
height: 20,
|
||||
),
|
||||
SizedBox(height: 20,),
|
||||
],
|
||||
),
|
||||
),
|
||||
|
||||
@ -1,14 +1,123 @@
|
||||
import 'dart:convert';
|
||||
|
||||
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 '../../../../../../infrastructure/services/img_asset_paths/banner_asset_path.dart';
|
||||
import '../../../custom_drawer_routes.dart';
|
||||
|
||||
class AppFeatures extends StatelessWidget {
|
||||
AppFeatures({super.key});
|
||||
class AppFeatures extends ConsumerStatefulWidget {
|
||||
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
|
||||
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(
|
||||
data: ThemeData(
|
||||
fontFamily: context.translate(
|
||||
@ -20,14 +129,16 @@ class AppFeatures extends StatelessWidget {
|
||||
),
|
||||
),
|
||||
child: BaseScaffold(
|
||||
backgroundColor: isDarkTheme ? Color(0xFF111111) : Colors.white,
|
||||
appbarColor: isDarkTheme ? Color(0xFF111111) : Colors.white,
|
||||
showDivider: true,
|
||||
showBackButton: true,
|
||||
bottomColor: Colors.white,
|
||||
dividerColor: Colors.grey[300],
|
||||
appbarColor: Colors.white,
|
||||
// appbarColor: Colors.white,
|
||||
mycenterTitle: true,
|
||||
title: Text(
|
||||
context.translate('Key Features','الميزات الرئيسية'),
|
||||
context.translate('Key Features', 'الميزات الرئيسية'),
|
||||
style: TextStyle(
|
||||
fontFamily: context.translate(
|
||||
'Roboto',
|
||||
@ -41,7 +152,8 @@ class AppFeatures extends StatelessWidget {
|
||||
),
|
||||
body: Container(
|
||||
width: double.infinity,
|
||||
color: Colors.white,
|
||||
color: isDarkTheme ? Color(0xFF111111) : Colors.white,
|
||||
// color: Colors.white,
|
||||
padding: EdgeInsets.all(16),
|
||||
child: SingleChildScrollView(
|
||||
child: Column(
|
||||
@ -50,77 +162,101 @@ class AppFeatures extends StatelessWidget {
|
||||
Align(
|
||||
alignment: Alignment.topLeft,
|
||||
child: Text(
|
||||
context.translate('App Features','الميزات الرئيسية'),
|
||||
style:
|
||||
TextStyle(
|
||||
context.translate('App Features', 'الميزات الرئيسية'),
|
||||
style: TextStyle(
|
||||
fontFamily: context.translate(
|
||||
'Roboto',
|
||||
'NotoKufi',
|
||||
),
|
||||
fontSize:20,
|
||||
color: Color(0xFF414042),
|
||||
fontSize: 20,
|
||||
color: isDarkTheme ? Colors.white : Color(0xFF414042),
|
||||
fontWeight: FontWeight.w600,
|
||||
),),
|
||||
),
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
width:MediaQuery.of(context).size.width,
|
||||
height:MediaQuery.of(context).size.height * 0.36,
|
||||
width: MediaQuery.of(context).size.width,
|
||||
height: MediaQuery.of(context).size.height * 0.36,
|
||||
child: Image.asset(
|
||||
'assets/user_guide/appFeatures.png',
|
||||
fit: BoxFit.contain,
|
||||
),
|
||||
),
|
||||
Text(
|
||||
context.translate('1. Comprehensive Statistics:','1. رؤى مستندة إلى البيانات '),
|
||||
style:TextStyle(
|
||||
context.translate('1. Comprehensive Statistics:',
|
||||
'1. رؤى مستندة إلى البيانات '),
|
||||
style: TextStyle(
|
||||
fontFamily: context.translate(
|
||||
'Roboto',
|
||||
'NotoKufi',
|
||||
),
|
||||
fontSize:16,
|
||||
color: Color(0xFF414042),
|
||||
fontSize: 16,
|
||||
color: isDarkTheme ? Colors.white : Color(0xFF414042),
|
||||
fontWeight: FontWeight.w600,
|
||||
),
|
||||
),
|
||||
SizedBox(height: 8),
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(left:7.0),
|
||||
padding: const EdgeInsets.only(left: 7.0),
|
||||
child: Column(
|
||||
children: [
|
||||
Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(top : 6.0),
|
||||
child: Icon(Icons.brightness_1, size: 5),
|
||||
padding: const EdgeInsets.only(top: 6.0),
|
||||
child: Icon(
|
||||
Icons.brightness_1,
|
||||
size: 5,
|
||||
color: isDarkTheme ? Colors.white : Colors.black,
|
||||
),
|
||||
), // Bullet point
|
||||
SizedBox(width: 8), // Space between bullet and text
|
||||
Expanded(
|
||||
child: RichText(
|
||||
text: TextSpan(
|
||||
text:context.translate(
|
||||
text: context.translate(
|
||||
'Access detailed datasets across categories such as ',
|
||||
'الوصول إلى مجموعات بيانات تفصيلية عبر فئات مثل الاقتصاد، البيئة، الاجتماعية، وغيرها.',),
|
||||
'الوصول إلى مجموعات بيانات تفصيلية عبر فئات مثل الاقتصاد، البيئة، الاجتماعية، وغيرها.',
|
||||
),
|
||||
style: TextStyle(
|
||||
color:Color(0xFF898C81),
|
||||
fontSize: 16,
|
||||
color: isDarkTheme
|
||||
? Colors.white
|
||||
: Color(0xFF898C81),
|
||||
fontSize: 16,
|
||||
fontFamily: context.translate(
|
||||
'Roboto',
|
||||
'NotoKufi',
|
||||
),
|
||||
),
|
||||
children: <TextSpan>[
|
||||
TextSpan(text:
|
||||
context.translate('Economy, Environment, Social, ',''),
|
||||
TextSpan(
|
||||
text: context.translate(
|
||||
'Economy, Environment, Social, ', ''),
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.bold,
|
||||
color: Color(0xFF414042),
|
||||
fontWeight: FontWeight.bold,
|
||||
color: isDarkTheme
|
||||
? Colors.white
|
||||
: Color(0xFF414042),
|
||||
fontFamily: context.translate(
|
||||
'Roboto',
|
||||
'NotoKufi',
|
||||
),
|
||||
),),
|
||||
TextSpan(text:context.translate('and more.','')),
|
||||
),
|
||||
),
|
||||
TextSpan(
|
||||
text: context.translate('and more.', ''),
|
||||
style: TextStyle(
|
||||
color: isDarkTheme
|
||||
? Colors.white
|
||||
: Color(0xFF898C81),
|
||||
fontSize: 16,
|
||||
fontFamily: context.translate(
|
||||
'Roboto',
|
||||
'NotoKufi',
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
@ -131,58 +267,29 @@ class AppFeatures extends StatelessWidget {
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(top : 8.0),
|
||||
child: Icon(Icons.brightness_1, size: 5, color: Color(0xFF414042),),
|
||||
), // Bullet point
|
||||
SizedBox(width: 8), // Space between bullet and text
|
||||
Expanded(
|
||||
child: Text( context.translate(
|
||||
'Explore statistics presented as smart metrics, graphs, and charts for better understanding.',
|
||||
'استكشاف الإحصائيات المقدمة على هيئة مقاييس ذكية ورسوم بيانية ومخططات لتعزيز الفهم.',),
|
||||
textAlign: TextAlign.justify, // Align the text
|
||||
softWrap: true,
|
||||
padding: const EdgeInsets.only(top: 8.0),
|
||||
child: Icon(
|
||||
Icons.brightness_1,
|
||||
size: 5,
|
||||
color: isDarkTheme
|
||||
? Colors.white
|
||||
: Color(0xFF414042),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
|
||||
|
||||
SizedBox(height: 8),
|
||||
Text(
|
||||
context.translate('2. Drilldown Navigation:','2. التنقل التفصيلي'),
|
||||
style:TextStyle(
|
||||
fontFamily: context.translate(
|
||||
'Roboto',
|
||||
'NotoKufi',
|
||||
),
|
||||
fontSize:16,
|
||||
color: Color(0xFF414042),
|
||||
fontWeight: FontWeight.w600,
|
||||
),
|
||||
),
|
||||
SizedBox(height: 8),
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(left:7.0),
|
||||
child: Column(
|
||||
children: [
|
||||
Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(top : 8.0),
|
||||
child: Icon(Icons.brightness_1, size: 5, color: Color(0xFF414042),),
|
||||
), // Bullet point
|
||||
SizedBox(width: 8), // Space between bullet and text
|
||||
Expanded(
|
||||
child: Text(
|
||||
context.translate(
|
||||
'Start with high-level categories and drill down to specific KPIs and metrics for deeper insights.',
|
||||
'البدء بالفئات العامة والتنقل وصولًا إلى مؤشرات الأداء الرئيسية (KPIs) والمقاييس المحددة للحصول على رؤى أعمق.',),
|
||||
textAlign: TextAlign.justify, // Align the text
|
||||
'Explore statistics presented as smart metrics, graphs, and charts for better understanding.',
|
||||
'استكشاف الإحصائيات المقدمة على هيئة مقاييس ذكية ورسوم بيانية ومخططات لتعزيز الفهم.',
|
||||
),
|
||||
textAlign: TextAlign.justify, // Align the text
|
||||
softWrap: true,
|
||||
style: TextStyle(
|
||||
color: isDarkTheme
|
||||
? Colors.white
|
||||
: Color(0xFF898C81),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
@ -190,39 +297,52 @@ class AppFeatures extends StatelessWidget {
|
||||
],
|
||||
),
|
||||
),
|
||||
|
||||
SizedBox(height: 8),
|
||||
Text(
|
||||
context.translate('3. Interactive Visualizations:','3. التصورات التفاعلية:'),
|
||||
style:TextStyle(
|
||||
context.translate(
|
||||
'2. Drilldown Navigation:', '2. التنقل التفصيلي'),
|
||||
style: TextStyle(
|
||||
fontFamily: context.translate(
|
||||
'Roboto',
|
||||
'NotoKufi',
|
||||
),
|
||||
fontSize:16,
|
||||
color: Color(0xFF414042),
|
||||
fontSize: 16,
|
||||
color: isDarkTheme ? Colors.white : Color(0xFF414042),
|
||||
fontWeight: FontWeight.w600,
|
||||
),
|
||||
),
|
||||
SizedBox(height: 8),
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(left:7.0),
|
||||
padding: const EdgeInsets.only(left: 7.0),
|
||||
child: Column(
|
||||
children: [
|
||||
Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(top : 8.0),
|
||||
child: Icon(Icons.brightness_1, size: 5, color: Color(0xFF414042),),
|
||||
padding: const EdgeInsets.only(top: 8.0),
|
||||
child: Icon(
|
||||
Icons.brightness_1,
|
||||
size: 5,
|
||||
color: isDarkTheme
|
||||
? Colors.white
|
||||
: Color(0xFF414042),
|
||||
),
|
||||
), // Bullet point
|
||||
SizedBox(width: 8), // Space between bullet and text
|
||||
Expanded(
|
||||
child: Text(context.translate(
|
||||
'View trends and relationships with interactive graphs and charts, including bar graphs, line charts, and more.',
|
||||
'عرض الاتجاهات والعلاقات باستخدام الرسوم البيانية التفاعلية مثل المخططات الشريطية، المخططات الخطية، وغيرها.',),
|
||||
child: Text(
|
||||
context.translate(
|
||||
'Start with high-level categories and drill down to specific KPIs and metrics for deeper insights.',
|
||||
'البدء بالفئات العامة والتنقل وصولًا إلى مؤشرات الأداء الرئيسية (KPIs) والمقاييس المحددة للحصول على رؤى أعمق.',
|
||||
),
|
||||
textAlign: TextAlign.justify, // Align the text
|
||||
softWrap: true,
|
||||
style: TextStyle(
|
||||
color: isDarkTheme
|
||||
? Colors.white
|
||||
: Color(0xFF898C81),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
@ -230,7 +350,62 @@ class AppFeatures extends StatelessWidget {
|
||||
],
|
||||
),
|
||||
),
|
||||
SizedBox(height: 20,),
|
||||
SizedBox(height: 8),
|
||||
Text(
|
||||
context.translate('3. Interactive Visualizations:',
|
||||
'3. التصورات التفاعلية:'),
|
||||
style: TextStyle(
|
||||
fontFamily: context.translate(
|
||||
'Roboto',
|
||||
'NotoKufi',
|
||||
),
|
||||
fontSize: 16,
|
||||
color: isDarkTheme ? Colors.white : Color(0xFF414042),
|
||||
fontWeight: FontWeight.w600,
|
||||
),
|
||||
),
|
||||
SizedBox(height: 8),
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(left: 7.0),
|
||||
child: Column(
|
||||
children: [
|
||||
Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(top: 8.0),
|
||||
child: Icon(
|
||||
Icons.brightness_1,
|
||||
size: 5,
|
||||
color: isDarkTheme
|
||||
? Colors.white
|
||||
: Color(0xFF414042),
|
||||
),
|
||||
), // Bullet point
|
||||
SizedBox(width: 8), // Space between bullet and text
|
||||
Expanded(
|
||||
child: Text(
|
||||
context.translate(
|
||||
'View trends and relationships with interactive graphs and charts, including bar graphs, line charts, and more.',
|
||||
'عرض الاتجاهات والعلاقات باستخدام الرسوم البيانية التفاعلية مثل المخططات الشريطية، المخططات الخطية، وغيرها.',
|
||||
),
|
||||
textAlign: TextAlign.justify, // Align the text
|
||||
softWrap: true,
|
||||
style: TextStyle(
|
||||
color: isDarkTheme
|
||||
? Colors.white
|
||||
: Color(0xFF898C81),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
height: 20,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
|
||||
@ -1,23 +1,136 @@
|
||||
import 'dart:convert';
|
||||
|
||||
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';
|
||||
|
||||
class ChangeMyPassword extends StatelessWidget {
|
||||
class ChangeMyPassword extends ConsumerStatefulWidget {
|
||||
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
|
||||
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(
|
||||
data: ThemeData(
|
||||
fontFamily: context.translate(
|
||||
'Roboto',
|
||||
'NotoKufi',
|
||||
),// Set default font family for this page
|
||||
), // Set default font family for this page
|
||||
textTheme: TextTheme(
|
||||
bodyMedium: TextStyle(fontSize: 16, color: Color(0xFF898C81),
|
||||
bodyMedium: TextStyle(
|
||||
fontSize: 16,
|
||||
color: Color(0xFF898C81),
|
||||
fontFamily: context.translate(
|
||||
'Roboto',
|
||||
'NotoKufi',
|
||||
),),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
child: BaseScaffold(
|
||||
@ -25,10 +138,12 @@ class ChangeMyPassword extends StatelessWidget {
|
||||
showBackButton: true,
|
||||
bottomColor: Colors.white,
|
||||
dividerColor: Colors.grey[300],
|
||||
appbarColor: Colors.white,
|
||||
// appbarColor: Colors.white,
|
||||
backgroundColor: isDarkTheme ? Colors.black : Colors.white,
|
||||
appbarColor: isDarkTheme ? Colors.black : Colors.white,
|
||||
mycenterTitle: true,
|
||||
title: Text(
|
||||
context.translate('Key Features','الميزات الرئيسية'),
|
||||
context.translate('Key Features', 'الميزات الرئيسية'),
|
||||
style: TextStyle(
|
||||
fontFamily: context.translate(
|
||||
'Roboto',
|
||||
@ -42,7 +157,7 @@ class ChangeMyPassword extends StatelessWidget {
|
||||
),
|
||||
body: Container(
|
||||
width: double.infinity,
|
||||
color: Colors.white,
|
||||
color: isDarkTheme ? Colors.black : Colors.white,
|
||||
padding: EdgeInsets.all(16),
|
||||
child: SingleChildScrollView(
|
||||
child: Column(
|
||||
@ -52,21 +167,23 @@ class ChangeMyPassword extends StatelessWidget {
|
||||
alignment: Alignment.topLeft,
|
||||
child: Text(
|
||||
context.translate(
|
||||
'How to Change My Password',
|
||||
'كيفية تغيير كلمة المرور الخاصة بي',),
|
||||
'How to Change My Password',
|
||||
'كيفية تغيير كلمة المرور الخاصة بي',
|
||||
),
|
||||
style: TextStyle(
|
||||
fontFamily: context.translate(
|
||||
'Roboto',
|
||||
'NotoKufi',
|
||||
),
|
||||
fontSize:20,
|
||||
color: Color(0xFF414042),
|
||||
fontSize: 20,
|
||||
color: isDarkTheme ? Colors.white : Color(0xFF414042),
|
||||
fontWeight: FontWeight.w600,
|
||||
),),
|
||||
),
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
width:MediaQuery.of(context).size.width,
|
||||
height:MediaQuery.of(context).size.height * 0.36,
|
||||
width: MediaQuery.of(context).size.width,
|
||||
height: MediaQuery.of(context).size.height * 0.36,
|
||||
child: Image.asset(
|
||||
'assets/user_guide/changePassword.png',
|
||||
fit: BoxFit.contain,
|
||||
@ -74,75 +191,105 @@ class ChangeMyPassword extends StatelessWidget {
|
||||
),
|
||||
Text(
|
||||
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),
|
||||
Text(
|
||||
context.translate('Steps to Change Password','خطوات تغيير كلمة المرور '),
|
||||
style:TextStyle(
|
||||
context.translate(
|
||||
'Steps to Change Password', 'خطوات تغيير كلمة المرور '),
|
||||
style: TextStyle(
|
||||
fontFamily: context.translate(
|
||||
'Roboto',
|
||||
'NotoKufi',
|
||||
),
|
||||
fontSize:22,
|
||||
color: Color(0xFF414042),
|
||||
fontSize: 22,
|
||||
color: isDarkTheme ? Colors.white : Color(0xFF414042),
|
||||
fontWeight: FontWeight.w600,
|
||||
),
|
||||
),
|
||||
SizedBox(height: 8),
|
||||
Text(
|
||||
context.translate(
|
||||
'1. Access the Change Password Page:',
|
||||
'1. الدخول إلى صفحة تغيير كلمة المرور:',),
|
||||
style:TextStyle(
|
||||
'1. Access the Change Password Page:',
|
||||
'1. الدخول إلى صفحة تغيير كلمة المرور:',
|
||||
),
|
||||
style: TextStyle(
|
||||
fontFamily: context.translate(
|
||||
'Roboto',
|
||||
'NotoKufi',
|
||||
),
|
||||
fontSize:16,
|
||||
color: Color(0xFF414042),
|
||||
fontSize: 16,
|
||||
color: isDarkTheme ? Colors.white : Color(0xFF414042),
|
||||
fontWeight: FontWeight.w600,
|
||||
),
|
||||
),
|
||||
SizedBox(height: 8),
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(left:8.0),
|
||||
padding: const EdgeInsets.only(left: 8.0),
|
||||
child: Column(
|
||||
children: [
|
||||
Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(top : 8.0),
|
||||
child: Icon(Icons.brightness_1, size: 5, color: Color(0xFF414042),),
|
||||
padding: const EdgeInsets.only(top: 8.0),
|
||||
child: Icon(
|
||||
Icons.brightness_1,
|
||||
size: 5,
|
||||
color: isDarkTheme
|
||||
? Colors.white
|
||||
: Color(0xFF414042),
|
||||
),
|
||||
), // Bullet point
|
||||
SizedBox(width: 8), // Space between bullet and text
|
||||
Expanded(
|
||||
child: RichText(
|
||||
child: RichText(
|
||||
text: TextSpan(
|
||||
text: context.translate(
|
||||
'From the Profile page, tap on the ',
|
||||
'من صفحة الملف الشخصي، انقر على رابط ',),
|
||||
style: TextStyle(fontSize: 16, color: Color(0xFF898C81), fontFamily: context.translate(
|
||||
'Roboto',
|
||||
'NotoKufi',
|
||||
),),
|
||||
'From the Profile page, tap on the ',
|
||||
'من صفحة الملف الشخصي، انقر على رابط ',
|
||||
),
|
||||
style: TextStyle(
|
||||
fontSize: 16,
|
||||
color: isDarkTheme
|
||||
? Colors.white
|
||||
: Color(0xFF898C81),
|
||||
fontFamily: context.translate(
|
||||
'Roboto',
|
||||
'NotoKufi',
|
||||
),
|
||||
),
|
||||
children: <TextSpan>[
|
||||
TextSpan(text: context.translate(
|
||||
'"Change Password"',
|
||||
'"تغيير كلمة المرور" ',),
|
||||
TextSpan(
|
||||
text: context.translate(
|
||||
'"Change Password"',
|
||||
'"تغيير كلمة المرور" ',
|
||||
),
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.w600,
|
||||
color: Color(0xFF414042),
|
||||
fontWeight: FontWeight.w600,
|
||||
color: isDarkTheme
|
||||
? Colors.white
|
||||
: Color(0xFF414042),
|
||||
fontFamily: context.translate(
|
||||
'Roboto',
|
||||
'NotoKufi',
|
||||
),
|
||||
),),
|
||||
TextSpan(text:context.translate(
|
||||
' link at the bottom.',
|
||||
'في الأسفل.',),
|
||||
),
|
||||
),
|
||||
TextSpan(
|
||||
text: context.translate(
|
||||
' link at the bottom.',
|
||||
'في الأسفل.',
|
||||
),
|
||||
style: TextStyle(
|
||||
color: isDarkTheme
|
||||
? Colors.white
|
||||
: Color(0xFF898C81),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
@ -153,195 +300,273 @@ class ChangeMyPassword extends StatelessWidget {
|
||||
],
|
||||
),
|
||||
),
|
||||
|
||||
SizedBox(height: 8),
|
||||
Text(context.translate(
|
||||
'2. Enter Old Password:',
|
||||
'2. إدخال كلمة المرور القديمة:',),
|
||||
style:TextStyle(
|
||||
fontFamily: context.translate(
|
||||
'Roboto',
|
||||
'NotoKufi',
|
||||
),
|
||||
fontSize:16,
|
||||
color: Color(0xFF414042),
|
||||
fontWeight: FontWeight.w600,
|
||||
),
|
||||
),
|
||||
SizedBox(height: 8),
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(left:8.0),
|
||||
child: Column(
|
||||
children: [
|
||||
Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(top : 8.0),
|
||||
child: Icon(Icons.brightness_1, size: 5),
|
||||
), // Bullet point
|
||||
SizedBox(width: 8), // Space between bullet and text
|
||||
Expanded(
|
||||
child: Text(
|
||||
context.translate(
|
||||
'Enter your current password in the first field.',
|
||||
'أدخل كلمة المرور الحالية في الحقل الأول.',),
|
||||
textAlign: TextAlign.justify, // Align the text
|
||||
softWrap: true,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
|
||||
SizedBox(height: 8),
|
||||
Text(context.translate(
|
||||
'3. Set a New Password:',
|
||||
'3. تعيين كلمة مرور جديدة:',),
|
||||
style:TextStyle(
|
||||
fontFamily: context.translate(
|
||||
'Roboto',
|
||||
'NotoKufi',
|
||||
),
|
||||
fontSize:16,
|
||||
color: Color(0xFF414042),
|
||||
fontWeight: FontWeight.w600,
|
||||
),
|
||||
),
|
||||
SizedBox(height: 8),
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(left:8.0),
|
||||
child: Column(
|
||||
children: [
|
||||
Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(top : 8.0),
|
||||
child: Icon(Icons.brightness_1, size: 5, color: Color(0xFF414042),),
|
||||
), // Bullet point
|
||||
SizedBox(width: 8), // Space between bullet and text
|
||||
Expanded(
|
||||
child: Text( context.translate(
|
||||
'Enter your new password in the second field.',
|
||||
'أدخل كلمة المرور الجديدة في الحقل الثاني.',),
|
||||
textAlign: TextAlign.justify, // Align the text
|
||||
softWrap: true,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(top : 8.0),
|
||||
child: Icon(Icons.brightness_1, size: 5, color: Color(0xFF414042),),
|
||||
), // Bullet point
|
||||
SizedBox(width: 8), // Space between bullet and text
|
||||
Expanded(
|
||||
child: Text(
|
||||
context.translate(
|
||||
'Re-enter the new password in the third field for confirmation.',
|
||||
'أعد إدخال كلمة المرور الجديدة في الحقل الثالث للتأكيد.',),
|
||||
textAlign: TextAlign.justify, // Align the text
|
||||
softWrap: true,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
|
||||
SizedBox(height: 8),
|
||||
Text(context.translate(
|
||||
'4. Password Requirements:','4. متطلبات كلمة المرور:',),
|
||||
style:TextStyle(
|
||||
fontFamily: context.translate(
|
||||
'Roboto',
|
||||
'NotoKufi',
|
||||
),
|
||||
fontSize:16,
|
||||
color: Color(0xFF414042),
|
||||
fontWeight: FontWeight.w600,
|
||||
),
|
||||
),
|
||||
SizedBox(height: 8),
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(left:8.0),
|
||||
child: Column(
|
||||
children: [
|
||||
Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(top : 8.0),
|
||||
child: Icon(Icons.brightness_1, size: 5, color: Color(0xFF414042),),
|
||||
), // Bullet point
|
||||
SizedBox(width: 8), // Space between bullet and text
|
||||
Expanded(
|
||||
child: Text(context.translate(
|
||||
'Your new password must be different from the previously used password.',
|
||||
'جب أن تكون كلمة المرور الجديدة مختلفة عن كلمة المرور المستخدمة سابقًا',),
|
||||
textAlign: TextAlign.justify, // Align the text
|
||||
softWrap: true,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
|
||||
SizedBox(height: 8),
|
||||
Text(
|
||||
context.translate('5. Save Your Password:','5. حفظ كلمة المرور '),
|
||||
style:TextStyle(
|
||||
context.translate(
|
||||
'2. Enter Old Password:',
|
||||
'2. إدخال كلمة المرور القديمة:',
|
||||
),
|
||||
style: TextStyle(
|
||||
fontFamily: context.translate(
|
||||
'Roboto',
|
||||
'NotoKufi',
|
||||
),
|
||||
fontSize:16,
|
||||
color: Color(0xFF414042),
|
||||
fontSize: 16,
|
||||
color: isDarkTheme ? Colors.white : Color(0xFF414042),
|
||||
fontWeight: FontWeight.w600,
|
||||
),
|
||||
),
|
||||
SizedBox(height: 8),
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(left:8.0),
|
||||
padding: const EdgeInsets.only(left: 8.0),
|
||||
child: Column(
|
||||
children: [
|
||||
Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(top : 8.0),
|
||||
child: Icon(Icons.brightness_1, size: 5, color: Color(0xFF414042),),
|
||||
padding: const EdgeInsets.only(top: 8.0),
|
||||
child: Icon(
|
||||
Icons.brightness_1,
|
||||
size: 5,
|
||||
color: isDarkTheme
|
||||
? Colors.white
|
||||
: Color(0xFF414042),
|
||||
),
|
||||
), // Bullet point
|
||||
SizedBox(width: 8), // Space between bullet and text
|
||||
Expanded(
|
||||
child: RichText(
|
||||
child: Text(
|
||||
context.translate(
|
||||
'Enter your current password in the first field.',
|
||||
'أدخل كلمة المرور الحالية في الحقل الأول.',
|
||||
),
|
||||
style: TextStyle(
|
||||
color: isDarkTheme
|
||||
? Colors.white
|
||||
: Color(0xFF898C81),
|
||||
),
|
||||
textAlign: TextAlign.justify, // Align the text
|
||||
softWrap: true,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
SizedBox(height: 8),
|
||||
Text(
|
||||
context.translate(
|
||||
'3. Set a New Password:',
|
||||
'3. تعيين كلمة مرور جديدة:',
|
||||
),
|
||||
style: TextStyle(
|
||||
fontFamily: context.translate(
|
||||
'Roboto',
|
||||
'NotoKufi',
|
||||
),
|
||||
fontSize: 16,
|
||||
color: isDarkTheme ? Colors.white : Color(0xFF414042),
|
||||
fontWeight: FontWeight.w600,
|
||||
),
|
||||
),
|
||||
SizedBox(height: 8),
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(left: 8.0),
|
||||
child: Column(
|
||||
children: [
|
||||
Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(top: 8.0),
|
||||
child: Icon(
|
||||
Icons.brightness_1,
|
||||
size: 5,
|
||||
color: isDarkTheme
|
||||
? Colors.white
|
||||
: Color(0xFF414042),
|
||||
),
|
||||
), // Bullet point
|
||||
SizedBox(width: 8), // Space between bullet and text
|
||||
Expanded(
|
||||
child: Text(
|
||||
context.translate(
|
||||
'Enter your new password in the second field.',
|
||||
'أدخل كلمة المرور الجديدة في الحقل الثاني.',
|
||||
),
|
||||
textAlign: TextAlign.justify, // Align the text
|
||||
softWrap: true,
|
||||
style: TextStyle(
|
||||
color: isDarkTheme
|
||||
? Colors.white
|
||||
: Color(0xFF898C81),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(top: 8.0),
|
||||
child: Icon(
|
||||
Icons.brightness_1,
|
||||
size: 5,
|
||||
color: isDarkTheme
|
||||
? Colors.white
|
||||
: Color(0xFF414042),
|
||||
),
|
||||
), // Bullet point
|
||||
SizedBox(width: 8), // Space between bullet and text
|
||||
Expanded(
|
||||
child: Text(
|
||||
context.translate(
|
||||
'Re-enter the new password in the third field for confirmation.',
|
||||
'أعد إدخال كلمة المرور الجديدة في الحقل الثالث للتأكيد.',
|
||||
),
|
||||
textAlign: TextAlign.justify, // Align the text
|
||||
softWrap: true,
|
||||
style: TextStyle(
|
||||
color: isDarkTheme
|
||||
? Colors.white
|
||||
: Color(0xFF898C81),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
SizedBox(height: 8),
|
||||
Text(
|
||||
context.translate(
|
||||
'4. Password Requirements:',
|
||||
'4. متطلبات كلمة المرور:',
|
||||
),
|
||||
style: TextStyle(
|
||||
fontFamily: context.translate(
|
||||
'Roboto',
|
||||
'NotoKufi',
|
||||
),
|
||||
fontSize: 16,
|
||||
color: isDarkTheme ? Colors.white : Color(0xFF414042),
|
||||
fontWeight: FontWeight.w600,
|
||||
),
|
||||
),
|
||||
SizedBox(height: 8),
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(left: 8.0),
|
||||
child: Column(
|
||||
children: [
|
||||
Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(top: 8.0),
|
||||
child: Icon(
|
||||
Icons.brightness_1,
|
||||
size: 5,
|
||||
color: isDarkTheme
|
||||
? Colors.white
|
||||
: Color(0xFF414042),
|
||||
),
|
||||
), // Bullet point
|
||||
SizedBox(width: 8), // Space between bullet and text
|
||||
Expanded(
|
||||
child: Text(
|
||||
context.translate(
|
||||
'Your new password must be different from the previously used password.',
|
||||
'جب أن تكون كلمة المرور الجديدة مختلفة عن كلمة المرور المستخدمة سابقًا',
|
||||
),
|
||||
textAlign: TextAlign.justify, // Align the text
|
||||
softWrap: true,
|
||||
style: TextStyle(
|
||||
color: isDarkTheme
|
||||
? Colors.white
|
||||
: Color(0xFF898C81),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
SizedBox(height: 8),
|
||||
Text(
|
||||
context.translate(
|
||||
'5. Save Your Password:', '5. حفظ كلمة المرور '),
|
||||
style: TextStyle(
|
||||
fontFamily: context.translate(
|
||||
'Roboto',
|
||||
'NotoKufi',
|
||||
),
|
||||
fontSize: 16,
|
||||
color: isDarkTheme ? Colors.white : Color(0xFF414042),
|
||||
fontWeight: FontWeight.w600,
|
||||
),
|
||||
),
|
||||
SizedBox(height: 8),
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(left: 8.0),
|
||||
child: Column(
|
||||
children: [
|
||||
Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(top: 8.0),
|
||||
child: Icon(
|
||||
Icons.brightness_1,
|
||||
size: 5,
|
||||
color: isDarkTheme
|
||||
? Colors.white
|
||||
: Color(0xFF414042),
|
||||
),
|
||||
), // Bullet point
|
||||
SizedBox(width: 8), // Space between bullet and text
|
||||
Expanded(
|
||||
child: RichText(
|
||||
text: TextSpan(
|
||||
text: context.translate('Tap the ','انقرعلى زر '),
|
||||
style: TextStyle(fontSize: 16, color: Color(0xFF898C81), fontFamily: context.translate(
|
||||
'Roboto',
|
||||
'NotoKufi',
|
||||
),),
|
||||
text: context.translate(
|
||||
'Tap the ', 'انقرعلى زر '),
|
||||
style: TextStyle(
|
||||
fontSize: 16,
|
||||
// color: Color(0xFF898C81),
|
||||
fontFamily: context.translate(
|
||||
'Roboto',
|
||||
'NotoKufi',
|
||||
),
|
||||
color: isDarkTheme
|
||||
? Colors.white
|
||||
: Color(0xFF898C81),
|
||||
),
|
||||
children: <TextSpan>[
|
||||
TextSpan(text:
|
||||
context.translate('Save ','"حفظ".'),
|
||||
TextSpan(
|
||||
text: context.translate('Save ', '"حفظ".'),
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.w600,
|
||||
color: Color(0xFF414042),
|
||||
fontWeight: FontWeight.w600,
|
||||
color: isDarkTheme
|
||||
? Colors.white
|
||||
: Color(0xFF414042),
|
||||
fontFamily: context.translate(
|
||||
'Roboto',
|
||||
'NotoKufi',
|
||||
),
|
||||
),),
|
||||
TextSpan(text: context.translate('button',''),),
|
||||
),
|
||||
),
|
||||
TextSpan(
|
||||
text: context.translate('button', ''),
|
||||
style: TextStyle(
|
||||
color: isDarkTheme
|
||||
? Colors.white
|
||||
: Color(0xFF898C81),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
@ -352,16 +577,29 @@ class ChangeMyPassword extends StatelessWidget {
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(top : 8.0),
|
||||
child: Icon(Icons.brightness_1, size: 5, color: Color(0xFF414042),),
|
||||
padding: const EdgeInsets.only(top: 8.0),
|
||||
child: Icon(
|
||||
Icons.brightness_1,
|
||||
size: 5,
|
||||
color: isDarkTheme
|
||||
? Colors.white
|
||||
: Color(0xFF414042),
|
||||
),
|
||||
), // Bullet point
|
||||
SizedBox(width: 8), // Space between bullet and text
|
||||
Expanded(
|
||||
child: Text(context.translate(
|
||||
'A confirmation message will appear: “Password has been successfully updated.”',
|
||||
'ستظهر رسالة تأكيد: "تم تحديث كلمة المرور بنجاح".',),
|
||||
child: Text(
|
||||
context.translate(
|
||||
'A confirmation message will appear: “Password has been successfully updated.”',
|
||||
'ستظهر رسالة تأكيد: "تم تحديث كلمة المرور بنجاح".',
|
||||
),
|
||||
textAlign: TextAlign.justify, // Align the text
|
||||
softWrap: true,
|
||||
style: TextStyle(
|
||||
color: isDarkTheme
|
||||
? Colors.white
|
||||
: Color(0xFF898C81),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
@ -371,36 +609,49 @@ class ChangeMyPassword extends StatelessWidget {
|
||||
),
|
||||
SizedBox(height: 8),
|
||||
Text(
|
||||
context.translate('6. Re-Login:','6. إعادة تسجيل الدخول'),
|
||||
style:TextStyle(
|
||||
context.translate('6. Re-Login:', '6. إعادة تسجيل الدخول'),
|
||||
style: TextStyle(
|
||||
fontFamily: context.translate(
|
||||
'Roboto',
|
||||
'NotoKufi',
|
||||
),
|
||||
fontSize:16,
|
||||
color: Color(0xFF414042),
|
||||
fontSize: 16,
|
||||
color: isDarkTheme ? Colors.white : Color(0xFF414042),
|
||||
fontWeight: FontWeight.w600,
|
||||
),
|
||||
),
|
||||
SizedBox(height: 8),
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(left:8.0),
|
||||
padding: const EdgeInsets.only(left: 8.0),
|
||||
child: Column(
|
||||
children: [
|
||||
Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(top : 8.0),
|
||||
child: Icon(Icons.brightness_1, size: 5, color: Color(0xFF414042),),
|
||||
padding: const EdgeInsets.only(top: 8.0),
|
||||
child: Icon(
|
||||
Icons.brightness_1,
|
||||
size: 5,
|
||||
color: isDarkTheme
|
||||
? Colors.white
|
||||
: Color(0xFF414042),
|
||||
),
|
||||
), // Bullet point
|
||||
SizedBox(width: 8), // Space between bullet and text
|
||||
Expanded(
|
||||
child: Text(context.translate(
|
||||
'Log in again using your new password to continue using the app',
|
||||
'قم بتسجيل الدخول مرة أخرى باستخدام كلمة المرور الجديدة للاستمرار في استخدام التطبيق.',),
|
||||
child: Text(
|
||||
context.translate(
|
||||
'Log in again using your new password to continue using the app',
|
||||
'قم بتسجيل الدخول مرة أخرى باستخدام كلمة المرور الجديدة للاستمرار في استخدام التطبيق.',
|
||||
),
|
||||
textAlign: TextAlign.justify, // Align the text
|
||||
softWrap: true,
|
||||
style: TextStyle(
|
||||
color: isDarkTheme
|
||||
? Colors.white
|
||||
: Color(0xFF898C81),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
@ -408,9 +659,10 @@ class ChangeMyPassword extends StatelessWidget {
|
||||
],
|
||||
),
|
||||
),
|
||||
SizedBox(height: 20,),
|
||||
SizedBox(
|
||||
height: 20,
|
||||
),
|
||||
],
|
||||
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
@ -1,14 +1,123 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:uae_stat/domain/use_cases/language.dart';
|
||||
import 'dart:convert';
|
||||
|
||||
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';
|
||||
|
||||
class HowUseTheApp extends StatelessWidget {
|
||||
const HowUseTheApp({super.key});
|
||||
class HowUseTheApp extends ConsumerStatefulWidget {
|
||||
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
|
||||
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(
|
||||
data: ThemeData(
|
||||
fontFamily: context.translate(
|
||||
@ -16,21 +125,27 @@ class HowUseTheApp extends StatelessWidget {
|
||||
'NotoKufi',
|
||||
), // Set default font family for this page
|
||||
textTheme: TextTheme(
|
||||
bodyMedium: TextStyle(fontSize: 16, color: Color(0xFF898C81),fontFamily: context.translate(
|
||||
'Roboto',
|
||||
'NotoKufi',
|
||||
),),
|
||||
bodyMedium: TextStyle(
|
||||
fontSize: 16,
|
||||
color: Color(0xFF898C81),
|
||||
fontFamily: context.translate(
|
||||
'Roboto',
|
||||
'NotoKufi',
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
child: BaseScaffold(
|
||||
backgroundColor: isDarkTheme ? Colors.black : Colors.white,
|
||||
appbarColor: isDarkTheme ? Colors.black : Colors.white,
|
||||
showDivider: true,
|
||||
showBackButton: true,
|
||||
dividerColor: Colors.grey[300],
|
||||
appbarColor: Colors.white,
|
||||
// appbarColor: Colors.white,
|
||||
bottomColor: Colors.white,
|
||||
mycenterTitle: true,
|
||||
title: Text(
|
||||
context.translate('Key Features','الميزات الرئيسية'),
|
||||
context.translate('Key Features', 'الميزات الرئيسية'),
|
||||
style: TextStyle(
|
||||
fontFamily: context.translate(
|
||||
'Roboto',
|
||||
@ -44,7 +159,7 @@ class HowUseTheApp extends StatelessWidget {
|
||||
),
|
||||
body: Container(
|
||||
width: double.infinity,
|
||||
color: Colors.white,
|
||||
color: isDarkTheme ? Colors.black : Colors.white,
|
||||
padding: EdgeInsets.all(16),
|
||||
child: SingleChildScrollView(
|
||||
child: Column(
|
||||
@ -53,14 +168,15 @@ class HowUseTheApp extends StatelessWidget {
|
||||
Align(
|
||||
alignment: Alignment.topLeft,
|
||||
child: Text(
|
||||
context.translate('How to Use the App','كيفية استخدام التطبيق:'),
|
||||
context.translate(
|
||||
'How to Use the App', 'كيفية استخدام التطبيق:'),
|
||||
style: TextStyle(
|
||||
fontFamily: context.translate(
|
||||
'Roboto',
|
||||
'NotoKufi',
|
||||
),
|
||||
fontSize: 20,
|
||||
color: Color(0xFF414042),
|
||||
color: isDarkTheme ? Colors.white : Color(0xFF414042),
|
||||
fontWeight: FontWeight.w600,
|
||||
),
|
||||
),
|
||||
@ -75,15 +191,16 @@ class HowUseTheApp extends StatelessWidget {
|
||||
),
|
||||
Text(
|
||||
context.translate(
|
||||
'1. Registration and Approval:',
|
||||
'1. التسجيل والموافقة:',),
|
||||
'1. Registration and Approval:',
|
||||
'1. التسجيل والموافقة:',
|
||||
),
|
||||
style: TextStyle(
|
||||
fontFamily: context.translate(
|
||||
'Roboto',
|
||||
'NotoKufi',
|
||||
),
|
||||
fontSize: 16,
|
||||
color: Color(0xFF414042),
|
||||
color: isDarkTheme ? Colors.white : Color(0xFF414042),
|
||||
fontWeight: FontWeight.w600,
|
||||
),
|
||||
),
|
||||
@ -96,17 +213,21 @@ class HowUseTheApp extends StatelessWidget {
|
||||
child: Icon(
|
||||
Icons.brightness_1,
|
||||
size: 5,
|
||||
color: Color(0xFF414042),
|
||||
color: isDarkTheme ? Colors.white : Color(0xFF414042),
|
||||
),
|
||||
), // Bullet point
|
||||
SizedBox(width: 8), // Space between bullet and text
|
||||
Expanded(
|
||||
child: Text(
|
||||
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
|
||||
softWrap: true,
|
||||
style: TextStyle(
|
||||
color:
|
||||
isDarkTheme ? Colors.white : Color(0xFF898C81)),
|
||||
),
|
||||
),
|
||||
],
|
||||
@ -114,15 +235,16 @@ class HowUseTheApp extends StatelessWidget {
|
||||
SizedBox(height: 8),
|
||||
Text(
|
||||
context.translate(
|
||||
'2. Login and Navigation:',
|
||||
'2. تسجيل الدخول والتصفح:',),
|
||||
'2. Login and Navigation:',
|
||||
'2. تسجيل الدخول والتصفح:',
|
||||
),
|
||||
style: TextStyle(
|
||||
fontFamily: context.translate(
|
||||
'Roboto',
|
||||
'NotoKufi',
|
||||
),
|
||||
fontSize: 16,
|
||||
color: Color(0xFF414042),
|
||||
color: isDarkTheme ? Colors.white : Color(0xFF414042),
|
||||
fontWeight: FontWeight.w600,
|
||||
),
|
||||
),
|
||||
@ -135,17 +257,21 @@ class HowUseTheApp extends StatelessWidget {
|
||||
child: Icon(
|
||||
Icons.brightness_1,
|
||||
size: 5,
|
||||
color: Color(0xFF414042),
|
||||
color: isDarkTheme ? Colors.white : Color(0xFF414042),
|
||||
),
|
||||
), // Bullet point
|
||||
SizedBox(width: 8), // Space between bullet and text
|
||||
Expanded(
|
||||
child: Text(
|
||||
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
|
||||
softWrap: true,
|
||||
style: TextStyle(
|
||||
color:
|
||||
isDarkTheme ? Colors.white : Color(0xFF898C81)),
|
||||
),
|
||||
),
|
||||
],
|
||||
@ -153,15 +279,16 @@ class HowUseTheApp extends StatelessWidget {
|
||||
SizedBox(height: 8),
|
||||
Text(
|
||||
context.translate(
|
||||
'3. Access Data:',
|
||||
'3. الوصول إلى البيانات:',),
|
||||
'3. Access Data:',
|
||||
'3. الوصول إلى البيانات:',
|
||||
),
|
||||
style: TextStyle(
|
||||
fontFamily: context.translate(
|
||||
'Roboto',
|
||||
'NotoKufi',
|
||||
),
|
||||
fontSize: 16,
|
||||
color: Color(0xFF414042),
|
||||
color: isDarkTheme ? Colors.white : Color(0xFF414042),
|
||||
fontWeight: FontWeight.w600,
|
||||
),
|
||||
),
|
||||
@ -174,17 +301,21 @@ class HowUseTheApp extends StatelessWidget {
|
||||
child: Icon(
|
||||
Icons.brightness_1,
|
||||
size: 5,
|
||||
color: Color(0xFF414042),
|
||||
color: isDarkTheme ? Colors.white : Color(0xFF414042),
|
||||
),
|
||||
), // Bullet point
|
||||
SizedBox(width: 8), // Space between bullet and text
|
||||
Expanded(
|
||||
child: Text(
|
||||
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
|
||||
softWrap: true,
|
||||
style: TextStyle(
|
||||
color:
|
||||
isDarkTheme ? Colors.white : Color(0xFF898C81)),
|
||||
),
|
||||
),
|
||||
],
|
||||
@ -192,15 +323,16 @@ class HowUseTheApp extends StatelessWidget {
|
||||
SizedBox(height: 8),
|
||||
Text(
|
||||
context.translate(
|
||||
'4. Bookmark Metrics:',
|
||||
'4. وضع إشارة مرجعية للمقاييس:',),
|
||||
'4. Bookmark Metrics:',
|
||||
'4. وضع إشارة مرجعية للمقاييس:',
|
||||
),
|
||||
style: TextStyle(
|
||||
fontFamily: context.translate(
|
||||
'Roboto',
|
||||
'NotoKufi',
|
||||
),
|
||||
fontSize: 16,
|
||||
color: Color(0xFF414042),
|
||||
color: isDarkTheme ? Colors.white : Color(0xFF414042),
|
||||
fontWeight: FontWeight.w600,
|
||||
),
|
||||
),
|
||||
@ -213,17 +345,21 @@ class HowUseTheApp extends StatelessWidget {
|
||||
child: Icon(
|
||||
Icons.brightness_1,
|
||||
size: 5,
|
||||
color: Color(0xFF414042),
|
||||
color: isDarkTheme ? Colors.white : Color(0xFF414042),
|
||||
),
|
||||
), // Bullet point
|
||||
SizedBox(width: 8), // Space between bullet and text
|
||||
Expanded(
|
||||
child: Text(
|
||||
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
|
||||
softWrap: true,
|
||||
style: TextStyle(
|
||||
color:
|
||||
isDarkTheme ? Colors.white : Color(0xFF898C81)),
|
||||
),
|
||||
),
|
||||
],
|
||||
|
||||
@ -1,12 +1,123 @@
|
||||
import 'dart:convert';
|
||||
|
||||
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';
|
||||
|
||||
class Purpose extends StatelessWidget {
|
||||
class Purpose extends ConsumerStatefulWidget {
|
||||
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
|
||||
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(
|
||||
data: ThemeData(
|
||||
fontFamily: context.translate(
|
||||
@ -25,14 +136,16 @@ class Purpose extends StatelessWidget {
|
||||
),
|
||||
),
|
||||
child: BaseScaffold(
|
||||
backgroundColor: isDarkTheme ? Colors.black : Colors.white,
|
||||
appbarColor: isDarkTheme ? Colors.black : Colors.white,
|
||||
showDivider: true,
|
||||
showBackButton: true,
|
||||
dividerColor: Colors.grey[300],
|
||||
appbarColor: Colors.white,
|
||||
// appbarColor: Colors.white,
|
||||
bottomColor: Colors.white,
|
||||
mycenterTitle: true,
|
||||
title: Text(
|
||||
context.translate('Key Features','الميزات الرئيسية'),
|
||||
context.translate('Key Features', 'الميزات الرئيسية'),
|
||||
style: TextStyle(
|
||||
fontFamily: context.translate(
|
||||
'Roboto',
|
||||
@ -46,7 +159,7 @@ class Purpose extends StatelessWidget {
|
||||
),
|
||||
body: Container(
|
||||
height: double.infinity,
|
||||
color: Colors.white,
|
||||
color: isDarkTheme ? Colors.black : Colors.white,
|
||||
padding: EdgeInsets.all(16),
|
||||
child: SingleChildScrollView(
|
||||
child: Column(
|
||||
@ -55,14 +168,14 @@ class Purpose extends StatelessWidget {
|
||||
Align(
|
||||
alignment: Alignment.topLeft,
|
||||
child: Text(
|
||||
context.translate('Purpose of the App','الغرض من التطبيق'),
|
||||
context.translate('Purpose of the App', 'الغرض من التطبيق'),
|
||||
style: TextStyle(
|
||||
fontFamily: context.translate(
|
||||
'Roboto',
|
||||
'NotoKufi',
|
||||
),
|
||||
fontSize: 20,
|
||||
color: Color(0xFF414042),
|
||||
color: isDarkTheme ? Colors.white : Color(0xFF414042),
|
||||
fontWeight: FontWeight.w600,
|
||||
),
|
||||
),
|
||||
@ -84,35 +197,49 @@ class Purpose extends StatelessWidget {
|
||||
child: Icon(
|
||||
Icons.brightness_1,
|
||||
size: 5,
|
||||
color: Color(0xFF414042),
|
||||
color: isDarkTheme ? Colors.white : Color(0xFF414042),
|
||||
),
|
||||
), // Bullet point
|
||||
SizedBox(width: 8), // Space between bullet and text
|
||||
Expanded(
|
||||
child: RichText(
|
||||
text: TextSpan(
|
||||
text: context.translate('Provide ',
|
||||
'توفير الإحصائيات الرسمية لدولة الإمارات بشكل سهل الوصول.',),
|
||||
text: context.translate(
|
||||
'Provide ',
|
||||
'توفير الإحصائيات الرسمية لدولة الإمارات بشكل سهل الوصول.',
|
||||
),
|
||||
style: TextStyle(
|
||||
color: Color(0xFF898C81),
|
||||
fontSize: 16,
|
||||
color:
|
||||
isDarkTheme ? Colors.white : Color(0xFF898C81),
|
||||
fontSize: 16,
|
||||
fontFamily: context.translate(
|
||||
'Roboto',
|
||||
'NotoKufi',
|
||||
),),
|
||||
),
|
||||
),
|
||||
children: <TextSpan>[
|
||||
TextSpan(
|
||||
text: context.translate('official statistics ',''),
|
||||
text:
|
||||
context.translate('official statistics ', ''),
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.bold,
|
||||
color: Color(0xFF414042),
|
||||
fontWeight: FontWeight.bold,
|
||||
color: isDarkTheme
|
||||
? Colors.white
|
||||
: Color(0xFF414042),
|
||||
fontFamily: context.translate(
|
||||
'Roboto',
|
||||
'NotoKufi',
|
||||
),),
|
||||
),
|
||||
),
|
||||
),
|
||||
TextSpan(
|
||||
text: context.translate('on the UAE in an accessible format.',''),),
|
||||
text: context.translate(
|
||||
'on the UAE in an accessible format.', ''),
|
||||
style: TextStyle(
|
||||
color: isDarkTheme
|
||||
? Colors.white
|
||||
: Color(0xFF898C81)),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
@ -127,17 +254,21 @@ class Purpose extends StatelessWidget {
|
||||
child: Icon(
|
||||
Icons.brightness_1,
|
||||
size: 5,
|
||||
color: Color(0xFF414042),
|
||||
color: isDarkTheme ? Colors.white : Color(0xFF414042),
|
||||
),
|
||||
), // Bullet point
|
||||
SizedBox(width: 8), // Space between bullet and text
|
||||
Expanded(
|
||||
child: Text(
|
||||
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
|
||||
softWrap: true,
|
||||
style: TextStyle(
|
||||
color:
|
||||
isDarkTheme ? Colors.white : Color(0xFF898C81)),
|
||||
),
|
||||
),
|
||||
],
|
||||
@ -150,17 +281,21 @@ class Purpose extends StatelessWidget {
|
||||
child: Icon(
|
||||
Icons.brightness_1,
|
||||
size: 5,
|
||||
color: Color(0xFF414042),
|
||||
color: isDarkTheme ? Colors.white : Color(0xFF414042),
|
||||
),
|
||||
), // Bullet point
|
||||
SizedBox(width: 8), // Space between bullet and text
|
||||
Expanded(
|
||||
child: Text(
|
||||
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
|
||||
softWrap: true,
|
||||
style: TextStyle(
|
||||
color:
|
||||
isDarkTheme ? Colors.white : Color(0xFF898C81)),
|
||||
),
|
||||
),
|
||||
],
|
||||
|
||||
@ -1,13 +1,121 @@
|
||||
import 'dart:convert';
|
||||
|
||||
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';
|
||||
|
||||
class StayUpdate extends StatelessWidget {
|
||||
const StayUpdate({super.key});
|
||||
class StayUpdate extends ConsumerStatefulWidget {
|
||||
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
|
||||
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(
|
||||
data: ThemeData(
|
||||
fontFamily: context.translate(
|
||||
@ -29,11 +137,13 @@ class StayUpdate extends StatelessWidget {
|
||||
showDivider: true,
|
||||
showBackButton: true,
|
||||
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,
|
||||
mycenterTitle: true,
|
||||
title: Text(
|
||||
context.translate('Key Features','الميزات الرئيسية'),
|
||||
context.translate('Key Features', 'الميزات الرئيسية'),
|
||||
style: TextStyle(
|
||||
fontFamily: context.translate(
|
||||
'Roboto',
|
||||
@ -47,7 +157,7 @@ class StayUpdate extends StatelessWidget {
|
||||
),
|
||||
body: Container(
|
||||
height: double.infinity,
|
||||
color: Colors.white,
|
||||
color: isDarkTheme ? Colors.black : Colors.white,
|
||||
padding: EdgeInsets.all(16),
|
||||
child: SingleChildScrollView(
|
||||
child: Column(
|
||||
@ -56,14 +166,14 @@ class StayUpdate extends StatelessWidget {
|
||||
Align(
|
||||
alignment: Alignment.topLeft,
|
||||
child: Text(
|
||||
context.translate('Stay Updated','ابقَ على اطلاع'),
|
||||
context.translate('Stay Updated', 'ابقَ على اطلاع'),
|
||||
style: TextStyle(
|
||||
fontFamily: context.translate(
|
||||
'Roboto',
|
||||
'NotoKufi',
|
||||
),
|
||||
fontSize: 20,
|
||||
color: Color(0xFF414042),
|
||||
color: isDarkTheme ? Colors.white : Color(0xFF414042),
|
||||
fontWeight: FontWeight.w600,
|
||||
),
|
||||
),
|
||||
@ -85,17 +195,21 @@ class StayUpdate extends StatelessWidget {
|
||||
child: Icon(
|
||||
Icons.brightness_1,
|
||||
size: 5,
|
||||
color: Color(0xFF414042),
|
||||
color: isDarkTheme ? Colors.white : Color(0xFF414042),
|
||||
),
|
||||
), // Bullet point
|
||||
SizedBox(width: 8), // Space between bullet and text
|
||||
Expanded(
|
||||
child: Text(
|
||||
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
|
||||
softWrap: true,
|
||||
style: TextStyle(
|
||||
color:
|
||||
isDarkTheme ? Colors.white : Color(0xFF898C81)),
|
||||
),
|
||||
),
|
||||
],
|
||||
|
||||
@ -1,12 +1,121 @@
|
||||
import 'dart:convert';
|
||||
|
||||
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';
|
||||
|
||||
class WhoUseTheApp extends StatelessWidget {
|
||||
const WhoUseTheApp({super.key});
|
||||
class WhoUseTheApp extends ConsumerStatefulWidget {
|
||||
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
|
||||
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(
|
||||
data: ThemeData(
|
||||
fontFamily: context.translate(
|
||||
@ -14,22 +123,27 @@ class WhoUseTheApp extends StatelessWidget {
|
||||
'NotoKufi',
|
||||
), // Set default font family for this page
|
||||
textTheme: TextTheme(
|
||||
bodyMedium: TextStyle(fontSize: 16, color: Color(0xFF898C81),fontFamily: context.translate(
|
||||
'Roboto',
|
||||
'NotoKufi',
|
||||
),
|
||||
bodyMedium: TextStyle(
|
||||
fontSize: 16,
|
||||
color: Color(0xFF898C81),
|
||||
fontFamily: context.translate(
|
||||
'Roboto',
|
||||
'NotoKufi',
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
child: BaseScaffold(
|
||||
backgroundColor: isDarkTheme ? Colors.black : Colors.white,
|
||||
appbarColor: isDarkTheme ? Colors.black : Colors.white,
|
||||
showDivider: true,
|
||||
showBackButton: true,
|
||||
dividerColor: Colors.grey[300],
|
||||
appbarColor: Colors.white,
|
||||
// appbarColor: Colors.white,
|
||||
bottomColor: Colors.white,
|
||||
mycenterTitle: true,
|
||||
title: Text(
|
||||
context.translate('Key Features','الميزات الرئيسية'),
|
||||
context.translate('Key Features', 'الميزات الرئيسية'),
|
||||
style: TextStyle(
|
||||
fontFamily: context.translate(
|
||||
'Roboto',
|
||||
@ -43,7 +157,7 @@ class WhoUseTheApp extends StatelessWidget {
|
||||
),
|
||||
body: Container(
|
||||
height: double.infinity,
|
||||
color: Colors.white,
|
||||
color: isDarkTheme ? Colors.black : Colors.white,
|
||||
padding: EdgeInsets.all(16),
|
||||
child: SingleChildScrollView(
|
||||
child: Column(
|
||||
@ -52,14 +166,15 @@ class WhoUseTheApp extends StatelessWidget {
|
||||
Align(
|
||||
alignment: Alignment.topLeft,
|
||||
child: Text(
|
||||
context.translate('Who can use the App?','من يمكنه استخدام التطبيق؟'),
|
||||
context.translate(
|
||||
'Who can use the App?', 'من يمكنه استخدام التطبيق؟'),
|
||||
style: TextStyle(
|
||||
fontFamily: context.translate(
|
||||
'Roboto',
|
||||
'NotoKufi',
|
||||
),
|
||||
fontSize: 20,
|
||||
color: Color(0xFF414042),
|
||||
color: isDarkTheme ? Colors.white : Color(0xFF414042),
|
||||
fontWeight: FontWeight.w600,
|
||||
),
|
||||
),
|
||||
@ -73,14 +188,15 @@ class WhoUseTheApp extends StatelessWidget {
|
||||
),
|
||||
),
|
||||
Text(
|
||||
context.translate('This app is intended for:','يستهدف هذا التطبيق:'),
|
||||
context.translate(
|
||||
'This app is intended for:', 'يستهدف هذا التطبيق:'),
|
||||
style: TextStyle(
|
||||
fontFamily: context.translate(
|
||||
'Roboto',
|
||||
'NotoKufi',
|
||||
),
|
||||
fontSize: 16,
|
||||
color: Color(0xFF414042),
|
||||
color: isDarkTheme ? Colors.white : Color(0xFF414042),
|
||||
fontWeight: FontWeight.w600,
|
||||
),
|
||||
),
|
||||
@ -93,17 +209,21 @@ class WhoUseTheApp extends StatelessWidget {
|
||||
child: Icon(
|
||||
Icons.brightness_1,
|
||||
size: 5,
|
||||
color: Color(0xFF414042),
|
||||
color: isDarkTheme ? Colors.white : Color(0xFF414042),
|
||||
),
|
||||
), // Bullet point
|
||||
SizedBox(width: 8), // Space between bullet and text
|
||||
Expanded(
|
||||
child: Text(
|
||||
context.translate(
|
||||
'Government officials requiring UAE statistics for decision-making.',
|
||||
'المسؤولين الحكوميين الذين يحتاجون إلى إحصاءات دولة الإمارات العربية المتحدة لاتخاذ القرارات.',),
|
||||
textAlign: TextAlign.justify, // Align the text
|
||||
'Government officials requiring UAE statistics for decision-making.',
|
||||
'المسؤولين الحكوميين الذين يحتاجون إلى إحصاءات دولة الإمارات العربية المتحدة لاتخاذ القرارات.',
|
||||
),
|
||||
textAlign: TextAlign.justify, // Align the text
|
||||
softWrap: true,
|
||||
style: TextStyle(
|
||||
color:
|
||||
isDarkTheme ? Colors.white : Color(0xFF898C81)),
|
||||
),
|
||||
),
|
||||
],
|
||||
@ -116,17 +236,21 @@ class WhoUseTheApp extends StatelessWidget {
|
||||
child: Icon(
|
||||
Icons.brightness_1,
|
||||
size: 5,
|
||||
color: Color(0xFF414042),
|
||||
color: isDarkTheme ? Colors.white : Color(0xFF414042),
|
||||
),
|
||||
), // Bullet point
|
||||
SizedBox(width: 8), // Space between bullet and text
|
||||
Expanded(
|
||||
child: Text(
|
||||
context.translate(
|
||||
'Business professionals and researchers analyzing market trends.',
|
||||
'المتخصصين في مجال الأعمال والباحثين الذين يقومون بتحليل اتجاهات السوق.',),
|
||||
'Business professionals and researchers analyzing market trends.',
|
||||
'المتخصصين في مجال الأعمال والباحثين الذين يقومون بتحليل اتجاهات السوق.',
|
||||
),
|
||||
textAlign: TextAlign.justify, // Align the text
|
||||
softWrap: true,
|
||||
style: TextStyle(
|
||||
color:
|
||||
isDarkTheme ? Colors.white : Color(0xFF898C81)),
|
||||
),
|
||||
),
|
||||
],
|
||||
@ -139,22 +263,25 @@ class WhoUseTheApp extends StatelessWidget {
|
||||
child: Icon(
|
||||
Icons.brightness_1,
|
||||
size: 5,
|
||||
color: Color(0xFF414042),
|
||||
color: isDarkTheme ? Colors.white : Color(0xFF414042),
|
||||
),
|
||||
), // Bullet point
|
||||
SizedBox(width: 8), // Space between bullet and text
|
||||
Expanded(
|
||||
child: Text(
|
||||
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
|
||||
softWrap: true,
|
||||
style: TextStyle(
|
||||
color:
|
||||
isDarkTheme ? Colors.white : Color(0xFF898C81)),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
|
||||
SizedBox(
|
||||
height: 20,
|
||||
),
|
||||
|
||||
@ -1,23 +1,131 @@
|
||||
import 'dart:convert';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_riverpod/flutter_riverpod.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/presentation/Screens/Bottom%20Navigation%20Pages/Country_Profile/country_profile.dart';
|
||||
import 'package:uae_stat/presentation/routes/drawer_routes/custom_drawer_routes.dart';
|
||||
|
||||
|
||||
class aboutTheApp extends StatelessWidget {
|
||||
class aboutTheApp extends ConsumerStatefulWidget {
|
||||
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
|
||||
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(
|
||||
backgroundColor: isDarkTheme ? Colors.black : Colors.white,
|
||||
appbarColor: isDarkTheme ? Colors.black : Colors.white,
|
||||
showDivider: true,
|
||||
showBackButton: true,
|
||||
bottomColor: Colors.white,
|
||||
dividerColor: Colors.grey[300],
|
||||
appbarColor: Colors.white,
|
||||
mycenterTitle: true,
|
||||
title: Text(
|
||||
context.translate('Getting Started','البدء'),
|
||||
context.translate('Getting Started', 'البدء'),
|
||||
style: TextStyle(
|
||||
fontSize: 22,
|
||||
fontFamily: context.translate(
|
||||
@ -31,15 +139,16 @@ class aboutTheApp extends StatelessWidget {
|
||||
),
|
||||
body: Container(
|
||||
width: double.infinity,
|
||||
color: Colors.white,
|
||||
color: isDarkTheme ? Colors.black : Colors.white,
|
||||
child: Column(
|
||||
children: [
|
||||
Container(
|
||||
decoration: BoxDecoration(
|
||||
border: Border(
|
||||
bottom: BorderSide(
|
||||
color: Colors.grey.shade300,
|
||||
width: 0.5,), // Grey bottom line
|
||||
color: Colors.grey.shade300,
|
||||
width: 0.5,
|
||||
), // Grey bottom line
|
||||
),
|
||||
),
|
||||
child: ListTile(
|
||||
@ -48,10 +157,10 @@ class aboutTheApp extends StatelessWidget {
|
||||
},
|
||||
tileColor: Colors.white,
|
||||
title: Text(
|
||||
context.translate('About FCSC','حول التطبيق'),
|
||||
context.translate('About FCSC', 'حول التطبيق'),
|
||||
style: TextStyle(
|
||||
fontSize: 16,
|
||||
color: Color(0xFF414042),
|
||||
color: isDarkTheme ? Colors.white : Color(0xFF414042),
|
||||
fontWeight: FontWeight.w500,
|
||||
fontFamily: context.translate(
|
||||
'Roboto',
|
||||
@ -59,15 +168,19 @@ class aboutTheApp extends StatelessWidget {
|
||||
),
|
||||
),
|
||||
),
|
||||
trailing: Icon(Icons.keyboard_arrow_right),
|
||||
trailing: Icon(
|
||||
Icons.keyboard_arrow_right,
|
||||
color: isDarkTheme ? Colors.white : Color(0xFF414042),
|
||||
),
|
||||
),
|
||||
),
|
||||
Container(
|
||||
decoration: BoxDecoration(
|
||||
border: Border(
|
||||
bottom: BorderSide(
|
||||
color: Colors.grey.shade300,
|
||||
width: 0.5,), // Grey bottom line
|
||||
color: Colors.grey.shade300,
|
||||
width: 0.5,
|
||||
), // Grey bottom line
|
||||
),
|
||||
),
|
||||
child: ListTile(
|
||||
@ -76,10 +189,10 @@ class aboutTheApp extends StatelessWidget {
|
||||
},
|
||||
// tileColor: Colors.white,
|
||||
title: Text(
|
||||
context.translate('How to Get Started?','كيفية البدء'),
|
||||
context.translate('How to Get Started?', 'كيفية البدء'),
|
||||
style: TextStyle(
|
||||
fontSize: 16,
|
||||
color: Color(0xFF414042),
|
||||
color: isDarkTheme ? Colors.white : Color(0xFF414042),
|
||||
fontWeight: FontWeight.w500,
|
||||
fontFamily: context.translate(
|
||||
'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(
|
||||
bottom: BorderSide(
|
||||
color: Colors.black, width: 3,), // Grey bottom line
|
||||
color: Colors.black,
|
||||
width: 3,
|
||||
), // Grey bottom line
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
@ -1,32 +1,140 @@
|
||||
import 'dart:convert';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_riverpod/flutter_riverpod.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/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/infrastructure/services/img_asset_paths/banner_asset_path.dart';
|
||||
|
||||
class UsingFeatures extends StatelessWidget {
|
||||
class UsingFeatures extends ConsumerStatefulWidget {
|
||||
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
|
||||
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(
|
||||
showDivider: true,
|
||||
showBackButton: true,
|
||||
dividerColor: Colors.grey[300],
|
||||
bottomColor: Colors.white,
|
||||
appbarColor: Colors.white,
|
||||
backgroundColor: isDarkTheme ? Colors.black : Colors.white,
|
||||
appbarColor: isDarkTheme ? Colors.black : Colors.white,
|
||||
// appbarColor: Colors.white,
|
||||
mycenterTitle: true,
|
||||
title: Text(
|
||||
context.translate('Key Features','الميزات الرئيسية'),
|
||||
context.translate('Key Features', 'الميزات الرئيسية'),
|
||||
style: TextStyle(
|
||||
fontSize: 22,
|
||||
fontFamily: context.translate(
|
||||
'Roboto',
|
||||
'NotoKufi',
|
||||
),
|
||||
fontFamily: context.translate(
|
||||
'Roboto',
|
||||
'NotoKufi',
|
||||
),
|
||||
color: Color(0xFF7DAFBC),
|
||||
fontWeight: FontWeight.w500,
|
||||
// fontWeight: FontWeight.w500,
|
||||
@ -34,7 +142,7 @@ class UsingFeatures extends StatelessWidget {
|
||||
),
|
||||
body: Container(
|
||||
width: double.infinity,
|
||||
color: Colors.white,
|
||||
color: isDarkTheme ? Colors.black : Colors.white,
|
||||
child: Column(
|
||||
children: [
|
||||
Container(
|
||||
@ -49,12 +157,12 @@ class UsingFeatures extends StatelessWidget {
|
||||
onTap: () {
|
||||
context.push('/user-guide/features/appFeatures');
|
||||
},
|
||||
tileColor: Colors.white,
|
||||
tileColor: isDarkTheme ? Colors.grey : Colors.white,
|
||||
title: Text(
|
||||
context.translate('App Features','الميزات الرئيسية '),
|
||||
context.translate('App Features', 'الميزات الرئيسية '),
|
||||
style: TextStyle(
|
||||
fontSize: 16,
|
||||
color: Color(0xFF414042),
|
||||
color: isDarkTheme ? Colors.white : Color(0xFF414042),
|
||||
fontWeight: FontWeight.w500,
|
||||
fontFamily: context.translate(
|
||||
'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(
|
||||
@ -79,10 +190,11 @@ class UsingFeatures extends StatelessWidget {
|
||||
},
|
||||
// tileColor: Colors.white,
|
||||
title: Text(
|
||||
context.translate('Who can use The App?','يمكنه استخدام التطبيق?'),
|
||||
context.translate(
|
||||
'Who can use The App?', 'يمكنه استخدام التطبيق?'),
|
||||
style: TextStyle(
|
||||
fontSize: 16,
|
||||
color: Color(0xFF414042),
|
||||
color: isDarkTheme ? Colors.white : Color(0xFF414042),
|
||||
fontWeight: FontWeight.w500,
|
||||
fontFamily: context.translate(
|
||||
'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(
|
||||
bottom: BorderSide(
|
||||
color: Colors.black, width: 3), // Grey bottom line
|
||||
@ -111,10 +226,10 @@ class UsingFeatures extends StatelessWidget {
|
||||
},
|
||||
// tileColor: Colors.white,
|
||||
title: Text(
|
||||
context.translate('Purpose of the App','ض من التطبيق'),
|
||||
context.translate('Purpose of the App', 'ض من التطبيق'),
|
||||
style: TextStyle(
|
||||
fontSize: 16,
|
||||
color: Color(0xFF414042),
|
||||
color: isDarkTheme ? Colors.white : Color(0xFF414042),
|
||||
fontWeight: FontWeight.w500,
|
||||
fontFamily: context.translate(
|
||||
'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(
|
||||
bottom: BorderSide(
|
||||
color: Colors.black, width: 3), // Grey bottom line
|
||||
@ -143,10 +261,11 @@ class UsingFeatures extends StatelessWidget {
|
||||
},
|
||||
// tileColor: Colors.white,
|
||||
title: Text(
|
||||
context.translate('How to Use the App','كيفية استخدام التطبيق'),
|
||||
context.translate(
|
||||
'How to Use the App', 'كيفية استخدام التطبيق'),
|
||||
style: TextStyle(
|
||||
fontSize: 16,
|
||||
color: Color(0xFF414042),
|
||||
color: isDarkTheme ? Colors.white : Color(0xFF414042),
|
||||
fontWeight: FontWeight.w500,
|
||||
fontFamily: context.translate(
|
||||
'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(
|
||||
bottom: BorderSide(
|
||||
color: Colors.black, width: 3), // Grey bottom line
|
||||
@ -175,10 +297,10 @@ class UsingFeatures extends StatelessWidget {
|
||||
},
|
||||
// tileColor: Colors.white,
|
||||
title: Text(
|
||||
context.translate('Stay Updated','ابق على اطلاع'),
|
||||
context.translate('Stay Updated', 'ابق على اطلاع'),
|
||||
style: TextStyle(
|
||||
fontSize: 16,
|
||||
color: Color(0xFF414042),
|
||||
color: isDarkTheme ? Colors.white : Color(0xFF414042),
|
||||
fontWeight: FontWeight.w500,
|
||||
fontFamily: context.translate(
|
||||
'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(
|
||||
bottom: BorderSide(
|
||||
color: Colors.black, width: 3), // Grey bottom line
|
||||
@ -207,10 +332,11 @@ class UsingFeatures extends StatelessWidget {
|
||||
},
|
||||
// tileColor: Colors.white,
|
||||
title: Text(
|
||||
context.translate('How to Change My Password','كيفية تغيير كلمة المرور الخاصة بي'),
|
||||
context.translate('How to Change My Password',
|
||||
'كيفية تغيير كلمة المرور الخاصة بي'),
|
||||
style: TextStyle(
|
||||
fontSize: 16,
|
||||
color: Color(0xFF414042),
|
||||
color: isDarkTheme ? Colors.white : Color(0xFF414042),
|
||||
fontWeight: FontWeight.w500,
|
||||
fontFamily: context.translate(
|
||||
'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(
|
||||
bottom: BorderSide(
|
||||
color: Colors.black, width: 3), // Grey bottom line
|
||||
@ -239,10 +368,11 @@ class UsingFeatures extends StatelessWidget {
|
||||
},
|
||||
// tileColor: Colors.white,
|
||||
title: Text(
|
||||
context.translate('How to Edit My Profile','كيفية تعديل ملفي الشخصي'),
|
||||
context.translate(
|
||||
'How to Edit My Profile', 'كيفية تعديل ملفي الشخصي'),
|
||||
style: TextStyle(
|
||||
fontSize: 16,
|
||||
color: Color(0xFF414042),
|
||||
color: isDarkTheme ? Colors.white : Color(0xFF414042),
|
||||
fontWeight: FontWeight.w500,
|
||||
fontFamily: context.translate(
|
||||
'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(
|
||||
bottom: BorderSide(
|
||||
color: Colors.black, width: 3), // Grey bottom line
|
||||
|
||||
@ -1,25 +1,59 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_riverpod/flutter_riverpod.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/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:iconify_design/iconify_design.dart';
|
||||
import 'package:flutter_gen/gen_l10n/app_localizations.dart';
|
||||
// import 'package:uae_stat/l10n/app_localizations.dart';
|
||||
|
||||
|
||||
class Userguide extends StatefulWidget {
|
||||
class Userguide extends ConsumerStatefulWidget {
|
||||
Userguide({super.key});
|
||||
|
||||
@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 = [
|
||||
{'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':'faq','color': Color(0xFF7296BE), 'text': 'FAQs', 'icon': 'mdi:faq', 'text-ar': 'لأسئلة الشائعة'},
|
||||
{
|
||||
'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': 'faq',
|
||||
'color': Color(0xFF7296BE),
|
||||
'text': 'FAQs',
|
||||
'icon': 'mdi:faq',
|
||||
'text-ar': 'لأسئلة الشائعة'
|
||||
},
|
||||
];
|
||||
|
||||
late ThemeMode currentTheme;
|
||||
@override
|
||||
initState() {
|
||||
super.initState();
|
||||
print('123456789');
|
||||
|
||||
}
|
||||
|
||||
@override
|
||||
Widget buildDynamicWidget(dynamic icons, Color color) {
|
||||
if (icons is IconData) {
|
||||
@ -46,15 +80,23 @@ class _UserguideState extends State<Userguide> {
|
||||
} else {
|
||||
return Text(
|
||||
'Unsupported type',
|
||||
style: TextStyle(color: Colors.red,fontFamily: context.translate(
|
||||
'Roboto',
|
||||
'NotoKufi',
|
||||
),),
|
||||
style: TextStyle(
|
||||
color: Colors.red,
|
||||
fontFamily: context.translate(
|
||||
'Roboto',
|
||||
'NotoKufi',
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Widget build(BuildContext context) {
|
||||
final currentTheme = ref.watch(themeProvider);
|
||||
isDarkTheme = currentTheme == ThemeMode.dark ||
|
||||
(currentTheme == ThemeMode.system &&
|
||||
MediaQuery.of(context).platformBrightness == Brightness.dark);
|
||||
|
||||
return PopScope(
|
||||
canPop: false,
|
||||
onPopInvokedWithResult: (didPop, result) {
|
||||
@ -63,13 +105,13 @@ class _UserguideState extends State<Userguide> {
|
||||
},
|
||||
child: BaseScaffold(
|
||||
showDivider: true,
|
||||
bottomColor: Colors.white,
|
||||
dividerColor: Colors.grey[300],
|
||||
appbarColor: Colors.white,
|
||||
title: Text(AppLocalizations.of(context)!.guide_title) ,
|
||||
body: Container(
|
||||
color: Colors.white,
|
||||
padding: const EdgeInsets.symmetric(horizontal: 16 , vertical: 20),
|
||||
bottomColor: isDarkTheme ? Color(0xFF111111) : Colors.white,
|
||||
dividerColor: isDarkTheme ? Color(0xFF111111) : Colors.grey[300],
|
||||
appbarColor: isDarkTheme ? Color(0xFF111111) : Colors.white,
|
||||
title: Text(AppLocalizations.of(context)!.guide_title,style: TextStyle(color: isDarkTheme ? Colors.white : Color(0xFF414042) ),),
|
||||
body: Container(
|
||||
color: isDarkTheme ? Color(0xFF111111) : Colors.white,
|
||||
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 20),
|
||||
child: GridView.builder(
|
||||
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
|
||||
crossAxisCount: 2,
|
||||
@ -82,7 +124,8 @@ class _UserguideState extends State<Userguide> {
|
||||
itemBuilder: (context, index) {
|
||||
return HoverContainer(
|
||||
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'],
|
||||
);
|
||||
},
|
||||
@ -91,83 +134,92 @@ class _UserguideState extends State<Userguide> {
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
class HoverContainer extends StatefulWidget {
|
||||
class HoverContainer extends ConsumerStatefulWidget {
|
||||
final String iconName;
|
||||
final String title;
|
||||
final String routePath;
|
||||
|
||||
|
||||
const HoverContainer({Key? key, required this.iconName, required this.title, required this.routePath}) : super(key: key);
|
||||
const HoverContainer(
|
||||
{Key? key,
|
||||
required this.iconName,
|
||||
required this.title,
|
||||
required this.routePath})
|
||||
: super(key: key);
|
||||
|
||||
@override
|
||||
_HoverContainerState createState() => _HoverContainerState();
|
||||
ConsumerState<HoverContainer> createState() => _HoverContainerState();
|
||||
}
|
||||
|
||||
class _HoverContainerState extends State<HoverContainer> {
|
||||
class _HoverContainerState extends ConsumerState<HoverContainer> {
|
||||
bool isHovered = true;
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final double screenWidth= MediaQuery.of(context).size.width;
|
||||
final double screenHeight= MediaQuery.of(context).size.height;
|
||||
final double screenWidth = MediaQuery.of(context).size.width;
|
||||
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(
|
||||
onTap: () { context.push('/user-guide/${widget.routePath}');},
|
||||
child: MouseRegion(
|
||||
onTap: () {
|
||||
context.push('/user-guide/${widget.routePath}');
|
||||
},
|
||||
child: MouseRegion(
|
||||
onEnter: (_) => setState(() => isHovered = true),
|
||||
onExit: (_) => setState(() => isHovered = true),
|
||||
child : Container(
|
||||
child: Container(
|
||||
padding: EdgeInsets.only(top: 4, right: 4, left: 4, bottom: 6),
|
||||
|
||||
width: screenWidth*0.30,
|
||||
width: screenWidth * 0.30,
|
||||
margin: EdgeInsets.all(1),
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white,
|
||||
color: isDarkTheme ? Color(0xFF111111) : Colors.white,
|
||||
borderRadius: BorderRadius.circular(10),
|
||||
boxShadow: isHovered
|
||||
? [
|
||||
BoxShadow(
|
||||
color: Colors.black.withOpacity(0.2),
|
||||
blurRadius:2,
|
||||
spreadRadius: 1,
|
||||
offset: Offset(0, 4),
|
||||
),
|
||||
]
|
||||
BoxShadow(
|
||||
color: Colors.black.withOpacity(0.2),
|
||||
blurRadius: 2,
|
||||
spreadRadius: 1,
|
||||
offset: Offset(0, 4),
|
||||
),
|
||||
]
|
||||
: [],
|
||||
border: Border.all(
|
||||
color: Color(0xFF7DAFBC),
|
||||
width: 1.0
|
||||
),
|
||||
border: Border.all(color: Color(0xFF7DAFBC), width: 1.0),
|
||||
),
|
||||
alignment: Alignment.center,
|
||||
// duration: Duration(milliseconds: 200),
|
||||
|
||||
child: LayoutBuilder(builder: (context, constraints){
|
||||
child: LayoutBuilder(builder: (context, constraints) {
|
||||
double containerWidth = constraints.maxWidth;
|
||||
double containerHeight = constraints.maxHeight;
|
||||
return Column(
|
||||
return Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
IconifyIcon(icon: widget.iconName,
|
||||
color: Color((0xFF7DAFBC)),
|
||||
size: containerHeight * 0.45,),
|
||||
IconifyIcon(
|
||||
icon: widget.iconName,
|
||||
color: Color(0xFF7DAFBC),
|
||||
size: containerHeight * 0.45,
|
||||
),
|
||||
// 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(
|
||||
width: containerWidth* 0.85,
|
||||
width: containerWidth * 0.85,
|
||||
padding: EdgeInsets.symmetric(horizontal: 4, vertical: 4),
|
||||
margin: EdgeInsets.only(bottom: 3),
|
||||
decoration: BoxDecoration(
|
||||
color: Color(0xFF7DAFBC),
|
||||
borderRadius: BorderRadius.circular(5),
|
||||
border: Border.all(color: Color(0xFF7DAFBC))
|
||||
),
|
||||
border: Border.all(color: Color(0xFF7DAFBC))),
|
||||
child: Text(
|
||||
widget.title,
|
||||
style: TextStyle(
|
||||
color: Colors.white, // Text color
|
||||
color: Colors.white, // Text color
|
||||
fontWeight: FontWeight.bold,
|
||||
fontFamily: context.translate(
|
||||
'Roboto',
|
||||
@ -179,16 +231,8 @@ class _HoverContainerState extends State<HoverContainer> {
|
||||
),
|
||||
],
|
||||
);
|
||||
})
|
||||
|
||||
|
||||
),
|
||||
})),
|
||||
),
|
||||
|
||||
|
||||
|
||||
);
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -45,10 +45,10 @@ class BaseScaffold extends ConsumerStatefulWidget {
|
||||
this.showBackButton = false,
|
||||
this.colorChange = false,
|
||||
this.mycenterTitle = false,
|
||||
this.appbarColor,
|
||||
this.appbarColor = Colors.white,
|
||||
this.mytitleColor,
|
||||
this.bottomColor = null,
|
||||
this.backgroundColor,
|
||||
this.backgroundColor = Colors.white,
|
||||
});
|
||||
final Widget body;
|
||||
final Widget title;
|
||||
@ -133,7 +133,7 @@ class _BaseScaffoldState extends ConsumerState<BaseScaffold> {
|
||||
|
||||
void _calculatetooglePosition() {
|
||||
final RenderBox cardRenderBox =
|
||||
toggleKey.currentContext!.findRenderObject() as RenderBox;
|
||||
toggleKey.currentContext!.findRenderObject() as RenderBox;
|
||||
final Offset cardPosition = cardRenderBox.localToGlobal(Offset.zero);
|
||||
final Size cardSize = cardRenderBox.size;
|
||||
toggleHeight = cardSize.height;
|
||||
@ -257,7 +257,7 @@ class _BaseScaffoldState extends ConsumerState<BaseScaffold> {
|
||||
.state = true;
|
||||
ref
|
||||
.read(previousChartsTourProvider
|
||||
.notifier)
|
||||
.notifier)
|
||||
.state = false;
|
||||
context.go(
|
||||
'/chartScreen/marriages?bgColor=0xFFAA8E83&mainTopic=null&title=Marriages',
|
||||
@ -290,7 +290,7 @@ class _BaseScaffoldState extends ConsumerState<BaseScaffold> {
|
||||
.state = true;
|
||||
ref
|
||||
.read(previousChartsTourProvider
|
||||
.notifier)
|
||||
.notifier)
|
||||
.state = false;
|
||||
context.go(
|
||||
'/chartScreen/marriages?bgColor=0xFFAA8E83&mainTopic=اجتماعي&title=الزواج&key=home',
|
||||
@ -579,8 +579,10 @@ class _BaseScaffoldState extends ConsumerState<BaseScaffold> {
|
||||
const SizedBox(width: 10),
|
||||
ElevatedButton(
|
||||
onPressed: () async {
|
||||
final prefs = await SharedPreferences.getInstance();
|
||||
String? loginCount = prefs.getString('login_count');
|
||||
final prefs =
|
||||
await SharedPreferences.getInstance();
|
||||
String? loginCount =
|
||||
prefs.getString('login_count');
|
||||
if (loginCount == '1') {
|
||||
await prefs.setString('login_count', '2');
|
||||
}
|
||||
@ -590,10 +592,10 @@ class _BaseScaffoldState extends ConsumerState<BaseScaffold> {
|
||||
.state = true;
|
||||
ref
|
||||
.read(
|
||||
previousChartsTourProvider.notifier)
|
||||
previousChartsTourProvider.notifier)
|
||||
.state = true;
|
||||
ref.read(homeTourProvider.notifier).state =
|
||||
true;
|
||||
true;
|
||||
ref
|
||||
.read(previousHomeTourProvider.notifier)
|
||||
.state = true;
|
||||
@ -602,7 +604,7 @@ class _BaseScaffoldState extends ConsumerState<BaseScaffold> {
|
||||
.state = true;
|
||||
ref
|
||||
.read(previousScaffoldTourProvider
|
||||
.notifier)
|
||||
.notifier)
|
||||
.state = true;
|
||||
tutorialCoachMark.finish();
|
||||
},
|
||||
@ -714,7 +716,8 @@ class _BaseScaffoldState extends ConsumerState<BaseScaffold> {
|
||||
String recordId = userId;
|
||||
String collectionId =
|
||||
userDetailsResponse.data['collectionId'] ?? '_pb_users_auth_';
|
||||
List<dynamic> userReadedNotification = userDetailsResponse.data['pushed_notification'];
|
||||
List<dynamic> userReadedNotification =
|
||||
userDetailsResponse.data['pushed_notification'];
|
||||
|
||||
// Convert to List<String>
|
||||
userReadedNotiOrNot = List<String>.from(userReadedNotification);
|
||||
@ -755,7 +758,7 @@ class _BaseScaffoldState extends ConsumerState<BaseScaffold> {
|
||||
print('notifications $notifications');
|
||||
// isLoading = false;
|
||||
});
|
||||
_processNotifications(notifications , userReadedNotiOrNot);
|
||||
_processNotifications(notifications, userReadedNotiOrNot);
|
||||
} else {
|
||||
throw Exception('Failed to load data');
|
||||
}
|
||||
@ -768,7 +771,8 @@ class _BaseScaffoldState extends ConsumerState<BaseScaffold> {
|
||||
}
|
||||
}
|
||||
|
||||
void _processNotifications(List<Map<String, dynamic>> notification, List<String> push) {
|
||||
void _processNotifications(
|
||||
List<Map<String, dynamic>> notification, List<String> push) {
|
||||
print('inside last function ${notification.length}');
|
||||
print('inside last function ${push.length}');
|
||||
|
||||
@ -802,7 +806,6 @@ class _BaseScaffoldState extends ConsumerState<BaseScaffold> {
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
// Future<void> logout() async {
|
||||
// final prefs = await SharedPreferences.getInstance();
|
||||
// // setState(() {
|
||||
@ -819,13 +822,13 @@ class _BaseScaffoldState extends ConsumerState<BaseScaffold> {
|
||||
final PAuthRepo _authRepo = PAuthRepo();
|
||||
|
||||
void _routeToIndex() {
|
||||
String url=GoRouterState.of(context).uri.toString();
|
||||
String url = GoRouterState.of(context).uri.toString();
|
||||
final uri = Uri.parse(url);
|
||||
final fromValue = uri.queryParameters['key'] ?? '';
|
||||
if (fromValue=='home'){
|
||||
ref.read(selectedIndexProvider.notifier).state= 0;
|
||||
}else if (fromValue=='uaenumbers'){
|
||||
ref.read(selectedIndexProvider.notifier).state= 1;
|
||||
if (fromValue == 'home') {
|
||||
ref.read(selectedIndexProvider.notifier).state = 0;
|
||||
} else if (fromValue == 'uaenumbers') {
|
||||
ref.read(selectedIndexProvider.notifier).state = 1;
|
||||
}
|
||||
}
|
||||
|
||||
@ -836,7 +839,6 @@ class _BaseScaffoldState extends ConsumerState<BaseScaffold> {
|
||||
context.go('/login'); // Redirect to login after logout
|
||||
}
|
||||
|
||||
|
||||
// void _showThemeDialog(BuildContext context) async {
|
||||
// AppTheme? result = await showDialog<AppTheme>(
|
||||
// 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 platformBrightness = MediaQuery.of(context).platformBrightness;
|
||||
|
||||
@ -926,7 +929,9 @@ class _BaseScaffoldState extends ConsumerState<BaseScaffold> {
|
||||
|
||||
if (selectedTheme != null) {
|
||||
// Update UI immediately
|
||||
ref.read(themeProvider.notifier).updateTheme(selectedTheme, platformBrightness);
|
||||
ref
|
||||
.read(themeProvider.notifier)
|
||||
.updateTheme(selectedTheme, platformBrightness);
|
||||
|
||||
// Send only 'light' or 'dark' to PocketBase
|
||||
final themeToSend = selectedTheme == AppTheme.system
|
||||
@ -937,10 +942,6 @@ class _BaseScaffoldState extends ConsumerState<BaseScaffold> {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final locale = ref.watch(localeProvider);
|
||||
@ -956,7 +957,8 @@ class _BaseScaffoldState extends ConsumerState<BaseScaffold> {
|
||||
final String currentRoute1 = ModalRoute.of(context)?.settings.name ?? '';
|
||||
|
||||
return Scaffold(
|
||||
backgroundColor: Colors.white,
|
||||
backgroundColor: widget.backgroundColor,
|
||||
// backgroundColor: Colors.white,
|
||||
appBar: AppBar(
|
||||
title: Padding(
|
||||
padding: EdgeInsets.only(top: 10),
|
||||
@ -980,32 +982,37 @@ class _BaseScaffoldState extends ConsumerState<BaseScaffold> {
|
||||
),
|
||||
scrolledUnderElevation: 0,
|
||||
titleSpacing: 0,
|
||||
flexibleSpace: (isDarkTheme && currentRoute == '/myhomepage')
|
||||
? Container(
|
||||
decoration: const BoxDecoration(
|
||||
image: DecorationImage(
|
||||
image: AssetImage('assets/dark_bg.png'),
|
||||
fit: BoxFit.cover,
|
||||
),
|
||||
flexibleSpace: Container(
|
||||
decoration: BoxDecoration(
|
||||
color: isDarkTheme ? Color(0xFF000000) : Color(0xFFFFFFFF),
|
||||
),
|
||||
)
|
||||
: (isDarkTheme && currentRoute == '/uaenumbers')
|
||||
? Container(
|
||||
decoration: const BoxDecoration(
|
||||
color: Color(0xFF333333),
|
||||
),
|
||||
)
|
||||
: null,
|
||||
),
|
||||
// flexibleSpace: (isDarkTheme && currentRoute == '/myhomepage')
|
||||
// ? Container(
|
||||
// decoration: const BoxDecoration(
|
||||
// image: DecorationImage(
|
||||
// image: AssetImage('assets/dark_bg.png'),
|
||||
// fit: BoxFit.cover,
|
||||
// ),
|
||||
// ),
|
||||
// )
|
||||
// : (isDarkTheme && currentRoute == '/uaenumbers')
|
||||
// ? Container(
|
||||
// decoration: const BoxDecoration(
|
||||
// color: Color(0xFF333333),
|
||||
// ),
|
||||
// )
|
||||
// : null,
|
||||
backgroundColor: widget.appbarColor ?? Colors.white,
|
||||
leadingWidth: widget.showBackButton ? mywidth * 0.18 : null,
|
||||
leadingWidth: widget.showBackButton ? mywidth * 0.18 : null,
|
||||
bottom: widget.showDivider
|
||||
? PreferredSize(
|
||||
preferredSize: Size.fromHeight(1), // Height of the line
|
||||
child: Container(
|
||||
color: widget.dividerColor, // Line color
|
||||
height: 1, // Line thickness
|
||||
),
|
||||
)
|
||||
preferredSize: Size.fromHeight(1), // Height of the line
|
||||
child: Container(
|
||||
color: widget.dividerColor, // Line color
|
||||
height: 1, // Line thickness
|
||||
),
|
||||
)
|
||||
: null,
|
||||
|
||||
// bottom: widget.showDivider
|
||||
@ -1048,7 +1055,15 @@ class _BaseScaffoldState extends ConsumerState<BaseScaffold> {
|
||||
child: IconButton(
|
||||
padding: EdgeInsets.zero,
|
||||
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),
|
||||
onPressed: () {
|
||||
if (widget.navBackArrow is Text &&
|
||||
@ -1087,7 +1102,7 @@ class _BaseScaffoldState extends ConsumerState<BaseScaffold> {
|
||||
),
|
||||
),
|
||||
drawer: Drawer(
|
||||
backgroundColor: isDarkTheme ? Color(0xFF111111) : Colors.white,
|
||||
backgroundColor: isDarkTheme ? Color(0xFF111111) : Colors.white,
|
||||
child: Column(children: [
|
||||
Expanded(
|
||||
child: ListView(
|
||||
@ -1120,19 +1135,19 @@ class _BaseScaffoldState extends ConsumerState<BaseScaffold> {
|
||||
child: ClipOval(
|
||||
child: _avatarUrl.isNotEmpty
|
||||
? Image(
|
||||
image: NetworkImage(_avatarUrl),
|
||||
fit: BoxFit.cover,
|
||||
width: double.infinity,
|
||||
height: double.infinity,
|
||||
)
|
||||
image: NetworkImage(_avatarUrl),
|
||||
fit: BoxFit.cover,
|
||||
width: double.infinity,
|
||||
height: double.infinity,
|
||||
)
|
||||
: Image(
|
||||
image: AssetImage(
|
||||
'assets/edit_profile/profile.jpg',
|
||||
),
|
||||
fit: BoxFit.cover,
|
||||
width: double.infinity,
|
||||
height: double.infinity,
|
||||
),
|
||||
image: AssetImage(
|
||||
'assets/edit_profile/profile.jpg',
|
||||
),
|
||||
fit: BoxFit.cover,
|
||||
width: double.infinity,
|
||||
height: double.infinity,
|
||||
),
|
||||
),
|
||||
//child: Image(image: AssetImage('assets/edit_profile/profile.png'))
|
||||
),
|
||||
@ -1167,31 +1182,43 @@ class _BaseScaffoldState extends ConsumerState<BaseScaffold> {
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
if (userId == "guest") ...[
|
||||
Text(userName ?? 'Guest User',
|
||||
style: TextStyle(
|
||||
color: isDarkTheme ? Color(0xFFAAAAAA) : null,
|
||||
),),
|
||||
Text(
|
||||
userName ?? 'Guest User',
|
||||
style: TextStyle(
|
||||
color: isDarkTheme
|
||||
? Color(0xFFAAAAAA)
|
||||
: null,
|
||||
),
|
||||
),
|
||||
] else ...[
|
||||
Text(userName ?? 'Loading...',
|
||||
style: TextStyle(
|
||||
color: isDarkTheme ? Color(0xFFAAAAAA) : null,
|
||||
),),
|
||||
Text(
|
||||
userName ?? 'Loading...',
|
||||
style: TextStyle(
|
||||
color: isDarkTheme
|
||||
? Color(0xFFAAAAAA)
|
||||
: null,
|
||||
),
|
||||
),
|
||||
Tooltip(
|
||||
message: userEmail ??
|
||||
'Loading...', // Shows full email on hover
|
||||
child: SizedBox(
|
||||
width: MediaQuery.of(context)
|
||||
.size
|
||||
.width *
|
||||
.size
|
||||
.width *
|
||||
0.6, // Adjust width as needed
|
||||
child: Text(
|
||||
userEmail ?? 'Loading...',
|
||||
style: TextStyle(fontSize: 12,
|
||||
color: isDarkTheme ? Color(0xFFAAAAAA) : null,
|
||||
fontFamily: context.translate(
|
||||
'Roboto',
|
||||
'NotoKufi',
|
||||
),),
|
||||
style: TextStyle(
|
||||
fontSize: 12,
|
||||
color: isDarkTheme
|
||||
? Color(0xFFAAAAAA)
|
||||
: null,
|
||||
fontFamily: context.translate(
|
||||
'Roboto',
|
||||
'NotoKufi',
|
||||
),
|
||||
),
|
||||
// softWrap: true,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
maxLines: 1,
|
||||
@ -1210,20 +1237,25 @@ color: isDarkTheme ? Color(0xFFAAAAAA) : null,
|
||||
),
|
||||
if (userId != 'guest')
|
||||
ListTile(
|
||||
leading: Icon(Icons.notifications_none,color: isDarkTheme ? Color(0xFFFFFFFF) : null),
|
||||
title: Text(AppLocalizations.of(context)!.notification,
|
||||
leading: Icon(Icons.notifications_none,
|
||||
color: isDarkTheme ? Color(0xFFFFFFFF) : null),
|
||||
title: Text(
|
||||
AppLocalizations.of(context)!.notification,
|
||||
style: TextStyle(
|
||||
color: isDarkTheme ? Color(0xFFAAAAAA) : null,
|
||||
fontFamily: context.translate(
|
||||
'Roboto',
|
||||
'NotoKufi',
|
||||
), ),
|
||||
),
|
||||
),
|
||||
),
|
||||
trailing: _buildNotificationBadge(count: notificationCount),
|
||||
trailing:
|
||||
_buildNotificationBadge(count: notificationCount),
|
||||
onTap: () => _navigateTo(context, '/notification'),
|
||||
),
|
||||
ListTile(
|
||||
leading: Icon(Icons.message_outlined,color: isDarkTheme ? Color(0xFFFFFFFF) : null),
|
||||
leading: Icon(Icons.message_outlined,
|
||||
color: isDarkTheme ? Color(0xFFFFFFFF) : null),
|
||||
// leading: Image.asset(
|
||||
// DrawerAssetIconPath.feedback,
|
||||
// color: Colors.black,
|
||||
@ -1231,19 +1263,23 @@ color: isDarkTheme ? Color(0xFFAAAAAA) : null,
|
||||
// height: 20,
|
||||
// ),
|
||||
// title: const Text('Feedback'),
|
||||
title: Text(AppLocalizations.of(context)!.feedback_title,
|
||||
title: Text(
|
||||
AppLocalizations.of(context)!.feedback_title,
|
||||
style: TextStyle(
|
||||
color: isDarkTheme ? Color(0xFFAAAAAA) : null,
|
||||
fontFamily: context.translate(
|
||||
'Roboto',
|
||||
'NotoKufi',
|
||||
), ),),
|
||||
),
|
||||
),
|
||||
),
|
||||
onTap: () =>
|
||||
_navigateTo(context, '/feedback', extra: userName),
|
||||
),
|
||||
if (role == 'admin')
|
||||
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(
|
||||
// DrawerAssetIconPath.manageUser,
|
||||
// color: Colors.black,
|
||||
@ -1258,12 +1294,14 @@ color: isDarkTheme ? Color(0xFFAAAAAA) : null,
|
||||
fontFamily: context.translate(
|
||||
'Roboto',
|
||||
'NotoKufi',
|
||||
), ),
|
||||
),
|
||||
),
|
||||
),
|
||||
onTap: () => _navigateTo(context, '/manageuser'),
|
||||
),
|
||||
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: Text(
|
||||
AppLocalizations.of(context)!.bookmark_title,
|
||||
@ -1272,12 +1310,14 @@ color: isDarkTheme ? Color(0xFFAAAAAA) : null,
|
||||
fontFamily: context.translate(
|
||||
'Roboto',
|
||||
'NotoKufi',
|
||||
), ),
|
||||
),
|
||||
),
|
||||
),
|
||||
onTap: () => _navigateTo(context, '/bookmark'),
|
||||
),
|
||||
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(
|
||||
// DrawerAssetIconPath.guide,
|
||||
// color: Colors.black,
|
||||
@ -1285,80 +1325,100 @@ color: isDarkTheme ? Color(0xFFAAAAAA) : null,
|
||||
// height: 20,
|
||||
// ),
|
||||
// title: const Text('User Guide'),
|
||||
title: Text(AppLocalizations.of(context)!.guide_title,
|
||||
title: Text(
|
||||
AppLocalizations.of(context)!.guide_title,
|
||||
style: TextStyle(
|
||||
color: isDarkTheme ? Color(0xFFAAAAAA) : null,
|
||||
fontFamily: context.translate(
|
||||
'Roboto',
|
||||
'NotoKufi',
|
||||
), ),
|
||||
),
|
||||
),
|
||||
),
|
||||
onTap: () => _navigateTo(context, '/user-guide'),
|
||||
),
|
||||
ListTile(
|
||||
leading: Icon(Icons.mail_outlined,color: isDarkTheme ? Color(0xFFFFFFFF) : null),
|
||||
title: Text(context.translate('Contact Us', 'اتصل بنا'),
|
||||
leading: Icon(Icons.mail_outlined,
|
||||
color: isDarkTheme ? Color(0xFFFFFFFF) : null),
|
||||
title: Text(
|
||||
context.translate('Contact Us', 'اتصل بنا'),
|
||||
style: TextStyle(
|
||||
color: isDarkTheme ? Color(0xFFAAAAAA) : null,
|
||||
fontFamily: context.translate(
|
||||
'Roboto',
|
||||
'NotoKufi',
|
||||
), ),),
|
||||
),
|
||||
),
|
||||
),
|
||||
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')
|
||||
ListTile(
|
||||
leading: Icon(Icons.logout,color: isDarkTheme ? Color(0xFFFFFFFF) : null),
|
||||
leading: Icon(Icons.logout,
|
||||
color: isDarkTheme ? Color(0xFFFFFFFF) : null),
|
||||
// title: const Text('Logout'),
|
||||
title: Text(AppLocalizations.of(context)!.logout,
|
||||
title: Text(
|
||||
AppLocalizations.of(context)!.logout,
|
||||
style: TextStyle(
|
||||
color: isDarkTheme ? Color(0xFFAAAAAA) : null,
|
||||
fontFamily: context.translate(
|
||||
'Roboto',
|
||||
'NotoKufi',
|
||||
), ),
|
||||
),
|
||||
),
|
||||
),
|
||||
onTap: () => _showLogoutConfirmationDialog(context),
|
||||
),
|
||||
if (userId == 'guest')
|
||||
ListTile(
|
||||
leading: Icon(Icons.login,color: isDarkTheme ? Color(0xFFFFFFFF) : null),
|
||||
leading: Icon(Icons.login,
|
||||
color: isDarkTheme ? Color(0xFFFFFFFF) : null),
|
||||
// title: const Text('Login'),
|
||||
title: Text(AppLocalizations.of(context)!.login_title,
|
||||
title: Text(
|
||||
AppLocalizations.of(context)!.login_title,
|
||||
style: TextStyle(
|
||||
color: isDarkTheme ? Color(0xFFAAAAAA) : null,
|
||||
fontFamily: context.translate(
|
||||
'Roboto',
|
||||
'NotoKufi',
|
||||
), ),
|
||||
),
|
||||
),
|
||||
),
|
||||
onTap: () => context.go('/login'),
|
||||
),
|
||||
if (userId == 'guest')
|
||||
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: Text(AppLocalizations.of(context)!.register_title,
|
||||
title: Text(
|
||||
AppLocalizations.of(context)!.register_title,
|
||||
style: TextStyle(
|
||||
color: isDarkTheme ? Color(0xFFAAAAAA) : null,
|
||||
fontFamily: context.translate(
|
||||
'Roboto',
|
||||
'NotoKufi',
|
||||
), ),
|
||||
),
|
||||
),
|
||||
),
|
||||
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) {
|
||||
return Text(
|
||||
'Loading version...',
|
||||
style: TextStyle(fontSize: 12, color: isDarkTheme ? Color(0xFFAAAAAA) : Colors.grey,fontFamily: context.translate(
|
||||
'Roboto',
|
||||
'NotoKufi',
|
||||
),),
|
||||
style: TextStyle(
|
||||
fontSize: 12,
|
||||
color: isDarkTheme ? Color(0xFFAAAAAA) : Colors.grey,
|
||||
fontFamily: context.translate(
|
||||
'Roboto',
|
||||
'NotoKufi',
|
||||
),
|
||||
),
|
||||
textAlign: TextAlign.center,
|
||||
);
|
||||
} else if (snapshot.hasError) {
|
||||
return Text(
|
||||
'Error fetching version',
|
||||
style: TextStyle(fontSize: 12, color: Colors.red,fontFamily: context.translate(
|
||||
'Roboto',
|
||||
'NotoKufi',
|
||||
),),
|
||||
style: TextStyle(
|
||||
fontSize: 12,
|
||||
color: Colors.red,
|
||||
fontFamily: context.translate(
|
||||
'Roboto',
|
||||
'NotoKufi',
|
||||
),
|
||||
),
|
||||
textAlign: TextAlign.center,
|
||||
);
|
||||
} else {
|
||||
return Text(
|
||||
'Version ${snapshot.data}',
|
||||
style: TextStyle(fontSize: 12, color: isDarkTheme ? Color(0xFFAAAAAA) : Colors.grey,fontFamily: context.translate(
|
||||
'Roboto',
|
||||
'NotoKufi',
|
||||
),),
|
||||
style: TextStyle(
|
||||
fontSize: 12,
|
||||
color: isDarkTheme ? Color(0xFFAAAAAA) : Colors.grey,
|
||||
fontFamily: context.translate(
|
||||
'Roboto',
|
||||
'NotoKufi',
|
||||
),
|
||||
),
|
||||
textAlign: TextAlign.center,
|
||||
);
|
||||
}
|
||||
@ -1410,104 +1482,104 @@ color: isDarkTheme ? Color(0xFFAAAAAA) : null,
|
||||
height: kBottomNavigationBarHeight + 0, // Adjust as needed
|
||||
decoration: BoxDecoration(
|
||||
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,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
BottomNavigationBar(
|
||||
backgroundColor: isDarkTheme ? Color(0xFF000000) : Colors.white,
|
||||
currentIndex: _getSelectedIndex(currentRoute),
|
||||
onTap: (index) => _onItemTapped(context, index),
|
||||
type: BottomNavigationBarType.fixed,
|
||||
items: [
|
||||
BottomNavigationBarItem(
|
||||
icon: Padding(
|
||||
padding:
|
||||
const EdgeInsets.only(bottom: 4), // Adjust this for spacing
|
||||
child: Image.asset(
|
||||
BottomBarAssetIconPath.home,
|
||||
color: _getSelectedIndex(currentRoute) == 0
|
||||
? (isDarkTheme ? Color(0xFF24B4FB) : Colors.black)
|
||||
: Color(0xFF989898),
|
||||
width: 23.98,
|
||||
height: 25,
|
||||
),
|
||||
backgroundColor: isDarkTheme ? Color(0xFF000000) : Colors.white,
|
||||
currentIndex: _getSelectedIndex(currentRoute),
|
||||
onTap: (index) => _onItemTapped(context, index),
|
||||
type: BottomNavigationBarType.fixed,
|
||||
items: [
|
||||
BottomNavigationBarItem(
|
||||
icon: Padding(
|
||||
padding: const EdgeInsets.only(
|
||||
bottom: 4), // Adjust this for spacing
|
||||
child: Image.asset(
|
||||
BottomBarAssetIconPath.home,
|
||||
color: _getSelectedIndex(currentRoute) == 0
|
||||
? (isDarkTheme ? Color(0xFF24B4FB) : Colors.black)
|
||||
: Color(0xFF989898),
|
||||
width: 23.98,
|
||||
height: 25,
|
||||
),
|
||||
// label: 'Home',
|
||||
label: AppLocalizations.of(context)!.nav_home,
|
||||
),
|
||||
BottomNavigationBarItem(
|
||||
// icon: Icon(Icons.map),
|
||||
icon: Padding(
|
||||
padding:
|
||||
const EdgeInsets.only(bottom: 4), // Adjust this for spacing
|
||||
child: Image.asset(
|
||||
BottomBarAssetIconPath.uaeMap,
|
||||
color: _getSelectedIndex(currentRoute) == 1
|
||||
? (isDarkTheme ? Color(0xFF24B4FB) : Colors.black)
|
||||
: Color(0xFF989898),
|
||||
width: 23.98,
|
||||
height: 25,
|
||||
),
|
||||
),
|
||||
// label: 'UAE Numbers'
|
||||
label: AppLocalizations.of(context)!.nav_uae,
|
||||
),
|
||||
BottomNavigationBarItem(
|
||||
icon: Padding(
|
||||
padding:
|
||||
const EdgeInsets.only(bottom: 4), // Adjust this for spacing
|
||||
child: Image.asset(
|
||||
BottomBarAssetIconPath.ranking,
|
||||
color: _getSelectedIndex(currentRoute) == 2
|
||||
? (isDarkTheme ? Color(0xFF24B4FB) : Colors.black)
|
||||
: Color(0xFF989898),
|
||||
width: 23.98,
|
||||
height: 25,
|
||||
),
|
||||
),
|
||||
// label: 'Competitiveness',
|
||||
label: AppLocalizations.of(context)!.nav_competitiveness,
|
||||
),
|
||||
BottomNavigationBarItem(
|
||||
icon: Padding(
|
||||
padding:
|
||||
const EdgeInsets.only(bottom: 4), // Adjust this for spacing
|
||||
child: Image.asset(
|
||||
BottomBarAssetIconPath.globe,
|
||||
color: _getSelectedIndex(currentRoute) == 3
|
||||
? (isDarkTheme ? Color(0xFF24B4FB) : Colors.black)
|
||||
: Color(0xFF989898),
|
||||
width: 23.98,
|
||||
height: 25,
|
||||
),
|
||||
),
|
||||
// label: 'Country Profile',
|
||||
label: AppLocalizations.of(context)!.country_profile,
|
||||
),
|
||||
],
|
||||
key: bottomNavKey,
|
||||
selectedItemColor: isDarkTheme ? Color(0xFF24B4FB) : Colors.black,
|
||||
unselectedItemColor: Colors.grey,
|
||||
selectedLabelStyle: TextStyle(
|
||||
fontFamily: context.translate(
|
||||
'Roboto',
|
||||
'NotoKufi',
|
||||
),
|
||||
fontSize: 10, // Font size for unselected label
|
||||
// label: 'Home',
|
||||
label: AppLocalizations.of(context)!.nav_home,
|
||||
),
|
||||
unselectedLabelStyle: TextStyle(
|
||||
fontFamily: context.translate(
|
||||
'Roboto',
|
||||
'NotoKufi',
|
||||
BottomNavigationBarItem(
|
||||
// icon: Icon(Icons.map),
|
||||
icon: Padding(
|
||||
padding: const EdgeInsets.only(
|
||||
bottom: 4), // Adjust this for spacing
|
||||
child: Image.asset(
|
||||
BottomBarAssetIconPath.uaeMap,
|
||||
color: _getSelectedIndex(currentRoute) == 1
|
||||
? (isDarkTheme ? Color(0xFF24B4FB) : Colors.black)
|
||||
: Color(0xFF989898),
|
||||
width: 23.98,
|
||||
height: 25,
|
||||
),
|
||||
),
|
||||
fontSize: 10, // Font size for unselected label
|
||||
// label: 'UAE Numbers'
|
||||
label: AppLocalizations.of(context)!.nav_uae,
|
||||
),
|
||||
showUnselectedLabels: true,
|
||||
BottomNavigationBarItem(
|
||||
icon: Padding(
|
||||
padding: const EdgeInsets.only(
|
||||
bottom: 4), // Adjust this for spacing
|
||||
child: Image.asset(
|
||||
BottomBarAssetIconPath.ranking,
|
||||
color: _getSelectedIndex(currentRoute) == 2
|
||||
? (isDarkTheme ? Color(0xFF24B4FB) : Colors.black)
|
||||
: Color(0xFF989898),
|
||||
width: 23.98,
|
||||
height: 25,
|
||||
),
|
||||
),
|
||||
// label: 'Competitiveness',
|
||||
label: AppLocalizations.of(context)!.nav_competitiveness,
|
||||
),
|
||||
BottomNavigationBarItem(
|
||||
icon: Padding(
|
||||
padding: const EdgeInsets.only(
|
||||
bottom: 4), // Adjust this for spacing
|
||||
child: Image.asset(
|
||||
BottomBarAssetIconPath.globe,
|
||||
color: _getSelectedIndex(currentRoute) == 3
|
||||
? (isDarkTheme ? Color(0xFF24B4FB) : Colors.black)
|
||||
: Color(0xFF989898),
|
||||
width: 23.98,
|
||||
height: 25,
|
||||
),
|
||||
),
|
||||
// label: 'Country Profile',
|
||||
label: AppLocalizations.of(context)!.country_profile,
|
||||
),
|
||||
],
|
||||
key: bottomNavKey,
|
||||
selectedItemColor: isDarkTheme ? Color(0xFF24B4FB) : Colors.black,
|
||||
unselectedItemColor: Colors.grey,
|
||||
selectedLabelStyle: TextStyle(
|
||||
fontFamily: context.translate(
|
||||
'Roboto',
|
||||
'NotoKufi',
|
||||
),
|
||||
fontSize: 10, // Font size for unselected label
|
||||
),
|
||||
|
||||
unselectedLabelStyle: TextStyle(
|
||||
fontFamily: context.translate(
|
||||
'Roboto',
|
||||
'NotoKufi',
|
||||
),
|
||||
fontSize: 10, // Font size for unselected label
|
||||
),
|
||||
showUnselectedLabels: true,
|
||||
),
|
||||
],
|
||||
),
|
||||
|
||||
@ -1669,10 +1741,14 @@ void _showLogoutConfirmationDialog(BuildContext context) {
|
||||
title: Text(
|
||||
context.translate('Log Out Confirmation', 'تأكيد تسجيل الخروج'),
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(fontSize: 20, fontWeight: FontWeight.bold, fontFamily: context.translate(
|
||||
'Roboto',
|
||||
'NotoKufi',
|
||||
),),
|
||||
style: TextStyle(
|
||||
fontSize: 20,
|
||||
fontWeight: FontWeight.bold,
|
||||
fontFamily: context.translate(
|
||||
'Roboto',
|
||||
'NotoKufi',
|
||||
),
|
||||
),
|
||||
),
|
||||
content: Padding(
|
||||
padding: const EdgeInsets.all(20.0),
|
||||
@ -1697,7 +1773,7 @@ void _showLogoutConfirmationDialog(BuildContext context) {
|
||||
children: [
|
||||
SizedBox(
|
||||
width:
|
||||
MediaQuery.of(context).size.width * 0.3, // Set button width
|
||||
MediaQuery.of(context).size.width * 0.3, // Set button width
|
||||
child: TextButton(
|
||||
onPressed: () => Navigator.pop(dialogContext),
|
||||
style: TextButton.styleFrom(
|
||||
@ -1725,7 +1801,7 @@ void _showLogoutConfirmationDialog(BuildContext context) {
|
||||
SizedBox(width: 16),
|
||||
SizedBox(
|
||||
width:
|
||||
MediaQuery.of(context).size.width * 0.3, // Set button width
|
||||
MediaQuery.of(context).size.width * 0.3, // Set button width
|
||||
child: TextButton(
|
||||
onPressed: () => logout(context),
|
||||
style: TextButton.styleFrom(
|
||||
@ -1740,10 +1816,14 @@ void _showLogoutConfirmationDialog(BuildContext context) {
|
||||
.scaleDown, // Prevents wrapping while adjusting text size
|
||||
child: Text(
|
||||
context.translate('Log Out', 'تسجيل الخروج'),
|
||||
style: TextStyle(color: Colors.white, fontSize: 16, fontFamily: context.translate(
|
||||
'Roboto',
|
||||
'NotoKufi',
|
||||
),),
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 16,
|
||||
fontFamily: context.translate(
|
||||
'Roboto',
|
||||
'NotoKufi',
|
||||
),
|
||||
),
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
),
|
||||
@ -1755,4 +1835,4 @@ void _showLogoutConfirmationDialog(BuildContext context) {
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -1,8 +1,8 @@
|
||||
name: uae_stat
|
||||
description: "View statistics about the UAE from the Federal Center for Statistics and Competitiveness."
|
||||
publish_to: "none"
|
||||
#version: 1.0.60+61
|
||||
version: 1.0.6+7
|
||||
#version: 1.0.61+62
|
||||
version: 1.0.7+8
|
||||
|
||||
environment:
|
||||
sdk: ">=3.2.3 <4.0.0"
|
||||
|
||||