From b326901d4bd437f4f7e5887e160b175fe3ede996 Mon Sep 17 00:00:00 2001 From: Kalonkarthik Date: Tue, 7 Jan 2025 18:02:54 +0530 Subject: [PATCH 1/2] User Guide v_7 Update --- lib/config/my_router.dart | 17 +- .../Drawer Items/user_guide/custom_text.dart | 94 +- .../Drawer Items/user_guide/faq_page.dart | 294 ++++- .../Drawer Items/user_guide/features.dart | 1151 ++++++++--------- .../user_guide/getting_started.dart | 277 ++-- .../Drawer Items/user_guide/user_guide.dart | 8 +- .../drawer_routes/custom_drawer_routes.dart | 32 +- macos/Flutter/GeneratedPluginRegistrant.swift | 2 + pubspec.lock | 80 +- pubspec.yaml | 1 + 10 files changed, 1080 insertions(+), 876 deletions(-) diff --git a/lib/config/my_router.dart b/lib/config/my_router.dart index 062e04af..263b4a1f 100644 --- a/lib/config/my_router.dart +++ b/lib/config/my_router.dart @@ -383,16 +383,15 @@ final GoRouter router = GoRouter( builder: (context, state) => UsingFeatures(), ), -GoRoute(path: '/faq', -name: 'faq', -builder: (context, state) => FAQPage(), -), + GoRoute(path: '/faq', + name: 'faq', + builder: (context, state) => FAQPage(), + ), - -GoRoute(path: '/gettingStarted', -name: 'gettingStarted', -builder: (context, state) => GettingStarted(), -), + GoRoute(path: '/gettingStarted', + name: 'gettingStarted', + builder: (context, state) => GettingStarted(), + ), ], ), // GoRoute( diff --git a/lib/presentation/routes/drawer_routes/Drawer Items/user_guide/custom_text.dart b/lib/presentation/routes/drawer_routes/Drawer Items/user_guide/custom_text.dart index 5abc4efd..a20db95f 100644 --- a/lib/presentation/routes/drawer_routes/Drawer Items/user_guide/custom_text.dart +++ b/lib/presentation/routes/drawer_routes/Drawer Items/user_guide/custom_text.dart @@ -1,64 +1,56 @@ import 'package:flutter/material.dart'; -class CustomContainer extends StatelessWidget { - final String text; - final EdgeInsetsGeometry padding; - final bool isBulletPoint; - final TextStyle? textStyle; - final double? fontSize; - final double? height; - final double defaultFontSize ; - final TextDecoration textDecoration ; - final Color? decorationColor; - final FontWeight fontWeight; - final Color color; +class CustomTextRich extends StatelessWidget { - const CustomContainer({ + const CustomTextRich({ super.key, - required this.text, + required this.textSpans, this.padding = const EdgeInsets.all(8.0), - this.isBulletPoint = false, - this.textStyle, - this.fontSize, - this.defaultFontSize=14, - this.height, - this.textDecoration = TextDecoration.none, - this.fontWeight =FontWeight.w500, - this.decorationColor, - this.color=const Color(0xFF898C81), + this.textAlign = TextAlign.left, }); - + final List textSpans; + final EdgeInsetsGeometry padding; + final TextAlign textAlign; @override Widget build(BuildContext context) { - return Padding( - padding: padding, - child: Row( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - if (isBulletPoint) - Text( - "• ", + return SingleChildScrollView( + child :Padding( + padding: padding, + child: Text.rich( + TextSpan(children: textSpans), + textAlign: textAlign, + ), + ), + ); - style: TextStyle(fontSize: fontSize ?? defaultFontSize, - color: color, - fontWeight: fontWeight, - height: height,), - ), - Expanded( - child: Text( - text, - style: TextStyle( - fontSize: fontSize ?? defaultFontSize, - color: color, - fontWeight: fontWeight, - height: height, - decoration: textDecoration, - decorationColor: decorationColor ?? color, - ), - ), - ), - ], + + } + + static TextSpan createTextSpan( + String text, { + double? fontSize, + Color color = const Color(0xFF898C81), + FontWeight fontWeight = FontWeight.w500, + double? height, + double defaultFontSize = 14, + TextDecoration textDecoration = TextDecoration.none, + Color? decorationColor, + double spacingTop = 0.0, + double spacingBottom = 0.0, + }) { + String spacedText = (spacingTop > 0.0 || spacingBottom > 0.0) + ? '${'\n' * spacingTop.toInt()}$text${'\n' * spacingBottom.toInt()}' + : text; + return TextSpan( + text: spacedText, + style: TextStyle( + fontSize: fontSize ?? defaultFontSize, + color: color, + fontWeight: fontWeight, + height: height, + decoration: textDecoration, + decorationColor: decorationColor ?? color, ), ); } diff --git a/lib/presentation/routes/drawer_routes/Drawer Items/user_guide/faq_page.dart b/lib/presentation/routes/drawer_routes/Drawer Items/user_guide/faq_page.dart index ad39293c..bf2b4771 100644 --- a/lib/presentation/routes/drawer_routes/Drawer Items/user_guide/faq_page.dart +++ b/lib/presentation/routes/drawer_routes/Drawer Items/user_guide/faq_page.dart @@ -1,6 +1,6 @@ import 'package:flutter/material.dart'; -import '../../custom_drawer_routes.dart'; +import 'package:uae_stat/presentation/routes/drawer_routes/custom_drawer_routes.dart'; class FAQPage extends StatefulWidget { const FAQPage({super.key}); @@ -13,38 +13,63 @@ class _FAQPageState extends State { @override Widget build(BuildContext context) { return BaseScaffold( - title: Text('FAQs'), - body: Scrollbar( - thumbVisibility: true, - thickness: 6, - radius: Radius.circular(10), - interactive: true, - child:SingleChildScrollView( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, + title: Text('FAQs', + style: TextStyle( + color:Color(0xFF7296BE), + fontWeight: FontWeight.w500, + ),), + showBackIcon: true, + body: SafeArea(child:Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + padding: const EdgeInsets.all(16.0), + width: MediaQuery.of(context).size.width, + child: Text.rich( + TextSpan( + text: 'Here are some common questions about the ', + style: TextStyle( + fontSize: 19, + fontWeight: FontWeight.w600, + color: Colors.grey, + ), children: [ - Container( - padding: const EdgeInsets.all(16.0), - width: MediaQuery.of(context).size.width, - child: Text( - 'HERE ARE SOME COMMON QUESTIONS ABOUT THE FEDERAL COMPETITIVENESS AND STATISTICS CENTRE (FCSC) MOBILE APPLICATION:', - style: TextStyle( - color: Color(0xFF265E84), // Text color - fontSize: 18, - fontWeight: FontWeight.w600 - ), + TextSpan( + text:' Federal Competitiveness and Statistics Centre (FCSC),', + style: TextStyle( + fontSize: 19, + fontWeight: FontWeight.w600, + color: Colors.black87, + ), + ), + TextSpan( + text: 'mobile application:', + style: TextStyle( + fontSize: 19, + fontWeight: FontWeight.w600, + color: Colors.grey, ), ), - Container( - padding: const EdgeInsets.all(0.0), - color: Colors.grey, - child: QuestionAnswerScrollView() - ) ], ), ), ), - + Expanded(child: Scrollbar( + thumbVisibility: true, + thickness: 8, + radius: Radius.circular(10), + interactive: true, + child:SingleChildScrollView( + child:Container( + padding: const EdgeInsets.all(0.0), + color: Colors.grey[50], + child: QuestionAnswerScrollView(), + ), + ), + ),), + ], + ), + ), ); } @@ -52,24 +77,194 @@ class _FAQPageState extends State { } class QuestionAnswerScrollView extends StatelessWidget { - final List> questionsAndAnswers = [ - {'question': '1. What is the purpose of this app?', 'answer': 'The app provides official UAE statistics across categories like Economy, Environment, and Social. It allows users to explore datasets, view trends, and access detailed metrics to make informed decisions.'}, - {'question': '2. How do I bookmark a metric?', - 'answer': 'When viewing a metric, tap on the Bookmark icon. Your bookmarks are accessible from the My Bookmarks section in the navigation bar.'}, - {'question': '3.Can I view the app in another language?', 'answer': 'Yes, the app supports both English and Arabic. You can toggle the language using the switch in the top-right corner of the app.'}, - {'question': '4.What happens if I forget my password?','answer':'Tap on the Forgot Password? link on the login page. Follow the steps to reset your password via your registered email address.'}, - {'question':'5. Can I edit my profile details?','answer': 'Yes, you can edit specific fields such as Date of Birth and User Image. However, certain fields like Username and Email are non-editable for security reasons.'}, - {'question':'6.How often is the data updated?','answer':'The app updates its datasets regularly to ensure users have access to the latest statistics. Notifications are sent whenever significant updates are made.'}, - {'question':'7.Do I need to create an account to use the app?', - 'answer':"Yes, the app is strictly for registered and approved users. To access the data:You need to sign up using the Register Now option on the login screen .Your registration must be approved by the admin.Once approved, you can log in to access the app's features and datasets.Guest access is not available for this application."}, - {'question':'8.How can I navigate through the app?','answer':'Use the main categories on the homepage (e.g., Economy, Environment) to access subcategories and detailed KPIs.Drill down into specific metrics or graphical views by tapping on a KPI.Access additional features like Bookmarks or Profile through the navigation bar.'}, - {'question':'9.What types of data are available?','answer':'The app offers data on:Economy: GDP, growth rates, and economic trends.Environment: Electricity production, water consumption, and more.Social: Labor force distribution, participation rates, and demographic data.'}, - {'question':'10.What types of graphs and charts are available?','answer':'The app provides a variety of visualizations, including:Line charts for trends.Bar and column charts for comparisons.Stacked charts for multi-layered data views.'}, - ]; + const QuestionAnswerScrollView({super.key}); + @override Widget build(BuildContext context) { + final List> questionsAndAnswers = [ + {'question':'What is the purpose of this app?', 'answer': 'The app provides official UAE statistics across categories like Economy, Environment, and Social. It allows users to explore datasets, view trends, and access detailed metrics to make informed decisions.'}, + {'question':'Do I need to create an account to use the app?', 'answer':RichText( + text: TextSpan( + children: [ + TextSpan( + text: 'Yes, the app is strictly for registered and approved users. To access the data:\n\n', + style: TextStyle(fontWeight: FontWeight.normal, color: Colors.grey), + ), + TextSpan( + text: ' 1. You need to sign up using the Register Now option on the login screen.\n', + style: TextStyle(color: Colors.grey), + ), + TextSpan( + text: ' 2. Your registration must be approved by the admin.\n', + style: TextStyle(color: Colors.grey), + ), + + TextSpan( + text: " 3. Once approved, you can log in to access the app's features and datasets.\n\nGuest access is not available for this application.\n ", + style: TextStyle(color: Colors.grey), + ), + ], + ), + ),}, + {'question':'How can I navigate through the app?','answer':'• Use the main categories on the homepage (e.g., Economy, Environment) to access subcategories and detailed KPIs.\n• Drill down into specific metrics or graphical views by tapping on a KPI.\n• Access additional features like Bookmarks or Profile through the navigation bar.\n'}, + {'question':'What types of data are available?', 'answer':RichText( + text: TextSpan( + children: [ + TextSpan( + text: 'The app offers data on:\n\n', + style: TextStyle(color: Colors.grey), + ), + TextSpan( + text: ' • Economy', + style: TextStyle(color: Colors.black87,fontWeight: FontWeight.w500), + ), + TextSpan( + text: ' GDP, growth rates, and economic trends\n', + style: TextStyle(color: Colors.grey), + ), + + TextSpan( + text: ' • Environment:', + style: TextStyle(color: Colors.black87,fontWeight: FontWeight.w500), + ), + TextSpan( + text: ' Electricity production, water consumption, and more.\n', + style: TextStyle(color: Colors.grey), + ), + TextSpan( + text: ' • Social:', + style: TextStyle(color: Colors.black87,fontWeight: FontWeight.w500), + ), + TextSpan( + text: ' Labor force distribution, participation rates, and demographic data.\n', + style: TextStyle(color: Colors.grey), + ), + ], + ), + ),}, + {'question':'How do I bookmark a metric?', 'answer': RichText( + text: TextSpan( + children: [ + TextSpan( + text: 'When viewing a metric, tap on the', + style: TextStyle(color: Colors.grey), + ), + TextSpan( + text: ' Bookmark ', + style: TextStyle(color: Colors.black87,fontWeight: FontWeight.w500), + ), + TextSpan( + text: 'icon. Your bookmarks are accessible from the', + style: TextStyle(color: Colors.grey), + ), + + TextSpan( + text: 'My Bookmarks', + style: TextStyle(color: Colors.black87,fontWeight: FontWeight.w500), + ), + TextSpan( + text: 'section in the navigation bar.\n', + style: TextStyle(color: Colors.grey), + ), + ], + ), + ),}, + {'question':'Can I view the app in another language?', 'answer': RichText( + text: TextSpan( + children: [ + TextSpan( + text: 'Yes, the app supports both ', + style: TextStyle(color: Colors.grey), + ), + TextSpan( + text: 'English ', + style: TextStyle(color: Colors.black87,fontWeight: FontWeight.w500), + ), + TextSpan( + text: 'and', + style: TextStyle(color: Colors.grey), + ), + + TextSpan( + text: ' Arabic ', + style: TextStyle(color: Colors.black87,fontWeight: FontWeight.w500), + ), + TextSpan( + text: '. You can toggle the language using the switch in the top-right corner of the app.\n', + style: TextStyle(color: Colors.grey), + ), + ], + ), + ),}, + {'question':'What happens if I forget my password?','answer':'Tap on the Forgot Password? link on the login page. Follow the steps to reset your password via your registered email address.\n'}, + {'question':'Can I edit my profile details?','answer': 'Yes, you can edit specific fields such as Date of Birth and User Image. However, certain fields like Username and Email are non-editable for security reasons.\n'}, + {'question':'How often is the data updated?','answer':'The app updates its datasets regularly to ensure users have access to the latest statistics. Notifications are sent whenever significant updates are made.\n'}, + {'question':'What types of graphs and charts are available?','answer':'The app provides a variety of visualizations, including:\n • Line charts for trends.\n • Bar and column charts for comparisons.\n • Stacked charts for multi-layered data views.\n'}, + {'question':'Can I share the data or charts?','answer':RichText( + text: TextSpan( + children: [ + TextSpan( + text: 'Yes, you can share data or charts directly from the app by tapping the ', + style: TextStyle(color: Colors.grey), + ), + TextSpan( + text: 'Share ', + style: TextStyle(color: Colors.black87,fontWeight: FontWeight.w500), + ), + TextSpan( + text: 'button available on most pages.\n', + style: TextStyle(color: Colors.grey), + ), + ], + ), + ),}, + {'question':'What should I do if I encounter an issue?','answer':RichText( + text: TextSpan( + children: [ + TextSpan( + text: 'For technical support or feedback, navigate to the ', + style: TextStyle(color: Colors.grey), + ), + TextSpan( + text: 'Help ', + style: TextStyle(color: Colors.black87,fontWeight: FontWeight.w500), + ), + TextSpan( + text: 'section in the app and contact the support team.\n', + style: TextStyle(color: Colors.grey), + ), + ], + ), + ),}, + {'question':'How do I log out of the app?','answer':RichText( + text: TextSpan( + children: [ + TextSpan( + text: 'Go to the ', + style: TextStyle(color: Colors.grey), + ), + TextSpan( + text: 'Profile ', + style: TextStyle(color: Colors.black87,fontWeight: FontWeight.w500), + ), + TextSpan( + text: 'section and tap the ', + style: TextStyle(color: Colors.grey), + ), + TextSpan( + text: 'Logout ', + style: TextStyle(color: Colors.black87,fontWeight: FontWeight.w500), + ), + TextSpan( + text: 'option in the top-right corner.\n', + style: TextStyle(color: Colors.grey), ), + ], + ), + ),}, + ]; + return SingleChildScrollView( child: Column( children: questionsAndAnswers.map((qa) => QuestionAnswerCard(qa: qa)).toList(), @@ -78,9 +273,10 @@ class QuestionAnswerScrollView extends StatelessWidget { } } -class QuestionAnswerCard extends StatefulWidget { - final Map qa; - QuestionAnswerCard({required this.qa}); +class QuestionAnswerCard extends StatefulWidget { // Use dynamic to accommodate RichText + + const QuestionAnswerCard({super.key, required this.qa}); + final Map qa; @override _QuestionAnswerCardState createState() => _QuestionAnswerCardState(); @@ -92,18 +288,18 @@ class _QuestionAnswerCardState extends State { @override Widget build(BuildContext context) { return Card( - color: Colors.white, + color: Colors.grey[50], elevation: 1, shape: RoundedRectangleBorder( borderRadius: BorderRadius.zero, // No rounding, it's a rectangle ), - margin: EdgeInsets.symmetric(vertical: 0,), + margin: EdgeInsets.symmetric(vertical: 0), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ ListTile( dense: true, - textColor:Color(0xFF414042), + textColor: Color(0xFF414042), title: Text( widget.qa['question']!, style: TextStyle(fontWeight: FontWeight.w600, fontSize: 15), @@ -118,8 +314,10 @@ class _QuestionAnswerCardState extends State { if (isExpanded) Padding( padding: const EdgeInsets.symmetric(horizontal: 16.0), - child: Text( - widget.qa["answer"]!, + child: widget.qa['answer'] is RichText + ? widget.qa['answer'] + : Text( + widget.qa['answer'] ?? '', style: TextStyle(color: Colors.grey), ), ), diff --git a/lib/presentation/routes/drawer_routes/Drawer Items/user_guide/features.dart b/lib/presentation/routes/drawer_routes/Drawer Items/user_guide/features.dart index b4c0315c..9ad1c659 100644 --- a/lib/presentation/routes/drawer_routes/Drawer Items/user_guide/features.dart +++ b/lib/presentation/routes/drawer_routes/Drawer Items/user_guide/features.dart @@ -1,621 +1,560 @@ import 'package:flutter/material.dart'; import 'package:uae_stat/presentation/routes/drawer_routes/custom_drawer_routes.dart'; -import 'custom_text.dart'; +import 'package:uae_stat/presentation/routes/drawer_routes/Drawer%20Items/user_guide/custom_text.dart'; class UsingFeatures extends StatelessWidget { - final List> contentList = [ - { - "text": "1.Data-Driven Insights:", - "fontSize": 16.0, - "color": Color(0xFF414042), - "fontWeight": FontWeight.bold, - "isBulletPoint": false, - }, - { - "text": "1.Access detailed datasets across categories such as Economy, Environment, Social, and more.Explore statistics presented as smart metrics, graphs, and charts for better understanding.", - "fontSize": 13.0, - "color": Color(0xFF898C81), - "fontWeight": FontWeight.normal, - "isBulletPoint": false, - }, - { - "text": "2.Drilldown Navigation:", - "fontSize": 16.0, - "color": Color(0xFF414042), - "fontWeight": FontWeight.bold, - "isBulletPoint": false, - }, - { - "text": "Start from high-level categories such as “Economy” and drill down into detailed KPIs, sub-sections, and graphical views for a better understanding of each topic.", - "fontSize": 14.0, - "color": Color(0xFF898C81), - "fontWeight": FontWeight.normal, - "isBulletPoint": false, - }, - { - "text": "3.Interactive Visualizations:", - "fontSize": 14.0, - "color": Color(0xFF414042), - "fontWeight": FontWeight.bold, - "isBulletPoint": false, - }, + const UsingFeatures({super.key}); - { - "text": "View trends and relationships with interactive graphs and charts, including bar graphs, line charts, and more.", - "fontSize": 14.0, - "color": Color(0xFF898C81), - "fontWeight": FontWeight.normal, - "isBulletPoint": true, - }, - { - "text": "Secure User Access:", - "fontSize": 14.0, - "height":1.0, - "color": Color(0xFF898C81), - "fontWeight": FontWeight.bold, - "isBulletPoint": true, - }, - - { - "text": "4.Available only to registered users whose accounts have been approved by an admin.Login ensures secure access to sensitive statistical information.", - "fontSize": 14.0, - "color": Color(0xFF414042), - "fontWeight": FontWeight.normal, - "isBulletPoint": false, - }, - - - - { - "text": "5.Profile Customization:", - "fontSize": 14.0, - "color": Color(0xFF414042), - "fontWeight": FontWeight.bold, - "isBulletPoint": false, - }, - - { - "text": "Update your profile details, such as name, password, and region, to personalize your experience.", - "fontSize": 14.0, - "color": Color(0xFF898C81), - "fontWeight": FontWeight.normal, - "isBulletPoint": false, - }, - - { - "text": "6.Bookmark:", - "fontSize": 14.0, - "color": Color(0xFF414042), - "fontWeight": FontWeight.bold, - "isBulletPoint": false, - }, - - { - "text": "Save frequently accessed metrics and datasets for quick reference via the Bookmarks section.", - "fontSize": 14.0, - "color": Color(0xFF898C81), - "fontWeight": FontWeight.normal, - "isBulletPoint": false, - }, - - { - "text": "7.Bilingual Support:", - "fontSize": 14.0, - "color": Color(0xFF414042), - "fontWeight": FontWeight.bold, - "isBulletPoint": false, - }, - - { - "text": "Toggle between English and Arabic for ease of use.", - "fontSize": 14.0, - "color": Color(0xFF898C81), - "fontWeight": FontWeight.normal, - "isBulletPoint": false, - }, - - { - "text": "Who Can Use the App?", - "fontSize": 18.0, - "color": Color(0xFF414042), - "fontWeight": FontWeight.w600, - "isBulletPoint": false, - }, - - { - "text": "This app is intended for:", - "fontSize": 14.0, - "color": Color(0xFF898C81), - "fontWeight": FontWeight.normal, - "isBulletPoint": false, - }, - - { - "text": "Government officials requiring UAE statistics for decision-making.", - "fontSize": 14.0, - "height":0.9, - "color": Color(0xFF898C81), - "fontWeight": FontWeight.normal, - "isBulletPoint": true, - }, - { - "text": "Business professionals and researchers analyzing market trends.", - "fontSize": 14.0, - "color": Color(0xFF898C81), - "fontWeight": FontWeight.normal, - "height":0.9, - "isBulletPoint": true, - }, - { - "text": "Students and educators needing reliable data for study and teaching.", - "fontSize": 14.0, - "color": Color(0xFF898C81), - "fontWeight": FontWeight.normal, - "height":0.9, - "isBulletPoint": true, - }, - - { - "text": "Purpose of the App", - "fontSize": 16.0, - "color": Color(0xFF414042), - "fontWeight": FontWeight.w600, - "isBulletPoint": false, - }, - - { - "text": "Provide official statistics on the UAE in an accessible format.", - "fontSize": 14.0, - "color": Color(0xFF898C81), - "fontWeight": FontWeight.normal, - "height":0.9, - "isBulletPoint": true, - }, - { - "text": "Support decision-making and research with reliable, up-to-date data.", - "fontSize": 14.0, - "color": Color(0xFF898C81), - "fontWeight": FontWeight.normal, - "height":0.9, - "isBulletPoint": true, - }, - { - "text": "Enable users to interact with data visually through graphs and metrics.", - "fontSize": 14.0, - "color": Color(0xFF898C81), - "fontWeight": FontWeight.normal, - "height":0.9, - "isBulletPoint": true, - }, - - { - "text": "How to Use the App", - "fontSize": 16.0, - "color":Color(0xFF414042), - "fontWeight": FontWeight.w600, - "isBulletPoint": false, - }, - - { - "text": "1.Registration and Approval:", - "fontSize": 14.0, - "color": Color(0xFF414042), - "fontWeight": FontWeight.w600, - "isBulletPoint": false, - }, - - { - "text": "Sign up for the app and wait for admin approval.", - "fontSize": 14.0, - "color": Color(0xFF898C81), - "fontWeight": FontWeight.normal, - "isBulletPoint": true, - }, - - { - "text": "2.Login and Navigation:", - "fontSize": 14.0, - "color": Color(0xFF414042), - "fontWeight": FontWeight.w600, - "isBulletPoint": false, - }, - { - "text": "Once approved, log in to access the app. Navigate through the categories on the home screen.", - "fontSize": 14.0, - "color": Color(0xFF898C81), - "fontWeight": FontWeight.normal, - "isBulletPoint": true, - }, - { - "text": "3.Access Data:", - "fontSize": 14.0, - "color": Color(0xFF414042), - "fontWeight": FontWeight.w600, - "isBulletPoint": false, - }, - { - "text": 'Drill down into specific categories like "Economy" or "Environment" to view detailed KPIs and visual insights.', - "fontSize": 14.0, - "color": Color(0xFF898C81), - "fontWeight": FontWeight.normal, - "isBulletPoint": true, - }, - - { - "text": "4.Bookmark Metrics:", - "fontSize": 14.0, - "color":Color(0xFF414042), - "fontWeight": FontWeight.w600, - "isBulletPoint": false, - }, - { - "text": 'Save important statistics for easy reference.', - "fontSize": 14.0, - "color": Color(0xFF898C81), - "fontWeight": FontWeight.normal, - "isBulletPoint": true, - }, - - { - "text": "Stay Updated", - "fontSize": 16.0, - "color": Color(0xFF414042), - "fontWeight": FontWeight.w600, - "isBulletPoint": false, - }, - { - "text": 'The app is regularly updated with the latest datasets and features to ensure users have access to the most current information.', - "fontSize": 14.0, - "color": Color(0xFF898C81), - "fontWeight": FontWeight.normal, - "isBulletPoint": false, - }, - - { - "text": "How to Change My Password", - "fontSize": 14.0, - "color":Color(0xFF414042), - "fontWeight": FontWeight.w600, - "isBulletPoint": false, - }, - - { - "text": "Changing your password helps keep your account secure. Follow these steps to update your password:", - "fontSize": 14.0, - "color": Color(0xFF898C81), - "fontWeight": FontWeight.normal, - "isBulletPoint": false, - }, - { - "text": "Steps to Change Password", - "fontSize": 16.0, - "color": Color(0xFF414042), - "fontWeight": FontWeight.w600, - "isBulletPoint": false, - }, - { - "text": "1. Access the Change Password Page:", - "fontSize": 14.0, - "color": Color(0xFF414042), - "fontWeight": FontWeight.w600, - "isBulletPoint": false, - }, - { - "text": 'From the Profile page, tap on the "Change Password" link at the bottom.', - "fontSize": 14.0, - "color": Color(0xFF898C81), - "fontWeight": FontWeight.normal, - "isBulletPoint": false, - }, - - { - "text": "2. Enter Old Password:", - "fontSize": 14.0, - "color": Color(0xFF414042), - "fontWeight": FontWeight.w600, - "isBulletPoint": false, - }, - - { - "text": "Enter your current password in the first field.", - "fontSize": 14.0, - "color": Color(0xFF898C81), - "fontWeight": FontWeight.normal, - "isBulletPoint": false, - }, - - { - "text": "3. Set a New Password:", - "fontSize": 14.0, - "color": Color(0xFF414042), - "fontWeight": FontWeight.w600, - "isBulletPoint": false, - }, - - { - "text": "Enter your new password in the second field.", - "fontSize": 14.0, - "color": Color(0xFF898C81), - "fontWeight": FontWeight.normal, - "isBulletPoint": true, - }, - - { - "text": "Re-enter the new password in the third field for confirmation.", - "fontSize": 14.0, - "color": Color(0xFF898C81), - "fontWeight": FontWeight.normal, - "isBulletPoint": false, - }, - - - { - "text": "4. Password Requirements:", - "fontSize": 14.0, - "color": Color(0xFF414042), - "fontWeight": FontWeight.w600, - "isBulletPoint": false, - }, - - { - "text": "Your new password must be different from the previously used password.", - "fontSize": 14.0, - "color": Color(0xFF898C81), - "fontWeight": FontWeight.normal, - "isBulletPoint": false, - }, - - { - "text": "5.Save Your Password", - "fontSize": 14.0, - "color":Color(0xFF414042), - "fontWeight": FontWeight.w600, - "isBulletPoint": false, - }, - - - { - "text": "Tap the Save button.", - "fontSize": 14.0, - "color": Color(0xFF898C81), - "fontWeight": FontWeight.normal, - "isBulletPoint": true, - }, - - { - "text": "A confirmation message will appear: “Password has been successfully updated.”", - "fontSize": 14.0, - "color": Color(0xFF898C81), - "fontWeight": FontWeight.normal, - "isBulletPoint": true, - }, - { - "text": "6.Re-Login:", - "fontSize": 14.0, - "color":Color(0xFF414042), - "fontWeight": FontWeight.w600, - "isBulletPoint": false, - }, - - { - "text": "Log in again using your new password to continue using the app", - "fontSize": 14.0, - "color": Color(0xFF898C81), - "fontWeight": FontWeight.normal, - "isBulletPoint": false, - }, - - { - "text": "How to Edit My Profile", - "fontSize": 16.0, - "color": Color(0xFF414042), - "fontWeight": FontWeight.w600, - "isBulletPoint": false, - }, - - { - "text": "Editing your profile allows you to update specific information while ensuring that critical details remain secure. Follow the steps below to update your profile:", - "fontSize": 14.0, - "color": Color(0xFF898C81), - "fontWeight": FontWeight.normal, - "isBulletPoint": false, - }, - - - { - "text": "Steps to Edit Profile", - "fontSize": 16.0, - "color": Color(0xFF414042), - "fontWeight": FontWeight.w600, - "isBulletPoint": false, - }, - - { - "text": "1.Access the Profile Page:", - "fontSize": 14.0, - "color": Color(0xFF414042), - "fontWeight": FontWeight.w600, - "isBulletPoint": false, - }, - - { - "text": 'Tap on the "Profile" option from the navigation bar at the top left corner of the screen.', - "fontSize": 14.0, - "color": Color(0xFF898C81), - "fontWeight": FontWeight.normal, - "isBulletPoint": false, - }, - - { - "text": "2.Editable Fields:", - "fontSize": 14.0, - "color":Color(0xFF414042), - "fontWeight": FontWeight.w600, - "isBulletPoint": false, - }, - - { - "text": "Full Name: Tap the text box to enter your name (up to 40 alphanumeric characters).", - "fontSize": 14.0, - "color": Color(0xFF898C81), - "fontWeight": FontWeight.normal, - "isBulletPoint": true, - }, - - { - "text": "Date of Birth: Use the calendar dropdown to select your date of birth.", - "fontSize": 14.0, - "color": Color(0xFF898C81), - "fontWeight": FontWeight.normal, - "isBulletPoint": true, - }, - - { - "text": "Country/Region: Choose your current location from the dropdown menu.", - "fontSize": 14.0, - "color": Color(0xFF898C81), - "fontWeight": FontWeight.normal, - "isBulletPoint": true, - }, - - { - "text": "User Image: Tap on the avatar icon to upload or change your profile picture.", - "fontSize": 14.0, - "color": Color(0xFF898C81), - "fontWeight": FontWeight.normal, - "isBulletPoint": true, - }, - - { - "text": "3.Non-Editable Fields:", - "fontSize": 14.0, - "color": Color(0xFF414042), - "fontWeight": FontWeight.w600, - "isBulletPoint": false, - }, - - { - "text": "Username and Email ID: These fields cannot be edited to ensure the integrity of your account.", - "fontSize": 14.0, - "color": Color(0xFF898C81), - "fontWeight": FontWeight.normal, - "isBulletPoint": false, - }, - - { - "text": "Agree to Terms and Conditions:", - "fontSize": 14.0, - "color": Color(0xFF414042), - "fontWeight": FontWeight.normal, - "isBulletPoint": false, - }, - - { - "text": 'Ensure that the checkbox for "I agree to Terms & Conditions and Privacy Policy" is selected before saving changes.', - "fontSize": 14.0, - "color": Color(0xFF898C81), - "fontWeight": FontWeight.normal, - "isBulletPoint": false, - }, - - { - "text": "Save Your Changes:", - "fontSize": 14.0, - "color": Color(0xFF414042), - "fontWeight": FontWeight.w600, - "isBulletPoint": false, - }, - - { - "text": "Tap the Save button at the bottom of the screen.", - "fontSize": 14.0, - "color": Color(0xFF898C81), - "fontWeight": FontWeight.normal, - "isBulletPoint": true, - }, - - { - "text": "A confirmation dialog will appear with the message:", - "fontSize": 14.0, - "color": Color(0xFF898C81), - "fontWeight": FontWeight.normal, - "isBulletPoint": true, - }, - - { - "text": "“Are you sure you want to save this page? Once saved, you will not be able to change your name or date of birth.”", - "fontSize": 14.0, - "color": Color(0xFF898C81), - "fontWeight": FontWeight.normal, - "isBulletPoint":false , - }, - - - { - "text": "Select Confirm to save the changes or Cancel to go back", - "fontSize": 14.0, - "color": Color(0xFF898C81), - "fontWeight": FontWeight.normal, - "isBulletPoint": true, - }, - - - // Add more items here as needed - ]; @override Widget build(BuildContext context) { - return BaseScaffold( title: Text('Key Features'), - body: Scrollbar( - thumbVisibility: true, - thickness: 6, - radius: Radius.circular(10), - interactive: true, - child:SingleChildScrollView( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Container( - padding: const EdgeInsets.all(16.0), - width: MediaQuery.of(context).size.width, - child: Text( - "FEATURES", - style: TextStyle( - color: Color(0xFF265E84), // Text color - fontSize: 18, - fontWeight: FontWeight.w600 - ), - ), - ), - Container( - padding: const EdgeInsets.all(13.0), - color: Color(0xFFD9D9D9), - child:ListView.builder( - shrinkWrap: true, - physics: const NeverScrollableScrollPhysics(), - itemCount: contentList.length, - itemBuilder: (context, index) { - final item = contentList[index]; - return CustomContainer( - text: item["text"], - fontSize: item["fontSize"], - color: item["color"], - fontWeight: item["fontWeight"], - height:item["height"], - isBulletPoint: item["isBulletPoint"] ?? false, - textDecoration: item["textDecoration"] ?? TextDecoration.none, - decorationColor: item["decorationColor"], - ); - }, - ), - ) - ], + + List textSpans = [ + CustomTextRich.createTextSpan('1.Data-Driven Insights:', + fontSize: 15, + color: Colors.black87, + fontWeight: FontWeight.bold, + height: 2, + ), + CustomTextRich.createTextSpan( + 'Access detailed datasets across categories such as Economy, Environment, Social, ', + fontSize: 13, color:Color(0xFF898C81), + fontWeight: FontWeight.normal , + spacingTop: 1.9,), + + CustomTextRich.createTextSpan( + ' Economy, Environment, Social ', + fontSize: 13, color:Colors.black, + fontWeight: FontWeight.w600 , + ), + CustomTextRich.createTextSpan( + 'and more.Explore statistics presented as smart metrics, graphs, and charts for better understanding.', + fontSize: 13, color:Color(0xFF898C81), + fontWeight: FontWeight.normal , + ), + + CustomTextRich.createTextSpan('\n2.Drilldown Navigation:', fontSize: 15, + color: Colors.black87, + fontWeight: FontWeight.w600, + height: 2 + ), + + CustomTextRich.createTextSpan( + '\nStart with high-level categories and drill down to specific KPIs and metrics for deeper insights.', + fontSize: 13, color:Color(0xFF898C81), + fontWeight: FontWeight.normal , + ), + CustomTextRich.createTextSpan('\n3.Interactive Visualizations:', fontSize: 15, + color: Colors.black87, + fontWeight: FontWeight.w600, + height: 2 + ), + + CustomTextRich.createTextSpan( + '\nStart with high-level categories and drill down to specific KPIs and metrics for deeper insights.', + fontSize: 13, color:Color(0xFF898C81), + fontWeight: FontWeight.normal , + ), + CustomTextRich.createTextSpan( + 'View trends and relationships with interactive graphs and charts, including bar graphs, line charts, and more.', + fontSize: 14.0, + color: Color(0xFF898C81), + fontWeight: FontWeight.normal, + ), + CustomTextRich.createTextSpan( + '\n4.Secure User Access:', + fontSize: 14.0, + color: Colors.black87, + fontWeight: FontWeight.bold, + height: 2, + ), + CustomTextRich.createTextSpan( + '\nAvailable only to registered users whose accounts have been approved by an admin. Login ensures secure access to sensitive statistical information.', + fontSize: 14.0, + color: Color(0xFF898C81), + fontWeight: FontWeight.normal, + ), + CustomTextRich.createTextSpan( + '\n5.Profile Customization:', + fontSize: 14.0, + color: Color(0xFF414042), + fontWeight: FontWeight.bold, + height: 2 + ), + CustomTextRich.createTextSpan( + '\nUpdate your profile details, such as name, password, and region, to personalize your experience.', + fontSize: 14.0, + color: Color(0xFF898C81), + fontWeight: FontWeight.normal, + ), + CustomTextRich.createTextSpan( + '\n6.Bookmark:', + fontSize: 14.0, + color: Color(0xFF414042), + fontWeight: FontWeight.bold, + ), + CustomTextRich.createTextSpan( + '\nSave frequently accessed metrics and datasets for quick reference via the Bookmarks section.', + fontSize: 14.0, + color: Color(0xFF898C81), + fontWeight: FontWeight.normal, + ), + CustomTextRich.createTextSpan( + '\n7.Bilingual Support:', + fontSize: 14.0, + color: Color(0xFF414042), + fontWeight: FontWeight.bold, + height: 2 + ), + CustomTextRich.createTextSpan( + '\nToggle between English and Arabic for ease of use.', + fontSize: 14.0, + color: Color(0xFF898C81), + fontWeight: FontWeight.normal, + ), + CustomTextRich.createTextSpan( + '\nWho Can Use the App?', + fontSize: 18.0, + color: Color(0xFF414042), + fontWeight: FontWeight.w600, + height: 2.5 + ), + CustomTextRich.createTextSpan( + '\nThis app is intended for:', + fontSize: 14.0, + color: Color(0xFF898C81), + fontWeight: FontWeight.normal, + ), + CustomTextRich.createTextSpan( + '\n\n • Government officials requiring UAE statistics for decision-making.', + fontSize: 14.0, + color: Color(0xFF898C81), + fontWeight: FontWeight.normal, + ), + CustomTextRich.createTextSpan( + '\n •Business professionals and researchers analyzing market trends.', + fontSize: 14.0, + color: Color(0xFF898C81), + fontWeight: FontWeight.normal, + ), + CustomTextRich.createTextSpan( + '\n •Students and educators needing reliable data for study and teaching.\n\n', + fontSize: 14.0, + color: Color(0xFF898C81), + fontWeight: FontWeight.normal, + ), + CustomTextRich.createTextSpan( + 'Purpose of the App\n', + fontSize: 16.0, + color: Color(0xFF414042), + fontWeight: FontWeight.w600, + height: 2.0 + ), + CustomTextRich.createTextSpan( + ' • Provide official statistics on the UAE in an accessible format.', + fontSize: 14.0, + color: Color(0xFF898C81), + fontWeight: FontWeight.normal, + ), + CustomTextRich.createTextSpan( + '\n • Support decision-making and research with reliable, up-to-date data.', + fontSize: 14.0, + color: Color(0xFF898C81), + fontWeight: FontWeight.normal, + ), + CustomTextRich.createTextSpan( + '\n • Enable users to interact with data visually through graphs and metrics.', + fontSize: 14.0, + color: Color(0xFF898C81), + fontWeight: FontWeight.normal, + ), + CustomTextRich.createTextSpan( + '\nHow to Use the App', + fontSize: 18.0, + color: Color(0xFF414042), + fontWeight: FontWeight.w600, + height: 2.3 + ), + CustomTextRich.createTextSpan( + '\n1.Registration and Approval:', + fontSize: 15.0, + color: Colors.black87, + fontWeight: FontWeight.bold, + height: 2.0 + ), + CustomTextRich.createTextSpan( + '\nSign up for the app and wait for admin approval.', + fontSize: 14.0, + color: Color(0xFF898C81), + fontWeight: FontWeight.normal, + ), + CustomTextRich.createTextSpan( + '\n2.Login and Navigation:', + fontSize: 15.0, + color: Color(0xFF414042), + fontWeight: FontWeight.bold, + height: 2.0, + ), + CustomTextRich.createTextSpan( + '\nOnce approved, log in to access the app. Navigate through the categories on the home screen.', + fontSize: 14.0, + color: Color(0xFF898C81), + fontWeight: FontWeight.normal, + ), + CustomTextRich.createTextSpan( + '\n3.Access Data:', + fontSize: 15.0, + color: Color(0xFF414042), + fontWeight: FontWeight.bold, + height: 2.0, + ), + CustomTextRich.createTextSpan( + '\nDrill down into specific categories like "Economy" or "Environment" to view detailed KPIs and visual insights.', + fontSize: 14.0, + color: Color(0xFF898C81), + fontWeight: FontWeight.normal, + ), + CustomTextRich.createTextSpan( + '\n4.Bookmark Metrics:', + fontSize: 15.0, + color: Color(0xFF414042), + fontWeight: FontWeight.bold, + height: 2.0, + ), + CustomTextRich.createTextSpan( + '\nSave important statistics for easy reference.', + fontSize: 14.0, + color: Color(0xFF898C81), + fontWeight: FontWeight.normal, + ), + CustomTextRich.createTextSpan( + '\nStay Updated', + fontSize: 18.0, + color: Color(0xFF414042), + fontWeight: FontWeight.w600, + height: 3, + ), + CustomTextRich.createTextSpan( + '\nThe app is regularly updated with the latest datasets and features to ensure users have access to the most current information.', + fontSize: 14.0, + color: Color(0xFF898C81), + fontWeight: FontWeight.normal, + ), + CustomTextRich.createTextSpan( + '\nHow to Change My Password', + fontSize: 18.0, + color: Colors.black87, + fontWeight: FontWeight.w600, + height: 3, + ), + CustomTextRich.createTextSpan( + '\nChanging your password helps keep your account secure. Follow these steps to update your password:\n \n', + fontSize: 14.0, + color: Color(0xFF898C81), + fontWeight: FontWeight.normal, + ), + CustomTextRich.createTextSpan( + 'Steps to Change Password', + fontSize: 16.0, + color: Color(0xFF414042), + fontWeight: FontWeight.bold, + height: 2.5 + ), + CustomTextRich.createTextSpan( + '\n1.Access the Change Password Page:', + fontSize: 14.0, + color: Color(0xFF414042), + fontWeight: FontWeight.bold, + height: 1.5, + ), + CustomTextRich.createTextSpan( + '\nFrom the Profile page, tap on the "Change Password" link at the bottom.', + fontSize: 14.0, + color: Color(0xFF898C81), + fontWeight: FontWeight.normal, + ), + CustomTextRich.createTextSpan( + '\n2.Enter Old Password:', + fontSize: 14.0, + color: Color(0xFF414042), + fontWeight: FontWeight.bold, + height: 1.5, + ), + CustomTextRich.createTextSpan( + '\nEnter your current password in the first field.', + fontSize: 14.0, + color: Color(0xFF898C81), + fontWeight: FontWeight.normal, + ), + CustomTextRich.createTextSpan( + '\n3.Set a New Password:', + fontSize: 14.0, + color: Color(0xFF414042), + fontWeight: FontWeight.bold, + height: 1.5, + ), + CustomTextRich.createTextSpan( + '\n• Enter your new password in the second field.', + fontSize: 14.0, + color: Color(0xFF898C81), + fontWeight: FontWeight.normal, + ), + CustomTextRich.createTextSpan( + '\n• Re-enter the new password in the third field for confirmation.', + fontSize: 14.0, + color: Color(0xFF898C81), + fontWeight: FontWeight.normal, + ), + CustomTextRich.createTextSpan( + '\n4.Password Requirements:', + fontSize: 14.0, + color: Color(0xFF414042), + fontWeight: FontWeight.bold, + ), + CustomTextRich.createTextSpan( + '\nYour new password must be different from the previously used password.', + fontSize: 14.0, + color: Color(0xFF898C81), + fontWeight: FontWeight.normal, + ), + CustomTextRich.createTextSpan( + '\n5.Save Your Password:', + fontSize: 14.0, + color: Color(0xFF414042), + fontWeight: FontWeight.bold, + ), + CustomTextRich.createTextSpan( + '\n• Tap the Save button.', + fontSize: 14.0, + color: Color(0xFF898C81), + fontWeight: FontWeight.normal, + ), + CustomTextRich.createTextSpan( + '\n• A confirmation message will appear: “Password has been successfully updated.”', + fontSize: 14.0, + color: Color(0xFF898C81), + fontWeight: FontWeight.normal, + ), + CustomTextRich.createTextSpan( + '\n6.Re-Login:', + fontSize: 14.0, + color: Color(0xFF414042), + fontWeight: FontWeight.bold, + ), + CustomTextRich.createTextSpan( + '\nLog in again using your new password to continue using the app.\n\n', + fontSize: 14.0, + color: Color(0xFF898C81), + fontWeight: FontWeight.normal, + ), + CustomTextRich.createTextSpan( + 'How to Edit My Profile', + fontSize: 18.0, + color: Color(0xFF414042), + fontWeight: FontWeight.w600, + height: 2.5, + ), + CustomTextRich.createTextSpan( + '\nEditing your profile allows you to update specific information while ensuring that critical details remain secure. Follow the steps below to update your profile:\n', + fontSize: 14.0, + color: Color(0xFF898C81), + fontWeight: FontWeight.normal, + ), + CustomTextRich.createTextSpan( + '\nSteps to Edit Profile', + fontSize: 17.0, + color: Color(0xFF414042), + fontWeight: FontWeight.bold, + height: 2, + ), + CustomTextRich.createTextSpan( + '\n 1.Access the Profile Page:', + fontSize: 14.0, + color: Colors.black87, + fontWeight: FontWeight.w600, + height: 2, + ), + CustomTextRich.createTextSpan( + '\nTap on the "Profile" option from the navigation bar at the top left corner of the screen.', + fontSize: 14.0, + color: Color(0xFF898C81), + fontWeight: FontWeight.normal, + ), + CustomTextRich.createTextSpan( + '\n 2. Editable Fields:', + fontSize: 14.0, + color: Colors.black87, + fontWeight: FontWeight.w600, + height: 2, + ), + CustomTextRich.createTextSpan( + '\n • Full Name:', + fontSize: 14.0, + color: Color(0xFF414042), + fontWeight: FontWeight.w500, + ), + CustomTextRich.createTextSpan( + ' Tap the text box to enter your name (up to 40 alphanumeric characters).', + fontSize: 14.0, + color: Color(0xFF898C81), + fontWeight: FontWeight.normal, + ), + CustomTextRich.createTextSpan( + '\n • Date of Birth:', + fontSize: 14.0, + color: Color(0xFF414042), + fontWeight: FontWeight.w500, + ), + CustomTextRich.createTextSpan( + ' Use the calendar dropdown to select your date of birth.', + fontSize: 14.0, + color: Color(0xFF898C81), + fontWeight: FontWeight.normal, + ), + CustomTextRich.createTextSpan( + '\n • Country/Region: ', + fontSize: 14.0, + color: Color(0xFF414042), + fontWeight: FontWeight.w500, + ), + CustomTextRich.createTextSpan( + 'Choose your current location from the dropdown menu.', + fontSize: 14.0, + color: Color(0xFF898C81), + fontWeight: FontWeight.normal, + ), + CustomTextRich.createTextSpan( + '\n •User Image: ', + fontSize: 14.0, + color: Color(0xFF414042), + fontWeight: FontWeight.w500, + ), + CustomTextRich.createTextSpan( + 'Tap on the avatar icon to upload or change your profile picture.', + fontSize: 14.0, + color: Color(0xFF898C81), + fontWeight: FontWeight.normal, + ), + CustomTextRich.createTextSpan( + '\n 3. Non-Editable Fields:', + fontSize: 14.0, + color: Colors.black87, + fontWeight: FontWeight.w600, + height: 2, + ), + CustomTextRich.createTextSpan( + '\nUsername ', + fontSize: 14.0, + color: Color(0xFF414042), + fontWeight: FontWeight.w500, + ), + CustomTextRich.createTextSpan( + 'and ', + fontSize: 14.0, + color: Color(0xFF898C81), + fontWeight: FontWeight.normal, + ), + CustomTextRich.createTextSpan( + 'Email ID: ', + fontSize: 14.0, + color: Color(0xFF414042), + fontWeight: FontWeight.w500, + ), + CustomTextRich.createTextSpan( + 'These fields cannot be edited to ensure the integrity of your account.', + fontSize: 14.0, + color: Color(0xFF898C81), + fontWeight: FontWeight.normal, + ), + CustomTextRich.createTextSpan( + '\n 4.Agree to Terms and Conditions:', + fontSize: 14.0, + color: Colors.black87, + fontWeight: FontWeight.w600, + height: 2, + ), + + CustomTextRich.createTextSpan( + '\nEnsure that the checkbox for "I agree to Terms & Conditions and Privacy Policy" is selected before saving changes.', + fontSize: 14.0, + color: Color(0xFF898C81), + fontWeight: FontWeight.normal, + ), + CustomTextRich.createTextSpan( + '\n 5. Save Your Changes:', + fontSize: 15.0, + color: Colors.black87, + fontWeight: FontWeight.bold, + height: 2, + ), + CustomTextRich.createTextSpan( + '\n • Tap the Save button at the bottom of the screen.', + fontSize: 14.0, + color: Color(0xFF898C81), + fontWeight: FontWeight.normal, + ), + CustomTextRich.createTextSpan( + '\n • A confirmation dialog will appear with the message:', + fontSize: 14.0, + color: Color(0xFF898C81), + fontWeight: FontWeight.normal, + ), + CustomTextRich.createTextSpan( + '“Are you sure you want to save this page? Once saved, you will not be able to change your name or date of birth.”', + fontSize: 14.0, + color: Color(0xFF898C81), + fontWeight: FontWeight.normal, + ), + CustomTextRich.createTextSpan( + '\n • Select Confirm to save the changes or Cancel to go back.', + fontSize: 14.0, + color: Color(0xFF898C81), + fontWeight: FontWeight.normal, + ), + + ]; + return + BaseScaffold( title: Text('Key Features', + style: TextStyle( + color: Color(0xFFAA8E83), + ),), + showBackIcon: true, + body:SafeArea(child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + padding: const EdgeInsets.all(16.0), + width: MediaQuery.of(context).size.width, + child: Text( + 'FEATURES', + style: TextStyle( + color: Colors.black,// Text color + fontSize: 18, + fontWeight: FontWeight.w500, + ), ), ), - ), - ); + Expanded(child: Scrollbar( + thumbVisibility: true, + thickness: 6, + radius: Radius.circular(10), + interactive: true, + child: + Container( + color: Colors.grey[50], // Set the background color here + // child: SingleChildScrollView( + child: CustomTextRich( + textSpans: textSpans, + padding: const EdgeInsets.all(16.0), + textAlign: TextAlign.start, + ), + ), + ),), + ], + ), ), + ); } } diff --git a/lib/presentation/routes/drawer_routes/Drawer Items/user_guide/getting_started.dart b/lib/presentation/routes/drawer_routes/Drawer Items/user_guide/getting_started.dart index cd911638..ad4510b6 100644 --- a/lib/presentation/routes/drawer_routes/Drawer Items/user_guide/getting_started.dart +++ b/lib/presentation/routes/drawer_routes/Drawer Items/user_guide/getting_started.dart @@ -1,3 +1,4 @@ +import 'package:flutter/gestures.dart'; import 'package:flutter/material.dart'; @@ -5,152 +6,174 @@ import 'package:uae_stat/presentation/routes/drawer_routes/Drawer%20Items/user_g import 'package:uae_stat/presentation/routes/drawer_routes/custom_drawer_routes.dart'; import 'package:uae_stat/infrastructure/services/img_asset_paths/banner_asset_path.dart'; +import 'package:url_launcher/url_launcher.dart'; class GettingStarted extends StatelessWidget { + GettingStarted({super.key}); + final String url = 'https://fcsc.gov.ae/en-us/Pages/home.aspx'; final fcscBanner = Image.asset( BannerAssetPath.fcsc, height: 56, alignment:Alignment.center, ); - final List> contentList = [ - { - 'text': 'This app provides a centralized platform to access key statistical data and insights about the UAE, empoweringusers with accurate and up-to-date information on various sectors.', - 'fontSize': 16.0, - 'color': Color(0xFF898C81), - 'fontWeight': FontWeight.normal, - 'isBulletPoint': false, - }, - { - 'text': 'How to Get Started', - 'fontSize': 18.0, - 'color': Color(0xFF414042), - 'fontWeight': FontWeight.w600, - 'isBulletPoint': false, - }, - { - 'text': '1.Download the app from the App Store or Google Play Store.', - 'fontSize': 14.0, - 'color': Color(0xFF898C81), - 'fontWeight': FontWeight.normal, - 'isBulletPoint': false, - }, - { - 'text': '2.Log in to unlock advanced features or continue as a guest.', - 'fontSize': 14.0, - 'color': Color(0xFF898C81), - 'fontWeight': FontWeight.normal, - 'isBulletPoint': false, - }, - { - 'text': '3.Navigate through categories, explore metrics, and bookmark essential information.', - 'fontSize': 14.0, - 'color': Color(0xFF898C81), - 'fontWeight': FontWeight.normal, - 'isBulletPoint': false, - }, - { - 'text': 'Stay Updated', - 'fontSize': 18.0, - 'color': Color(0xFF414042), - 'fontWeight': FontWeight.bold, - 'isBulletPoint': false, - }, - { - 'text': 'The app regularly updates datasets and features to reflect the latest information. Notifications will alert you about new data or improvements.', - 'fontSize': 14.0, - 'color': Color(0xFF898C81), - 'fontWeight': FontWeight.normal, - 'isBulletPoint': false, - }, - ]; + + @override Widget build(BuildContext context) { - return BaseScaffold(title: Text ('Getting Started'), - body: Scrollbar( - thumbVisibility: true, - thickness: 6, - radius: Radius.circular(10), - interactive: true, - child:SingleChildScrollView( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Container( - padding: const EdgeInsets.all(16.0), - width: MediaQuery.of(context).size.width, - child: Text( - 'WELCOME TO THE FEDERAL COMPETITIVENESS AND STATISTICS CENTRE (FCSC) MOBILE APPLICATION.', - style: TextStyle( - color: Color(0xFF265E84), // Text color - fontSize: 18, - fontWeight: FontWeight.w600 - ), - ), - ), - Container( - padding: const EdgeInsets.all(16.0), - color: Color(0xFFD9D9D9), - child:ListView.builder( - shrinkWrap: true, - physics: const NeverScrollableScrollPhysics(), - itemCount: contentList.length, - itemBuilder: (context, index) { - final item = contentList[index]; - return CustomContainer( - text: item['text'], - fontSize: item['fontSize']?? 20, - color: item['color'], - fontWeight: item['fontWeight'], - height:item['height'], - isBulletPoint: item['isBulletPoint'] ?? false, - textDecoration: item['textDecoration'] ?? TextDecoration.none, - decorationColor: item['decorationColor'], - ); - }, - ), - ), - Container( - padding: const EdgeInsets.all(16.0), - width: MediaQuery.of(context).size.width, - color: Color(0xFFD9D9D9), - child: Text.rich( - TextSpan( - children: [ - TextSpan( - text: 'For more information please visit ', - style: TextStyle( - fontSize: 16.0, - color: Color(0xFF265E84), - fontWeight: FontWeight.normal, - ), - ), + List textSpans = [ - TextSpan( - text: 'www.fcsc.gov.ae', - style: TextStyle( - fontSize: 16.0, - color: Color(0xFF568898), - fontWeight: FontWeight.normal, - decoration: TextDecoration.underline, - decorationColor:Color(0xFF568898), - ), - ), - ], + CustomTextRich.createTextSpan('How to Get Started\n', fontSize: 17, + color: Colors.black87, + fontWeight: FontWeight.bold, + ), + CustomTextRich.createTextSpan('1.Download the app from the App Store or Google Play Store.', + fontSize: 13, color:Color(0xFF898C81), + fontWeight: FontWeight.normal , + spacingTop: 1.9, + ), + CustomTextRich.createTextSpan( + '2.Log in to unlock advanced features or continue as a guest.\n', + fontSize: 13, color:Color(0xFF898C81), + fontWeight: FontWeight.normal , + spacingTop: 1.9,), + + CustomTextRich.createTextSpan( + '3.Navigate through categories, explore metrics, and bookmark essential information.\n', + fontSize: 13, color:Color(0xFF898C81), + fontWeight: FontWeight.normal , + ), + + CustomTextRich.createTextSpan('\nStay Updated', fontSize: 15, + color: Colors.black87, + fontWeight: FontWeight.w600, + height: 2, + ), + + CustomTextRich.createTextSpan( + '\nThe app regularly updates datasets and features to reflect the latest information. Notifications will alert you about new data or improvements.', + fontSize: 13, color:Color(0xFF898C81), + fontWeight: FontWeight.normal , + ), + + CustomTextRich.createTextSpan( + 'Support decision-making and research with reliable, up-to-date data.\n \n ', + fontSize: 14.0, + color: Color(0xFF898C81), + fontWeight: FontWeight.normal, + ), + + + ]; + return BaseScaffold( title: Text('About the App', + style: TextStyle( + color:Color(0xFF265E84), + fontWeight: FontWeight.w500, + ), + ), + showBackIcon: true, + body:SafeArea(child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + padding: const EdgeInsets.all(16.0), + width: MediaQuery.of(context).size.width, + child: Text.rich( + TextSpan( + text: 'The', + style: TextStyle( + fontSize: 19, + fontWeight: FontWeight.w600, + color: Colors.grey, + ), + children: [ + TextSpan( + text:' Federal Competitiveness and Statistics Centre (FCSC),', + style: TextStyle( + fontSize: 19, + fontWeight: FontWeight.w600, + color: Colors.black87, ), - ), ), - Container( - color: Color(0xFFD9D9D9), - padding: const EdgeInsets.all(16.0), - width: MediaQuery.of(context).size.width, - child: Center( child: fcscBanner,), + TextSpan( + text:' in your App is designed to provide registered and approved users with access to accurate and comprehensive statistics about the UAE. The app serves as a centralized platform for exploring key datasets, trends, and insights across various sectors.', + style: TextStyle( + fontSize: 19, + fontWeight: FontWeight.w600, + color: Colors.grey, + ), ), ], ), ), ), + Expanded(child: Scrollbar( + thumbVisibility: true, + thickness: 6, + radius: Radius.circular(10), + interactive: true, + child: SingleChildScrollView( + child: Column( + children: [ + Container( + color: Colors.grey[50], // Set the background color here + // child: SingleChildScrollView( + child: CustomTextRich( + textSpans: textSpans, + padding: const EdgeInsets.all(16.0), + textAlign: TextAlign.start, + ), + ), + Container( + color: Colors.grey[50], + padding: EdgeInsets.only(bottom: 26.0), + child:Text.rich( + TextSpan( + text: 'For more information please visit ', + style: TextStyle( + fontSize: 16.0, + color: Color(0xFF265E84), + fontWeight: FontWeight.normal,), + children: [ + TextSpan( + text: 'www.fcsc.gov.ae', + style: TextStyle( + fontSize: 16.0, + color: Color(0xFF568898), + fontWeight: FontWeight.normal, + decoration: TextDecoration.underline, + decorationColor:Color(0xFF568898), + ), + recognizer: TapGestureRecognizer() + ..onTap = () async { + final Uri uri = Uri.parse(url); + if (await launchUrl(uri)) { + await launchUrl(uri, mode: LaunchMode.externalApplication); + } else { + throw 'Could not launch $url'; + } + }, + ), + ], + ), + ), + ), + Container( + color: Colors.grey[50], + padding: EdgeInsets.only(bottom: 26.0), + width: MediaQuery.of(context).size.width, + child: Center( + child: fcscBanner, + ), + ), + ], + ), + ), + + ),), + ], + ), ), ); } } diff --git a/lib/presentation/routes/drawer_routes/Drawer Items/user_guide/user_guide.dart b/lib/presentation/routes/drawer_routes/Drawer Items/user_guide/user_guide.dart index de257834..c4086555 100644 --- a/lib/presentation/routes/drawer_routes/Drawer Items/user_guide/user_guide.dart +++ b/lib/presentation/routes/drawer_routes/Drawer Items/user_guide/user_guide.dart @@ -43,14 +43,10 @@ class _UserGuideState extends State { // Each pair defines a row of (Color, Text) pairs [ {'routePath':'gettingStarted','color': Color(0xFF90B0D5), 'text': 'Getting Started', 'icon': 'START', 'index': '1'}, - {'routePath':'features','color': Color(0xFF497B8C), 'text': 'Account & Profile', 'icon': Icons.person_outline_rounded, 'index': '2'}, + {'routePath':'features','color': Color(0xFFAA8E83), 'text': 'Using Features', 'icon': Icons.stars_outlined, 'index': '2'}, ], [ - {'routePath':'features','color': Color(0xFFAA8E83), 'text': 'Using Features', 'icon': Icons.stars_outlined, 'index': '3'}, - {'routePath':'features','color': Color(0xFF265E84), 'text': 'Contact', 'icon': Icons.local_phone_outlined, 'index': '4'}, - ], - [ - {'routePath':'faq','color': Color(0xFF7296BE), 'text': 'FAQs', 'icon': Icons.question_answer_sharp, 'index': '5'}, + {'routePath':'faq','color': Color(0xFF7296BE), 'text': 'FAQs', 'icon': Icons.question_answer_sharp, 'index': '3'}, // {'routePath':'features','color': Color(0xFF7DAFBC), 'text': 'Advanced Settings', 'icon': Icons.settings_outlined, 'index': '6'}, ], ]), diff --git a/lib/presentation/routes/drawer_routes/custom_drawer_routes.dart b/lib/presentation/routes/drawer_routes/custom_drawer_routes.dart index 52fc756b..7bb46425 100644 --- a/lib/presentation/routes/drawer_routes/custom_drawer_routes.dart +++ b/lib/presentation/routes/drawer_routes/custom_drawer_routes.dart @@ -5,16 +5,18 @@ class BaseScaffold extends StatelessWidget { final Widget body; final Widget title; final List? actions; + final bool showBackIcon; + final VoidCallback? onBackIconPressed; const BaseScaffold({ Key? key, required this.body, required this.title, this.actions, + this.showBackIcon=false, + this.onBackIconPressed, }) : super(key: key); - // final Widget body; - // - // const BaseScaffold({required this.body}); + @override Widget build(BuildContext context) { @@ -23,9 +25,29 @@ class BaseScaffold extends StatelessWidget { double myheight = MediaQuery.of(context).size.height; double mywidth = MediaQuery.of(context).size.width; return Scaffold( - appBar: AppBar(title: title, actions: [ + appBar: AppBar(title: title, + leading:showBackIcon + ? IconButton( + padding: EdgeInsets.zero, + icon: const Icon(Icons.arrow_back_ios_new_sharp), + onPressed: onBackIconPressed ?? + () { + Navigator.of(context).pop(); // Default back button behavior + }, + ) : null, + actions: [ IconButton(onPressed: () {}, icon: Icon(Icons.toggle_off_outlined)), - ]), + if (showBackIcon) + Builder( + builder: (context) => IconButton( + padding: EdgeInsets.zero, + icon: const Icon(Icons.menu), + onPressed: () { + Scaffold.of(context).openDrawer(); // Opens the drawer + }, + ), + ), + ],), drawer: Drawer( child: ListView( children: [ diff --git a/macos/Flutter/GeneratedPluginRegistrant.swift b/macos/Flutter/GeneratedPluginRegistrant.swift index 89ab99dd..436f106b 100644 --- a/macos/Flutter/GeneratedPluginRegistrant.swift +++ b/macos/Flutter/GeneratedPluginRegistrant.swift @@ -10,6 +10,7 @@ import flutter_secure_storage_macos import path_provider_foundation import share_plus import shared_preferences_foundation +import url_launcher_macos import video_player_avfoundation import webview_flutter_wkwebview @@ -19,6 +20,7 @@ func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) { PathProviderPlugin.register(with: registry.registrar(forPlugin: "PathProviderPlugin")) SharePlusMacosPlugin.register(with: registry.registrar(forPlugin: "SharePlusMacosPlugin")) SharedPreferencesPlugin.register(with: registry.registrar(forPlugin: "SharedPreferencesPlugin")) + UrlLauncherPlugin.register(with: registry.registrar(forPlugin: "UrlLauncherPlugin")) FVPVideoPlayerPlugin.register(with: registry.registrar(forPlugin: "FVPVideoPlayerPlugin")) FLTWebViewFlutterPlugin.register(with: registry.registrar(forPlugin: "FLTWebViewFlutterPlugin")) } diff --git a/pubspec.lock b/pubspec.lock index cc69ece0..7f0df837 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -5,23 +5,23 @@ packages: dependency: transitive description: name: _fe_analyzer_shared - sha256: "16e298750b6d0af7ce8a3ba7c18c69c3785d11b15ec83f6dcd0ad2a0009b3cab" + sha256: f256b0c0ba6c7577c15e2e4e114755640a875e885099367bf6e012b19314c834 url: "https://pub.dev" source: hosted - version: "76.0.0" + version: "72.0.0" _macros: dependency: transitive description: dart source: sdk - version: "0.3.3" + version: "0.3.2" analyzer: dependency: transitive description: name: analyzer - sha256: "1f14db053a8c23e260789e9b0980fa27f2680dd640932cae5e1137cce0e46e1e" + sha256: b652861553cd3990d8ed361f7979dc6d7053a9ac8843fa73820ab68ce5410139 url: "https://pub.dev" source: hosted - version: "6.11.0" + version: "6.7.0" analyzer_plugin: dependency: transitive description: @@ -186,10 +186,10 @@ packages: dependency: transitive description: name: collection - sha256: a1ace0a119f20aabc852d165077c036cd864315bd99b7eaa10a60100341941bf + sha256: ee67cb0715911d28db6bf4af1026078bd6f0128b07a5f66fb2ed94ec6783c09a url: "https://pub.dev" source: hosted - version: "1.19.0" + version: "1.18.0" convert: dependency: transitive description: @@ -266,10 +266,10 @@ packages: dependency: transitive description: name: custom_lint_visitor - sha256: bfe9b7a09c4775a587b58d10ebb871d4fe618237639b1e84d5ec62d7dfef25f9 + sha256: "8aeb3b6ae2bb765e7716b93d1d10e8356d04e0ff6d7592de6ee04e0dd7d6587d" url: "https://pub.dev" source: hosted - version: "1.0.0+6.11.0" + version: "1.0.0+6.7.0" dart_style: dependency: transitive description: @@ -773,18 +773,18 @@ packages: dependency: transitive description: name: leak_tracker - sha256: "7bb2830ebd849694d1ec25bf1f44582d6ac531a57a365a803a6034ff751d2d06" + sha256: "3f87a60e8c63aecc975dda1ceedbc8f24de75f09e4856ea27daf8958f2f0ce05" url: "https://pub.dev" source: hosted - version: "10.0.7" + version: "10.0.5" leak_tracker_flutter_testing: dependency: transitive description: name: leak_tracker_flutter_testing - sha256: "9491a714cca3667b60b5c420da8217e6de0d1ba7a5ec322fab01758f6998f379" + sha256: "932549fb305594d82d7183ecd9fa93463e9914e1b67cacc34bc40906594a1806" url: "https://pub.dev" source: hosted - version: "3.0.8" + version: "3.0.5" leak_tracker_testing: dependency: transitive description: @@ -813,10 +813,10 @@ packages: dependency: transitive description: name: macros - sha256: "1d9e801cd66f7ea3663c45fc708450db1fa57f988142c64289142c9b7ee80656" + sha256: "0acaed5d6b7eab89f63350bccd82119e6c602df0f391260d0e32b5e23db79536" url: "https://pub.dev" source: hosted - version: "0.1.3-main.0" + version: "0.1.2-main.4" mailer: dependency: "direct main" description: @@ -1172,7 +1172,7 @@ packages: dependency: transitive description: flutter source: sdk - version: "0.0.0" + version: "0.0.99" smart_api_client: dependency: "direct main" description: @@ -1216,10 +1216,10 @@ packages: dependency: transitive description: name: stack_trace - sha256: "9f47fd3630d76be3ab26f0ee06d213679aa425996925ff3feffdec504931c377" + sha256: "73713990125a6d93122541237550ee3352a2d84baad52d375a4cad2eb9b7ce0b" url: "https://pub.dev" source: hosted - version: "1.12.0" + version: "1.11.1" state_notifier: dependency: transitive description: @@ -1248,10 +1248,10 @@ packages: dependency: transitive description: name: string_scanner - sha256: "688af5ed3402a4bde5b3a6c15fd768dbf2621a614950b17f04626c431ab3c4c3" + sha256: "556692adab6cfa87322a115640c11f13cb77b3f076ddcc5d6ae3c20242bedcde" url: "https://pub.dev" source: hosted - version: "1.3.0" + version: "1.2.0" syncfusion_flutter_charts: dependency: "direct main" description: @@ -1280,10 +1280,10 @@ packages: dependency: transitive description: name: test_api - sha256: "664d3a9a64782fcdeb83ce9c6b39e78fd2971d4e37827b9b06c3aa1edc5e760c" + sha256: "5b8a98dafc4d5c4c9c72d8b31ab2b23fc13422348d2997120294d3bac86b4ddb" url: "https://pub.dev" source: hosted - version: "0.7.3" + version: "0.7.2" the_validator: dependency: "direct main" description: @@ -1316,6 +1316,30 @@ packages: url: "https://pub.dev" source: hosted version: "2.2.2" + url_launcher: + dependency: "direct main" + description: + name: url_launcher + sha256: "9d06212b1362abc2f0f0d78e6f09f726608c74e3b9462e8368bb03314aa8d603" + url: "https://pub.dev" + source: hosted + version: "6.3.1" + url_launcher_android: + dependency: transitive + description: + name: url_launcher_android + sha256: "6fc2f56536ee873eeb867ad176ae15f304ccccc357848b351f6f0d8d4a40d193" + url: "https://pub.dev" + source: hosted + version: "6.3.14" + url_launcher_ios: + dependency: transitive + description: + name: url_launcher_ios + sha256: "16a513b6c12bb419304e72ea0ae2ab4fed569920d1c7cb850263fe3acc824626" + url: "https://pub.dev" + source: hosted + version: "6.3.2" url_launcher_linux: dependency: transitive description: @@ -1324,6 +1348,14 @@ packages: url: "https://pub.dev" source: hosted version: "3.2.1" + url_launcher_macos: + dependency: transitive + description: + name: url_launcher_macos + sha256: "17ba2000b847f334f16626a574c702b196723af2a289e7a93ffcb79acff855c2" + url: "https://pub.dev" + source: hosted + version: "3.2.2" url_launcher_platform_interface: dependency: transitive description: @@ -1408,10 +1440,10 @@ packages: dependency: transitive description: name: vm_service - sha256: f6be3ed8bd01289b34d679c2b62226f63c0e69f9fd2e50a6b3c1c729a961041b + sha256: "5c5f338a667b4c644744b661f309fb8080bb94b18a7e91ef1dbd343bed00ed6d" url: "https://pub.dev" source: hosted - version: "14.3.0" + version: "14.2.5" watcher: dependency: transitive description: diff --git a/pubspec.yaml b/pubspec.yaml index a223630d..133d2b6d 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -22,6 +22,7 @@ dependencies: cupertino_icons: ^1.0.6 fl_chart: ^0.69.0 marquee: ^2.2.3 + url_launcher: ^6.3.1 # dynamic_layouts: # git: # url: https://github.com/flutter/packages.git From 3b038f7b428f2c659a16690e7f8160ac44e0d594 Mon Sep 17 00:00:00 2001 From: VINISTAN Date: Thu, 9 Jan 2025 13:36:31 +0530 Subject: [PATCH 2/2] Marriage card Implemented --- lib/config/my_router.dart | 13 +- .../competitiveness.dart | 0 .../Country_Profile/country_profile.dart | 142 ++++++++ .../UAE_Numbers/Social/marriages.dart | 266 ++++++++++++++ .../{ => UAE_Numbers}/uae_numbers.dart | 36 +- .../country_profile.dart | 31 -- .../tab_routes/home_route.dart | 10 +- .../drawer_routes/custom_drawer_routes.dart | 329 +++++++++++++++--- pubspec.lock | 4 +- pubspec.yaml | 2 +- 10 files changed, 723 insertions(+), 110 deletions(-) rename lib/presentation/Screens/Bottom Navigation Pages/{ => Competitiveness}/competitiveness.dart (100%) create mode 100644 lib/presentation/Screens/Bottom Navigation Pages/Country_Profile/country_profile.dart create mode 100644 lib/presentation/Screens/Bottom Navigation Pages/UAE_Numbers/Social/marriages.dart rename lib/presentation/Screens/Bottom Navigation Pages/{ => UAE_Numbers}/uae_numbers.dart (91%) delete mode 100644 lib/presentation/Screens/Bottom Navigation Pages/country_profile.dart diff --git a/lib/config/my_router.dart b/lib/config/my_router.dart index 1e6d9a68..40b75655 100644 --- a/lib/config/my_router.dart +++ b/lib/config/my_router.dart @@ -294,9 +294,10 @@ import 'package:flutter/material.dart'; import 'package:go_router/go_router.dart'; -import 'package:uae_stat/presentation/Screens/Bottom%20Navigation%20Pages/competitiveness.dart'; -import 'package:uae_stat/presentation/Screens/Bottom%20Navigation%20Pages/country_profile.dart'; -import 'package:uae_stat/presentation/Screens/Bottom%20Navigation%20Pages/uae_numbers.dart'; +import 'package:uae_stat/presentation/Screens/Bottom%20Navigation%20Pages/Competitiveness/competitiveness.dart'; +import 'package:uae_stat/presentation/Screens/Bottom%20Navigation%20Pages/Country_Profile/country_profile.dart'; +import 'package:uae_stat/presentation/Screens/Bottom%20Navigation%20Pages/UAE_Numbers/Social/marriages.dart'; +import 'package:uae_stat/presentation/Screens/Bottom%20Navigation%20Pages/UAE_Numbers/uae_numbers.dart'; import 'package:uae_stat/presentation/Screens/auth_verification/registration.dart'; import 'package:uae_stat/presentation/routes/drawer_routes/Drawer%20Items/user_guide/getting_started.dart'; import 'package:uae_stat/presentation/routes/drawer_routes/custom_drawer_routes.dart'; @@ -426,5 +427,11 @@ final GoRouter router = GoRouter( builder: (context, state) => CountryProfile(), ), + + // UAE NUMBER Routes + GoRoute( + path: '/marriages', + builder: (context, state) => Marriages(), + ), ], ); diff --git a/lib/presentation/Screens/Bottom Navigation Pages/competitiveness.dart b/lib/presentation/Screens/Bottom Navigation Pages/Competitiveness/competitiveness.dart similarity index 100% rename from lib/presentation/Screens/Bottom Navigation Pages/competitiveness.dart rename to lib/presentation/Screens/Bottom Navigation Pages/Competitiveness/competitiveness.dart diff --git a/lib/presentation/Screens/Bottom Navigation Pages/Country_Profile/country_profile.dart b/lib/presentation/Screens/Bottom Navigation Pages/Country_Profile/country_profile.dart new file mode 100644 index 00000000..58a1c5ae --- /dev/null +++ b/lib/presentation/Screens/Bottom Navigation Pages/Country_Profile/country_profile.dart @@ -0,0 +1,142 @@ +import 'package:flutter/material.dart'; +import 'package:uae_stat/presentation/routes/drawer_routes/custom_drawer_routes.dart'; +import 'package:fl_chart/fl_chart.dart'; + +class CountryProfile extends StatelessWidget { + const CountryProfile({super.key}); + + @override + Widget build(BuildContext context) { + double myheight = MediaQuery.of(context).size.height; + double mywidth = MediaQuery.of(context).size.width; + return BaseScaffold( + title: Center( + child: SizedBox( + height: myheight / 5, + width: mywidth / 3, + child: Image(image: AssetImage('assets/logos/uae_stat.png')))), + body: CountryProfileWidget(), + ); + } +} +class CountryProfileWidget extends StatelessWidget { + const CountryProfileWidget({super.key}); + + @override + Widget build(BuildContext context) { + return HorizontalBarChart(); + } +} + + + + + +class HorizontalBarChart extends StatelessWidget { + final List xAxisData = ['2019', '2020', '2021', '2022', '2023']; + final List yAxisData = [2, 4, 1, 5, 3]; + + + @override + Widget build(BuildContext context) { + double myheight = MediaQuery.of(context).size.height; + return Scaffold( + appBar: AppBar(title: Text('Horizontal Bar Chart')), + body: Padding( + padding: const EdgeInsets.all(16.0), + child: + Container( + height: myheight/4, + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(12), + boxShadow: [ + BoxShadow( + color: Colors.black12, + blurRadius: 8, + offset: Offset(0, 4), + ), + ], + ), + child: + Padding( + padding: const EdgeInsets.only(top: 16,left: 8.0,right: 8.0,bottom: 8.0), + child: BarChart( + BarChartData( + alignment: BarChartAlignment.spaceAround, + maxY: 8, + barTouchData: BarTouchData(enabled: false), + titlesData: FlTitlesData( + leftTitles: AxisTitles( + sideTitles: SideTitles( + showTitles: true, + interval: 2, + getTitlesWidget: (value, meta) { + return Padding( + padding: const EdgeInsets.only(right: 8.0), + child: Text('${value.toInt()}K'), + ); + }, + reservedSize: 60, + ), + ), + bottomTitles: AxisTitles( + sideTitles: SideTitles( + showTitles: true, + getTitlesWidget: (value, meta) { + return Padding( + padding: const EdgeInsets.only(top: 8.0), + child: Text(xAxisData[value.toInt()]), + ); + }, + reservedSize: 40, + ), + ), + topTitles: AxisTitles( + sideTitles: SideTitles(showTitles: false), // Hides top titles + ), + rightTitles: AxisTitles( + sideTitles: SideTitles(showTitles: false), // Hides right titles + ), + ), + gridData: FlGridData(show: false), + borderData: FlBorderData(show: false), + barGroups: List.generate( + xAxisData.length, + (index) => BarChartGroupData( + x: index, + barRods: [ + BarChartRodData( + toY: yAxisData[index], + color: Colors.blueAccent, + //colors: [Colors.blueAccent], + borderRadius: BorderRadius.circular(4), + width: 20, + ), + ], + ), + ), + ), + ), + ), + ), + ), + ); + } +} + +void main() { + runApp(MaterialApp(home: HorizontalBarChart())); +} + + +// void main() { +// runApp(MaterialApp(home: HorizontalBarChart())); +// } + + + + + + + diff --git a/lib/presentation/Screens/Bottom Navigation Pages/UAE_Numbers/Social/marriages.dart b/lib/presentation/Screens/Bottom Navigation Pages/UAE_Numbers/Social/marriages.dart new file mode 100644 index 00000000..0caad6ea --- /dev/null +++ b/lib/presentation/Screens/Bottom Navigation Pages/UAE_Numbers/Social/marriages.dart @@ -0,0 +1,266 @@ +import 'package:flutter/material.dart'; +import 'package:uae_stat/presentation/components/constant/constant.dart'; +import 'package:uae_stat/presentation/routes/drawer_routes/custom_drawer_routes.dart'; +import 'package:fl_chart/fl_chart.dart'; + + +class Marriages extends StatelessWidget { + const Marriages({super.key}); + + @override + Widget build(BuildContext context) { + double myheight = MediaQuery.of(context).size.height; + double mywidth = MediaQuery.of(context).size.width; + final List xAxisData = ['2019', '2020', '2021', '2022', '2023']; + final List yAxisData = [2, 4, 1, 5, 3]; + return BaseScaffold( + //appbarActions: IconButton(onPressed: (){}, icon: Icon(Icons.arrow_back_ios_new)), + appbarColor: Color(0xFFC6BEB2), + title: Text("UAE Numbers",style: TextStyle(color: Colors.white,fontWeight: FontWeight.bold),), + showBackButton: true, + body: SingleChildScrollView( + child: Column( + children : [ + Container( + height: myheight/4.5, + width: double.infinity, + color: Color(0xFFC6BEB2), + child: Padding(padding: EdgeInsets.only(left: 30,right: 30,top: 20,bottom: 10),child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text("SOCIAL",style: TextStyle(color: Colors.white,fontSize: 30),), + Container(width: mywidth/5,child: Divider(thickness: 10,color: Colors.white,)), + Text("Marriages",style: TextStyle(color: Colors.white,fontSize: 20),), + Row( + mainAxisAlignment: MainAxisAlignment.end, + children: [ + IconButton(onPressed: (){}, icon: Icon(Icons.bookmark_add_outlined,color: Colors.white,size: 40,)), + IconButton(onPressed: (){}, icon: Icon(Icons.share,color: Colors.white,size: 30,)), + ],), + ], + ),) + ), + SingleChildScrollView(child: Container( + height: myheight, + color: Color(0xFFC6BEB2), + child: Padding( + padding: const EdgeInsets.only(top: 0.0,left: 10,right: 10,bottom: 20), + child: Column( + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + children: [ + Container(height: myheight/3.5,width: mywidth/2.5, + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.all(Radius.circular(10)) + ), + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Image.asset( + 'assets/icons/indicator/social/marriage.png', + height: myheight / 10, // This ensures the image fits within the container's height + width: myheight / 10, // You can adjust the size as needed + ), + Text("Total",style: TextStyle(fontWeight: FontWeight.bold,fontSize: 26),), + Text("2022",style: TextStyle(fontSize: 15,color: Colors.grey),), + Text("16759",style: TextStyle(fontSize: 26,fontWeight: FontWeight.bold,color: socialColor),), + ], + ), + ), + Container(height: myheight/3.5,width: mywidth/2.5, + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.all(Radius.circular(10)) + ), + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Image.asset( + 'assets/icons/indicator/social/marriage.png', + height: myheight / 10, // This ensures the image fits within the container's height + width: myheight / 10, // You can adjust the size as needed + ), + Text("Average",style: TextStyle(fontWeight: FontWeight.bold,fontSize: 26),), + Text("(2021 - 2022)",style: TextStyle(fontSize: 15,color: Colors.grey),), + Text("15987",style: TextStyle(fontSize: 26,fontWeight: FontWeight.bold,color: socialColor),), + ], + ), + ), + ], + ), + SizedBox(height: myheight/20,), + Container( + height: myheight/2, + width: mywidth/1.2, + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.all(Radius.circular(10)) + ), + child: Padding( + padding: const EdgeInsets.all(10.0), + child: Column( + children: [ + SizedBox(height: myheight/30,), + Center(child: Text("Total Marriages by Marriage Type",style: TextStyle(fontSize: 16,fontWeight: FontWeight.bold),), + ), + SizedBox(height: myheight/30,), + Container( + height: myheight/4, + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(12), + boxShadow: [ + BoxShadow( + color: Colors.black12, + blurRadius: 8, + offset: Offset(0, 4), + ), + ], + ), + child: + Padding( + padding: const EdgeInsets.only(top: 16,left: 8.0,right: 8.0,bottom: 8.0), + child: BarChart( + BarChartData( + alignment: BarChartAlignment.spaceAround, + maxY: 8, + barTouchData: BarTouchData(enabled: false), + titlesData: FlTitlesData( + leftTitles: AxisTitles( + sideTitles: SideTitles( + showTitles: true, + interval: 2, + getTitlesWidget: (value, meta) { + return Padding( + padding: const EdgeInsets.only(right: 8.0), + child: Text('${value.toInt()}K'), + ); + }, + reservedSize: 60, + ), + ), + bottomTitles: AxisTitles( + sideTitles: SideTitles( + showTitles: true, + getTitlesWidget: (value, meta) { + return Padding( + padding: const EdgeInsets.only(top: 8.0), + child: Text(xAxisData[value.toInt()]), + ); + }, + reservedSize: 40, + ), + ), + topTitles: AxisTitles( + sideTitles: SideTitles(showTitles: false), // Hides top titles + ), + rightTitles: AxisTitles( + sideTitles: SideTitles(showTitles: false), // Hides right titles + ), + ), + gridData: FlGridData(show: false), + borderData: FlBorderData(show: false), + barGroups: List.generate( + xAxisData.length, + (index) => BarChartGroupData( + x: index, + barRods: [ + BarChartRodData( + toY: yAxisData[index], + color: Colors.blueAccent, + //colors: [Colors.blueAccent], + borderRadius: BorderRadius.circular(4), + width: 20, + ), + ], + ), + ), + ), + ), + ), + ), + // Container( + // decoration: BoxDecoration( + // color: Colors.white, + // borderRadius: BorderRadius.circular(12), + // boxShadow: [ + // BoxShadow( + // color: Colors.black12, + // blurRadius: 8, + // offset: Offset(0, 4), + // ), + // ], + // ), + // child: + // BarChart( + // BarChartData( + // alignment: BarChartAlignment.spaceAround, + // maxY: 20, + // barTouchData: BarTouchData(enabled: false), + // titlesData: FlTitlesData( + // leftTitles: AxisTitles( + // sideTitles: SideTitles( + // showTitles: true, + // getTitlesWidget: (value, meta) { + // return Padding( + // padding: const EdgeInsets.only(right: 8.0), + // child: Text('${value.toInt()}K'), + // ); + // }, + // reservedSize: 40, + // ), + // ), + // bottomTitles: AxisTitles( + // sideTitles: SideTitles( + // showTitles: true, + // getTitlesWidget: (value, meta) { + // return Padding( + // padding: const EdgeInsets.only(top: 8.0), + // child: Text(xAxisData[value.toInt()]), + // ); + // }, + // reservedSize: 40, + // ), + // ), + // ), + // gridData: FlGridData(show: false), + // borderData: FlBorderData(show: false), + // barGroups: List.generate( + // xAxisData.length, + // (index) => BarChartGroupData( + // x: index, + // barRods: [ + // BarChartRodData( + // toY: yAxisData[index], + // color: Colors.blueAccent, + // //colors: [Colors.blueAccent], + // borderRadius: BorderRadius.circular(4), + // width: 20, + // ), + // ], + // ), + // ), + // ), + // ), + // ), + + ], + ), + ), + ) + ], + ), + ), + + + ),) + ] + ), + ), mycenterTitle: false, + + ); + } +} + diff --git a/lib/presentation/Screens/Bottom Navigation Pages/uae_numbers.dart b/lib/presentation/Screens/Bottom Navigation Pages/UAE_Numbers/uae_numbers.dart similarity index 91% rename from lib/presentation/Screens/Bottom Navigation Pages/uae_numbers.dart rename to lib/presentation/Screens/Bottom Navigation Pages/UAE_Numbers/uae_numbers.dart index b1899ffa..5cb1bbb5 100644 --- a/lib/presentation/Screens/Bottom Navigation Pages/uae_numbers.dart +++ b/lib/presentation/Screens/Bottom Navigation Pages/UAE_Numbers/uae_numbers.dart @@ -1,4 +1,5 @@ import 'package:flutter/material.dart'; +import 'package:go_router/go_router.dart'; import 'package:uae_stat/presentation/routes/bottom_bar_routes/tab_routes/home_route.dart'; import 'package:uae_stat/presentation/routes/drawer_routes/custom_drawer_routes.dart'; import 'package:uae_stat/presentation/components/constant/constant.dart'; @@ -16,7 +17,7 @@ class UaeNumbers extends StatelessWidget { body: //EconomicDashboard(), //EconomyExpandTile() - uaenumberWidget()); + uaenumberWidget(),); } } @@ -83,8 +84,10 @@ class uaenumberWidget extends StatelessWidget { ]), buildCategoryTitle('Vital Statistics',socialColor), buildCardRow([ - buildCard(context,'Marriages', '96%', '2023',socialColor,socialColor,mywidth/2.5), - buildCard(context,'Divorces', '1.2K', '2024',socialColor,socialColor,mywidth/2.5), + InkWell(onTap : (){ + context.go('/marriages'); + },child: buildCard(context,'Marriages', '96%', '2023',socialColor,socialColor,mywidth/2.5)), + InkWell(onTap : (){},child: buildCard(context,'Divorces', '1.2K', '2024',socialColor,socialColor,mywidth/2.5)), ]), buildCategoryTitle('Education',socialColor), buildCardRow([ @@ -265,21 +268,22 @@ class _CustomExpandableTileState extends State { duration: Duration(milliseconds: 300), curve: Curves.easeInOut, width: double.infinity, - height: isExpanded ? myheight : 0, child: isExpanded - ? SingleChildScrollView( - child: Container( - decoration: BoxDecoration( - color: Colors.white, - borderRadius: BorderRadius.all(Radius.circular(20)) - ), + ? IntrinsicHeight( + child: IntrinsicWidth( + child: Container( + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.all(Radius.circular(20)) + ), - padding: const EdgeInsets.all(10), - child: Column( - children: widget.children, - ), - ), - ) + padding: const EdgeInsets.all(10), + child: Column( + children: widget.children, + ), + ), + ), + ) : null, ), ), diff --git a/lib/presentation/Screens/Bottom Navigation Pages/country_profile.dart b/lib/presentation/Screens/Bottom Navigation Pages/country_profile.dart deleted file mode 100644 index 8d3f1081..00000000 --- a/lib/presentation/Screens/Bottom Navigation Pages/country_profile.dart +++ /dev/null @@ -1,31 +0,0 @@ -import 'package:flutter/material.dart'; -import 'package:uae_stat/presentation/routes/drawer_routes/custom_drawer_routes.dart'; - -class CountryProfile extends StatelessWidget { - const CountryProfile({super.key}); - - @override - Widget build(BuildContext context) { - double myheight = MediaQuery.of(context).size.height; - double mywidth = MediaQuery.of(context).size.width; - return BaseScaffold( - title: Center( - child: SizedBox( - height: myheight / 5, - width: mywidth / 3, - child: Image(image: AssetImage('assets/logos/uae_stat.png')))), - body: CountryProfileWidget() - ); - } -} -class CountryProfileWidget extends StatelessWidget { - const CountryProfileWidget({super.key}); - - @override - Widget build(BuildContext context) { - return Center(child: Text("COuntry Profile"),); - } -} - - - diff --git a/lib/presentation/routes/bottom_bar_routes/tab_routes/home_route.dart b/lib/presentation/routes/bottom_bar_routes/tab_routes/home_route.dart index cc4702c4..491dc171 100644 --- a/lib/presentation/routes/bottom_bar_routes/tab_routes/home_route.dart +++ b/lib/presentation/routes/bottom_bar_routes/tab_routes/home_route.dart @@ -177,11 +177,11 @@ class _MyHomePageState extends State { double myheight = MediaQuery.of(context).size.height; double mywidth = MediaQuery.of(context).size.width; return BaseScaffold( - title: Center( - child: SizedBox( - height: myheight / 5, - width: mywidth / 3, - child: Image(image: AssetImage('assets/logos/uae_stat.png')))), + mycenterTitle: true, + title: SizedBox( + height: myheight / 5, + width: mywidth / 3, + child: Image(image: AssetImage('assets/logos/uae_stat.png'))), body: EconomyStats(), ); } diff --git a/lib/presentation/routes/drawer_routes/custom_drawer_routes.dart b/lib/presentation/routes/drawer_routes/custom_drawer_routes.dart index de8715ed..5b2a903e 100644 --- a/lib/presentation/routes/drawer_routes/custom_drawer_routes.dart +++ b/lib/presentation/routes/drawer_routes/custom_drawer_routes.dart @@ -1,20 +1,215 @@ +// import 'package:flutter/material.dart'; +// import 'package:go_router/go_router.dart'; +// +// class BaseScaffold extends StatelessWidget { +// final Widget body; +// final Widget title; +// final Widget? appbarActions; +// final List? actions; +// final Color? appbarColor,mytitleColor; +// +// const BaseScaffold({ +// Key? key, +// required this.body, +// required this.title, +// this.actions, +// this.appbarColor, +// this.mytitleColor, +// this.appbarActions +// }) : super(key: key); +// // final Widget body; +// // +// // const BaseScaffold({required this.body}); +// +// @override +// Widget build(BuildContext context) { +// // Get the current route to highlight the active item +// String currentRoute = GoRouterState.of(context).matchedLocation; +// double myheight = MediaQuery.of(context).size.height; +// double mywidth = MediaQuery.of(context).size.width; +// return Scaffold( +// appBar: AppBar(title: title,backgroundColor: appbarColor, actions: [ +// IconButton(onPressed: () {}, icon: Icon(Icons.toggle_off_outlined)), +// ], +// leading: appbarActions, +// +// ), +// +// drawer: Drawer( +// child: ListView( +// children: [ +// DrawerHeader( +// //decoration: BoxDecoration(color: Colors.blue), +// child: Column( +// crossAxisAlignment: CrossAxisAlignment.stretch, +// children: [ +// Row( +// children: [ +// SizedBox( +// width: mywidth / 8, +// child: Image( +// image: AssetImage('assets/logos/fcsc.png'))), +// ], +// ), +// Divider(), +// InkWell( +// onTap: () => context.go('/editProfile'), +// child: Row( +// children: [ +// SizedBox( +// width: mywidth / 8, +// child: Image( +// image: AssetImage( +// 'assets/edit_profile/profile.png'))), +// SizedBox( +// width: mywidth / 20, +// ), +// Column( +// crossAxisAlignment: CrossAxisAlignment.start, +// children: [ +// Text('Mohammad'), +// Text('Mohammad@fcsc.com') +// ], +// ) +// ], +// ), +// ) +// ], +// ), +// ), +// ListTile( +// leading: SizedBox( +// height: myheight / 15, +// width: mywidth / 15, +// child: Image( +// image: AssetImage('assets/icons/drawer/message.png'))), +// title: Text('Feedback'), +// onTap: () => context.go('/feedback'), +// ), +// ListTile( +// leading: SizedBox( +// height: myheight / 15, +// width: mywidth / 15, +// child: Image( +// image: AssetImage('assets/icons/drawer/manageuser.png'))), +// title: Text('Manage User'), +// onTap: () => context.go('/manageuser'), +// ), +// +// ListTile( +// leading: SizedBox( +// height: myheight / 15, +// width: mywidth / 15, +// child: Image( +// image: AssetImage('assets/icons/drawer/book.png'))), +// title: Text('User Guide'), +// onTap: () => context.go('/user-guide'), +// ), +// ], +// ), +// ), +// bottomNavigationBar: BottomNavigationBar( +// currentIndex: _getSelectedIndex(currentRoute), +// onTap: (index) => _onItemTapped(context, index), +// type: BottomNavigationBarType.fixed, +// items: [ +// BottomNavigationBarItem( +// icon: SizedBox( +// height: myheight / 15, +// width: mywidth / 15, +// child: Image( +// image: AssetImage('assets/icons/bottom_bar/home.png'))), +// label: 'Home', +// ), +// BottomNavigationBarItem( +// icon: SizedBox( +// height: myheight / 15, +// width: mywidth / 15, +// child: Image( +// image: AssetImage('assets/icons/bottom_bar/uae_map.png'))), +// label: 'UAE Numbers', +// ), +// BottomNavigationBarItem( +// icon: SizedBox( +// height: myheight / 15, +// width: mywidth / 15, +// child: Image( +// image: +// AssetImage('assets/icons/bottom_bar/ranking.png'))), +// label: 'Competitiveness'), +// BottomNavigationBarItem( +// icon: SizedBox( +// height: myheight / 15, +// width: mywidth / 15, +// child: Image( +// image: AssetImage('assets/icons/bottom_bar/globe.png'))), +// label: 'Country Profile'), +// ], +// selectedItemColor: Colors.black, +// unselectedItemColor: Colors.grey, +// showUnselectedLabels: true, +// ), +// body: body, +// ); +// } +// +// //Map the current route to the selected index +// int _getSelectedIndex(String route) { +// switch (route) { +// case '/': +// return 0; +// case '/uaenumbers': +// return 1; +// case '/competitiveness': +// return 2; +// case '/countryprofile': +// return 3; +// default: +// return 0; +// } +// } +// +// //Handle navigation when an item is tapped +// void _onItemTapped(BuildContext context, int index) { +// switch (index) { +// case 0: +// context.go('/'); +// break; +// case 1: +// context.go('/uaenumbers'); +// break; +// case 2: +// context.go('/competitiveness'); +// break; +// case 3: +// context.go('/countryprofile'); +// break; +// } +// } +// } + + + import 'package:flutter/material.dart'; import 'package:go_router/go_router.dart'; class BaseScaffold extends StatelessWidget { final Widget body; final Widget title; + final bool? mycenterTitle; + final bool showBackButton; final List? actions; + final Color? appbarColor, mytitleColor; const BaseScaffold({ Key? key, required this.body, required this.title, this.actions, + this.appbarColor, + this.mytitleColor, + this.showBackButton = false, this.mycenterTitle = false, // Default is to show the drawer icon }) : super(key: key); - // final Widget body; - // - // const BaseScaffold({required this.body}); @override Widget build(BuildContext context) { @@ -23,76 +218,105 @@ class BaseScaffold extends StatelessWidget { double myheight = MediaQuery.of(context).size.height; double mywidth = MediaQuery.of(context).size.width; return Scaffold( - appBar: AppBar(title: title, actions: [ - IconButton(onPressed: () {}, icon: Icon(Icons.toggle_off_outlined)), - ]), + appBar: AppBar( + centerTitle: mycenterTitle, + title: title, + backgroundColor: appbarColor, + leading: + + Stack( + children: [ + + // Show the back button if showBackButton is true, otherwise show the drawer menu + if (showBackButton) + Positioned( + left: 20, + child: IconButton( + color: Colors.white, + icon: Icon(Icons.arrow_back_ios_new), + onPressed: () { + Navigator.of(context).pop(); + }, + ), + ), + // Show the drawer icon in all cases + Positioned( + right: 10, + child: Builder( + builder: (BuildContext context) { + return IconButton( + color: showBackButton ? Colors.white : Colors.black, + icon: Icon(Icons.menu), + onPressed: () { + // Open the drawer using the Scaffold context + Scaffold.of(context).openDrawer(); + }, + ); + }, + ), + ), + ], + ), + + actions: actions, + ), drawer: Drawer( child: ListView( children: [ DrawerHeader( - //decoration: BoxDecoration(color: Colors.blue), + child: Container( child: Column( - crossAxisAlignment: CrossAxisAlignment.stretch, + crossAxisAlignment: CrossAxisAlignment.start, children: [ - Row( - children: [ - SizedBox( - width: mywidth / 8, - child: Image( - image: AssetImage('assets/logos/fcsc.png'))), - ], - ), + SizedBox( + width: mywidth/5, + height: myheight/15, + child: Image.asset('assets/logos/fcsc.png')), Divider(), - InkWell( - onTap: () => context.go('/editProfile'), + SizedBox( + height: myheight/15, child: Row( + mainAxisAlignment: MainAxisAlignment.start, + mainAxisSize: MainAxisSize.min, // Ensures the row only takes up as much space as its children need children: [ - SizedBox( - width: mywidth / 8, - child: Image( - image: AssetImage( - 'assets/edit_profile/profile.png'))), - SizedBox( - width: mywidth / 20, + // The profile image with fixed size + Image.asset( + 'assets/edit_profile/profile.png', + height: myheight / 10, // This ensures the image fits within the container's height + width: myheight / 10, // You can adjust the size as needed + ), + + // Wrapping the Column in Flexible to ensure no overflow + Flexible( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text('Mohammad'), + Text('Mohammad@fcsc.com'), + ], + ), ), - Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text('Mohammad'), - Text('Mohammad@fcsc.com') - ], - ) ], ), - ) + ), ], - ), + + ),), + ), + SizedBox(height: myheight/60,), ListTile( - leading: SizedBox( - height: myheight / 15, - width: mywidth / 15, - child: Image( - image: AssetImage('assets/icons/drawer/message.png'))), + leading: Icon(Icons.feedback), title: Text('Feedback'), onTap: () => context.go('/feedback'), ), ListTile( - leading: SizedBox( - height: myheight / 15, - width: mywidth / 15, - child: Image( - image: AssetImage('assets/icons/drawer/manageuser.png'))), + leading: Icon(Icons.people), title: Text('Manage User'), onTap: () => context.go('/manageuser'), ), - ListTile( - leading: SizedBox( - height: myheight / 15, - width: mywidth / 15, - child: Image( - image: AssetImage('assets/icons/drawer/book.png'))), + leading: Icon(Icons.book), title: Text('User Guide'), onTap: () => context.go('/user-guide'), ), @@ -126,7 +350,7 @@ class BaseScaffold extends StatelessWidget { width: mywidth / 15, child: Image( image: - AssetImage('assets/icons/bottom_bar/ranking.png'))), + AssetImage('assets/icons/bottom_bar/ranking.png'))), label: 'Competitiveness'), BottomNavigationBarItem( icon: SizedBox( @@ -143,7 +367,6 @@ class BaseScaffold extends StatelessWidget { body: body, ); } - //Map the current route to the selected index int _getSelectedIndex(String route) { switch (route) { @@ -178,3 +401,5 @@ class BaseScaffold extends StatelessWidget { } } } + + diff --git a/pubspec.lock b/pubspec.lock index cc69ece0..566653a8 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -385,10 +385,10 @@ packages: dependency: "direct main" description: name: fl_chart - sha256: "74959b99b92b9eebeed1a4049426fd67c4abc3c5a0f4d12e2877097d6a11ae08" + sha256: "10ddaf334fe84d59333a12d153043e366f243e0bdfff2df0313e1e249f5bf926" url: "https://pub.dev" source: hosted - version: "0.69.2" + version: "0.70.1" flutter: dependency: "direct main" description: flutter diff --git a/pubspec.yaml b/pubspec.yaml index a223630d..ab6ae569 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -20,7 +20,7 @@ dependencies: injectable: ^2.3.2 riverpod_annotation: ^2.3.3 cupertino_icons: ^1.0.6 - fl_chart: ^0.69.0 + fl_chart: ^0.70.1 marquee: ^2.2.3 # dynamic_layouts: # git: