country list arabic and bilateral trade dynamic
This commit is contained in:
parent
4ed46d5d54
commit
07d97fa541
@ -2,27 +2,27 @@ C/C++ Structured Logo
|
|||||||
m
|
m
|
||||||
kC:\Flutter Applications\Git_New\FCSC\android\app\.cxx\Debug\29y7472m\arm64-v8a\additional_project_files.txtC
|
kC:\Flutter Applications\Git_New\FCSC\android\app\.cxx\Debug\29y7472m\arm64-v8a\additional_project_files.txtC
|
||||||
A
|
A
|
||||||
?com.android.build.gradle.internal.cxx.io.EncodedFileFingerPrint øŒµ¬ü2 äýŸÞø2l
|
?com.android.build.gradle.internal.cxx.io.EncodedFileFingerPrint ŒíÍ€ý2 äýŸÞø2l
|
||||||
j
|
j
|
||||||
hC:\Flutter Applications\Git_New\FCSC\android\app\.cxx\Debug\29y7472m\arm64-v8a\android_gradle_build.json øŒµ¬ü2É ŠþŸÞø2q
|
hC:\Flutter Applications\Git_New\FCSC\android\app\.cxx\Debug\29y7472m\arm64-v8a\android_gradle_build.json ŒíÍ€ý2É ŠþŸÞø2q
|
||||||
o
|
o
|
||||||
mC:\Flutter Applications\Git_New\FCSC\android\app\.cxx\Debug\29y7472m\arm64-v8a\android_gradle_build_mini.json øŒµ¬ü2œ ·þŸÞø2^
|
mC:\Flutter Applications\Git_New\FCSC\android\app\.cxx\Debug\29y7472m\arm64-v8a\android_gradle_build_mini.json ŒíÍ€ý2œ ·þŸÞø2^
|
||||||
\
|
\
|
||||||
ZC:\Flutter Applications\Git_New\FCSC\android\app\.cxx\Debug\29y7472m\arm64-v8a\build.ninja øŒµ¬ü2›Ü çúŸÞø2b
|
ZC:\Flutter Applications\Git_New\FCSC\android\app\.cxx\Debug\29y7472m\arm64-v8a\build.ninja ŒíÍ€ý2›Ü çúŸÞø2b
|
||||||
`
|
`
|
||||||
^C:\Flutter Applications\Git_New\FCSC\android\app\.cxx\Debug\29y7472m\arm64-v8a\build.ninja.txt øŒµ¬ü2g
|
^C:\Flutter Applications\Git_New\FCSC\android\app\.cxx\Debug\29y7472m\arm64-v8a\build.ninja.txt ŒíÍ€ý2g
|
||||||
e
|
e
|
||||||
cC:\Flutter Applications\Git_New\FCSC\android\app\.cxx\Debug\29y7472m\arm64-v8a\build_file_index.txt øŒµ¬ü2
K ÜþŸÞø2h
|
cC:\Flutter Applications\Git_New\FCSC\android\app\.cxx\Debug\29y7472m\arm64-v8a\build_file_index.txt ŒíÍ€ý2
K ÜþŸÞø2h
|
||||||
f
|
f
|
||||||
dC:\Flutter Applications\Git_New\FCSC\android\app\.cxx\Debug\29y7472m\arm64-v8a\compile_commands.json øŒµ¬ü2l
|
dC:\Flutter Applications\Git_New\FCSC\android\app\.cxx\Debug\29y7472m\arm64-v8a\compile_commands.json ŒíÍ€ý2l
|
||||||
j
|
j
|
||||||
hC:\Flutter Applications\Git_New\FCSC\android\app\.cxx\Debug\29y7472m\arm64-v8a\compile_commands.json.bin øŒµ¬ü2 r
|
hC:\Flutter Applications\Git_New\FCSC\android\app\.cxx\Debug\29y7472m\arm64-v8a\compile_commands.json.bin ŒíÍ€ý2 r
|
||||||
p
|
p
|
||||||
nC:\Flutter Applications\Git_New\FCSC\android\app\.cxx\Debug\29y7472m\arm64-v8a\metadata_generation_command.txt øŒµ¬ü2
|
nC:\Flutter Applications\Git_New\FCSC\android\app\.cxx\Debug\29y7472m\arm64-v8a\metadata_generation_command.txt ŒíÍ€ý2
|
||||||
à ÔþŸÞø2e
|
à ÔþŸÞø2e
|
||||||
c
|
c
|
||||||
aC:\Flutter Applications\Git_New\FCSC\android\app\.cxx\Debug\29y7472m\arm64-v8a\prefab_config.json øŒµ¬ü2
( ÙþŸÞø2j
|
aC:\Flutter Applications\Git_New\FCSC\android\app\.cxx\Debug\29y7472m\arm64-v8a\prefab_config.json ŒíÍ€ý2
( ÙþŸÞø2j
|
||||||
h
|
h
|
||||||
fC:\Flutter Applications\Git_New\FCSC\android\app\.cxx\Debug\29y7472m\arm64-v8a\symbol_folder_index.txt øŒµ¬ü2
] ÙþŸÞø2O
|
fC:\Flutter Applications\Git_New\FCSC\android\app\.cxx\Debug\29y7472m\arm64-v8a\symbol_folder_index.txt ŒíÍ€ý2
] ÙþŸÞø2O
|
||||||
M
|
M
|
||||||
KC:\src\flutter\packages\flutter_tools\gradle\src\main\groovy\CMakeLists.txt øŒµ¬ü2
§ œ¬ùšõ2
|
KC:\src\flutter\packages\flutter_tools\gradle\src\main\groovy\CMakeLists.txt ŒíÍ€ý2
§ œ¬ùšõ2
|
||||||
@ -2,27 +2,27 @@ C/C++ Structured Logq
|
|||||||
o
|
o
|
||||||
mC:\Flutter Applications\Git_New\FCSC\android\app\.cxx\Debug\29y7472m\armeabi-v7a\additional_project_files.txtC
|
mC:\Flutter Applications\Git_New\FCSC\android\app\.cxx\Debug\29y7472m\armeabi-v7a\additional_project_files.txtC
|
||||||
A
|
A
|
||||||
?com.android.build.gradle.internal.cxx.io.EncodedFileFingerPrint ¢<EFBFBD>µ¬ü2 åÇ Þø2n
|
?com.android.build.gradle.internal.cxx.io.EncodedFileFingerPrint ÂíÍ€ý2 åÇ Þø2n
|
||||||
l
|
l
|
||||||
jC:\Flutter Applications\Git_New\FCSC\android\app\.cxx\Debug\29y7472m\armeabi-v7a\android_gradle_build.json ¢<EFBFBD>µ¬ü2Í ïÇ Þø2s
|
jC:\Flutter Applications\Git_New\FCSC\android\app\.cxx\Debug\29y7472m\armeabi-v7a\android_gradle_build.json ÃíÍ€ý2Í ïÇ Þø2s
|
||||||
q
|
q
|
||||||
oC:\Flutter Applications\Git_New\FCSC\android\app\.cxx\Debug\29y7472m\armeabi-v7a\android_gradle_build_mini.json ¢<EFBFBD>µ¬ü2 óÇ Þø2`
|
oC:\Flutter Applications\Git_New\FCSC\android\app\.cxx\Debug\29y7472m\armeabi-v7a\android_gradle_build_mini.json ÃíÍ€ý2 óÇ Þø2`
|
||||||
^
|
^
|
||||||
\C:\Flutter Applications\Git_New\FCSC\android\app\.cxx\Debug\29y7472m\armeabi-v7a\build.ninja ¢<EFBFBD>µ¬ü2¥Ü ÃÅ Þø2d
|
\C:\Flutter Applications\Git_New\FCSC\android\app\.cxx\Debug\29y7472m\armeabi-v7a\build.ninja ÃíÍ€ý2¥Ü ÃÅ Þø2d
|
||||||
b
|
b
|
||||||
`C:\Flutter Applications\Git_New\FCSC\android\app\.cxx\Debug\29y7472m\armeabi-v7a\build.ninja.txt ¢<EFBFBD>µ¬ü2i
|
`C:\Flutter Applications\Git_New\FCSC\android\app\.cxx\Debug\29y7472m\armeabi-v7a\build.ninja.txt ÃíÍ€ý2i
|
||||||
g
|
g
|
||||||
eC:\Flutter Applications\Git_New\FCSC\android\app\.cxx\Debug\29y7472m\armeabi-v7a\build_file_index.txt ¢<EFBFBD>µ¬ü2
K ýÇ Þø2j
|
eC:\Flutter Applications\Git_New\FCSC\android\app\.cxx\Debug\29y7472m\armeabi-v7a\build_file_index.txt ÃíÍ€ý2
K ýÇ Þø2j
|
||||||
h
|
h
|
||||||
fC:\Flutter Applications\Git_New\FCSC\android\app\.cxx\Debug\29y7472m\armeabi-v7a\compile_commands.json ¢<EFBFBD>µ¬ü2n
|
fC:\Flutter Applications\Git_New\FCSC\android\app\.cxx\Debug\29y7472m\armeabi-v7a\compile_commands.json ÃíÍ€ý2n
|
||||||
l
|
l
|
||||||
jC:\Flutter Applications\Git_New\FCSC\android\app\.cxx\Debug\29y7472m\armeabi-v7a\compile_commands.json.bin ¢<EFBFBD>µ¬ü2 t
|
jC:\Flutter Applications\Git_New\FCSC\android\app\.cxx\Debug\29y7472m\armeabi-v7a\compile_commands.json.bin ÃíÍ€ý2 t
|
||||||
r
|
r
|
||||||
pC:\Flutter Applications\Git_New\FCSC\android\app\.cxx\Debug\29y7472m\armeabi-v7a\metadata_generation_command.txt ¢<EFBFBD>µ¬ü2
|
pC:\Flutter Applications\Git_New\FCSC\android\app\.cxx\Debug\29y7472m\armeabi-v7a\metadata_generation_command.txt ÃíÍ€ý2
|
||||||
ê øÇ Þø2g
|
ê øÇ Þø2g
|
||||||
e
|
e
|
||||||
cC:\Flutter Applications\Git_New\FCSC\android\app\.cxx\Debug\29y7472m\armeabi-v7a\prefab_config.json ¢<EFBFBD>µ¬ü2
( ùÇ Þø2l
|
cC:\Flutter Applications\Git_New\FCSC\android\app\.cxx\Debug\29y7472m\armeabi-v7a\prefab_config.json ÃíÍ€ý2
( ùÇ Þø2l
|
||||||
j
|
j
|
||||||
hC:\Flutter Applications\Git_New\FCSC\android\app\.cxx\Debug\29y7472m\armeabi-v7a\symbol_folder_index.txt ¢<EFBFBD>µ¬ü2
_ ùÇ Þø2O
|
hC:\Flutter Applications\Git_New\FCSC\android\app\.cxx\Debug\29y7472m\armeabi-v7a\symbol_folder_index.txt ÃíÍ€ý2
_ ùÇ Þø2O
|
||||||
M
|
M
|
||||||
KC:\src\flutter\packages\flutter_tools\gradle\src\main\groovy\CMakeLists.txt ¢<EFBFBD>µ¬ü2
§ œ¬ùšõ2
|
KC:\src\flutter\packages\flutter_tools\gradle\src\main\groovy\CMakeLists.txt ÃíÍ€ý2
§ œ¬ùšõ2
|
||||||
@ -2,27 +2,27 @@ C/C++ Structured Logi
|
|||||||
g
|
g
|
||||||
eC:\Flutter Applications\Git_New\FCSC\android\app\.cxx\Debug\29y7472m\x86\additional_project_files.txtC
|
eC:\Flutter Applications\Git_New\FCSC\android\app\.cxx\Debug\29y7472m\x86\additional_project_files.txtC
|
||||||
A
|
A
|
||||||
?com.android.build.gradle.internal.cxx.io.EncodedFileFingerPrint û<EFBFBD>µ¬ü2 ÿò Þø2f
|
?com.android.build.gradle.internal.cxx.io.EncodedFileFingerPrint éíÍ€ý2 ÿò Þø2f
|
||||||
d
|
d
|
||||||
bC:\Flutter Applications\Git_New\FCSC\android\app\.cxx\Debug\29y7472m\x86\android_gradle_build.json û<EFBFBD>µ¬ü2½ ¤ó Þø2k
|
bC:\Flutter Applications\Git_New\FCSC\android\app\.cxx\Debug\29y7472m\x86\android_gradle_build.json éíÍ€ý2½ ¤ó Þø2k
|
||||||
i
|
i
|
||||||
gC:\Flutter Applications\Git_New\FCSC\android\app\.cxx\Debug\29y7472m\x86\android_gradle_build_mini.json û<EFBFBD>µ¬ü2<18> °ó Þø2X
|
gC:\Flutter Applications\Git_New\FCSC\android\app\.cxx\Debug\29y7472m\x86\android_gradle_build_mini.json éíÍ€ý2<18> °ó Þø2X
|
||||||
V
|
V
|
||||||
TC:\Flutter Applications\Git_New\FCSC\android\app\.cxx\Debug\29y7472m\x86\build.ninja û<EFBFBD>µ¬ü2ýÛ ³ï Þø2\
|
TC:\Flutter Applications\Git_New\FCSC\android\app\.cxx\Debug\29y7472m\x86\build.ninja éíÍ€ý2ýÛ ³ï Þø2\
|
||||||
Z
|
Z
|
||||||
XC:\Flutter Applications\Git_New\FCSC\android\app\.cxx\Debug\29y7472m\x86\build.ninja.txt û<EFBFBD>µ¬ü2a
|
XC:\Flutter Applications\Git_New\FCSC\android\app\.cxx\Debug\29y7472m\x86\build.ninja.txt éíÍ€ý2a
|
||||||
_
|
_
|
||||||
]C:\Flutter Applications\Git_New\FCSC\android\app\.cxx\Debug\29y7472m\x86\build_file_index.txt û<EFBFBD>µ¬ü2
K Âó Þø2b
|
]C:\Flutter Applications\Git_New\FCSC\android\app\.cxx\Debug\29y7472m\x86\build_file_index.txt éíÍ€ý2
K Âó Þø2b
|
||||||
`
|
`
|
||||||
^C:\Flutter Applications\Git_New\FCSC\android\app\.cxx\Debug\29y7472m\x86\compile_commands.json û<EFBFBD>µ¬ü2f
|
^C:\Flutter Applications\Git_New\FCSC\android\app\.cxx\Debug\29y7472m\x86\compile_commands.json éíÍ€ý2f
|
||||||
d
|
d
|
||||||
bC:\Flutter Applications\Git_New\FCSC\android\app\.cxx\Debug\29y7472m\x86\compile_commands.json.bin û<EFBFBD>µ¬ü2 l
|
bC:\Flutter Applications\Git_New\FCSC\android\app\.cxx\Debug\29y7472m\x86\compile_commands.json.bin éíÍ€ý2 l
|
||||||
j
|
j
|
||||||
hC:\Flutter Applications\Git_New\FCSC\android\app\.cxx\Debug\29y7472m\x86\metadata_generation_command.txt û<EFBFBD>µ¬ü2
|
hC:\Flutter Applications\Git_New\FCSC\android\app\.cxx\Debug\29y7472m\x86\metadata_generation_command.txt éíÍ€ý2
|
||||||
 ´ó Þø2_
|
 ´ó Þø2_
|
||||||
]
|
]
|
||||||
[C:\Flutter Applications\Git_New\FCSC\android\app\.cxx\Debug\29y7472m\x86\prefab_config.json û<EFBFBD>µ¬ü2
( ´ó Þø2d
|
[C:\Flutter Applications\Git_New\FCSC\android\app\.cxx\Debug\29y7472m\x86\prefab_config.json éíÍ€ý2
( ´ó Þø2d
|
||||||
b
|
b
|
||||||
`C:\Flutter Applications\Git_New\FCSC\android\app\.cxx\Debug\29y7472m\x86\symbol_folder_index.txt û<EFBFBD>µ¬ü2
W ¹ó Þø2O
|
`C:\Flutter Applications\Git_New\FCSC\android\app\.cxx\Debug\29y7472m\x86\symbol_folder_index.txt éíÍ€ý2
W ¹ó Þø2O
|
||||||
M
|
M
|
||||||
KC:\src\flutter\packages\flutter_tools\gradle\src\main\groovy\CMakeLists.txt û<EFBFBD>µ¬ü2
§ œ¬ùšõ2
|
KC:\src\flutter\packages\flutter_tools\gradle\src\main\groovy\CMakeLists.txt éíÍ€ý2
§ œ¬ùšõ2
|
||||||
@ -2,27 +2,27 @@ C/C++ Structured Logl
|
|||||||
j
|
j
|
||||||
hC:\Flutter Applications\Git_New\FCSC\android\app\.cxx\Debug\29y7472m\x86_64\additional_project_files.txtC
|
hC:\Flutter Applications\Git_New\FCSC\android\app\.cxx\Debug\29y7472m\x86_64\additional_project_files.txtC
|
||||||
A
|
A
|
||||||
?com.android.build.gradle.internal.cxx.io.EncodedFileFingerPrint 掵¬ü2 ù”¡Þø2i
|
?com.android.build.gradle.internal.cxx.io.EncodedFileFingerPrint ‰îÍ€ý2 ù”¡Þø2i
|
||||||
g
|
g
|
||||||
eC:\Flutter Applications\Git_New\FCSC\android\app\.cxx\Debug\29y7472m\x86_64\android_gradle_build.json 掵¬ü2à ‚•¡Þø2n
|
eC:\Flutter Applications\Git_New\FCSC\android\app\.cxx\Debug\29y7472m\x86_64\android_gradle_build.json ‰îÍ€ý2à ‚•¡Þø2n
|
||||||
l
|
l
|
||||||
jC:\Flutter Applications\Git_New\FCSC\android\app\.cxx\Debug\29y7472m\x86_64\android_gradle_build_mini.json 掵¬ü2– †•¡Þø2[
|
jC:\Flutter Applications\Git_New\FCSC\android\app\.cxx\Debug\29y7472m\x86_64\android_gradle_build_mini.json ‰îÍ€ý2– †•¡Þø2[
|
||||||
Y
|
Y
|
||||||
WC:\Flutter Applications\Git_New\FCSC\android\app\.cxx\Debug\29y7472m\x86_64\build.ninja 掵¬ü2ŒÜ þ’¡Þø2_
|
WC:\Flutter Applications\Git_New\FCSC\android\app\.cxx\Debug\29y7472m\x86_64\build.ninja ‰îÍ€ý2ŒÜ þ’¡Þø2_
|
||||||
]
|
]
|
||||||
[C:\Flutter Applications\Git_New\FCSC\android\app\.cxx\Debug\29y7472m\x86_64\build.ninja.txt 掵¬ü2d
|
[C:\Flutter Applications\Git_New\FCSC\android\app\.cxx\Debug\29y7472m\x86_64\build.ninja.txt ‰îÍ€ý2d
|
||||||
b
|
b
|
||||||
`C:\Flutter Applications\Git_New\FCSC\android\app\.cxx\Debug\29y7472m\x86_64\build_file_index.txt 掵¬ü2
K <20>•¡Þø2e
|
`C:\Flutter Applications\Git_New\FCSC\android\app\.cxx\Debug\29y7472m\x86_64\build_file_index.txt ‰îÍ€ý2
K <20>•¡Þø2e
|
||||||
c
|
c
|
||||||
aC:\Flutter Applications\Git_New\FCSC\android\app\.cxx\Debug\29y7472m\x86_64\compile_commands.json 掵¬ü2i
|
aC:\Flutter Applications\Git_New\FCSC\android\app\.cxx\Debug\29y7472m\x86_64\compile_commands.json ‰îÍ€ý2i
|
||||||
g
|
g
|
||||||
eC:\Flutter Applications\Git_New\FCSC\android\app\.cxx\Debug\29y7472m\x86_64\compile_commands.json.bin 玵¬ü2 o
|
eC:\Flutter Applications\Git_New\FCSC\android\app\.cxx\Debug\29y7472m\x86_64\compile_commands.json.bin ‰îÍ€ý2 o
|
||||||
m
|
m
|
||||||
kC:\Flutter Applications\Git_New\FCSC\android\app\.cxx\Debug\29y7472m\x86_64\metadata_generation_command.txt 玵¬ü2
|
kC:\Flutter Applications\Git_New\FCSC\android\app\.cxx\Debug\29y7472m\x86_64\metadata_generation_command.txt ‰îÍ€ý2
|
||||||
Ñ ‰•¡Þø2b
|
Ñ ‰•¡Þø2b
|
||||||
`
|
`
|
||||||
^C:\Flutter Applications\Git_New\FCSC\android\app\.cxx\Debug\29y7472m\x86_64\prefab_config.json 玵¬ü2
( ‹•¡Þø2g
|
^C:\Flutter Applications\Git_New\FCSC\android\app\.cxx\Debug\29y7472m\x86_64\prefab_config.json ‰îÍ€ý2
( ‹•¡Þø2g
|
||||||
e
|
e
|
||||||
cC:\Flutter Applications\Git_New\FCSC\android\app\.cxx\Debug\29y7472m\x86_64\symbol_folder_index.txt 玵¬ü2
Z Œ•¡Þø2O
|
cC:\Flutter Applications\Git_New\FCSC\android\app\.cxx\Debug\29y7472m\x86_64\symbol_folder_index.txt ‰îÍ€ý2
Z Œ•¡Þø2O
|
||||||
M
|
M
|
||||||
KC:\src\flutter\packages\flutter_tools\gradle\src\main\groovy\CMakeLists.txt 玵¬ü2
§ œ¬ùšõ2
|
KC:\src\flutter\packages\flutter_tools\gradle\src\main\groovy\CMakeLists.txt ‰îÍ€ý2
§ œ¬ùšõ2
|
||||||
@ -656,8 +656,7 @@ final GoRouter router = GoRouter(
|
|||||||
|
|
||||||
GoRoute(
|
GoRoute(
|
||||||
path: '/countryprofile',
|
path: '/countryprofile',
|
||||||
builder: (context, state) => const CountryProfilePage(),
|
builder: (context, state) => const ListCountriesRoute(),
|
||||||
|
|
||||||
),
|
),
|
||||||
GoRoute(
|
GoRoute(
|
||||||
path: '/country-profile-detail',
|
path: '/country-profile-detail',
|
||||||
|
|||||||
@ -59,7 +59,7 @@ class DetailedCountryProfilePage extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
const SizedBox(height: 8),
|
const SizedBox(height: 8),
|
||||||
Text(
|
Text(
|
||||||
countryName.toUpperCase(),
|
context.translate(countryName.toUpperCase(),country.nameAR),
|
||||||
style: const TextStyle(
|
style: const TextStyle(
|
||||||
fontSize: 22,
|
fontSize: 22,
|
||||||
fontWeight: FontWeight.bold,
|
fontWeight: FontWeight.bold,
|
||||||
@ -300,11 +300,60 @@ class _CategoryButton extends StatelessWidget {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class CategoryPopupContent extends StatelessWidget {
|
class CategoryPopupContent extends StatefulWidget {
|
||||||
final String category;
|
final String category;
|
||||||
|
|
||||||
const CategoryPopupContent({super.key, required this.category});
|
const CategoryPopupContent({super.key, required this.category});
|
||||||
|
|
||||||
|
@override
|
||||||
|
State<CategoryPopupContent> createState() => _CategoryPopupContentState();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _CategoryPopupContentState extends State<CategoryPopupContent> {
|
||||||
|
late String bilateralTrade=context.translate('Import','الواردات');
|
||||||
|
late bool selected;
|
||||||
|
late List<Map<String, dynamic>> tradeList=importLists;
|
||||||
|
|
||||||
|
String updateTrade(String newTrade) {
|
||||||
|
setState(() {
|
||||||
|
bilateralTrade = newTrade;
|
||||||
|
if (bilateralTrade=='Import'){
|
||||||
|
tradeList=importLists;
|
||||||
|
}else if(bilateralTrade=='Export'){
|
||||||
|
tradeList=exportLists;
|
||||||
|
}else if (bilateralTrade=='ReExport'){
|
||||||
|
tradeList=reExportLists;
|
||||||
|
}else {
|
||||||
|
tradeList=[];
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
print ('my new bilsteral is $bilateralTrade');
|
||||||
|
return bilateralTrade;
|
||||||
|
}
|
||||||
|
List<Map<String, dynamic>> importLists=[
|
||||||
|
{'image':PopupAssetPath.vegetable,'content-eng':'Vegetable Products','content-ar':'المنتجات النباتية','value': 198.6},
|
||||||
|
{'image':PopupAssetPath.food,'content-eng':'Foodstuffs, Beverages, Spirits And Tobacco','content-ar':'المواد الغذائية والمشروبات والمشروبات الروحية والتبغ','value': 89.9},
|
||||||
|
{'image':PopupAssetPath.metal,'content-eng':'Base Metals And Articles Of Base Metal','content-ar':'المعادن الأساسية ومصنوعاتها','value': 65.6},
|
||||||
|
{'image':PopupAssetPath.animal,'content-eng':'Live Animals And Their Products','content-ar':'الحيوانات الحية ومنتجاتها','value': 23.7},
|
||||||
|
{'image':PopupAssetPath.chemical,'content-eng':'Products Of The Chemical or Allied Industries','content-ar':'منتجات الصناعات الكيميائية أو المرتبطة بها','value': 4.7},
|
||||||
|
];
|
||||||
|
|
||||||
|
List<Map<String, dynamic>> exportLists=[
|
||||||
|
{'image':PopupAssetPath.vegetable,'content-eng':'Vegetable Products','content-ar':'المنتجات النباتية','value': 19.6},
|
||||||
|
{'image':PopupAssetPath.food,'content-eng':'Foodstuffs, Beverages, Spirits And Tobacco','content-ar':'المواد الغذائية والمشروبات والمشروبات الروحية والتبغ','value': 9.9},
|
||||||
|
{'image':PopupAssetPath.metal,'content-eng':'Base Metals And Articles Of Base Metal','content-ar':'المعادن الأساسية ومصنوعاتها','value': 12.7},
|
||||||
|
{'image':PopupAssetPath.animal,'content-eng':'Live Animals And Their Products','content-ar':'الحيوانات الحية ومنتجاتها','value': 0.0},
|
||||||
|
{'image':PopupAssetPath.chemical,'content-eng':'Products Of The Chemical or Allied Industries','content-ar':'منتجات الصناعات الكيميائية أو المرتبطة بها','value': 0.0},
|
||||||
|
];
|
||||||
|
List<Map<String, dynamic>> reExportLists=[
|
||||||
|
{'image':PopupAssetPath.vegetable,'content-eng':'Vegetable Products','content-ar':'المنتجات النباتية','value': 0.0},
|
||||||
|
{'image':PopupAssetPath.food,'content-eng':'Foodstuffs, Beverages, Spirits And Tobacco','content-ar':'المواد الغذائية والمشروبات والمشروبات الروحية والتبغ','value': 0.0},
|
||||||
|
{'image':PopupAssetPath.metal,'content-eng':'Base Metals And Articles Of Base Metal','content-ar':'المعادن الأساسية ومصنوعاتها','value': 0.0},
|
||||||
|
{'image':PopupAssetPath.animal,'content-eng':'Live Animals And Their Products','content-ar':'الحيوانات الحية ومنتجاتها','value': 23.7},
|
||||||
|
{'image':PopupAssetPath.chemical,'content-eng':'Products Of The Chemical or Allied Industries','content-ar':'منتجات الصناعات الكيميائية أو المرتبطة بها','value': 16.3},
|
||||||
|
];
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
final lineBorder=Padding(
|
final lineBorder=Padding(
|
||||||
@ -325,7 +374,7 @@ class CategoryPopupContent extends StatelessWidget {
|
|||||||
color: Color(0xFFE9BF70),
|
color: Color(0xFFE9BF70),
|
||||||
);
|
);
|
||||||
final screenWidth=MediaQuery.of(context).size.width;
|
final screenWidth=MediaQuery.of(context).size.width;
|
||||||
switch (category) {
|
switch (widget.category) {
|
||||||
case 'Demography':
|
case 'Demography':
|
||||||
return Column(
|
return Column(
|
||||||
mainAxisSize: MainAxisSize.min,
|
mainAxisSize: MainAxisSize.min,
|
||||||
@ -546,19 +595,22 @@ class CategoryPopupContent extends StatelessWidget {
|
|||||||
label: context.translate('Total Import','إجمالي الواردات'),
|
label: context.translate('Total Import','إجمالي الواردات'),
|
||||||
value: '\$390.2M',
|
value: '\$390.2M',
|
||||||
color: Color(0xFF5BB3AA),
|
color: Color(0xFF5BB3AA),
|
||||||
isSelected: true,
|
isSelected: updateTrade,
|
||||||
|
defaultTrade:bilateralTrade
|
||||||
),
|
),
|
||||||
_BilateralTradeValueBox(
|
_BilateralTradeValueBox(
|
||||||
label: context.translate('Total Export','إجمالي الصادرات'),
|
label: context.translate('Total Export','إجمالي الصادرات'),
|
||||||
value: '\$42.2M',
|
value: '\$42.2M',
|
||||||
color: Color(0xFFB57184),
|
color: Color(0xFFB57184),
|
||||||
isSelected: false,
|
isSelected: updateTrade,
|
||||||
|
defaultTrade: bilateralTrade,
|
||||||
),
|
),
|
||||||
_BilateralTradeValueBox(
|
_BilateralTradeValueBox(
|
||||||
label: context.translate('Total ReExport','إجمالي إعادة التصدير'),
|
label: context.translate('Total ReExport','إجمالي إعادة التصدير'),
|
||||||
value: '\$40.2M',
|
value: '\$40.2M',
|
||||||
color: Color(0xFF243E83),
|
color: Color(0xFF243E83),
|
||||||
isSelected: false,
|
isSelected: updateTrade,
|
||||||
|
defaultTrade: bilateralTrade,
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
@ -567,7 +619,7 @@ class CategoryPopupContent extends StatelessWidget {
|
|||||||
const SizedBox(height: 24),
|
const SizedBox(height: 24),
|
||||||
Center(
|
Center(
|
||||||
child: Text(
|
child: Text(
|
||||||
context.translate('Top 5 Import Commodities','أهم 5 سلع مستوردة'),
|
context.translate('Top 5 $bilateralTrade Commodities','أهم 5 سلع $bilateralTrade'),
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: 20,
|
fontSize: 20,
|
||||||
fontWeight: FontWeight.bold,
|
fontWeight: FontWeight.bold,
|
||||||
@ -576,35 +628,65 @@ class CategoryPopupContent extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
const SizedBox(height: 12),
|
const SizedBox(height: 12),
|
||||||
yellowDivider,
|
yellowDivider,
|
||||||
_CommodityRow(
|
Expanded(
|
||||||
icon: PopupAssetPath.vegetable,
|
child: ListView.separated(
|
||||||
label: context.translate('Vegetable Products','المنتجات النباتية'),
|
itemCount: tradeList.length,
|
||||||
value: '\$198.6M',),
|
itemBuilder: (context, index) {
|
||||||
yellowDivider,
|
final item = tradeList[index];
|
||||||
_CommodityRow(
|
return ListTile(
|
||||||
icon: PopupAssetPath.food,
|
contentPadding: EdgeInsets.symmetric(horizontal: 10,vertical: 1),
|
||||||
label: context.translate('Foodstuffs, Beverages, Spirits And Tobacco','المواد الغذائية والمشروبات والمشروبات الروحية والتبغ'),
|
leading: Image.asset(
|
||||||
value: '\$89.9M',),
|
item['image'],
|
||||||
yellowDivider,
|
width: 30,
|
||||||
_CommodityRow(
|
height: 30,
|
||||||
icon: PopupAssetPath.metal,
|
),
|
||||||
label: context.translate('Base Metals And Articles Of Base Metal','المعادن الأساسية ومصنوعاتها'),
|
title: Text(
|
||||||
value: '\$65.6M',),
|
context.translate(item['content-eng'], item['content-ar']),
|
||||||
yellowDivider,
|
style: const TextStyle(fontSize: 15,fontWeight: FontWeight.w500)
|
||||||
_CommodityRow(
|
),
|
||||||
icon: PopupAssetPath.animal,
|
trailing: Text(
|
||||||
label: context.translate('Live Animals And Their Products','الحيوانات الحية ومنتجاتها'),
|
'\$${item['value']}',
|
||||||
value: '\$23.7M',),
|
style: const TextStyle(fontSize: 15,
|
||||||
yellowDivider,
|
fontWeight: FontWeight.w500,
|
||||||
_CommodityRow(
|
color: Color(0xFF54AFA6),),
|
||||||
icon: PopupAssetPath.chemical,
|
),
|
||||||
label: context.translate('Products Of The Chemical or Allied Industries','منتجات الصناعات الكيميائية أو المرتبطة بها'),
|
);
|
||||||
value: '\$4.7M',),
|
},
|
||||||
|
separatorBuilder: (context, index) => Padding(
|
||||||
|
padding: const EdgeInsets.symmetric(horizontal: 6, vertical: 2),
|
||||||
|
child: yellowDivider, // or use Dash widget if using flutter_dash package
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
// _CommodityRow(
|
||||||
|
// icon: PopupAssetPath.vegetable,
|
||||||
|
// label: context.translate('Vegetable Products','المنتجات النباتية'),
|
||||||
|
// value: '\$198.6M',),
|
||||||
|
// yellowDivider,
|
||||||
|
// _CommodityRow(
|
||||||
|
// icon: PopupAssetPath.food,
|
||||||
|
// label: context.translate('Foodstuffs, Beverages, Spirits And Tobacco','المواد الغذائية والمشروبات والمشروبات الروحية والتبغ'),
|
||||||
|
// value: '\$89.9M',),
|
||||||
|
// yellowDivider,
|
||||||
|
// _CommodityRow(
|
||||||
|
// icon: PopupAssetPath.metal,
|
||||||
|
// label: context.translate('Base Metals And Articles Of Base Metal','المعادن الأساسية ومصنوعاتها'),
|
||||||
|
// value: '\$65.6M',),
|
||||||
|
// yellowDivider,
|
||||||
|
// _CommodityRow(
|
||||||
|
// icon: PopupAssetPath.animal,
|
||||||
|
// label: context.translate('Live Animals And Their Products','الحيوانات الحية ومنتجاتها'),
|
||||||
|
// value: '\$23.7M',),
|
||||||
|
// yellowDivider,
|
||||||
|
// _CommodityRow(
|
||||||
|
// icon: PopupAssetPath.chemical,
|
||||||
|
// label: context.translate('Products Of The Chemical or Allied Industries','منتجات الصناعات الكيميائية أو المرتبطة بها'),
|
||||||
|
// value: '\$4.7M',),
|
||||||
const SizedBox(height: 16),
|
const SizedBox(height: 16),
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
default:
|
default:
|
||||||
return Center(child: Text('$category details coming soon.'));
|
return Center(child: Text('${widget.category} details coming soon.'));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -862,29 +944,52 @@ Widget _TradeItem({
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
class _BilateralTradeValueBox extends StatelessWidget {
|
class _BilateralTradeValueBox extends StatefulWidget {
|
||||||
final String label;
|
final String label;
|
||||||
final String value;
|
final String value;
|
||||||
final Color color;
|
final Color color;
|
||||||
final bool isSelected;
|
final String Function(String) isSelected;
|
||||||
|
final String? defaultTrade;
|
||||||
|
|
||||||
const _BilateralTradeValueBox({
|
const _BilateralTradeValueBox({
|
||||||
required this.label,
|
required this.label,
|
||||||
required this.value,
|
required this.value,
|
||||||
required this.color,
|
required this.color,
|
||||||
required this.isSelected,
|
required this.isSelected,
|
||||||
|
this.defaultTrade,
|
||||||
});
|
});
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
State<_BilateralTradeValueBox> createState() => _BilateralTradeValueBoxState();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _BilateralTradeValueBoxState extends State<_BilateralTradeValueBox> {
|
||||||
|
late String title;
|
||||||
|
|
||||||
|
@override
|
||||||
|
void initState() {
|
||||||
|
super.initState();
|
||||||
|
title = widget.label.split(' ').last;
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Container(
|
final bool selected=title==widget.defaultTrade;
|
||||||
|
return GestureDetector(
|
||||||
|
onTap: (){
|
||||||
|
setState(() {
|
||||||
|
widget.isSelected(title);
|
||||||
|
});
|
||||||
|
},
|
||||||
|
child: Container(
|
||||||
height: 90,
|
height: 90,
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 5, vertical: 8),
|
padding: const EdgeInsets.symmetric(horizontal: 5, vertical: 8),
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: isSelected?Colors.white:Colors.transparent,
|
color: selected?Colors.white:Colors.transparent,
|
||||||
borderRadius: BorderRadius.circular(10),
|
borderRadius: BorderRadius.circular(10),
|
||||||
border: isSelected?Border.all(color:Color(0xFFAA8E83)):null,
|
border: selected?Border.all(color:Color(0xFFAA8E83)):null,
|
||||||
boxShadow:isSelected ?[
|
boxShadow:selected ?[
|
||||||
BoxShadow(
|
BoxShadow(
|
||||||
color: Color(0xFFAA8E83).withValues(alpha: 0.5),
|
color: Color(0xFFAA8E83).withValues(alpha: 0.5),
|
||||||
blurRadius: 15,
|
blurRadius: 15,
|
||||||
@ -900,20 +1005,21 @@ class _BilateralTradeValueBox extends StatelessWidget {
|
|||||||
mainAxisAlignment: MainAxisAlignment.center,
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
children: [
|
children: [
|
||||||
Text(
|
Text(
|
||||||
label,
|
widget.label,
|
||||||
style: TextStyle(fontSize: 13),
|
style: TextStyle(fontSize: 13),
|
||||||
),
|
),
|
||||||
const SizedBox(height: 4),
|
const SizedBox(height: 4),
|
||||||
Text(
|
Text(
|
||||||
value,
|
widget.value,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontWeight: FontWeight.bold,
|
fontWeight: FontWeight.bold,
|
||||||
fontSize: 22,
|
fontSize: 22,
|
||||||
color: color,
|
color: widget.color,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,81 +1,199 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_gen/gen_l10n/app_localizations.dart';
|
import 'package:flutter_gen/gen_l10n/app_localizations.dart';
|
||||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||||
import 'package:shared_preferences/shared_preferences.dart';
|
|
||||||
import 'package:go_router/go_router.dart';
|
import 'package:go_router/go_router.dart';
|
||||||
import 'package:flutter_svg/flutter_svg.dart';
|
import 'package:flutter_svg/flutter_svg.dart';
|
||||||
import 'package:uae_stat/domain/use_cases/language.dart';
|
import 'package:uae_stat/domain/use_cases/language.dart';
|
||||||
import 'package:uae_stat/infrastructure/services/img_asset_paths/icons/misc_icon_asset_path.dart';
|
import 'package:uae_stat/infrastructure/services/img_asset_paths/icons/misc_icon_asset_path.dart';
|
||||||
import 'package:uae_stat/presentation/routes/drawer_routes/custom_drawer_routes.dart';
|
import 'package:uae_stat/presentation/routes/drawer_routes/custom_drawer_routes.dart';
|
||||||
import 'package:fl_chart/fl_chart.dart';
|
import 'package:fl_chart/fl_chart.dart';
|
||||||
|
import 'package:external_repos/external_repos.dart';
|
||||||
|
import 'package:flutter_hooks/flutter_hooks.dart';
|
||||||
|
import 'package:flutter_svg/svg.dart';
|
||||||
|
import 'package:hooks_riverpod/hooks_riverpod.dart';
|
||||||
|
|
||||||
final localeProvider = StateProvider<Locale>((ref) => const Locale('en'));
|
// final localeProvider = StateProvider<Locale>((ref) => const Locale('en'));
|
||||||
|
|
||||||
class CountryProfilePage extends ConsumerStatefulWidget {
|
// class CountryProfilePage extends ConsumerStatefulWidget {
|
||||||
const CountryProfilePage({Key? key}) : super(key: key);
|
// const CountryProfilePage({Key? key}) : super(key: key);
|
||||||
|
//
|
||||||
|
// @override
|
||||||
|
// ConsumerState<CountryProfilePage> createState() => _CountryProfilePageState();
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// class _CountryProfilePageState extends ConsumerState<CountryProfilePage> {
|
||||||
|
// final TextEditingController _searchController = TextEditingController();
|
||||||
|
//
|
||||||
|
// final List<Map<String, String>> _allCountries = [
|
||||||
|
// {"name": "Afghanistan", "flag": "🇦🇫",'code':'AF'},
|
||||||
|
// {"name": "Albania", "flag": "🇦🇱",'code':'AL'},
|
||||||
|
// {"name": "Algeria", "flag": "🇩🇿",'code':'DZ'},
|
||||||
|
// {"name": "American Samoa", "flag": "🇦🇸",'code':'AS'},
|
||||||
|
// {"name": "Andorra", "flag": "🇦🇩",'code':'AD'},
|
||||||
|
// {"name": "Angola", "flag": "🇦🇴",'code':'AO'},
|
||||||
|
// {"name": "Anguilla", "flag": "🇦🇮",'code':'AI'},
|
||||||
|
// {"name": "Antigua And Barbuda", "flag": "🇦🇬",'code':'AG'},
|
||||||
|
// {"name": "Argentina", "flag": "🇦🇷",'code':'AR'},
|
||||||
|
// {"name": "Armenia", "flag": "🇦🇲",'code':'AM'},
|
||||||
|
// {"name": "Aruba", "flag": "🇦🇼",'code':'AW'},
|
||||||
|
// {"name": "Australia", "flag": "🇦🇺",'code':'AU'},
|
||||||
|
// {"name": "Austria", "flag": "🇦🇹",'code':'AT'},
|
||||||
|
// {"name": "Azerbaijan", "flag": "🇦🇿",'code':'AZ'},
|
||||||
|
// {"name": "Bahamas", "flag": "🇧🇸",'code':'BS'},
|
||||||
|
// {"name": "Bahrain", "flag": "🇧🇭",'code':'BH'},
|
||||||
|
// {"name": "Bangladesh", "flag": "🇧🇩",'code':'BD'},
|
||||||
|
// ];
|
||||||
|
//
|
||||||
|
// String _searchTerm = '';
|
||||||
|
//
|
||||||
|
// void filterData(String value) {
|
||||||
|
// setState(() => _searchTerm = value);
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// @override
|
||||||
|
// Widget build(BuildContext context) {
|
||||||
|
// final locale = AppLocalizations.of(context)!;
|
||||||
|
// final filtered = _allCountries
|
||||||
|
// .where((c) => c['name']!.toLowerCase().contains(_searchTerm.toLowerCase()))
|
||||||
|
// .toList();
|
||||||
|
//
|
||||||
|
// double myheight = MediaQuery.of(context).size.height;
|
||||||
|
// double mywidth = MediaQuery.of(context).size.width;
|
||||||
|
//
|
||||||
|
// return PopScope(
|
||||||
|
// canPop: false,
|
||||||
|
// onPopInvokedWithResult: (didPop, result) {
|
||||||
|
// if (didPop) return;
|
||||||
|
// context.go('/myhomepage');
|
||||||
|
// },
|
||||||
|
// child: BaseScaffold(
|
||||||
|
// title: Text(
|
||||||
|
// context.translate(
|
||||||
|
// 'Country Profile',
|
||||||
|
// 'ملف الدولة',
|
||||||
|
// ),
|
||||||
|
// style: TextStyle(
|
||||||
|
// fontFamily: context.translate(
|
||||||
|
// 'Roboto',
|
||||||
|
// 'NotoKufi',
|
||||||
|
// )
|
||||||
|
// ),
|
||||||
|
// ),
|
||||||
|
// body: Column(
|
||||||
|
// children: [
|
||||||
|
// Padding(
|
||||||
|
// padding: const EdgeInsets.symmetric(horizontal: 12.0, vertical: 12.0),
|
||||||
|
// child: Container(
|
||||||
|
// decoration: BoxDecoration(
|
||||||
|
// color: Colors.white,
|
||||||
|
// borderRadius: BorderRadius.circular(30.0),
|
||||||
|
// border: Border.all(width: 1, color: Color(0xFFAA8E83)),
|
||||||
|
// ),
|
||||||
|
// child: TextField(
|
||||||
|
// controller: _searchController,
|
||||||
|
// onChanged: (value) {
|
||||||
|
// filterData(value);
|
||||||
|
// },
|
||||||
|
// decoration: InputDecoration(
|
||||||
|
// hintText: AppLocalizations.of(context)!.searchCountry,
|
||||||
|
// hintStyle: TextStyle(
|
||||||
|
// color: Color(0xFFAA8E83),
|
||||||
|
// fontFamily: context.translate('Roboto', 'NotoKufi'),
|
||||||
|
// fontSize: 14,
|
||||||
|
// height: 1.8,
|
||||||
|
// ),
|
||||||
|
// prefixIconConstraints: BoxConstraints(
|
||||||
|
// maxWidth: 42,
|
||||||
|
// maxHeight: 42,
|
||||||
|
// ),
|
||||||
|
// prefixIcon: Container(
|
||||||
|
// padding: EdgeInsets.only(right: 5, left: 5),
|
||||||
|
// alignment: Alignment.center,
|
||||||
|
// child: SvgPicture.asset(
|
||||||
|
// MiscIconAssetPath.Search,
|
||||||
|
// semanticsLabel: 'Search',
|
||||||
|
// colorFilter: ColorFilter.mode(Color(0xFFAA8E83), BlendMode.srcIn),
|
||||||
|
// height: 18,
|
||||||
|
// width: 18,
|
||||||
|
// ),
|
||||||
|
// ),
|
||||||
|
// suffixIcon: _searchController.text.isNotEmpty
|
||||||
|
// ? IconButton(
|
||||||
|
// icon: Icon(
|
||||||
|
// Icons.clear,
|
||||||
|
// color: Color(0xFFAA8E83),
|
||||||
|
// size: 18,
|
||||||
|
// ),
|
||||||
|
// onPressed: () {
|
||||||
|
// _searchController.clear();
|
||||||
|
// filterData('');
|
||||||
|
// },
|
||||||
|
// )
|
||||||
|
// : null,
|
||||||
|
// border: InputBorder.none,
|
||||||
|
// contentPadding: EdgeInsets.symmetric(vertical: 9, horizontal: 18.0),
|
||||||
|
// ),
|
||||||
|
// ),
|
||||||
|
// ),
|
||||||
|
// ),
|
||||||
|
//
|
||||||
|
// // Updated section for "No country found"
|
||||||
|
// Expanded(
|
||||||
|
// child: filtered.isEmpty
|
||||||
|
// ? Center(
|
||||||
|
// child: Text(
|
||||||
|
// 'No country found',
|
||||||
|
// style: TextStyle(
|
||||||
|
// fontSize: 16,
|
||||||
|
// color: Colors.grey,
|
||||||
|
// fontWeight: FontWeight.w500,
|
||||||
|
// ),
|
||||||
|
// ),
|
||||||
|
// )
|
||||||
|
// : ListView.builder(
|
||||||
|
// itemCount: filtered.length,
|
||||||
|
// itemBuilder: (context, index) {
|
||||||
|
// final country = filtered[index];
|
||||||
|
// return ListTile(
|
||||||
|
// leading: Text(
|
||||||
|
// country['flag']!,
|
||||||
|
// style: const TextStyle(fontSize: 24),
|
||||||
|
// ),
|
||||||
|
// title: Text(country['name']!),
|
||||||
|
// onTap: () {
|
||||||
|
// context.push('/country-profile-detail', extra: {
|
||||||
|
// 'countryName': country['name'] as String,
|
||||||
|
// 'flag': country['code'] as String,
|
||||||
|
// });
|
||||||
|
// },
|
||||||
|
// );
|
||||||
|
// },
|
||||||
|
// ),
|
||||||
|
// ),
|
||||||
|
// ],
|
||||||
|
// ),
|
||||||
|
// ),
|
||||||
|
// );
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
|
||||||
|
class ListCountriesRoute extends HookConsumerWidget {
|
||||||
|
const ListCountriesRoute({super.key});
|
||||||
|
|
||||||
@override
|
@override
|
||||||
ConsumerState<CountryProfilePage> createState() => _CountryProfilePageState();
|
Widget build(BuildContext context, WidgetRef ref) {
|
||||||
}
|
final screenWidth = MediaQuery.of(context).size.width;
|
||||||
|
final _searchController = useTextEditingController();
|
||||||
|
final searchTerm = useState('');
|
||||||
|
|
||||||
class _CountryProfilePageState extends ConsumerState<CountryProfilePage> {
|
final filteredCountries = ISOCountry.values.where((country) {
|
||||||
final TextEditingController _searchController = TextEditingController();
|
final query = searchTerm.value.trim().toLowerCase();
|
||||||
|
if (query.isEmpty) return true; // 🔥 show all if search is empty
|
||||||
|
return country.nameEN.toLowerCase().contains(query) ||
|
||||||
|
country.nameAR.toLowerCase().contains(query);
|
||||||
|
}).toList();
|
||||||
|
|
||||||
final List<Map<String, String>> _allCountries = [
|
final body = BaseScaffold(
|
||||||
{"name": "Afghanistan", "flag": "🇦🇫",'code':'AF'},
|
|
||||||
{"name": "Albania", "flag": "🇦🇱",'code':'AL'},
|
|
||||||
{"name": "Algeria", "flag": "🇩🇿",'code':'DZ'},
|
|
||||||
{"name": "American Samoa", "flag": "🇦🇸",'code':'AS'},
|
|
||||||
{"name": "Andorra", "flag": "🇦🇩",'code':'AD'},
|
|
||||||
{"name": "Angola", "flag": "🇦🇴",'code':'AO'},
|
|
||||||
{"name": "Anguilla", "flag": "🇦🇮",'code':'AI'},
|
|
||||||
{"name": "Antigua And Barbuda", "flag": "🇦🇬",'code':'AG'},
|
|
||||||
{"name": "Argentina", "flag": "🇦🇷",'code':'AR'},
|
|
||||||
{"name": "Armenia", "flag": "🇦🇲",'code':'AM'},
|
|
||||||
{"name": "Aruba", "flag": "🇦🇼",'code':'AW'},
|
|
||||||
{"name": "Australia", "flag": "🇦🇺",'code':'AU'},
|
|
||||||
{"name": "Austria", "flag": "🇦🇹",'code':'AT'},
|
|
||||||
{"name": "Azerbaijan", "flag": "🇦🇿",'code':'AZ'},
|
|
||||||
{"name": "Bahamas", "flag": "🇧🇸",'code':'BS'},
|
|
||||||
{"name": "Bahrain", "flag": "🇧🇭",'code':'BH'},
|
|
||||||
{"name": "Bangladesh", "flag": "🇧🇩",'code':'BD'},
|
|
||||||
];
|
|
||||||
|
|
||||||
String _searchTerm = '';
|
|
||||||
|
|
||||||
void filterData(String value) {
|
|
||||||
setState(() => _searchTerm = value);
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
Widget build(BuildContext context) {
|
|
||||||
final locale = AppLocalizations.of(context)!;
|
|
||||||
final filtered = _allCountries
|
|
||||||
.where((c) => c['name']!.toLowerCase().contains(_searchTerm.toLowerCase()))
|
|
||||||
.toList();
|
|
||||||
|
|
||||||
double myheight = MediaQuery.of(context).size.height;
|
|
||||||
double mywidth = MediaQuery.of(context).size.width;
|
|
||||||
|
|
||||||
return PopScope(
|
|
||||||
canPop: false,
|
|
||||||
onPopInvokedWithResult: (didPop, result) {
|
|
||||||
if (didPop) return;
|
|
||||||
context.go('/myhomepage');
|
|
||||||
},
|
|
||||||
child: BaseScaffold(
|
|
||||||
title: Text(
|
|
||||||
context.translate(
|
|
||||||
'Country Profile',
|
|
||||||
'ملف الدولة',
|
|
||||||
),
|
|
||||||
style: TextStyle(
|
|
||||||
fontFamily: context.translate(
|
|
||||||
'Roboto',
|
|
||||||
'NotoKufi',
|
|
||||||
)
|
|
||||||
),
|
|
||||||
),
|
|
||||||
body: Column(
|
body: Column(
|
||||||
children: [
|
children: [
|
||||||
Padding(
|
Padding(
|
||||||
@ -86,26 +204,30 @@ class _CountryProfilePageState extends ConsumerState<CountryProfilePage> {
|
|||||||
borderRadius: BorderRadius.circular(30.0),
|
borderRadius: BorderRadius.circular(30.0),
|
||||||
border: Border.all(width: 1, color: Color(0xFFAA8E83)),
|
border: Border.all(width: 1, color: Color(0xFFAA8E83)),
|
||||||
),
|
),
|
||||||
child: TextField(
|
child: SearchBar(
|
||||||
|
constraints: BoxConstraints(
|
||||||
|
maxWidth: MediaQuery.of(context).size.width*0.9,
|
||||||
|
maxHeight: 50,
|
||||||
|
),
|
||||||
|
elevation: WidgetStatePropertyAll(0),
|
||||||
|
backgroundColor: WidgetStatePropertyAll(Colors.white),
|
||||||
controller: _searchController,
|
controller: _searchController,
|
||||||
onChanged: (value) {
|
|
||||||
filterData(value);
|
|
||||||
},
|
|
||||||
decoration: InputDecoration(
|
|
||||||
hintText: AppLocalizations.of(context)!.searchCountry,
|
hintText: AppLocalizations.of(context)!.searchCountry,
|
||||||
hintStyle: TextStyle(
|
hintStyle: WidgetStateProperty.all(
|
||||||
|
TextStyle(
|
||||||
color: Color(0xFFAA8E83),
|
color: Color(0xFFAA8E83),
|
||||||
fontFamily: context.translate('Roboto', 'NotoKufi'),
|
fontFamily: context.translate('Roboto', 'NotoKufi'),
|
||||||
fontSize: 14,
|
fontSize: 14,
|
||||||
height: 1.8,
|
height: 1.8,
|
||||||
),
|
),
|
||||||
prefixIconConstraints: BoxConstraints(
|
),
|
||||||
|
leading: Container(
|
||||||
|
padding: EdgeInsets.only(right: 5, left: 5),
|
||||||
|
alignment: Alignment.center,
|
||||||
|
constraints: BoxConstraints(
|
||||||
maxWidth: 42,
|
maxWidth: 42,
|
||||||
maxHeight: 42,
|
maxHeight: 42,
|
||||||
),
|
),
|
||||||
prefixIcon: Container(
|
|
||||||
padding: EdgeInsets.only(right: 5, left: 5),
|
|
||||||
alignment: Alignment.center,
|
|
||||||
child: SvgPicture.asset(
|
child: SvgPicture.asset(
|
||||||
MiscIconAssetPath.Search,
|
MiscIconAssetPath.Search,
|
||||||
semanticsLabel: 'Search',
|
semanticsLabel: 'Search',
|
||||||
@ -114,62 +236,86 @@ class _CountryProfilePageState extends ConsumerState<CountryProfilePage> {
|
|||||||
width: 18,
|
width: 18,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
suffixIcon: _searchController.text.isNotEmpty
|
onChanged: (value){
|
||||||
? IconButton(
|
searchTerm.value=value;
|
||||||
icon: Icon(
|
|
||||||
Icons.clear,
|
|
||||||
color: Color(0xFFAA8E83),
|
|
||||||
size: 18,
|
|
||||||
),
|
|
||||||
onPressed: () {
|
|
||||||
_searchController.clear();
|
|
||||||
filterData('');
|
|
||||||
},
|
},
|
||||||
)
|
|
||||||
: null,
|
|
||||||
border: InputBorder.none,
|
|
||||||
contentPadding: EdgeInsets.symmetric(vertical: 9, horizontal: 18.0),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
|
||||||
|
|
||||||
// Updated section for "No country found"
|
|
||||||
Expanded(
|
Expanded(
|
||||||
child: filtered.isEmpty
|
child: ValueListenableBuilder(
|
||||||
? Center(
|
valueListenable: _searchController,
|
||||||
|
builder: (context, value, child){
|
||||||
|
if (filteredCountries.isEmpty) {
|
||||||
|
return Center(
|
||||||
child: Text(
|
child: Text(
|
||||||
'No country found',
|
context.translate(
|
||||||
style: TextStyle(
|
'No countries match your search term.',
|
||||||
fontSize: 16,
|
'لا توجد بلدان تتطابق مع مصطلح البحث الخاص بك.',
|
||||||
color: Colors.grey,
|
|
||||||
fontWeight: FontWeight.w500,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
)
|
|
||||||
: ListView.builder(
|
|
||||||
itemCount: filtered.length,
|
|
||||||
itemBuilder: (context, index) {
|
|
||||||
final country = filtered[index];
|
|
||||||
return ListTile(
|
|
||||||
leading: Text(
|
|
||||||
country['flag']!,
|
|
||||||
style: const TextStyle(fontSize: 24),
|
|
||||||
),
|
|
||||||
title: Text(country['name']!),
|
|
||||||
onTap: () {
|
|
||||||
context.push('/country-profile-detail', extra: {
|
|
||||||
'countryName': country['name'] as String,
|
|
||||||
'flag': country['code'] as String,
|
|
||||||
});
|
|
||||||
},
|
|
||||||
);
|
|
||||||
},
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
return ListView.builder(
|
||||||
|
itemCount: filteredCountries.length,
|
||||||
|
itemBuilder: (context, index)=> _CountryListTile(
|
||||||
|
key: ValueKey(filteredCountries[index].alpha2),
|
||||||
|
countryCode: filteredCountries[index].alpha2,), );
|
||||||
|
},),
|
||||||
|
)
|
||||||
|
],
|
||||||
|
), title: Text('Country Profile'),
|
||||||
|
);
|
||||||
|
return body;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
class _CountryListTile extends ConsumerWidget {
|
||||||
|
const _CountryListTile({
|
||||||
|
required super.key,
|
||||||
|
required this.countryCode,
|
||||||
|
});
|
||||||
|
|
||||||
|
final String countryCode;
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context, WidgetRef ref) {
|
||||||
|
final country = ISOCountry.fromAlpha2(countryCode);
|
||||||
|
final flag = Image.asset(
|
||||||
|
country.flagImgPath,
|
||||||
|
fit: BoxFit.contain,
|
||||||
|
height: 18,
|
||||||
|
width: 18 * (3 / 2),
|
||||||
|
cacheHeight: 32,
|
||||||
|
cacheWidth: 48,
|
||||||
|
);
|
||||||
|
return ListTile(
|
||||||
|
leading: flag,
|
||||||
|
contentPadding: const EdgeInsets.symmetric(
|
||||||
|
horizontal: 24,
|
||||||
|
vertical: 0,
|
||||||
|
),
|
||||||
|
dense: true,
|
||||||
|
minTileHeight: 40,
|
||||||
|
title: Text(
|
||||||
|
context.translate(
|
||||||
|
country.nameEN,
|
||||||
|
country.nameAR,
|
||||||
|
),
|
||||||
|
style: TextStyle(
|
||||||
|
fontFamily: context.translate(
|
||||||
|
'Roboto',
|
||||||
|
'NotoKufi',
|
||||||
|
),
|
||||||
|
fontSize: 14,
|
||||||
|
fontWeight: FontWeight.w400,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
onTap: () => context.push('/country-profile-detail', extra: {
|
||||||
|
'countryName': country.nameEN,
|
||||||
|
'flag': country.alpha2,
|
||||||
|
})
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user