diff --git a/android/app/.cxx/Debug/m4rj1019/arm64-v8a/configure_fingerprint.bin b/android/app/.cxx/Debug/m4rj1019/arm64-v8a/configure_fingerprint.bin new file mode 100644 index 00000000..2ab8857d --- /dev/null +++ b/android/app/.cxx/Debug/m4rj1019/arm64-v8a/configure_fingerprint.bin @@ -0,0 +1,28 @@ +C/C++ Structured Logd +b +`C:\flutter code\FCSC\FCSC\android\app\.cxx\Debug\m4rj1019\arm64-v8a\additional_project_files.txtC +A +?com.android.build.gradle.internal.cxx.io.EncodedFileFingerPrint  2  Ҷ2a +_ +]C:\flutter code\FCSC\FCSC\android\app\.cxx\Debug\m4rj1019\arm64-v8a\android_gradle_build.json  2 축2f +d +bC:\flutter code\FCSC\FCSC\android\app\.cxx\Debug\m4rj1019\arm64-v8a\android_gradle_build_mini.json  2 2S +Q +OC:\flutter code\FCSC\FCSC\android\app\.cxx\Debug\m4rj1019\arm64-v8a\build.ninja  2 2W +U +SC:\flutter code\FCSC\FCSC\android\app\.cxx\Debug\m4rj1019\arm64-v8a\build.ninja.txt  2\ +Z +XC:\flutter code\FCSC\FCSC\android\app\.cxx\Debug\m4rj1019\arm64-v8a\build_file_index.txt  2 S 2] +[ +YC:\flutter code\FCSC\FCSC\android\app\.cxx\Debug\m4rj1019\arm64-v8a\compile_commands.json  2a +_ +]C:\flutter code\FCSC\FCSC\android\app\.cxx\Debug\m4rj1019\arm64-v8a\compile_commands.json.bin  2 g +e +cC:\flutter code\FCSC\FCSC\android\app\.cxx\Debug\m4rj1019\arm64-v8a\metadata_generation_command.txt  2 + 2Z +X +VC:\flutter code\FCSC\FCSC\android\app\.cxx\Debug\m4rj1019\arm64-v8a\prefab_config.json  2  ( 2_ +] +[C:\flutter code\FCSC\FCSC\android\app\.cxx\Debug\m4rj1019\arm64-v8a\symbol_folder_index.txt  2  R 2W +U +SC:\flutter\src\flutter\packages\flutter_tools\gradle\src\main\groovy\CMakeLists.txt  2  2 \ No newline at end of file diff --git a/android/app/.cxx/Debug/m4rj1019/armeabi-v7a/configure_fingerprint.bin b/android/app/.cxx/Debug/m4rj1019/armeabi-v7a/configure_fingerprint.bin new file mode 100644 index 00000000..5797e372 --- /dev/null +++ b/android/app/.cxx/Debug/m4rj1019/armeabi-v7a/configure_fingerprint.bin @@ -0,0 +1,28 @@ +C/C++ Structured Logf +d +bC:\flutter code\FCSC\FCSC\android\app\.cxx\Debug\m4rj1019\armeabi-v7a\additional_project_files.txtC +A +?com.android.build.gradle.internal.cxx.io.EncodedFileFingerPrint  勝2  ږ2c +a +_C:\flutter code\FCSC\FCSC\android\app\.cxx\Debug\m4rj1019\armeabi-v7a\android_gradle_build.json  拝2 얖2h +f +dC:\flutter code\FCSC\FCSC\android\app\.cxx\Debug\m4rj1019\armeabi-v7a\android_gradle_build_mini.json  拝2 2U +S +QC:\flutter code\FCSC\FCSC\android\app\.cxx\Debug\m4rj1019\armeabi-v7a\build.ninja  拝2 2Y +W +UC:\flutter code\FCSC\FCSC\android\app\.cxx\Debug\m4rj1019\armeabi-v7a\build.ninja.txt  拝2^ +\ +ZC:\flutter code\FCSC\FCSC\android\app\.cxx\Debug\m4rj1019\armeabi-v7a\build_file_index.txt  拝2 S 2_ +] +[C:\flutter code\FCSC\FCSC\android\app\.cxx\Debug\m4rj1019\armeabi-v7a\compile_commands.json  拝2c +a +_C:\flutter code\FCSC\FCSC\android\app\.cxx\Debug\m4rj1019\armeabi-v7a\compile_commands.json.bin  拝2 i +g +eC:\flutter code\FCSC\FCSC\android\app\.cxx\Debug\m4rj1019\armeabi-v7a\metadata_generation_command.txt  拝2 + ט2\ +Z +XC:\flutter code\FCSC\FCSC\android\app\.cxx\Debug\m4rj1019\armeabi-v7a\prefab_config.json  拝2  ( 2a +_ +]C:\flutter code\FCSC\FCSC\android\app\.cxx\Debug\m4rj1019\armeabi-v7a\symbol_folder_index.txt  拝2  T 2W +U +SC:\flutter\src\flutter\packages\flutter_tools\gradle\src\main\groovy\CMakeLists.txt  拝2  2 \ No newline at end of file diff --git a/android/app/.cxx/Debug/m4rj1019/x86/configure_fingerprint.bin b/android/app/.cxx/Debug/m4rj1019/x86/configure_fingerprint.bin new file mode 100644 index 00000000..f94d43ce --- /dev/null +++ b/android/app/.cxx/Debug/m4rj1019/x86/configure_fingerprint.bin @@ -0,0 +1,28 @@ +C/C++ Structured Log^ +\ +ZC:\flutter code\FCSC\FCSC\android\app\.cxx\Debug\m4rj1019\x86\additional_project_files.txtC +A +?com.android.build.gradle.internal.cxx.io.EncodedFileFingerPrint  2  2[ +Y +WC:\flutter code\FCSC\FCSC\android\app\.cxx\Debug\m4rj1019\x86\android_gradle_build.json  2 2` +^ +\C:\flutter code\FCSC\FCSC\android\app\.cxx\Debug\m4rj1019\x86\android_gradle_build_mini.json  2 2M +K +IC:\flutter code\FCSC\FCSC\android\app\.cxx\Debug\m4rj1019\x86\build.ninja  2 2Q +O +MC:\flutter code\FCSC\FCSC\android\app\.cxx\Debug\m4rj1019\x86\build.ninja.txt  2V +T +RC:\flutter code\FCSC\FCSC\android\app\.cxx\Debug\m4rj1019\x86\build_file_index.txt  2 S 2W +U +SC:\flutter code\FCSC\FCSC\android\app\.cxx\Debug\m4rj1019\x86\compile_commands.json  2[ +Y +WC:\flutter code\FCSC\FCSC\android\app\.cxx\Debug\m4rj1019\x86\compile_commands.json.bin  2 a +_ +]C:\flutter code\FCSC\FCSC\android\app\.cxx\Debug\m4rj1019\x86\metadata_generation_command.txt  2 + 2T +R +PC:\flutter code\FCSC\FCSC\android\app\.cxx\Debug\m4rj1019\x86\prefab_config.json  2  ( 2Y +W +UC:\flutter code\FCSC\FCSC\android\app\.cxx\Debug\m4rj1019\x86\symbol_folder_index.txt  2  L 2W +U +SC:\flutter\src\flutter\packages\flutter_tools\gradle\src\main\groovy\CMakeLists.txt  2  2 \ No newline at end of file diff --git a/android/app/.cxx/Debug/m4rj1019/x86_64/configure_fingerprint.bin b/android/app/.cxx/Debug/m4rj1019/x86_64/configure_fingerprint.bin new file mode 100644 index 00000000..2c0d0d45 --- /dev/null +++ b/android/app/.cxx/Debug/m4rj1019/x86_64/configure_fingerprint.bin @@ -0,0 +1,28 @@ +C/C++ Structured Loga +_ +]C:\flutter code\FCSC\FCSC\android\app\.cxx\Debug\m4rj1019\x86_64\additional_project_files.txtC +A +?com.android.build.gradle.internal.cxx.io.EncodedFileFingerPrint  ɗ2  2^ +\ +ZC:\flutter code\FCSC\FCSC\android\app\.cxx\Debug\m4rj1019\x86_64\android_gradle_build.json  ɗ2 2c +a +_C:\flutter code\FCSC\FCSC\android\app\.cxx\Debug\m4rj1019\x86_64\android_gradle_build_mini.json  ɗ2 2P +N +LC:\flutter code\FCSC\FCSC\android\app\.cxx\Debug\m4rj1019\x86_64\build.ninja  ɗ2 炗2T +R +PC:\flutter code\FCSC\FCSC\android\app\.cxx\Debug\m4rj1019\x86_64\build.ninja.txt  ʗ2Y +W +UC:\flutter code\FCSC\FCSC\android\app\.cxx\Debug\m4rj1019\x86_64\build_file_index.txt  ʗ2 S 2Z +X +VC:\flutter code\FCSC\FCSC\android\app\.cxx\Debug\m4rj1019\x86_64\compile_commands.json  ʗ2^ +\ +ZC:\flutter code\FCSC\FCSC\android\app\.cxx\Debug\m4rj1019\x86_64\compile_commands.json.bin  ʗ2 d +b +`C:\flutter code\FCSC\FCSC\android\app\.cxx\Debug\m4rj1019\x86_64\metadata_generation_command.txt  ʗ2 + 2W +U +SC:\flutter code\FCSC\FCSC\android\app\.cxx\Debug\m4rj1019\x86_64\prefab_config.json  ʗ2  ( 2\ +Z +XC:\flutter code\FCSC\FCSC\android\app\.cxx\Debug\m4rj1019\x86_64\symbol_folder_index.txt  ʗ2  O 2W +U +SC:\flutter\src\flutter\packages\flutter_tools\gradle\src\main\groovy\CMakeLists.txt  ʗ2  2 \ No newline at end of file diff --git a/assets/competitiveness/solo.png b/assets/competitiveness/solo.png new file mode 100644 index 00000000..96bc34c8 Binary files /dev/null and b/assets/competitiveness/solo.png differ diff --git a/assets/competitiveness/soloo.png b/assets/competitiveness/soloo.png new file mode 100644 index 00000000..408355dc Binary files /dev/null and b/assets/competitiveness/soloo.png differ diff --git a/lib/presentation/Screens/Bottom Navigation Pages/Competitiveness/Detailedcompetitiveness.dart b/lib/presentation/Screens/Bottom Navigation Pages/Competitiveness/Detailedcompetitiveness.dart index 544b4e16..961485a3 100644 --- a/lib/presentation/Screens/Bottom Navigation Pages/Competitiveness/Detailedcompetitiveness.dart +++ b/lib/presentation/Screens/Bottom Navigation Pages/Competitiveness/Detailedcompetitiveness.dart @@ -1,216 +1,216 @@ -import 'package:flutter/material.dart'; -import 'package:flutter_svg/flutter_svg.dart'; -import 'package:uae_stat/domain/use_cases/language.dart'; -import 'package:uae_stat/presentation/routes/drawer_routes/custom_drawer_routes.dart'; - -class ReportDetailPage extends StatelessWidget { - final Map report; - - const ReportDetailPage({super.key, required this.report}); - - @override - Widget build(BuildContext context) { - double width = MediaQuery.of(context).size.width; - - return BaseScaffold( - title: Text( - context.translate('UAE Competitiveness', 'القدرة التنافسية للإمارات'), // Add localization - style: TextStyle( - fontFamily: context.translate('Roboto', 'NotoKufi'), - ), - ), - // hasDrawer: false, - showBackButton: true, - body: SingleChildScrollView( - padding: const EdgeInsets.all(16.0), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - // Header Section: Report Title and Image - Center( - child: Column( - children: [ - Image.asset( - 'assets/competitiveness/solo.png', - height: 80, // Increase size for prominence - ), - const SizedBox(height: 8), - Text( - context.translate('Prosperity Index (2023)', 'مؤشر الازدهار (2023)'), - style: const TextStyle( - fontSize: 22, - fontWeight: FontWeight.bold, - ), - ), - ], - ), - ), - const SizedBox(height: 24), - - // Description Section - Text( - context.translate( - "The Legatum Prosperity Index is published annually by the Legatum Institute. It is a policy-focused report that measures the current state of prosperity since 2007. Using the Prosperity Index framework, nations around the world can assess their strengths and weaknesses in order to determine the economic and strategic choices that need to be made to further build inclusive societies, open economies, and empowered people to drive greater levels of prosperity.", - "يُنشر مؤشر الازدهار الليجاتوم سنويًا من قبل معهد ليجاتوم. إنه تقرير يركز على السياسات ويقيس الحالة الحالية للازدهار منذ عام 2007. باستخدام إطار مؤشر الازدهار، يمكن للدول حول العالم تقييم نقاط قوتها وضعفها لتحديد الخيارات الاقتصادية والاستراتيجية التي يجب اتخاذها لتعزيز بناء مجتمعات شاملة واقتصادات مفتوحة وتمكين الأفراد لدفع مستويات أعلى من الازدهار.", - ), - style: const TextStyle(fontSize: 14), - ), - const SizedBox(height: 24), - - // Ranking Section (Using LeaderCard-like styling) - Wrap( - spacing: 16, - runSpacing: 16, - alignment: WrapAlignment.center, - children: [ - _RankingCard( - title: context.translate('Rank in 2023', 'الترتيب في 2023'), - value: "44", - icon: const Icon(Icons.arrow_downward, color: Colors.red, size: 16), - ), - _RankingCard( - title: context.translate('vs. Previous Edition', 'مقارنة بالإصدار السابق'), - value: "41", - icon: const SizedBox.shrink(), // No icon for this - ), - ], - ), - const SizedBox(height: 24), - - // Country Rankings Section (Using CategoryButton-like styling) - // Wrap( - // spacing: 16, - // runSpacing: 16, - // alignment: WrapAlignment.center, - // children: [ - // _CountryRankingButton( - // title: context.translate('First Globally: DENMARK', 'الأول عالميًا: الدنمارك'), - // imagePath: 'assets/flags/denmark.png', - // color: const Color(0xFFD7C1AF), - // ), - // _CountryRankingButton( - // title: context.translate('First in GCC: MULTIPLE COUNTRIES', 'الأول في دول الخليج: دول متعددة'), - // imagePath: null, // No specific flag - // color: const Color(0xFFAEC6CF), - // ), - // _CountryRankingButton( - // title: context.translate('First in Arab Countries: UAE', 'الأول في الدول العربية: الإمارات'), - // imagePath: 'assets/flags/uae.png', - // color: const Color(0xFFD7AFAF), - // ), - // ], - // ), - ], - ), - ), - ); - } -} - -// Ranking Card (similar to _LeaderCard) -class _RankingCard extends StatelessWidget { - final String title; - final String value; - final Widget icon; - - const _RankingCard({ - Key? key, - required this.title, - required this.value, - required this.icon, - }) : super(key: key); - - @override - Widget build(BuildContext context) { - return SizedBox( - width: 160, - child: Container( - padding: const EdgeInsets.all(12), - decoration: BoxDecoration( - color: Colors.grey[100], - borderRadius: BorderRadius.circular(12), - ), - child: Column( - children: [ - Text( - title, - textAlign: TextAlign.center, - style: const TextStyle( - fontSize: 13, - color: Colors.black54, - ), - ), - const SizedBox(height: 4), - Row( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Text( - value, - textAlign: TextAlign.center, - style: const TextStyle( - fontSize: 24, - fontWeight: FontWeight.bold, - ), - ), - const SizedBox(width: 4), - icon, - ], - ), - ], - ), - ), - ); - } -} - -// Country Ranking Button (similar to _CategoryButton) -class _CountryRankingButton extends StatelessWidget { - final String title; - final String? imagePath; - final Color color; - - const _CountryRankingButton({ - Key? key, - required this.title, - required this.imagePath, - required this.color, - }) : super(key: key); - - @override - Widget build(BuildContext context) { - return Container( - width: 160, - height: 70, - decoration: BoxDecoration( - color: color, - borderRadius: BorderRadius.circular(16), - ), - alignment: Alignment.center, - child: Row( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - if (imagePath != null) ...[ - Image.asset( - imagePath!, - width: 24, - height: 24, - ), - const SizedBox(width: 8), - ], - Flexible( - child: Text( - title, - style: const TextStyle( - color: Colors.white, - fontWeight: FontWeight.bold, - fontSize: 14, - ), - textAlign: TextAlign.center, - overflow: TextOverflow.ellipsis, - ), - ), - ], - ), - ); - } +import 'package:flutter/material.dart'; +import 'package:flutter_svg/flutter_svg.dart'; +import 'package:uae_stat/domain/use_cases/language.dart'; +import 'package:uae_stat/presentation/routes/drawer_routes/custom_drawer_routes.dart'; + +class ReportDetailPage extends StatelessWidget { + final Map report; + + const ReportDetailPage({super.key, required this.report}); + + @override + Widget build(BuildContext context) { + double width = MediaQuery.of(context).size.width; + + return BaseScaffold( + title: Text( + context.translate('UAE Competitiveness', 'القدرة التنافسية للإمارات'), // Add localization + style: TextStyle( + fontFamily: context.translate('Roboto', 'NotoKufi'), + ), + ), + // hasDrawer: false, + showBackButton: true, + body: SingleChildScrollView( + padding: const EdgeInsets.all(16.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + // Header Section: Report Title and Image + Center( + child: Column( + children: [ + Image.asset( + 'assets/competitiveness/solo.png', + height: 80, // Increase size for prominence + ), + const SizedBox(height: 8), + Text( + context.translate('Prosperity Index (2023)', 'مؤشر الازدهار (2023)'), + style: const TextStyle( + fontSize: 22, + fontWeight: FontWeight.bold, + ), + ), + ], + ), + ), + const SizedBox(height: 24), + + // Description Section + Text( + context.translate( + "The Legatum Prosperity Index is published annually by the Legatum Institute. It is a policy-focused report that measures the current state of prosperity since 2007. Using the Prosperity Index framework, nations around the world can assess their strengths and weaknesses in order to determine the economic and strategic choices that need to be made to further build inclusive societies, open economies, and empowered people to drive greater levels of prosperity.", + "يُنشر مؤشر الازدهار الليجاتوم سنويًا من قبل معهد ليجاتوم. إنه تقرير يركز على السياسات ويقيس الحالة الحالية للازدهار منذ عام 2007. باستخدام إطار مؤشر الازدهار، يمكن للدول حول العالم تقييم نقاط قوتها وضعفها لتحديد الخيارات الاقتصادية والاستراتيجية التي يجب اتخاذها لتعزيز بناء مجتمعات شاملة واقتصادات مفتوحة وتمكين الأفراد لدفع مستويات أعلى من الازدهار.", + ), + style: const TextStyle(fontSize: 14), + ), + const SizedBox(height: 24), + + // Ranking Section (Using LeaderCard-like styling) + Wrap( + spacing: 16, + runSpacing: 16, + alignment: WrapAlignment.center, + children: [ + _RankingCard( + title: context.translate('Rank in 2023', 'الترتيب في 2023'), + value: "44", + icon: const Icon(Icons.arrow_downward, color: Colors.red, size: 16), + ), + _RankingCard( + title: context.translate('vs. Previous Edition', 'مقارنة بالإصدار السابق'), + value: "41", + icon: const SizedBox.shrink(), // No icon for this + ), + ], + ), + const SizedBox(height: 24), + + // Country Rankings Section (Using CategoryButton-like styling) + // Wrap( + // spacing: 16, + // runSpacing: 16, + // alignment: WrapAlignment.center, + // children: [ + // _CountryRankingButton( + // title: context.translate('First Globally: DENMARK', 'الأول عالميًا: الدنمارك'), + // imagePath: 'assets/flags/denmark.png', + // color: const Color(0xFFD7C1AF), + // ), + // _CountryRankingButton( + // title: context.translate('First in GCC: MULTIPLE COUNTRIES', 'الأول في دول الخليج: دول متعددة'), + // imagePath: null, // No specific flag + // color: const Color(0xFFAEC6CF), + // ), + // _CountryRankingButton( + // title: context.translate('First in Arab Countries: UAE', 'الأول في الدول العربية: الإمارات'), + // imagePath: 'assets/flags/uae.png', + // color: const Color(0xFFD7AFAF), + // ), + // ], + // ), + ], + ), + ), + ); + } +} + +// Ranking Card (similar to _LeaderCard) +class _RankingCard extends StatelessWidget { + final String title; + final String value; + final Widget icon; + + const _RankingCard({ + Key? key, + required this.title, + required this.value, + required this.icon, + }) : super(key: key); + + @override + Widget build(BuildContext context) { + return SizedBox( + width: 160, + child: Container( + padding: const EdgeInsets.all(12), + decoration: BoxDecoration( + color: Colors.grey[100], + borderRadius: BorderRadius.circular(12), + ), + child: Column( + children: [ + Text( + title, + textAlign: TextAlign.center, + style: const TextStyle( + fontSize: 13, + color: Colors.black54, + ), + ), + const SizedBox(height: 4), + Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Text( + value, + textAlign: TextAlign.center, + style: const TextStyle( + fontSize: 24, + fontWeight: FontWeight.bold, + ), + ), + const SizedBox(width: 4), + icon, + ], + ), + ], + ), + ), + ); + } +} + +// Country Ranking Button (similar to _CategoryButton) +class _CountryRankingButton extends StatelessWidget { + final String title; + final String? imagePath; + final Color color; + + const _CountryRankingButton({ + Key? key, + required this.title, + required this.imagePath, + required this.color, + }) : super(key: key); + + @override + Widget build(BuildContext context) { + return Container( + width: 160, + height: 70, + decoration: BoxDecoration( + color: color, + borderRadius: BorderRadius.circular(16), + ), + alignment: Alignment.center, + child: Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + if (imagePath != null) ...[ + Image.asset( + imagePath!, + width: 24, + height: 24, + ), + const SizedBox(width: 8), + ], + Flexible( + child: Text( + title, + style: const TextStyle( + color: Colors.white, + fontWeight: FontWeight.bold, + fontSize: 14, + ), + textAlign: TextAlign.center, + overflow: TextOverflow.ellipsis, + ), + ), + ], + ), + ); + } } \ No newline at end of file diff --git a/lib/presentation/Screens/Bottom Navigation Pages/Competitiveness/competitiveness.dart b/lib/presentation/Screens/Bottom Navigation Pages/Competitiveness/competitiveness.dart index c21ee7de..6f0e331b 100644 --- a/lib/presentation/Screens/Bottom Navigation Pages/Competitiveness/competitiveness.dart +++ b/lib/presentation/Screens/Bottom Navigation Pages/Competitiveness/competitiveness.dart @@ -1,157 +1,157 @@ -import 'package:flutter/material.dart'; -import 'package:go_router/go_router.dart'; -import 'package:uae_stat/domain/use_cases/language.dart'; -import 'package:uae_stat/presentation/routes/drawer_routes/custom_drawer_routes.dart'; - -class Competitiveness extends StatelessWidget { - const Competitiveness({super.key}); - - @override - Widget build(BuildContext context) { - return PopScope( - canPop: false, - onPopInvokedWithResult: (didPop, result) { - if (didPop) return; - context.go('/myhomepage'); - }, - child: BaseScaffold( - title: Text( - context.translate( - 'UAE Competitiveness', - 'تنافسية دولة الإمارات العربية المتحدة', - ), - style: TextStyle( - fontFamily: context.translate( - 'Roboto', - 'NotoKufi', - ) - ), - ), - body: CompetitivenessState(context), - ), - ); - } - - Widget CompetitivenessState(BuildContext context) { - final List> reports = [ - { - 'rank': 44, - 'title': 'Prosperity Index (2023)', - 'logo': 'assets/competitiveness/solo.png', - 'borderColor': Colors.blue, - }, - { - 'rank': 26, - 'title': 'World Happiness Report (2023)', - 'logo': 'assets/competitiveness/soloo.png', - 'borderColor': Color(0xFF844F36), - }, - { - 'rank': 7, - 'title': 'Logistics Performance Index (2023)', - 'logo': 'assets/competitiveness/solo.png', - 'borderColor': Colors.blue, - }, - { - 'rank': 10, - 'title': 'Global Soft Power Index (2023)', - 'logo': 'assets/competitiveness/soloo.png', - 'borderColor': Colors.blue, - }, - { - 'rank': 76, - 'title': 'Global Terrorism Index (2023)', - 'logo': 'assets/competitiveness/solo.png', - 'borderColor': Color(0xFF844F36), - }, - { - 'rank': 10, - 'title': 'The World Competitiveness Yearbook (2023)', - 'logo': 'assets/competitiveness/soloo.png', - 'borderColor': Colors.blue, - }, - { - 'rank': 71, - 'title': 'Global Gender Gap Report (2023)', - 'logo': 'assets/competitiveness/solo.png', - 'borderColor': Colors.blue, - }, - { - 'rank': 29, - 'title': 'Competitive Industrial Performance Index (2023)', - 'logo': 'assets/competitiveness/soloo.png', - 'borderColor': Color(0xFF844F36), - }, - ]; - - return Column( - children: [ - SizedBox(height: 16), - Text( - '(22) Competitive Reports', - style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600), - ), - SizedBox(height: 12), - Expanded( - child: ListView.builder( - itemCount: reports.length, - itemBuilder: (context, index) { - final report = reports[index]; - return Padding( - padding: const EdgeInsets.symmetric(horizontal: 12, vertical: 6), - child: InkWell( - onTap: () { - // Navigate to detail page with arguments - context.push('/reportDetail', extra: report); - }, - child: Container( - decoration: BoxDecoration( - border: Border.all(color: report['borderColor']), - borderRadius: BorderRadius.circular(12), - ), - padding: const EdgeInsets.symmetric(vertical: 12, horizontal: 16), - child: Row( - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Column( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Text( - 'Rank', - style: TextStyle(fontSize: 12, color: Colors.grey[600]), - ), - Text( - '${report['rank']}', - style: const TextStyle(fontSize: 20, fontWeight: FontWeight.bold), - ), - ], - ), - const SizedBox(width: 12), - Expanded( - child: Text( - report['title'], - style: const TextStyle(fontSize: 14, fontWeight: FontWeight.w500), - ), - ), - const SizedBox(width: 8), - Container( - height: 58, - width: 69, - alignment: Alignment.center, - child: Image.asset( - report['logo'], - fit: BoxFit.fitHeight, - ), - ), - ], - ), - ), - ), - ); - }, - ), - ), - ], - ); - } -} +import 'package:flutter/material.dart'; +import 'package:go_router/go_router.dart'; +import 'package:uae_stat/domain/use_cases/language.dart'; +import 'package:uae_stat/presentation/routes/drawer_routes/custom_drawer_routes.dart'; + +class Competitiveness extends StatelessWidget { + const Competitiveness({super.key}); + + @override + Widget build(BuildContext context) { + return PopScope( + canPop: false, + onPopInvokedWithResult: (didPop, result) { + if (didPop) return; + context.go('/myhomepage'); + }, + child: BaseScaffold( + title: Text( + context.translate( + 'UAE Competitiveness', + 'تنافسية دولة الإمارات العربية المتحدة', + ), + style: TextStyle( + fontFamily: context.translate( + 'Roboto', + 'NotoKufi', + ) + ), + ), + body: CompetitivenessState(context), + ), + ); + } + + Widget CompetitivenessState(BuildContext context) { + final List> reports = [ + { + 'rank': 44, + 'title': 'Prosperity Index (2023)', + 'logo': 'assets/competitiveness/solo.png', + 'borderColor': Colors.blue, + }, + { + 'rank': 26, + 'title': 'World Happiness Report (2023)', + 'logo': 'assets/competitiveness/soloo.png', + 'borderColor': Color(0xFF844F36), + }, + { + 'rank': 7, + 'title': 'Logistics Performance Index (2023)', + 'logo': 'assets/competitiveness/solo.png', + 'borderColor': Colors.blue, + }, + { + 'rank': 10, + 'title': 'Global Soft Power Index (2023)', + 'logo': 'assets/competitiveness/soloo.png', + 'borderColor': Colors.blue, + }, + { + 'rank': 76, + 'title': 'Global Terrorism Index (2023)', + 'logo': 'assets/competitiveness/solo.png', + 'borderColor': Color(0xFF844F36), + }, + { + 'rank': 10, + 'title': 'The World Competitiveness Yearbook (2023)', + 'logo': 'assets/competitiveness/soloo.png', + 'borderColor': Colors.blue, + }, + { + 'rank': 71, + 'title': 'Global Gender Gap Report (2023)', + 'logo': 'assets/competitiveness/solo.png', + 'borderColor': Colors.blue, + }, + { + 'rank': 29, + 'title': 'Competitive Industrial Performance Index (2023)', + 'logo': 'assets/competitiveness/soloo.png', + 'borderColor': Color(0xFF844F36), + }, + ]; + + return Column( + children: [ + SizedBox(height: 16), + Text( + '(22) Competitive Reports', + style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600), + ), + SizedBox(height: 12), + Expanded( + child: ListView.builder( + itemCount: reports.length, + itemBuilder: (context, index) { + final report = reports[index]; + return Padding( + padding: const EdgeInsets.symmetric(horizontal: 12, vertical: 6), + child: InkWell( + onTap: () { + // Navigate to detail page with arguments + context.push('/reportDetail', extra: report); + }, + child: Container( + decoration: BoxDecoration( + border: Border.all(color: report['borderColor']), + borderRadius: BorderRadius.circular(12), + ), + padding: const EdgeInsets.symmetric(vertical: 12, horizontal: 16), + child: Row( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Text( + 'Rank', + style: TextStyle(fontSize: 12, color: Colors.grey[600]), + ), + Text( + '${report['rank']}', + style: const TextStyle(fontSize: 20, fontWeight: FontWeight.bold), + ), + ], + ), + const SizedBox(width: 12), + Expanded( + child: Text( + report['title'], + style: const TextStyle(fontSize: 14, fontWeight: FontWeight.w500), + ), + ), + const SizedBox(width: 8), + Container( + height: 58, + width: 69, + alignment: Alignment.center, + child: Image.asset( + report['logo'], + fit: BoxFit.fitHeight, + ), + ), + ], + ), + ), + ), + ); + }, + ), + ), + ], + ); + } +} diff --git a/lib/presentation/Screens/Bottom Navigation Pages/Country_Profile/DetailedCountryProfilePage.dart b/lib/presentation/Screens/Bottom Navigation Pages/Country_Profile/DetailedCountryProfilePage.dart index d9789184..f23ff5d3 100644 --- a/lib/presentation/Screens/Bottom Navigation Pages/Country_Profile/DetailedCountryProfilePage.dart +++ b/lib/presentation/Screens/Bottom Navigation Pages/Country_Profile/DetailedCountryProfilePage.dart @@ -1,816 +1,816 @@ -import 'dart:ui'; - -import 'package:flutter/material.dart'; -import 'package:flutter_svg/flutter_svg.dart'; -import 'package:uae_stat/presentation/routes/drawer_routes/custom_drawer_routes.dart'; - -class DetailedCountryProfilePage extends StatelessWidget { - final String countryName; - final String flag; - - const DetailedCountryProfilePage({ - Key? key, - required this.countryName, - required this.flag, - }) : super(key: key); - - @override - Widget build(BuildContext context) { - double width = MediaQuery.of(context).size.width; - - return BaseScaffold( - title: const Text('Country Profile'), - // hasDrawer: false, - showBackButton: true, - body: SingleChildScrollView( - child: Padding( - padding: const EdgeInsets.all(16.0), - child: Column( - children: [ - // Country name and flag - Center( - child: Column( - children: [ - Text(flag, style: const TextStyle(fontSize: 48)), - const SizedBox(height: 8), - Text( - countryName.toUpperCase(), - style: const TextStyle( - fontSize: 22, - fontWeight: FontWeight.bold, - ), - ), - ], - ), - ), - const SizedBox(height: 24), - - // Government Officials - GridView.count( - crossAxisCount: 2, - shrinkWrap: true, - physics: const NeverScrollableScrollPhysics(), - mainAxisSpacing: 12, - crossAxisSpacing: 12, - childAspectRatio: 2.0, - children: const [ - _LeaderCard( - imagePath: 'assets/country-profile/alberto.png', - name: 'Alberto Fernández', - position: 'President', - ), - _LeaderCard( - imagePath: 'assets/country-profile/alberto.png', - name: 'Alberto Fernández', - position: 'President', - ), - _LeaderCard( - imagePath: 'assets/country-profile/alberto.png', - name: 'Alberto Fernández', - position: 'President', - ), - _LeaderCard( - imagePath: 'assets/country-profile/alberto.png', - name: 'Alberto Fernández', - position: 'President', - ), - ], - ), - const SizedBox(height: 24), - Column( - crossAxisAlignment: CrossAxisAlignment.stretch, - children: [ - Row( - mainAxisAlignment: MainAxisAlignment.spaceEvenly, - children: [ - Expanded( - child: _CategoryButton( - title: 'Demography', - color: const Color(0xFFD7C1AF), - onTap: () => showCategoryPopup(context, 'Demography'), - ), - ), - const SizedBox(width: 16), - Expanded( - child: _CategoryButton( - title: 'GDP', - color: const Color(0xFFAEC6CF), - onTap: () => showCategoryPopup(context, 'GDP'), - ), - ), - ], - ), - const SizedBox(height: 16), - Row( - mainAxisAlignment: MainAxisAlignment.spaceEvenly, - children: [ - Expanded( - child: _CategoryButton( - title: 'FDI', - color: const Color(0xFFD7AFAF), - onTap: () => showCategoryPopup(context, 'FDI'), - ), - ), - const SizedBox(width: 16), - Expanded( - child: _CategoryButton( - title: 'Trade', - color: const Color(0xFFAFCFAF), - onTap: () => showCategoryPopup(context, 'Trade'), - ), - ), - ], - ), - const SizedBox(height: 16), - // Full-width button - _CategoryButton( - title: 'Bilateral Trade', - color: const Color(0xFF9FAFCF), - onTap: () => showCategoryPopup(context, 'Bilateral Trade'), - ), - ], - ) - - - ], - ), - ), - ), - ); - } -} -class _GDPItem extends StatelessWidget { - final String title; - final String value; - final String rank; - - const _GDPItem({ - required this.title, - required this.value, - required this.rank, - }); - - @override - Widget build(BuildContext context) { - return Row( - children: [ - Expanded( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text(title, style: TextStyle(color: Colors.grey)), - SizedBox(height: 4), - Row( - children: [ - Text( - value, - style: TextStyle(fontSize: 18, fontWeight: FontWeight.bold), - ), - SizedBox(width: 8), - Text( - '$rank ↓', - style: TextStyle(color: Colors.red, fontSize: 12), - ), - SizedBox(width: 4), - Text('Rank', style: TextStyle(fontSize: 10, color: Colors.grey)), - ], - ), - ], - ), - ), - ], - ); - } -} -class _LeaderCard extends StatelessWidget { - final String imagePath; - final String name; - final String position; - - const _LeaderCard({ - Key? key, - required this.imagePath, - required this.name, - required this.position, - }) : super(key: key); - - @override - Widget build(BuildContext context) { - return Container( - padding: const EdgeInsets.all(10), - decoration: BoxDecoration( - color: Colors.white, - borderRadius: BorderRadius.circular(12), - boxShadow: [ - BoxShadow( - color: Colors.grey.shade300, - blurRadius: 4, - offset: const Offset(0, 2), - ), - ], - ), - child: Row( - children: [ - ClipRRect( - borderRadius: BorderRadius.circular(8), - child: Image.asset( - imagePath, - width: 70, - height: 80, - fit: BoxFit.cover, - ), - ), - const SizedBox(width: 8), - Expanded( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text( - position, - style: TextStyle( - fontSize: 10, - color: Colors.grey.shade600, - ), - maxLines: 2, - overflow: TextOverflow.ellipsis, - ), - const SizedBox(height: 2), - Text( - name, - style: const TextStyle( - fontWeight: FontWeight.bold, - fontSize: 12, - ), - maxLines: 2, - overflow: TextOverflow.ellipsis, - ), - ], - ), - ), - ], - ), - ); - } -} -class _CategoryButton extends StatelessWidget { - final String title; - final Color color; - final VoidCallback onTap; - - const _CategoryButton({ - super.key, - required this.title, - required this.color, - required this.onTap, - }); - - @override - Widget build(BuildContext context) { - return GestureDetector( - onTap: onTap, - child: Container( - height: 100, - width: double.infinity, // This ensures full width - decoration: BoxDecoration( - color: color, - borderRadius: BorderRadius.circular(12), - ), - alignment: Alignment.center, - child: Text( - title, - style: const TextStyle( - fontSize: 16, - color: Colors.white, - fontWeight: FontWeight.bold, - ), - ), - ), - ); - } -} -class CategoryPopupContent extends StatelessWidget { - final String category; - - const CategoryPopupContent({super.key, required this.category}); - - @override - Widget build(BuildContext context) { - switch (category) { - case 'Demography': - return Column( - mainAxisSize: MainAxisSize.min, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - const SizedBox(height: 8), - Container( - width: 50, - height: 5, - decoration: BoxDecoration( - color: Colors.grey[300], - borderRadius: BorderRadius.circular(10), - ), - ), - const SizedBox(height: 16), - - _DemographyItem( - icon: Icons.location_city, - title: 'Capital City', - value: 'Buenos Aires', - ), - Divider(), - - _DemographyItem( - icon: Icons.map, - title: 'Surface Area', - value: '2,780,400 sq. km', - ), - Divider(), - - _DemographyStatItem( - icon: Icons.groups, - title: '2021 Population', - value: '45.81 M', - suffix: '32 ↑ Rank', - suffixStyle: const TextStyle(color: Colors.green, fontSize: 12), - ), - Divider(), - - _DemographyStatItem( - icon: Icons.male, - title: '2021 Male Population', - value: '22.35 M', - suffix: '0.98% ↑ Growth Rate', - valueColor: Colors.deepPurple, - ), - Divider(), - - _DemographyStatItem( - icon: Icons.female, - title: '2021 Female Population', - value: '23.46 M', - suffix: '0.93% ↑ Growth Rate', - valueColor: Colors.purple, - ), - - const SizedBox(height: 16), - ], - ); - case 'GDP': - return Column( - mainAxisSize: MainAxisSize.min, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - const SizedBox(height: 8), - Container( - width: 50, - height: 5, - decoration: BoxDecoration( - color: Colors.grey[300], - borderRadius: BorderRadius.circular(10), - ), - ), - const SizedBox(height: 16), - - _GDPMetricItem( - icon: Icons.apartment, - title: '2021 Nominal GDP (AED)', - value: '1.8 T', - rank: '26', - rankDirection: '↓', - rankColor: Colors.red, - ), - Divider(), - - _GDPMetricItem( - icon: Icons.public, - title: '2021 Real GDP (AED)', - value: '2.08 T', - rank: '22', - rankDirection: '↓', - rankColor: Colors.red, - ), - Divider(), - - _GDPMetricItem( - icon: Icons.groups_3, - title: '2021 GDP Per Capita (AED)', - value: '39.38 K', - rank: '64', - rankDirection: '↓', - rankColor: Colors.red, - ), - Divider(), - - const SizedBox(height: 8), - Icon(Icons.stacked_bar_chart, color: Colors.grey), - const SizedBox(height: 4), - const Text( - 'Income Level', - style: TextStyle(color: Colors.grey), - ), - const SizedBox(height: 4), - const Text( - 'Upper Middle Income', - style: TextStyle(fontWeight: FontWeight.bold, fontSize: 16), - ), - const SizedBox(height: 16), - ], - ); - case 'FDI': - return Column( - mainAxisSize: MainAxisSize.min, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - const SizedBox(height: 8), - Container( - width: 50, - height: 5, - decoration: BoxDecoration( - color: Colors.grey[300], - borderRadius: BorderRadius.circular(10), - ), - ), - const SizedBox(height: 16), - - _FDIItem( - icon: Icons.trending_down, - title: '2020 FDI Outflows (AED)', - value: '4.75 B', - growthRate: '-15.94%', - isPositive: false, - ), - Divider(), - - _FDIItem( - icon: Icons.swap_horizontal_circle_outlined, - title: '2020 FDI Inflows (AED)', - value: '14.75 B', - growthRate: '-39.68%', - isPositive: false, - ), - Divider(), - - _FDIItem( - icon: Icons.thumb_up_alt_outlined, - title: '2021 FDI Stocks (AED)', - value: '18.98 B', - growthRate: '89.75%', - isPositive: true, - ), - const SizedBox(height: 16), - ], - ); - case 'Trade': - return Column( - mainAxisSize: MainAxisSize.min, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - const SizedBox(height: 8), - Container( - width: 50, - height: 5, - decoration: BoxDecoration( - color: Colors.grey[300], - borderRadius: BorderRadius.circular(10), - ), - ), - const SizedBox(height: 16), - - _TradeItem( - icon: Icons.cached, - title: '2021 Total Trade (AED)', - value: '603 B', - growthRate: '39.89%', - isPositive: true, - ), - Divider(), - - _TradeItem( - icon: Icons.download_outlined, - title: '2021 Imports (AED)', - value: '272.9 B', - growthRate: '40.79%', - isPositive: true, - ), - Divider(), - - _TradeItem( - icon: Icons.upload_outlined, - title: '2021 Exports (AED)', - value: '330.1 B', - growthRate: '39.15%', - isPositive: true, - ), - const SizedBox(height: 16), - ], - ); - case 'Bilateral Trade': - return Column( - mainAxisSize: MainAxisSize.min, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - const SizedBox(height: 8), - Center( - child: Container( - width: 50, - height: 5, - decoration: BoxDecoration( - color: Colors.grey[300], - borderRadius: BorderRadius.circular(10), - ), - ), - ), - const SizedBox(height: 16), - const Center( - child: Text( - 'UAE Bilateral Trade (2022)', - style: TextStyle(fontSize: 16, fontWeight: FontWeight.bold), - ), - ), - const SizedBox(height: 8), - const Center( - child: Text( - 'Total \$472.5M', - style: TextStyle(fontSize: 20, fontWeight: FontWeight.bold), - ), - ), - const SizedBox(height: 16), - Row( - mainAxisAlignment: MainAxisAlignment.spaceEvenly, - children: const [ - _BilateralTradeValueBox(label: 'Total Import', value: '\$390.2M', color: Color(0xFF00B292)), - _BilateralTradeValueBox(label: 'Total Export', value: '\$42.2M', color: Color(0xFFDE4D86)), - _BilateralTradeValueBox(label: 'Total ReExport', value: '\$40.2M', color: Color(0xFF4D52A1)), - ], - ), - const SizedBox(height: 24), - const Center( - child: Text( - 'Top 5 Import Commodities', - style: TextStyle( - fontSize: 16, fontWeight: FontWeight.bold, color: Color(0xFF4FBFA8)), - ), - ), - const SizedBox(height: 12), - _CommodityRow(icon: Icons.eco, label: 'Vegetable Products', value: '\$198.6M'), - _CommodityRow(icon: Icons.liquor, label: 'Foodstuffs, Beverages, Spirits And Tobacco', value: '\$89.9M'), - _CommodityRow(icon: Icons.build, label: 'Base Metals And Articles Of Base Metal', value: '\$65.6M'), - _CommodityRow(icon: Icons.pets, label: 'Live Animals And Their Products', value: '\$23.7M'), - _CommodityRow(icon: Icons.science, label: 'Products Of The Chemical or Allied Industries', value: '\$4.7M'), - const SizedBox(height: 16), - ], - ); - // Add other categories here... - - default: - return Center(child: Text('$category details coming soon.')); - } - } -} -Widget _DemographyItem({ - required IconData icon, - required String title, - required String value, -}) { - return Column( - children: [ - Icon(icon, size: 32, color: Colors.grey), - const SizedBox(height: 4), - Text(title, style: const TextStyle(color: Colors.grey)), - const SizedBox(height: 4), - Text( - value, - style: const TextStyle(fontWeight: FontWeight.bold, fontSize: 16), - textAlign: TextAlign.center, - ), - ], - ); -} -Widget _DemographyStatItem({ - required IconData icon, - required String title, - required String value, - String? suffix, - TextStyle? suffixStyle, - Color? valueColor, -}) { - return Column( - children: [ - Icon(icon, size: 32, color: Colors.grey), - const SizedBox(height: 4), - Text(title, style: const TextStyle(color: Colors.grey)), - const SizedBox(height: 4), - RichText( - textAlign: TextAlign.center, - text: TextSpan( - children: [ - TextSpan( - text: '$value ', - style: TextStyle( - fontWeight: FontWeight.bold, - fontSize: 16, - color: valueColor ?? Colors.black, - ), - ), - if (suffix != null) - TextSpan( - text: suffix, - style: suffixStyle ?? - const TextStyle(fontSize: 12, color: Colors.green), - ), - ], - ), - ), - ], - ); -} -Widget _GDPMetricItem({ - required IconData icon, - required String title, - required String value, - required String rank, - required String rankDirection, - required Color rankColor, -}) { - return Column( - children: [ - Icon(icon, size: 32, color: Colors.grey), - const SizedBox(height: 4), - Text(title, style: const TextStyle(color: Colors.grey)), - const SizedBox(height: 4), - RichText( - textAlign: TextAlign.center, - text: TextSpan( - children: [ - TextSpan( - text: '$value ', - style: const TextStyle( - fontWeight: FontWeight.bold, - fontSize: 18, - color: Colors.black, - ), - ), - TextSpan( - text: '$rank $rankDirection\n', - style: TextStyle( - fontSize: 12, - color: rankColor, - ), - ), - const TextSpan( - text: 'Rank', - style: TextStyle(fontSize: 10, color: Colors.grey), - ), - ], - ), - ), - ], - ); -} -Widget _FDIItem({ - required IconData icon, - required String title, - required String value, - required String growthRate, - required bool isPositive, -}) { - return Column( - children: [ - Icon(icon, size: 32, color: Colors.grey), - const SizedBox(height: 4), - Text(title, style: const TextStyle(color: Colors.grey)), - const SizedBox(height: 4), - Text( - value, - style: const TextStyle( - fontWeight: FontWeight.bold, - fontSize: 18, - color: Colors.black, - ), - ), - const SizedBox(height: 2), - Text( - '$growthRate Growth Rate', - style: TextStyle( - color: isPositive ? Colors.green : Colors.red, - fontSize: 12, - ), - ), - ], - ); -} -Widget _TradeItem({ - required IconData icon, - required String title, - required String value, - required String growthRate, - required bool isPositive, -}) { - return Column( - children: [ - Icon(icon, size: 32, color: Colors.grey), - const SizedBox(height: 4), - Text(title, style: const TextStyle(color: Colors.grey)), - const SizedBox(height: 4), - Text( - value, - style: const TextStyle( - fontWeight: FontWeight.bold, - fontSize: 18, - color: Colors.black, - ), - ), - const SizedBox(height: 2), - Text( - '$growthRate Growth Rate', - style: TextStyle( - color: isPositive ? Colors.green : Colors.red, - fontSize: 12, - ), - ), - ], - ); -} -class _BilateralTradeValueBox extends StatelessWidget { - final String label; - final String value; - final Color color; - - const _BilateralTradeValueBox({ - required this.label, - required this.value, - required this.color, - }); - - @override - Widget build(BuildContext context) { - return Container( - padding: const EdgeInsets.symmetric(horizontal: 12, vertical: 8), - decoration: BoxDecoration( - color: color.withOpacity(0.1), - borderRadius: BorderRadius.circular(10), - border: Border.all(color: color), - ), - child: Column( - children: [ - Text( - label, - style: TextStyle(fontSize: 12, color: color), - ), - const SizedBox(height: 4), - Text( - value, - style: TextStyle( - fontWeight: FontWeight.bold, - fontSize: 14, - color: color, - ), - ), - ], - ), - ); - } -} - -Widget _CommodityRow({ - required IconData icon, - required String label, - required String value, -}) { - return Padding( - padding: const EdgeInsets.symmetric(vertical: 6, horizontal: 12), - child: Row( - children: [ - Icon(icon, size: 20, color: Colors.grey[600]), - const SizedBox(width: 12), - Expanded( - child: Text(label, style: const TextStyle(fontSize: 14)), - ), - Text(value, style: const TextStyle(fontWeight: FontWeight.bold, color: Colors.teal)), - ], - ), - ); -} -//pop-up -void showCategoryPopup(BuildContext context, String category) { - showDialog( - context: context, - barrierColor: Colors.black.withOpacity(0.3), - builder: (context) => BackdropFilter( - filter: ImageFilter.blur(sigmaX: 5, sigmaY: 5), - child: Dialog( - backgroundColor: Colors.white, - insetPadding: const EdgeInsets.symmetric(horizontal: 20, vertical: 40), - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(16), - ), - child: Padding( - padding: const EdgeInsets.all(16.0), - child: CategoryPopupContent(category: category), - ), - ), - ), - ); -} - - +import 'dart:ui'; + +import 'package:flutter/material.dart'; +import 'package:flutter_svg/flutter_svg.dart'; +import 'package:uae_stat/presentation/routes/drawer_routes/custom_drawer_routes.dart'; + +class DetailedCountryProfilePage extends StatelessWidget { + final String countryName; + final String flag; + + const DetailedCountryProfilePage({ + Key? key, + required this.countryName, + required this.flag, + }) : super(key: key); + + @override + Widget build(BuildContext context) { + double width = MediaQuery.of(context).size.width; + + return BaseScaffold( + title: const Text('Country Profile'), + // hasDrawer: false, + showBackButton: true, + body: SingleChildScrollView( + child: Padding( + padding: const EdgeInsets.all(16.0), + child: Column( + children: [ + // Country name and flag + Center( + child: Column( + children: [ + Text(flag, style: const TextStyle(fontSize: 48)), + const SizedBox(height: 8), + Text( + countryName.toUpperCase(), + style: const TextStyle( + fontSize: 22, + fontWeight: FontWeight.bold, + ), + ), + ], + ), + ), + const SizedBox(height: 24), + + // Government Officials + GridView.count( + crossAxisCount: 2, + shrinkWrap: true, + physics: const NeverScrollableScrollPhysics(), + mainAxisSpacing: 12, + crossAxisSpacing: 12, + childAspectRatio: 2.0, + children: const [ + _LeaderCard( + imagePath: 'assets/country-profile/alberto.png', + name: 'Alberto Fernández', + position: 'President', + ), + _LeaderCard( + imagePath: 'assets/country-profile/alberto.png', + name: 'Alberto Fernández', + position: 'President', + ), + _LeaderCard( + imagePath: 'assets/country-profile/alberto.png', + name: 'Alberto Fernández', + position: 'President', + ), + _LeaderCard( + imagePath: 'assets/country-profile/alberto.png', + name: 'Alberto Fernández', + position: 'President', + ), + ], + ), + const SizedBox(height: 24), + Column( + crossAxisAlignment: CrossAxisAlignment.stretch, + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + children: [ + Expanded( + child: _CategoryButton( + title: 'Demography', + color: const Color(0xFFD7C1AF), + onTap: () => showCategoryPopup(context, 'Demography'), + ), + ), + const SizedBox(width: 16), + Expanded( + child: _CategoryButton( + title: 'GDP', + color: const Color(0xFFAEC6CF), + onTap: () => showCategoryPopup(context, 'GDP'), + ), + ), + ], + ), + const SizedBox(height: 16), + Row( + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + children: [ + Expanded( + child: _CategoryButton( + title: 'FDI', + color: const Color(0xFFD7AFAF), + onTap: () => showCategoryPopup(context, 'FDI'), + ), + ), + const SizedBox(width: 16), + Expanded( + child: _CategoryButton( + title: 'Trade', + color: const Color(0xFFAFCFAF), + onTap: () => showCategoryPopup(context, 'Trade'), + ), + ), + ], + ), + const SizedBox(height: 16), + // Full-width button + _CategoryButton( + title: 'Bilateral Trade', + color: const Color(0xFF9FAFCF), + onTap: () => showCategoryPopup(context, 'Bilateral Trade'), + ), + ], + ) + + + ], + ), + ), + ), + ); + } +} +class _GDPItem extends StatelessWidget { + final String title; + final String value; + final String rank; + + const _GDPItem({ + required this.title, + required this.value, + required this.rank, + }); + + @override + Widget build(BuildContext context) { + return Row( + children: [ + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text(title, style: TextStyle(color: Colors.grey)), + SizedBox(height: 4), + Row( + children: [ + Text( + value, + style: TextStyle(fontSize: 18, fontWeight: FontWeight.bold), + ), + SizedBox(width: 8), + Text( + '$rank ↓', + style: TextStyle(color: Colors.red, fontSize: 12), + ), + SizedBox(width: 4), + Text('Rank', style: TextStyle(fontSize: 10, color: Colors.grey)), + ], + ), + ], + ), + ), + ], + ); + } +} +class _LeaderCard extends StatelessWidget { + final String imagePath; + final String name; + final String position; + + const _LeaderCard({ + Key? key, + required this.imagePath, + required this.name, + required this.position, + }) : super(key: key); + + @override + Widget build(BuildContext context) { + return Container( + padding: const EdgeInsets.all(10), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(12), + boxShadow: [ + BoxShadow( + color: Colors.grey.shade300, + blurRadius: 4, + offset: const Offset(0, 2), + ), + ], + ), + child: Row( + children: [ + ClipRRect( + borderRadius: BorderRadius.circular(8), + child: Image.asset( + imagePath, + width: 70, + height: 80, + fit: BoxFit.cover, + ), + ), + const SizedBox(width: 8), + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + position, + style: TextStyle( + fontSize: 10, + color: Colors.grey.shade600, + ), + maxLines: 2, + overflow: TextOverflow.ellipsis, + ), + const SizedBox(height: 2), + Text( + name, + style: const TextStyle( + fontWeight: FontWeight.bold, + fontSize: 12, + ), + maxLines: 2, + overflow: TextOverflow.ellipsis, + ), + ], + ), + ), + ], + ), + ); + } +} +class _CategoryButton extends StatelessWidget { + final String title; + final Color color; + final VoidCallback onTap; + + const _CategoryButton({ + super.key, + required this.title, + required this.color, + required this.onTap, + }); + + @override + Widget build(BuildContext context) { + return GestureDetector( + onTap: onTap, + child: Container( + height: 100, + width: double.infinity, // This ensures full width + decoration: BoxDecoration( + color: color, + borderRadius: BorderRadius.circular(12), + ), + alignment: Alignment.center, + child: Text( + title, + style: const TextStyle( + fontSize: 16, + color: Colors.white, + fontWeight: FontWeight.bold, + ), + ), + ), + ); + } +} +class CategoryPopupContent extends StatelessWidget { + final String category; + + const CategoryPopupContent({super.key, required this.category}); + + @override + Widget build(BuildContext context) { + switch (category) { + case 'Demography': + return Column( + mainAxisSize: MainAxisSize.min, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + const SizedBox(height: 8), + Container( + width: 50, + height: 5, + decoration: BoxDecoration( + color: Colors.grey[300], + borderRadius: BorderRadius.circular(10), + ), + ), + const SizedBox(height: 16), + + _DemographyItem( + icon: Icons.location_city, + title: 'Capital City', + value: 'Buenos Aires', + ), + Divider(), + + _DemographyItem( + icon: Icons.map, + title: 'Surface Area', + value: '2,780,400 sq. km', + ), + Divider(), + + _DemographyStatItem( + icon: Icons.groups, + title: '2021 Population', + value: '45.81 M', + suffix: '32 ↑ Rank', + suffixStyle: const TextStyle(color: Colors.green, fontSize: 12), + ), + Divider(), + + _DemographyStatItem( + icon: Icons.male, + title: '2021 Male Population', + value: '22.35 M', + suffix: '0.98% ↑ Growth Rate', + valueColor: Colors.deepPurple, + ), + Divider(), + + _DemographyStatItem( + icon: Icons.female, + title: '2021 Female Population', + value: '23.46 M', + suffix: '0.93% ↑ Growth Rate', + valueColor: Colors.purple, + ), + + const SizedBox(height: 16), + ], + ); + case 'GDP': + return Column( + mainAxisSize: MainAxisSize.min, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + const SizedBox(height: 8), + Container( + width: 50, + height: 5, + decoration: BoxDecoration( + color: Colors.grey[300], + borderRadius: BorderRadius.circular(10), + ), + ), + const SizedBox(height: 16), + + _GDPMetricItem( + icon: Icons.apartment, + title: '2021 Nominal GDP (AED)', + value: '1.8 T', + rank: '26', + rankDirection: '↓', + rankColor: Colors.red, + ), + Divider(), + + _GDPMetricItem( + icon: Icons.public, + title: '2021 Real GDP (AED)', + value: '2.08 T', + rank: '22', + rankDirection: '↓', + rankColor: Colors.red, + ), + Divider(), + + _GDPMetricItem( + icon: Icons.groups_3, + title: '2021 GDP Per Capita (AED)', + value: '39.38 K', + rank: '64', + rankDirection: '↓', + rankColor: Colors.red, + ), + Divider(), + + const SizedBox(height: 8), + Icon(Icons.stacked_bar_chart, color: Colors.grey), + const SizedBox(height: 4), + const Text( + 'Income Level', + style: TextStyle(color: Colors.grey), + ), + const SizedBox(height: 4), + const Text( + 'Upper Middle Income', + style: TextStyle(fontWeight: FontWeight.bold, fontSize: 16), + ), + const SizedBox(height: 16), + ], + ); + case 'FDI': + return Column( + mainAxisSize: MainAxisSize.min, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + const SizedBox(height: 8), + Container( + width: 50, + height: 5, + decoration: BoxDecoration( + color: Colors.grey[300], + borderRadius: BorderRadius.circular(10), + ), + ), + const SizedBox(height: 16), + + _FDIItem( + icon: Icons.trending_down, + title: '2020 FDI Outflows (AED)', + value: '4.75 B', + growthRate: '-15.94%', + isPositive: false, + ), + Divider(), + + _FDIItem( + icon: Icons.swap_horizontal_circle_outlined, + title: '2020 FDI Inflows (AED)', + value: '14.75 B', + growthRate: '-39.68%', + isPositive: false, + ), + Divider(), + + _FDIItem( + icon: Icons.thumb_up_alt_outlined, + title: '2021 FDI Stocks (AED)', + value: '18.98 B', + growthRate: '89.75%', + isPositive: true, + ), + const SizedBox(height: 16), + ], + ); + case 'Trade': + return Column( + mainAxisSize: MainAxisSize.min, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + const SizedBox(height: 8), + Container( + width: 50, + height: 5, + decoration: BoxDecoration( + color: Colors.grey[300], + borderRadius: BorderRadius.circular(10), + ), + ), + const SizedBox(height: 16), + + _TradeItem( + icon: Icons.cached, + title: '2021 Total Trade (AED)', + value: '603 B', + growthRate: '39.89%', + isPositive: true, + ), + Divider(), + + _TradeItem( + icon: Icons.download_outlined, + title: '2021 Imports (AED)', + value: '272.9 B', + growthRate: '40.79%', + isPositive: true, + ), + Divider(), + + _TradeItem( + icon: Icons.upload_outlined, + title: '2021 Exports (AED)', + value: '330.1 B', + growthRate: '39.15%', + isPositive: true, + ), + const SizedBox(height: 16), + ], + ); + case 'Bilateral Trade': + return Column( + mainAxisSize: MainAxisSize.min, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + const SizedBox(height: 8), + Center( + child: Container( + width: 50, + height: 5, + decoration: BoxDecoration( + color: Colors.grey[300], + borderRadius: BorderRadius.circular(10), + ), + ), + ), + const SizedBox(height: 16), + const Center( + child: Text( + 'UAE Bilateral Trade (2022)', + style: TextStyle(fontSize: 16, fontWeight: FontWeight.bold), + ), + ), + const SizedBox(height: 8), + const Center( + child: Text( + 'Total \$472.5M', + style: TextStyle(fontSize: 20, fontWeight: FontWeight.bold), + ), + ), + const SizedBox(height: 16), + Row( + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + children: const [ + _BilateralTradeValueBox(label: 'Total Import', value: '\$390.2M', color: Color(0xFF00B292)), + _BilateralTradeValueBox(label: 'Total Export', value: '\$42.2M', color: Color(0xFFDE4D86)), + _BilateralTradeValueBox(label: 'Total ReExport', value: '\$40.2M', color: Color(0xFF4D52A1)), + ], + ), + const SizedBox(height: 24), + const Center( + child: Text( + 'Top 5 Import Commodities', + style: TextStyle( + fontSize: 16, fontWeight: FontWeight.bold, color: Color(0xFF4FBFA8)), + ), + ), + const SizedBox(height: 12), + _CommodityRow(icon: Icons.eco, label: 'Vegetable Products', value: '\$198.6M'), + _CommodityRow(icon: Icons.liquor, label: 'Foodstuffs, Beverages, Spirits And Tobacco', value: '\$89.9M'), + _CommodityRow(icon: Icons.build, label: 'Base Metals And Articles Of Base Metal', value: '\$65.6M'), + _CommodityRow(icon: Icons.pets, label: 'Live Animals And Their Products', value: '\$23.7M'), + _CommodityRow(icon: Icons.science, label: 'Products Of The Chemical or Allied Industries', value: '\$4.7M'), + const SizedBox(height: 16), + ], + ); + // Add other categories here... + + default: + return Center(child: Text('$category details coming soon.')); + } + } +} +Widget _DemographyItem({ + required IconData icon, + required String title, + required String value, +}) { + return Column( + children: [ + Icon(icon, size: 32, color: Colors.grey), + const SizedBox(height: 4), + Text(title, style: const TextStyle(color: Colors.grey)), + const SizedBox(height: 4), + Text( + value, + style: const TextStyle(fontWeight: FontWeight.bold, fontSize: 16), + textAlign: TextAlign.center, + ), + ], + ); +} +Widget _DemographyStatItem({ + required IconData icon, + required String title, + required String value, + String? suffix, + TextStyle? suffixStyle, + Color? valueColor, +}) { + return Column( + children: [ + Icon(icon, size: 32, color: Colors.grey), + const SizedBox(height: 4), + Text(title, style: const TextStyle(color: Colors.grey)), + const SizedBox(height: 4), + RichText( + textAlign: TextAlign.center, + text: TextSpan( + children: [ + TextSpan( + text: '$value ', + style: TextStyle( + fontWeight: FontWeight.bold, + fontSize: 16, + color: valueColor ?? Colors.black, + ), + ), + if (suffix != null) + TextSpan( + text: suffix, + style: suffixStyle ?? + const TextStyle(fontSize: 12, color: Colors.green), + ), + ], + ), + ), + ], + ); +} +Widget _GDPMetricItem({ + required IconData icon, + required String title, + required String value, + required String rank, + required String rankDirection, + required Color rankColor, +}) { + return Column( + children: [ + Icon(icon, size: 32, color: Colors.grey), + const SizedBox(height: 4), + Text(title, style: const TextStyle(color: Colors.grey)), + const SizedBox(height: 4), + RichText( + textAlign: TextAlign.center, + text: TextSpan( + children: [ + TextSpan( + text: '$value ', + style: const TextStyle( + fontWeight: FontWeight.bold, + fontSize: 18, + color: Colors.black, + ), + ), + TextSpan( + text: '$rank $rankDirection\n', + style: TextStyle( + fontSize: 12, + color: rankColor, + ), + ), + const TextSpan( + text: 'Rank', + style: TextStyle(fontSize: 10, color: Colors.grey), + ), + ], + ), + ), + ], + ); +} +Widget _FDIItem({ + required IconData icon, + required String title, + required String value, + required String growthRate, + required bool isPositive, +}) { + return Column( + children: [ + Icon(icon, size: 32, color: Colors.grey), + const SizedBox(height: 4), + Text(title, style: const TextStyle(color: Colors.grey)), + const SizedBox(height: 4), + Text( + value, + style: const TextStyle( + fontWeight: FontWeight.bold, + fontSize: 18, + color: Colors.black, + ), + ), + const SizedBox(height: 2), + Text( + '$growthRate Growth Rate', + style: TextStyle( + color: isPositive ? Colors.green : Colors.red, + fontSize: 12, + ), + ), + ], + ); +} +Widget _TradeItem({ + required IconData icon, + required String title, + required String value, + required String growthRate, + required bool isPositive, +}) { + return Column( + children: [ + Icon(icon, size: 32, color: Colors.grey), + const SizedBox(height: 4), + Text(title, style: const TextStyle(color: Colors.grey)), + const SizedBox(height: 4), + Text( + value, + style: const TextStyle( + fontWeight: FontWeight.bold, + fontSize: 18, + color: Colors.black, + ), + ), + const SizedBox(height: 2), + Text( + '$growthRate Growth Rate', + style: TextStyle( + color: isPositive ? Colors.green : Colors.red, + fontSize: 12, + ), + ), + ], + ); +} +class _BilateralTradeValueBox extends StatelessWidget { + final String label; + final String value; + final Color color; + + const _BilateralTradeValueBox({ + required this.label, + required this.value, + required this.color, + }); + + @override + Widget build(BuildContext context) { + return Container( + padding: const EdgeInsets.symmetric(horizontal: 12, vertical: 8), + decoration: BoxDecoration( + color: color.withOpacity(0.1), + borderRadius: BorderRadius.circular(10), + border: Border.all(color: color), + ), + child: Column( + children: [ + Text( + label, + style: TextStyle(fontSize: 12, color: color), + ), + const SizedBox(height: 4), + Text( + value, + style: TextStyle( + fontWeight: FontWeight.bold, + fontSize: 14, + color: color, + ), + ), + ], + ), + ); + } +} + +Widget _CommodityRow({ + required IconData icon, + required String label, + required String value, +}) { + return Padding( + padding: const EdgeInsets.symmetric(vertical: 6, horizontal: 12), + child: Row( + children: [ + Icon(icon, size: 20, color: Colors.grey[600]), + const SizedBox(width: 12), + Expanded( + child: Text(label, style: const TextStyle(fontSize: 14)), + ), + Text(value, style: const TextStyle(fontWeight: FontWeight.bold, color: Colors.teal)), + ], + ), + ); +} +//pop-up +void showCategoryPopup(BuildContext context, String category) { + showDialog( + context: context, + barrierColor: Colors.black.withOpacity(0.3), + builder: (context) => BackdropFilter( + filter: ImageFilter.blur(sigmaX: 5, sigmaY: 5), + child: Dialog( + backgroundColor: Colors.white, + insetPadding: const EdgeInsets.symmetric(horizontal: 20, vertical: 40), + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(16), + ), + child: Padding( + padding: const EdgeInsets.all(16.0), + child: CategoryPopupContent(category: category), + ), + ), + ), + ); +} + + diff --git a/pubspec.yaml b/pubspec.yaml index 60a1fcde..35ade861 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -122,6 +122,8 @@ flutter: - assets/backgrounds/ - assets/backgrounds/from_alsaray/ - assets/country_flags/ + - assets/country-profile/ + - assets/competitiveness/ - assets/cached_responses/informatica/ - assets/cached_responses/sharepoint/ - assets/cached_responses/qlik/