From 32991063a7ed8ae038fa393328840fb5d08ed978 Mon Sep 17 00:00:00 2001 From: Kalonkarthik Date: Fri, 27 Dec 2024 10:44:02 +0530 Subject: [PATCH 1/5] User Guide added --- lib/config/my_router.dart | 50 +- .../routes/auth_routes/login_route.dart | 472 +++++----- .../Drawer Items/user_guide/custom_text.dart | 65 ++ .../Drawer Items/user_guide/faq_page.dart | 131 +++ .../Drawer Items/user_guide/features.dart | 872 ++++++++++++------ .../user_guide/getting_started.dart | 156 ++++ .../Drawer Items/user_guide/user_guide.dart | 10 +- .../drawer_routes/custom_drawer_routes.dart | 43 +- 8 files changed, 1242 insertions(+), 557 deletions(-) create mode 100644 lib/presentation/routes/drawer_routes/Drawer Items/user_guide/custom_text.dart create mode 100644 lib/presentation/routes/drawer_routes/Drawer Items/user_guide/faq_page.dart create mode 100644 lib/presentation/routes/drawer_routes/Drawer Items/user_guide/getting_started.dart diff --git a/lib/config/my_router.dart b/lib/config/my_router.dart index b8d290e6..188460de 100644 --- a/lib/config/my_router.dart +++ b/lib/config/my_router.dart @@ -294,7 +294,7 @@ import 'package:flutter/material.dart'; import 'package:go_router/go_router.dart'; -import 'package:uae_stat/presentation/Screens/auth_verification/registration.dart'; +import 'package:uae_stat/presentation/routes/drawer_routes/Drawer%20Items/user_guide/faq_page.dart'; import 'package:uae_stat/presentation/routes/drawer_routes/custom_drawer_routes.dart'; import '../domain/use_cases/preferences_use_case.dart'; @@ -305,10 +305,10 @@ import '../presentation/Screens/auth_verification/otp_verification.dart'; import '../presentation/Screens/profilepage.dart'; import '../presentation/routes/auth_routes/login_route.dart'; import '../presentation/routes/bottom_bar_routes/tab_routes/home_route.dart'; -import '../presentation/routes/drawer_routes/Drawer Items/edit_profile.dart'; import '../presentation/routes/drawer_routes/Drawer Items/feedback.dart'; -import '../presentation/routes/drawer_routes/Drawer Items/user_guide/features.dart'; -import '../presentation/routes/drawer_routes/Drawer Items/user_guide/user_guide.dart'; +import 'package:uae_stat/presentation/routes/drawer_routes/Drawer%20Items/user_guide/features.dart'; +import 'package:uae_stat/presentation/routes/drawer_routes/Drawer%20Items/user_guide/getting_started.dart'; +import 'package:uae_stat/presentation/routes/drawer_routes/Drawer%20Items/user_guide/user_guide.dart'; import '../presentation/routes/drawer_routes/Drawer Items/manage_users.dart'; final GoRouter router = GoRouter( @@ -316,16 +316,12 @@ final GoRouter router = GoRouter( GoRoute( path: '/', //builder: (context, state) => LoginRoute(), - builder: (context, state) => LoginRoute(), + builder: (context, state) => MyHomePage(), ), GoRoute( path: '/myhomepage', builder: (context, state) => MyHomePage(), ), - GoRoute( - path: '/register', - builder: (context, state) => RegisterScreen(), - ), GoRoute( path: '/mailverification', builder: (context, state) => EmailVerificationScreen( @@ -337,11 +333,10 @@ final GoRouter router = GoRouter( ), ), GoRoute( - path: '/changepassword/:userId', - builder: (context, state) { - final userId = state.pathParameters['userId']!; - return Changepassword(userId: userId); - }, + path: '/changepassword', + builder: (context, state) => Changepassword( + userId: '', + ), ), GoRoute( path: '/createNewPw/:userId/:email', @@ -364,21 +359,27 @@ final GoRouter router = GoRouter( path: '/feedback', builder: (context, state) => FeedbackForm(), ), - //Sub route GoRoute( - path: '/profile/:userId', - builder: (context, state) { - final userId = state.pathParameters['userId']!; - return ProfileScreen(userId: userId); - }, + path: '/profile', + builder: (context, state) => ProfileScreen( + userId: '', + ), ), GoRoute( path: '/user-guide', builder: (context, state) => UserGuide(), routes: [ GoRoute(path: '/features', - name: 'features', - builder: (context, state) => AboutFCSC(), + name: 'features', + builder: (context, state) => UsingFeatures(), + ), + GoRoute(path: '/gettingStarted', + name: 'gettingStarted', + builder: (context, state) => GettingStarted(), + ), + GoRoute(path: '/faq', + name: 'faq', + builder: (context, state) => FAQPage(), ), ], ), @@ -390,13 +391,10 @@ final GoRouter router = GoRouter( // return ManageUserRouter(title: title); // }, // ), - GoRoute( - path: '/editProfile', - builder: (context, state) => EditProfile(), - ), GoRoute( path: '/manageuser', builder: (context, state) => ManageUserRouter(), ), ], ); + diff --git a/lib/presentation/routes/auth_routes/login_route.dart b/lib/presentation/routes/auth_routes/login_route.dart index cbf28f0a..da9c40ba 100644 --- a/lib/presentation/routes/auth_routes/login_route.dart +++ b/lib/presentation/routes/auth_routes/login_route.dart @@ -540,13 +540,13 @@ class _LoginRouteState extends State { ), color: Color(0xFF898C81), fontSize: 18, fontWeight: FontWeight.bold),), - Text("UAE's key official statistics",style: TextStyle( - fontFamily: context.translate( - 'Roboto', - 'NotoKufi', - ), - color: Color(0xFF898C81), - fontSize: 16, fontWeight: FontWeight.bold),), + Text("UAE's key official statistics",style: TextStyle( + fontFamily: context.translate( + 'Roboto', + 'NotoKufi', + ), + color: Color(0xFF898C81), + fontSize: 16, fontWeight: FontWeight.bold),), SizedBox(height: 10), // Display this if registration is pending approval @@ -559,8 +559,8 @@ class _LoginRouteState extends State { prefixIcon: Image.asset("assets/icons/misc/person.png",scale: 2,color: Colors.lightBlueAccent,), border: OutlineInputBorder(borderRadius: BorderRadius.circular(15)), focusedBorder: OutlineInputBorder( - borderRadius: BorderRadius.circular(10), - borderSide: BorderSide(color: Colors.blue.shade900,) + borderRadius: BorderRadius.circular(10), + borderSide: BorderSide(color: Colors.blue.shade900,) ), enabledBorder: OutlineInputBorder( borderRadius: BorderRadius.circular(10), // Keep rounded corners @@ -583,7 +583,7 @@ class _LoginRouteState extends State { // obscureText: _obscurePassword, decoration: InputDecoration( hintText: "Password", - // hintText: _showHints[2] ? 'Enter your password' : null, + // hintText: _showHints[2] ? 'Enter your password' : null, prefixIcon: Image.asset("assets/icons/misc/lock.png",scale: 2,color: Colors.lightBlueAccent,), suffixIcon: IconButton( icon: Icon( @@ -600,8 +600,8 @@ class _LoginRouteState extends State { ), border: OutlineInputBorder(borderRadius: BorderRadius.circular(15)), focusedBorder: OutlineInputBorder( - borderRadius: BorderRadius.circular(10), - borderSide: BorderSide(color: Colors.blue.shade900,), + borderRadius: BorderRadius.circular(10), + borderSide: BorderSide(color: Colors.blue.shade900,), ), enabledBorder: OutlineInputBorder( @@ -620,9 +620,9 @@ class _LoginRouteState extends State { SizedBox(height: 10), Row(mainAxisAlignment: MainAxisAlignment.end, - children: [Text("Forgot Password?", - style: TextStyle(color: Color(0xFF985400),fontWeight: FontWeight.bold - ),)],), + children: [Text("Forgot Password?", + style: TextStyle(color: Color(0xFF985400),fontWeight: FontWeight.bold + ),)],), SizedBox(height: 20), SizedBox( width: screenwidth, @@ -648,7 +648,7 @@ class _LoginRouteState extends State { ), SizedBox(width: 8), Icon(Icons.arrow_forward_ios, - color: Colors.white, + color: Colors.white, size: 10, ), ], @@ -659,22 +659,22 @@ class _LoginRouteState extends State { Row( mainAxisAlignment: MainAxisAlignment.center, children: [ - Text( - "Don't have an account? ", - style: TextStyle( - fontFamily: context.translate( - 'Roboto', - 'NotoKufi', - ), - color: Color(0xFF898C81), - fontSize: 18, fontWeight: FontWeight.bold), - ), - InkWell( - onTap: (){ - context.go('/registration'); - }, - child: Text( - " Register Now", + Text( + "Don't have an account? ", + style: TextStyle( + fontFamily: context.translate( + 'Roboto', + 'NotoKufi', + ), + color: Color(0xFF898C81), + fontSize: 18, fontWeight: FontWeight.bold), + ), + InkWell( + onTap: (){ + context.go('/registration'); + }, + child: Text( + " Register Now", style: TextStyle( fontFamily: context.translate( 'Roboto', @@ -682,9 +682,9 @@ class _LoginRouteState extends State { ), color: Color(0xFF985400), fontSize: 18, fontWeight: FontWeight.bold), + ), ), - ), - ],), + ],), SizedBox( height: screenheight/20, @@ -714,7 +714,7 @@ class _LoginRouteState extends State { ), SizedBox(width: 8), Icon(Icons.arrow_forward_ios, - color: Colors.white,size: 10,), + color: Colors.white,size: 10,), ], ), ), @@ -740,206 +740,206 @@ class _LoginRouteState extends State { ), ), ); -<<<<<<< HEAD -======= - final form = Form( - key: formKey, - child: Column( - children: [ - ThemedFormField( - hintText: context.translate( - 'Email', - 'بريد إلكتروني', - ), - validator: FieldValidator.email(), - imgPath: MiscIconAssetPath.person, - controller: emailCtl, - ), - 15.verticalSpace, - ThemedFormField( - validator: (text) { - if (text!.length < 8) { - return 'The password must be at least 8 characters'; - } - return FieldValidator.password(minLength: 8)(text); - }, - hintText: context.translate( - 'Password', - 'كلمة المرور', - ), - imgPath: MiscIconAssetPath.lock, - controller: pwCtl, - isObscurable: true, - ), - // 6.verticalSpace, - Align( - alignment: AlignmentDirectional.topEnd, - child: forgotPwBtn, - ), - 10.verticalSpace, - loginBtn, - ], - ), - ); - final helloAndPleaseLoginTexts = Column( - children: [ - Text( - context.translate( - 'Hello Again!', - 'مرحبا مجددا!', - ), - style: TextStyle( - fontFamily: context.translate( - 'Roboto', - 'NotoKufi', - ), - fontSize: 40, - fontWeight: FontWeight.w300, - ), - ), - 10.verticalSpace, - Text( - context.translate( - 'Please login to access UAE’s key official statistics', - 'يرجى تسجيل الدخول للوصول إلى الإحصاءات الرسمية الرئيسية لدولة الإمارات العربية المتحدة', - ), - textAlign: TextAlign.center, - style: TextStyle( - fontFamily: context.translate( - 'Roboto', - 'NotoKufi', - ), - fontSize: 18, - color: const Color(0xff898C81), - fontWeight: FontWeight.w700, - ), - ), - ], - ); - final dontHaveAnAccountRegisterBtn = TextButton( - onPressed: () => { - Navigator.push( - context, - MaterialPageRoute(builder: (context) => RegisterScreen()), - ), - }, - child: Text.rich( - textAlign: TextAlign.center, - TextSpan( - style: TextStyle( - fontFamily: context.translate( - 'Roboto', - 'NotoKufi', - ), - fontSize: 18, - fontWeight: FontWeight.bold, - ), - children: [ - TextSpan( - text: context.translate( - 'Don\'t have an account? ', - 'ليس لديك حساب؟', - ), - style: const TextStyle( - color: Color(0xff898C81), - ), - ), - const TextSpan( - text: ' ', - ), - TextSpan( - text: context.translate( - 'Register Now', - 'سجل الان', - ), - style: TextStyle( - color: MyTheme.topicColor(IndicatorTopic.economy).shade600, - ), - ), - ], - ), - ), - ); - final continueAsGuestBtn = SizedBox( - width: double.infinity, - child: ElevatedButton( - onPressed: () => context - .go('/${context.language}/${BottomNavBarItem.home.routePath}'), - style: ButtonStyle( - shape: WidgetStatePropertyAll( - RoundedRectangleBorder( - borderRadius: BorderRadius.circular(10), - ), - ), - padding: const WidgetStatePropertyAll( - EdgeInsets.symmetric(vertical: 10.5), - ), - textStyle: WidgetStatePropertyAll( - TextStyle( - fontFamily: context.translate( - 'Roboto', - 'NotoKufi', - ), - fontSize: 16, - fontWeight: FontWeight.w600, - ), - ), - backgroundColor: WidgetStatePropertyAll( - MyTheme.topicColor(IndicatorTopic.environment), - ), - foregroundColor: const WidgetStatePropertyAll( - Colors.white, - ), - ), - child: Row( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Text( - context.translate( - 'Continue as Guest', - 'استمر كضيف', - ), - ), - 6.horizontalSpace, - const Icon(Icons.chevron_right_outlined), - ], - ), - ), - ); - final fcscBanner = Image.asset( - BannerAssetPath.fcsc, - height: 56, - ); - final screenWidth = MediaQuery.of(context).size.width; - final listViewHorizontalPadding = - screenWidth < 700 ? 30 : 30 + (screenWidth - 700) / 2; - final scaffoldBody = ListView( - padding: EdgeInsets.symmetric( - horizontal: listViewHorizontalPadding.toDouble(), - ), - children: [ - 36.verticalSpace, - const Align( - alignment: AlignmentDirectional.topEnd, - child: LangToggle(), - ), - 16.verticalSpace, - helloAndPleaseLoginTexts, - 42.verticalSpace, - form, - 20.verticalSpace, - dontHaveAnAccountRegisterBtn, - 36.verticalSpace, - continueAsGuestBtn, - 72.verticalSpace, - fcscBanner, - ], - ); - final bgScaffold = Scaffold( - backgroundColor: Colors.white, - body: SafeArea(child: scaffoldBody), - ); - return bgScaffold; ->>>>>>> b0c5ebce3deb7da2aa24b0ea5ffe684df7dfb7bf +// <<<<<<< HEAD +// // ======= +// final form = Form( +// key: formKey, +// child: Column( +// children: [ +// ThemedFormField( +// hintText: context.translate( +// 'Email', +// 'بريد إلكتروني', +// ), +// validator: FieldValidator.email(), +// imgPath: MiscIconAssetPath.person, +// controller: emailCtl, +// ), +// 15.verticalSpace, +// ThemedFormField( +// validator: (text) { +// if (text!.length < 8) { +// return 'The password must be at least 8 characters'; +// } +// return FieldValidator.password(minLength: 8)(text); +// }, +// hintText: context.translate( +// 'Password', +// 'كلمة المرور', +// ), +// imgPath: MiscIconAssetPath.lock, +// controller: pwCtl, +// isObscurable: true, +// ), +// // 6.verticalSpace, +// Align( +// alignment: AlignmentDirectional.topEnd, +// child: forgotPwBtn, +// ), +// 10.verticalSpace, +// loginBtn, +// ], +// ), +// ); +// final helloAndPleaseLoginTexts = Column( +// children: [ +// Text( +// context.translate( +// 'Hello Again!', +// 'مرحبا مجددا!', +// ), +// style: TextStyle( +// fontFamily: context.translate( +// 'Roboto', +// 'NotoKufi', +// ), +// fontSize: 40, +// fontWeight: FontWeight.w300, +// ), +// ), +// 10.verticalSpace, +// Text( +// context.translate( +// 'Please login to access UAE’s key official statistics', +// 'يرجى تسجيل الدخول للوصول إلى الإحصاءات الرسمية الرئيسية لدولة الإمارات العربية المتحدة', +// ), +// textAlign: TextAlign.center, +// style: TextStyle( +// fontFamily: context.translate( +// 'Roboto', +// 'NotoKufi', +// ), +// fontSize: 18, +// color: const Color(0xff898C81), +// fontWeight: FontWeight.w700, +// ), +// ), +// ], +// ); +// final dontHaveAnAccountRegisterBtn = TextButton( +// onPressed: () => { +// Navigator.push( +// context, +// MaterialPageRoute(builder: (context) => RegisterScreen()), +// ), +// }, +// child: Text.rich( +// textAlign: TextAlign.center, +// TextSpan( +// style: TextStyle( +// fontFamily: context.translate( +// 'Roboto', +// 'NotoKufi', +// ), +// fontSize: 18, +// fontWeight: FontWeight.bold, +// ), +// children: [ +// TextSpan( +// text: context.translate( +// 'Don\'t have an account? ', +// 'ليس لديك حساب؟', +// ), +// style: const TextStyle( +// color: Color(0xff898C81), +// ), +// ), +// const TextSpan( +// text: ' ', +// ), +// TextSpan( +// text: context.translate( +// 'Register Now', +// 'سجل الان', +// ), +// style: TextStyle( +// color: MyTheme.topicColor(IndicatorTopic.economy).shade600, +// ), +// ), +// ], +// ), +// ), +// ); +// final continueAsGuestBtn = SizedBox( +// width: double.infinity, +// child: ElevatedButton( +// onPressed: () => context +// .go('/${context.language}/${BottomNavBarItem.home.routePath}'), +// style: ButtonStyle( +// shape: WidgetStatePropertyAll( +// RoundedRectangleBorder( +// borderRadius: BorderRadius.circular(10), +// ), +// ), +// padding: const WidgetStatePropertyAll( +// EdgeInsets.symmetric(vertical: 10.5), +// ), +// textStyle: WidgetStatePropertyAll( +// TextStyle( +// fontFamily: context.translate( +// 'Roboto', +// 'NotoKufi', +// ), +// fontSize: 16, +// fontWeight: FontWeight.w600, +// ), +// ), +// backgroundColor: WidgetStatePropertyAll( +// MyTheme.topicColor(IndicatorTopic.environment), +// ), +// foregroundColor: const WidgetStatePropertyAll( +// Colors.white, +// ), +// ), +// child: Row( +// mainAxisAlignment: MainAxisAlignment.center, +// children: [ +// Text( +// context.translate( +// 'Continue as Guest', +// 'استمر كضيف', +// ), +// ), +// 6.horizontalSpace, +// const Icon(Icons.chevron_right_outlined), +// ], +// ), +// ), +// ); +// final fcscBanner = Image.asset( +// BannerAssetPath.fcsc, +// height: 56, +// ); +// final screenWidth = MediaQuery.of(context).size.width; +// final listViewHorizontalPadding = +// screenWidth < 700 ? 30 : 30 + (screenWidth - 700) / 2; +// final scaffoldBody = ListView( +// padding: EdgeInsets.symmetric( +// horizontal: listViewHorizontalPadding.toDouble(), +// ), +// children: [ +// 36.verticalSpace, +// const Align( +// alignment: AlignmentDirectional.topEnd, +// child: LangToggle(), +// ), +// 16.verticalSpace, +// helloAndPleaseLoginTexts, +// 42.verticalSpace, +// form, +// 20.verticalSpace, +// dontHaveAnAccountRegisterBtn, +// 36.verticalSpace, +// continueAsGuestBtn, +// 72.verticalSpace, +// fcscBanner, +// ], +// ); +// final bgScaffold = Scaffold( +// backgroundColor: Colors.white, +// body: SafeArea(child: scaffoldBody), +// ); +// return bgScaffold; +// >>>>>>> b0c5ebce3deb7da2aa24b0ea5ffe684df7dfb7bf } } 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 new file mode 100644 index 00000000..5abc4efd --- /dev/null +++ b/lib/presentation/routes/drawer_routes/Drawer Items/user_guide/custom_text.dart @@ -0,0 +1,65 @@ +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; + + const CustomContainer({ + super.key, + required this.text, + 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), + }); + + + @override + Widget build(BuildContext context) { + return Padding( + padding: padding, + child: Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + if (isBulletPoint) + Text( + "• ", + + 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, + ), + ), + ), + ], + ), + ); + } +} 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 new file mode 100644 index 00000000..8b6d602a --- /dev/null +++ b/lib/presentation/routes/drawer_routes/Drawer Items/user_guide/faq_page.dart @@ -0,0 +1,131 @@ +import 'package:flutter/material.dart'; + +import '../../custom_drawer_routes.dart'; + +class FAQPage extends StatefulWidget { + const FAQPage({super.key}); + + @override + State createState() => _FAQPageState(); +} + +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, + children: [ + Container( + padding: const EdgeInsets.all(16.0), + width: MediaQuery.of(context).size.width, + // color: Colors.white, // Background color// Optional padding around the text + 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 + ), + ), + ), + Container( + padding: const EdgeInsets.all(0.0), + color: Colors.grey, + child: QuestionAnswerScrollView() + ) + ], + ), + ), + ), + + ); + } + + + +} +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.'}, + ]; + + + @override + Widget build(BuildContext context) { + return SingleChildScrollView( + child: Column( + children: questionsAndAnswers.map((qa) => QuestionAnswerCard(qa: qa)).toList(), + ), + ); + } +} + +class QuestionAnswerCard extends StatefulWidget { + final Map qa; + QuestionAnswerCard({required this.qa}); + + @override + _QuestionAnswerCardState createState() => _QuestionAnswerCardState(); +} + +class _QuestionAnswerCardState extends State { + bool isExpanded = false; + + @override + Widget build(BuildContext context) { + return Card( + color: Colors.white, + elevation: 1, + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.zero, // No rounding, it's a rectangle + ), + margin: EdgeInsets.symmetric(vertical: 0,), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + ListTile( + dense: true, + textColor:Color(0xFF414042), + title: Text( + widget.qa['question']!, + style: TextStyle(fontWeight: FontWeight.w600, fontSize: 15), + ), + trailing: Icon(isExpanded ? Icons.remove : Icons.add), + onTap: () { + setState(() { + isExpanded = !isExpanded; + }); + }, + ), + if (isExpanded) + Padding( + padding: const EdgeInsets.symmetric(horizontal: 16.0), + child: Text( + widget.qa["answer"]!, + style: TextStyle(color: Colors.grey), + ), + ), + ], + ), + ); + } +} \ No newline at end of file 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 a77bd894..f1f511da 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,291 +1,617 @@ import 'package:flutter/material.dart'; -import 'package:hooks_riverpod/hooks_riverpod.dart'; -import 'package:uae_stat/presentation/routes/drawer_routes/Drawer Items/user_guide/textRich.dart'; -import 'package:uae_stat/presentation/components/space.dart'; -import 'package:uae_stat/infrastructure/services/img_asset_paths/banner_asset_path.dart'; + +import 'package:uae_stat/presentation/routes/drawer_routes/Drawer%20Items/user_guide/custom_text.dart'; import 'package:uae_stat/presentation/routes/drawer_routes/custom_drawer_routes.dart'; -class AboutFCSC extends HookConsumerWidget { - const AboutFCSC({super.key}); - - @override - Widget build(BuildContext context, WidgetRef ref) { - final Color tColor=const Color(0xFF265E84); - final fcscBanner = Image.asset( - BannerAssetPath.fcsc, - height: 56, - alignment:Alignment.center, - ); - return BaseScaffold( - title: const Text('Features'), - - body: Scrollbar( - thumbVisibility: true, - thickness: 8, - radius: Radius.circular(10), - interactive: true, - child: SingleChildScrollView( - child: Container( - padding: const EdgeInsets.only(left: 14.0,right: 16.0, bottom: 16.0), - color: const Color(0xFFD9D9D9), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - buildRichText([ - createTextSpan( - 'Using Features\n', - fontSize: 20, - color: tColor, - fontWeight: FontWeight.w600, - height: 2, - ), - createTextSpan( - 'When a user clicks on a category, expand or open a new page it to show a list of sub-categories or articles under that section. e.g., under "Using Features", we should see articles like:\n\n', - fontWeight: FontWeight.w400, - ), - createTextSpan( - '1.How to use the Dashboard.\n2.Managing Notifications.\n3.Customizing Preferences.', - height: 1.7, - ), - - createTextSpan( - '\n\nGetting Started with FCSC App', - fontSize: 17, - color:tColor, - fontWeight: FontWeight.w500, - ), - ]), - QuestionAnswerScrollView(), - - ExpandableRichText( - maxLines: 5, - textSpans: [ - createTextSpan( - 'What to Do if Your Register is Pending Approval?\n', - fontSize: 20, - fontWeight: FontWeight.w500, - color: tColor, - ), - createTextSpan( - fontWeight: FontWeight.w400, - 'When you register for the FCSC App, your account may require approval from an administrator before you can start using the app. Follow this guide to understand the process and how to check your registration status.\n', - ), - createTextSpan( - 'Step 1\n', - fontSize: 17, - fontWeight: FontWeight.w600, - color: tColor, - height: 2, - ), - createTextSpan( - 'Complete Your Registration', - fontWeight: FontWeight.w500, - color:tColor, - spacingBottom: 2, - height: 0.8 - ), - createTextSpan( - - fontWeight: FontWeight.w400, - height: 1.4, - spacingBottom: 2, - '1.After entering your details during the registration process, you will receive a confirmation message indicating that your registration has been submitted.\n' - '2.Your registration will be in a "Pending Approval" state until an administrator reviews and approves your request.', - ), - createTextSpan( - 'Step 2\n', - fontSize: 16, - fontWeight: FontWeight.w600, - color:tColor, - height: 2, - ), - createTextSpan( - 'What Happens During Admin Approval?', - spacingBottom: 2, - height: 0.8, - color: tColor, - ), - createTextSpan('1.The administrator will review your details to ensure they meet the necessary criteria\n2.This process typically takes [X amount of time]. You will be notified via email once your registration is approved.\n3.You may receive an email asking for additional information or clarifications if needed.\n\n', - fontWeight: FontWeight.w400, - ), - createTextSpan( - 'Step 3\n', - fontSize: 17, - fontWeight: FontWeight.w600, - color: tColor, - height: 2, - ), - - createTextSpan( - 'How to Check Your Registration Status?', - spacingBottom: 2, - height: 0.8, - color: tColor, - ), - - createTextSpan('1. While waiting for approval, you can check the status of your registration by following these steps:\n', - fontWeight: FontWeight.w400, - ), - - createTextSpan( - ' • Login to the FCSC App: ', - spacingTop: 1, - height: 0.7, - color: tColor, - ), - createTextSpan( - 'Even while your registration is pending, you can still log in using your email and password.', - fontWeight: FontWeight.w400, - ), - createTextSpan( - ' • View Your Dashboard: ', - spacingTop: 2, - height: 0.5, - color: tColor, - ), createTextSpan( - 'Once logged in, you will see a message on your dashboard indicating that your account is still under review. This message will look like: Your registration is pending admin approval. You will be notified once your account is approved', - fontWeight: FontWeight.w400, - ), createTextSpan( - ' • Notifications: ', - spacingTop: 2, - height: 0.5, - color: tColor, - ), createTextSpan( - 'Keep an eye on your email inbox. You will receive a notification when your account is approved and ready for use.\n\n', - fontWeight: FontWeight.w400, - ), - - createTextSpan( - 'Step 4\n', - fontSize: 16, - fontWeight: FontWeight.w600, - color:tColor, - height: 2, - ), - - createTextSpan( - 'What Happens After Approval?', - spacingBottom: 2, - height: 0.8, - color: tColor, - ), - createTextSpan('1.Once your registration is approved, you will receive an email notification confirming your account activation.\n2. You can then log in and access all the features of the FCSC App without any restrictions.\n\n', - fontWeight: FontWeight.w400, - ), - createTextSpan( - 'Step 5\n', - fontSize: 16, - fontWeight: FontWeight.w600, - color:tColor, - height: 2, - ), - - createTextSpan( - "Still Haven't Heard Back?", - spacingBottom: 2, - height: 0.8, - color: tColor, - ), - createTextSpan( - '1.If you haven’t received approval after the expected time, you can contact FCSC Support by clicking [Support Link] or sending an email to [support@fcsc.gov.ae].\n2. Provide your registration details and ask for an update on your approval status.\n', - fontWeight: FontWeight.w400, - ), - ], - ), - buildRichText([ - createTextSpan( - 'For more information please visit ', - color:tColor, - fontSize: 16, - ), - createTextSpan( - 'www.fcsc.gov.ae ', - color: const Color(0xFF568898), - fontSize: 16, - textDecoration: TextDecoration.underline, - ), - ]), - 10.verticalSpace, - Center( child: fcscBanner,), - 50.verticalSpace, - ], - ), - ), - ), +class UsingFeatures extends StatelessWidget { - ), - ); - } -} + final List> contentList = [ + { + 'text': '1.Comprehensive Statistics', + 'fontSize': 16.0, + 'color': Color(0xFF414042), + "fontWeight": FontWeight.bold, + "isBulletPoint": false, + }, + { + 'text': 'Gain insights into vital statistics across categories like Economy, Environment, Social, and more.Explore detailed data, smart metrics, and interactive graphical representations.', + "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.Personalized Experience:", + "fontSize": 14.0, + "color": Color(0xFF414042), + "fontWeight": FontWeight.bold, + "isBulletPoint": false, + }, -//Question and Answer -class QuestionAnswerScrollView extends StatelessWidget { - QuestionAnswerScrollView({super.key}); + { + "text": "Bookmark important metrics for quick access.", + "fontSize": 14.0, + "height":0.1, + "color": Color(0xFF898C81), + "fontWeight": FontWeight.normal, + "isBulletPoint": true, + }, + { + "text": "Edit your profile to keep your information updated.", + "fontSize": 14.0, + "height":1.0, + "color": Color(0xFF898C81), + "fontWeight": FontWeight.normal, + "isBulletPoint": true, + }, - final List> questionsAndAnswers = [ - {'question': '1. How to Create an Account', 'answer': 'Learn how to register for an account on the FCSC App in a few simple steps.'}, - {'question': '2. Exploring the FCSC Dashboard', 'answer': 'Get a detailed guide on the main sections of the home page, including dashboard features.'}, - {'question': '3. What to Do If Your Registration is Pending Approval', 'answer': 'Understand the approval process and how to check if your registration has been approved by the admin.'}, - {'question':'4. Overview of Key Features in FCSC','answer':'Discover the essential features you can use within the FCSC App to enhance your experience.'} + { + "text": "4.Interactive Graphs and Metrics:", + "fontSize": 14.0, + "color": Color(0xFF414042), + "fontWeight": FontWeight.bold, + "isBulletPoint": false, + }, + + { + "text": "Visualize trends and insights with well-designed, interactive charts and graphs that make data easy to understand.", + "fontSize": 14.0, + "color": Color(0xFF898C81), + "fontWeight": FontWeight.normal, + "isBulletPoint": false, + }, + + { + "text": "5.Log-in Access Mode:", + "fontSize": 14.0, + "color": Color(0xFF414042), + "fontWeight": FontWeight.bold, + "isBulletPoint": false, + }, + + { + "text": "Access advanced features like bookmarks and profile customization.", + "fontSize": 14.0, + "color": Color(0xFF898C81), + "fontWeight": FontWeight.normal, + "isBulletPoint": false, + }, + + { + "text": "6.Dual Language Support:", + "fontSize": 14.0, + "color": Color(0xFF414042), + "fontWeight": FontWeight.bold, + "isBulletPoint": false, + }, + + { + "text": "Toggle between English and Arabic for a seamless bilingual experience.", + "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 SingleChildScrollView( - child: Column( - children: questionsAndAnswers.map((qa) => QuestionAnswerCard(qa: qa)).toList(), - ), - ); - } -} + 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, + // color: Colors.white, + 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'], + ); + }, + ), + ), -class QuestionAnswerCard extends StatefulWidget { - final Map qa; - const QuestionAnswerCard({required this.qa}); - - @override - _QuestionAnswerCardState createState() => _QuestionAnswerCardState(); -} - -class _QuestionAnswerCardState extends State { - bool isExpanded = false; - - @override - Widget build(BuildContext context) { - return Card( - color: Colors.transparent, - elevation: 0, - margin: EdgeInsets.zero, - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - ListTile( - dense: true, - textColor: Color(0xFF265E84), - title: Text( - widget.qa['question']!, - style: TextStyle(fontWeight: FontWeight.w600, fontSize: 15), - ), - trailing: Icon(isExpanded ? Icons.keyboard_arrow_up : Icons.keyboard_arrow_down), - onTap: () { - setState(() { - isExpanded = !isExpanded; - }); - }, - ), - if (isExpanded) - Padding( - padding: EdgeInsets.only(bottom: 2), - child: Text( - widget.qa['answer']!, - style: TextStyle(color: Colors.black54), + ], ), ), - ], - ), + ), ); } -} \ No newline at end of file +} 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 new file mode 100644 index 00000000..86d00ca1 --- /dev/null +++ b/lib/presentation/routes/drawer_routes/Drawer Items/user_guide/getting_started.dart @@ -0,0 +1,156 @@ +import 'package:flutter/material.dart'; + + +import 'package:uae_stat/presentation/routes/drawer_routes/Drawer%20Items/user_guide/custom_text.dart'; +import 'package:uae_stat/presentation/routes/drawer_routes/custom_drawer_routes.dart'; + +import 'package:uae_stat/infrastructure/services/img_asset_paths/banner_asset_path.dart'; +class GettingStarted extends StatelessWidget { + + 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, + ), + ), + + TextSpan( + text: 'www.fcsc.gov.ae', + style: TextStyle( + fontSize: 16.0, + color: Color(0xFF568898), + fontWeight: FontWeight.normal, + decoration: TextDecoration.underline, + decorationColor:Color(0xFF568898), + ), + ), + ], + ), + ), + ), + Container( + color: Color(0xFFD9D9D9), + padding: const EdgeInsets.all(16.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 cd9ed57a..de257834 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 @@ -42,16 +42,16 @@ class _UserGuideState extends State { children: createRows([ // Each pair defines a row of (Color, Text) pairs [ - {'routePath':'features','color': Color(0xFF90B0D5), 'text': 'Getting Started', 'icon': 'START', 'index': '1'}, + {'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': '3'}, - {'routePath':'features','color': Color(0xFF265E84), 'text': 'Troubleshooting', 'icon': Icons.troubleshoot_outlined, 'index': '4'}, + {'routePath':'features','color': Color(0xFF265E84), 'text': 'Contact', 'icon': Icons.local_phone_outlined, 'index': '4'}, ], [ - {'routePath':'features','color': Color(0xFF7296BE), 'text': 'FAQs', 'icon': Icons.question_answer_sharp, 'index': '5'}, - {'routePath':'features','color': Color(0xFF7DAFBC), 'text': 'Advanced Settings', 'icon': Icons.settings_outlined, 'index': '6'}, + {'routePath':'faq','color': Color(0xFF7296BE), 'text': 'FAQs', 'icon': Icons.question_answer_sharp, 'index': '5'}, + // {'routePath':'features','color': Color(0xFF7DAFBC), 'text': 'Advanced Settings', 'icon': Icons.settings_outlined, 'index': '6'}, ], ]), ), @@ -116,7 +116,7 @@ class userGuides extends StatelessWidget { alignment: Alignment.center, child: Stack( children: [Column( - mainAxisAlignment: MainAxisAlignment.center, // Align icon and text in the center + mainAxisAlignment: MainAxisAlignment.center, children: [ // Icon( // size:38, diff --git a/lib/presentation/routes/drawer_routes/custom_drawer_routes.dart b/lib/presentation/routes/drawer_routes/custom_drawer_routes.dart index ba1d5bd7..b0b43163 100644 --- a/lib/presentation/routes/drawer_routes/custom_drawer_routes.dart +++ b/lib/presentation/routes/drawer_routes/custom_drawer_routes.dart @@ -25,7 +25,7 @@ class BaseScaffold extends StatelessWidget { return Scaffold( appBar: AppBar(title: title, actions: [ IconButton(onPressed: () {}, icon: Icon(Icons.toggle_off_outlined)), - ]), + ],), drawer: Drawer( child: ListView( children: [ @@ -37,21 +37,21 @@ class BaseScaffold extends StatelessWidget { Row( children: [ SizedBox( - width: mywidth / 8, - child: Image( - image: AssetImage('assets/logos/fcsc.png'))), + width: mywidth / 8, + child: Image( + image: AssetImage('assets/logos/fcsc.png'),),), ], ), Divider(), InkWell( - onTap: () => context.go('/editProfile'), + onTap: () => context.go('/Profile'), child: Row( children: [ SizedBox( - width: mywidth / 8, - child: Image( - image: AssetImage( - 'assets/edit_profile/profile.png'))), + width: mywidth / 8, + child: Image( + image: AssetImage( + 'assets/edit_profile/profile.png',),),), SizedBox( width: mywidth / 20, ), @@ -59,24 +59,33 @@ class BaseScaffold extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ Text('Mohammad'), - Text('Mohammad@fcsc.com') + Text('Mohammad@fcsc.com'), ], - ) + ), ], ), - ) + ), ], ), ), ListTile( leading: SizedBox( - height: myheight / 15, - width: mywidth / 15, - child: Image( - image: AssetImage('assets/icons/drawer/message.png'))), + 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/book.png'),),), + title: Text('User Guide'), + onTap: () => context.go('/user-guide'), + ), ListTile( leading: SizedBox( height: myheight / 15, @@ -116,7 +125,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( From 08fb48486836af583d4466086136b0bbd91a6424 Mon Sep 17 00:00:00 2001 From: VINISTAN Date: Fri, 27 Dec 2024 13:37:28 +0530 Subject: [PATCH 2/5] homepage router- Guest login --- .../routes/auth_routes/login_route.dart | 5 +- pubspec.lock | 48 +++++++++---------- 2 files changed, 27 insertions(+), 26 deletions(-) diff --git a/lib/presentation/routes/auth_routes/login_route.dart b/lib/presentation/routes/auth_routes/login_route.dart index 41dc0b37..f8c74a5c 100644 --- a/lib/presentation/routes/auth_routes/login_route.dart +++ b/lib/presentation/routes/auth_routes/login_route.dart @@ -457,8 +457,9 @@ class LoginRoute extends HookConsumerWidget { final continueAsGuestBtn = SizedBox( width: double.infinity, child: ElevatedButton( - onPressed: () => context - .go('/${context.language}/${BottomNavBarItem.home.routePath}'), + onPressed: () => + context.go('/myhomepage'), + // context.go('/${context.language}/${BottomNavBarItem.home.routePath}'), style: ButtonStyle( shape: WidgetStatePropertyAll( RoundedRectangleBorder( diff --git a/pubspec.lock b/pubspec.lock index 7d1ab196..1c9d9ebb 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -5,23 +5,23 @@ packages: dependency: transitive description: name: _fe_analyzer_shared - sha256: f256b0c0ba6c7577c15e2e4e114755640a875e885099367bf6e012b19314c834 + sha256: "16e298750b6d0af7ce8a3ba7c18c69c3785d11b15ec83f6dcd0ad2a0009b3cab" url: "https://pub.dev" source: hosted - version: "72.0.0" + version: "76.0.0" _macros: dependency: transitive description: dart source: sdk - version: "0.3.2" + version: "0.3.3" analyzer: dependency: transitive description: name: analyzer - sha256: b652861553cd3990d8ed361f7979dc6d7053a9ac8843fa73820ab68ce5410139 + sha256: "1f14db053a8c23e260789e9b0980fa27f2680dd640932cae5e1137cce0e46e1e" url: "https://pub.dev" source: hosted - version: "6.7.0" + version: "6.11.0" analyzer_plugin: dependency: transitive description: @@ -186,10 +186,10 @@ packages: dependency: transitive description: name: collection - sha256: ee67cb0715911d28db6bf4af1026078bd6f0128b07a5f66fb2ed94ec6783c09a + sha256: a1ace0a119f20aabc852d165077c036cd864315bd99b7eaa10a60100341941bf url: "https://pub.dev" source: hosted - version: "1.18.0" + version: "1.19.0" convert: dependency: transitive description: @@ -266,10 +266,10 @@ packages: dependency: transitive description: name: custom_lint_visitor - sha256: "8aeb3b6ae2bb765e7716b93d1d10e8356d04e0ff6d7592de6ee04e0dd7d6587d" + sha256: bfe9b7a09c4775a587b58d10ebb871d4fe618237639b1e84d5ec62d7dfef25f9 url: "https://pub.dev" source: hosted - version: "1.0.0+6.7.0" + version: "1.0.0+6.11.0" dart_style: dependency: transitive description: @@ -773,18 +773,18 @@ packages: dependency: transitive description: name: leak_tracker - sha256: "3f87a60e8c63aecc975dda1ceedbc8f24de75f09e4856ea27daf8958f2f0ce05" + sha256: "7bb2830ebd849694d1ec25bf1f44582d6ac531a57a365a803a6034ff751d2d06" url: "https://pub.dev" source: hosted - version: "10.0.5" + version: "10.0.7" leak_tracker_flutter_testing: dependency: transitive description: name: leak_tracker_flutter_testing - sha256: "932549fb305594d82d7183ecd9fa93463e9914e1b67cacc34bc40906594a1806" + sha256: "9491a714cca3667b60b5c420da8217e6de0d1ba7a5ec322fab01758f6998f379" url: "https://pub.dev" source: hosted - version: "3.0.5" + version: "3.0.8" leak_tracker_testing: dependency: transitive description: @@ -813,10 +813,10 @@ packages: dependency: transitive description: name: macros - sha256: "0acaed5d6b7eab89f63350bccd82119e6c602df0f391260d0e32b5e23db79536" + sha256: "1d9e801cd66f7ea3663c45fc708450db1fa57f988142c64289142c9b7ee80656" url: "https://pub.dev" source: hosted - version: "0.1.2-main.4" + version: "0.1.3-main.0" mailer: dependency: "direct main" description: @@ -1172,7 +1172,7 @@ packages: dependency: transitive description: flutter source: sdk - version: "0.0.99" + version: "0.0.0" smart_api_client: dependency: "direct main" description: @@ -1216,10 +1216,10 @@ packages: dependency: transitive description: name: stack_trace - sha256: "73713990125a6d93122541237550ee3352a2d84baad52d375a4cad2eb9b7ce0b" + sha256: "9f47fd3630d76be3ab26f0ee06d213679aa425996925ff3feffdec504931c377" url: "https://pub.dev" source: hosted - version: "1.11.1" + version: "1.12.0" state_notifier: dependency: transitive description: @@ -1248,10 +1248,10 @@ packages: dependency: transitive description: name: string_scanner - sha256: "556692adab6cfa87322a115640c11f13cb77b3f076ddcc5d6ae3c20242bedcde" + sha256: "688af5ed3402a4bde5b3a6c15fd768dbf2621a614950b17f04626c431ab3c4c3" url: "https://pub.dev" source: hosted - version: "1.2.0" + version: "1.3.0" syncfusion_flutter_charts: dependency: "direct main" description: @@ -1280,10 +1280,10 @@ packages: dependency: transitive description: name: test_api - sha256: "5b8a98dafc4d5c4c9c72d8b31ab2b23fc13422348d2997120294d3bac86b4ddb" + sha256: "664d3a9a64782fcdeb83ce9c6b39e78fd2971d4e37827b9b06c3aa1edc5e760c" url: "https://pub.dev" source: hosted - version: "0.7.2" + version: "0.7.3" the_validator: dependency: "direct main" description: @@ -1408,10 +1408,10 @@ packages: dependency: transitive description: name: vm_service - sha256: "5c5f338a667b4c644744b661f309fb8080bb94b18a7e91ef1dbd343bed00ed6d" + sha256: f6be3ed8bd01289b34d679c2b62226f63c0e69f9fd2e50a6b3c1c729a961041b url: "https://pub.dev" source: hosted - version: "14.2.5" + version: "14.3.0" watcher: dependency: transitive description: From aef2798e76cd9f92990b698430020b9c2e84f3bb Mon Sep 17 00:00:00 2001 From: VINISTAN Date: Fri, 27 Dec 2024 17:40:03 +0530 Subject: [PATCH 3/5] Routing - Guest --- lib/presentation/routes/auth_routes/login_route.dart | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/presentation/routes/auth_routes/login_route.dart b/lib/presentation/routes/auth_routes/login_route.dart index 41dc0b37..bf929e14 100644 --- a/lib/presentation/routes/auth_routes/login_route.dart +++ b/lib/presentation/routes/auth_routes/login_route.dart @@ -457,8 +457,9 @@ class LoginRoute extends HookConsumerWidget { final continueAsGuestBtn = SizedBox( width: double.infinity, child: ElevatedButton( - onPressed: () => context - .go('/${context.language}/${BottomNavBarItem.home.routePath}'), + onPressed: () => + context.go('/myhomepage'), + //context.go('/${context.language}/${BottomNavBarItem.home.routePath}'), style: ButtonStyle( shape: WidgetStatePropertyAll( RoundedRectangleBorder( From 630b004ed01161545dca59de2e5cee425af1bf11 Mon Sep 17 00:00:00 2001 From: VINISTAN Date: Thu, 2 Jan 2025 19:00:26 +0530 Subject: [PATCH 4/5] UAE Number tab added --- android/gradle.properties | 2 +- .../gradle/wrapper/gradle-wrapper.properties | 2 +- lib/config/my_router.dart | 63 ++- .../competitiveness.dart | 21 + .../country_profile.dart | 272 +++++++++++ .../Bottom Navigation Pages/uae_numbers.dart | 455 ++++++++++++++++++ .../components/constant/constant.dart | 18 + .../drawer_routes/custom_drawer_routes.dart | 12 +- 8 files changed, 813 insertions(+), 32 deletions(-) create mode 100644 lib/presentation/Screens/Bottom Navigation Pages/competitiveness.dart create mode 100644 lib/presentation/Screens/Bottom Navigation Pages/country_profile.dart create mode 100644 lib/presentation/Screens/Bottom Navigation Pages/uae_numbers.dart create mode 100644 lib/presentation/components/constant/constant.dart diff --git a/android/gradle.properties b/android/gradle.properties index 7f5b17ec..303728bd 100644 --- a/android/gradle.properties +++ b/android/gradle.properties @@ -1,4 +1,4 @@ org.gradle.jvmargs=-Xmx4G -XX:+HeapDumpOnOutOfMemoryError android.useAndroidX=true android.enableJetifier=true -org.gradle.java.home=C:\\Program Files\\Eclipse Adoptium\\jdk-17.0.13.11-hotspot +org.gradle.java.home=C:/Program Files/Eclipse Adoptium/jdk-21.0.5.11-hotspot diff --git a/android/gradle/wrapper/gradle-wrapper.properties b/android/gradle/wrapper/gradle-wrapper.properties index e1ca574e..5e6b5427 100644 --- a/android/gradle/wrapper/gradle-wrapper.properties +++ b/android/gradle/wrapper/gradle-wrapper.properties @@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.3-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-all.zip diff --git a/lib/config/my_router.dart b/lib/config/my_router.dart index 062e04af..1e6d9a68 100644 --- a/lib/config/my_router.dart +++ b/lib/config/my_router.dart @@ -294,6 +294,9 @@ 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/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'; @@ -317,8 +320,8 @@ final GoRouter router = GoRouter( routes: [ GoRoute( path: '/', -//builder: (context, state) => LoginRoute(), - builder: (context, state) => LoginRoute(), + //builder: (context, state) => LoginRoute(), + builder: (context, state) => MyHomePage(), ), GoRoute( path: '/myhomepage', @@ -378,31 +381,24 @@ final GoRouter router = GoRouter( path: '/user-guide', builder: (context, state) => UserGuide(), routes: [ - GoRoute(path: '/features', - name: 'features', - builder: (context, state) => UsingFeatures(), + GoRoute( + path: '/features', + name: 'features', + builder: (context, state) => UsingFeatures(), + ), + GoRoute( + path: '/faq', + name: 'faq', + builder: (context, state) => FAQPage(), + ), + GoRoute( + path: '/gettingStarted', + name: 'gettingStarted', + builder: (context, state) => GettingStarted(), ), - -GoRoute(path: '/faq', -name: 'faq', -builder: (context, state) => FAQPage(), -), - - -GoRoute(path: '/gettingStarted', -name: 'gettingStarted', -builder: (context, state) => GettingStarted(), -), ], ), - // GoRoute( - // path: '/manageuser', - // builder: (context, state) { - // // Retrieve the title from extra or query params - // final title = state.extra as String? ?? 'Manage users'; - // return ManageUserRouter(title: title); - // }, - // ), + GoRoute( path: '/editProfile', builder: (context, state) => EditProfile(), @@ -411,5 +407,24 @@ builder: (context, state) => GettingStarted(), path: '/manageuser', builder: (context, state) => ManageUserRouter(), ), + + + + // Bottom Navigation Routes + GoRoute( + path: '/uaenumbers', + builder: (context, state) => UaeNumbers(), + ), + + GoRoute( + path: '/competitiveness', + builder: (context, state) => Competitiveness(), + ), + + GoRoute( + path: '/countryprofile', + builder: (context, state) => CountryProfile(), + ), + ], ); diff --git a/lib/presentation/Screens/Bottom Navigation Pages/competitiveness.dart b/lib/presentation/Screens/Bottom Navigation Pages/competitiveness.dart new file mode 100644 index 00000000..aca6ea73 --- /dev/null +++ b/lib/presentation/Screens/Bottom Navigation Pages/competitiveness.dart @@ -0,0 +1,21 @@ +import 'package:flutter/material.dart'; +import 'package:uae_stat/presentation/routes/drawer_routes/custom_drawer_routes.dart'; + +class Competitiveness extends StatelessWidget { + const Competitiveness({super.key}); + + @override + Widget build(BuildContext context) { + 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: CompetitivenessState(context), + ); + } + Widget CompetitivenessState(BuildContext context) {return Center(child: Text("Competitiveness"));} +} diff --git a/lib/presentation/Screens/Bottom Navigation Pages/country_profile.dart b/lib/presentation/Screens/Bottom Navigation Pages/country_profile.dart new file mode 100644 index 00000000..7967d316 --- /dev/null +++ b/lib/presentation/Screens/Bottom Navigation Pages/country_profile.dart @@ -0,0 +1,272 @@ +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'; + +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) { + double mywidth = MediaQuery.of(context).size.width; + return Padding( + padding: const EdgeInsets.all(16.0), + child: ListView( + children: [ + CustomExpandableTile( + title: 'ECONOMY', + titleBackgroundColor: economyColor, + children: [ + buildCategoryTitle('National Accounts',economyColor), + buildCardRow([ + buildCard(context,'GDP (Constant)', '1.62T', '2022 (AED)',economyColor,economyColor,mywidth/2.5), + buildCard(context,'FDI', '1.45T', '2021 (AED)',economyColor,economyColor,mywidth/2.5), + ]), + buildCategoryTitle('International Trade',economyColor), + buildCardRow([ + buildCard(context,'Total Trade', '669.9B', 'Jan - Mar 2024 (AED)',economyColor,economyColor,mywidth/2.5), + buildCard(context,'Total Import', '686B', 'Jan - Mar 2024 (AED)',economyColor,economyColor,mywidth/2.5), + ]), + buildCardRow([ + buildCard(context,'Total Export', '669.9B', 'Jan - Mar 2024 (AED)',economyColor,economyColor,mywidth/2.5), + buildCard(context,'Total ReExport', '686B', 'Jan - Mar 2024 (AED)',economyColor,economyColor,mywidth/2.5), + ]), + buildCategoryTitle('Prices',economyColor), + buildCardRow([ + buildCard(context,'Total Export', '669.9B', 'Jan - Mar 2024 (AED)',economyColor,economyColor,mywidth/1.2), + ]), + ], + ), + CustomExpandableTile( + title: 'SOCIAL', + titleBackgroundColor: socialColor, + children: [ + buildCategoryTitle('Population',socialColor), + buildCardRow([ + InkWell(onTap: (){},child: buildCard(context,'Population', '9.89M', '2024',socialColor,socialColor,mywidth/2.5)), + buildCard(context,'Population Growth', '2.1%', '2023',socialColor,socialColor,mywidth/2.5), + ]), + 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), + ]), + buildCategoryTitle('Education',socialColor), + buildCardRow([ + buildCard(context,'General Education', '96%', '2023',socialColor,socialColor,mywidth/2.5), + buildCard(context,'Higher Education', '1.2K', '2024',socialColor,socialColor,mywidth/2.5), + ]), + buildCategoryTitle('Health',socialColor), + buildCardRow([ + buildCard(context,'Hospital', '96%', '2023',socialColor,socialColor,mywidth/2.5), + buildCard(context,'Clinic and Centres', '1.2K', '2024',socialColor,socialColor,mywidth/2.5), + ]), + ], + ), + CustomExpandableTile( + title: 'ENVIRONMENT', + titleBackgroundColor: environmentColor, + children: [ + buildCategoryTitle('Agriculture',environmentColor), + buildCardRow([ + buildCard(context,'Crops - Total Area', '27°C', 'Average 2024',environmentColor,environmentColor,mywidth/2.5), + buildCard(context,'Livestock', '120mm', '2024',environmentColor,environmentColor,mywidth/2.5), + ]), + buildCategoryTitle('Environment',environmentColor), + buildCardRow([ + buildCard(context,'Climate - Max Temp', '15%', '2024',environmentColor,environmentColor,mywidth/2.5), + buildCard(context,'Climate - Min Temp', '30%', '2023',environmentColor,environmentColor,mywidth/2.5), + ]), + buildCardRow([ + buildCard(context,'Desalinated Produced Water', '15%', '2024',environmentColor,environmentColor,mywidth/2.5), + buildCard(context,'Area of Natural Reserves', '30%', '2023',environmentColor,environmentColor,mywidth/2.5), + ]), + buildCategoryTitle('Energy',environmentColor), + buildCardRow([ + buildCard(context,'Electricity Production', '15%', '2024',environmentColor,environmentColor,mywidth/2.5), + buildCard(context,'Renewable Energy Production', '30%', '2023',environmentColor,environmentColor,mywidth/2.5), + ]), + ], + ), + ], + ), + ); + } + + Widget buildCategoryTitle(String title,Color color) { + return Padding( + padding: const EdgeInsets.symmetric(vertical: 8.0), + child: Text( + title, + style: TextStyle( + fontSize: 16, + fontWeight: FontWeight.bold, + color: color, + ), + ), + ); + } + + Widget buildCardRow(List cards) { + return SingleChildScrollView( + scrollDirection: Axis.horizontal, + child: Row( + children: cards.map((card) { + return Padding( + padding: const EdgeInsets.symmetric(horizontal: 8.0), + child: card, + ); + }).toList(), + ), + ); + } + + Widget buildCard(BuildContext context,String title, String value, String subtitle,Color bordercolor,boldColor,double mywidth) { + // double myheight = MediaQuery.of(context).size.height; + // double mywidth = MediaQuery.of(context).size.width; + return Card( + elevation: 2, + child: Container( + width: mywidth, + decoration: BoxDecoration( + color: Colors.white, // Background color + border: Border.all( + color: bordercolor, // Border color + width: 2, // Border width + ), + borderRadius: BorderRadius.circular(12), // Optional: Rounded corners + ), + padding: const EdgeInsets.all(16.0), + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Text( + title, + textAlign: TextAlign.center, + style: robotoRegular11, + ), + SizedBox(height: 8), + Text( + subtitle, + textAlign: TextAlign.center, + style: subtitleStyle + ), + SizedBox(height: 8), + Text( + value, + style: TextStyle( + fontSize: 26, + color: boldColor, + fontWeight: FontWeight.bold, + ), + ), + ], + ), + ), + ); + } +} + +class CustomExpandableTile extends StatefulWidget { + final String title; + final Color titleBackgroundColor; + final List children; + + const CustomExpandableTile({ + required this.title, + required this.titleBackgroundColor, + required this.children, + }); + + @override + _CustomExpandableTileState createState() => _CustomExpandableTileState(); +} + +class _CustomExpandableTileState extends State { + bool isExpanded = false; + + @override + Widget build(BuildContext context) { + double myheight = MediaQuery.of(context).size.height; + return Card( + elevation: 4, + child: Column( + children: [ + GestureDetector( + onTap: () { + setState(() { + isExpanded = !isExpanded; + }); + }, + child: Container( + decoration: BoxDecoration( + color: widget.titleBackgroundColor, + borderRadius: BorderRadius.all(Radius.circular(12)) + ), + padding: const EdgeInsets.all(12), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Text( + widget.title, + style: TextStyle( + color: Colors.white, + fontWeight: FontWeight.bold, + fontSize: 18, + ), + ), + Icon( + isExpanded + ? Icons.keyboard_arrow_up + : Icons.keyboard_arrow_down, + color: Colors.white, + ), + ], + ), + ), + ), + ClipRRect( + child: AnimatedContainer( + 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)) + ), + + padding: const EdgeInsets.all(10), + child: Column( + children: widget.children, + ), + ), + ) + : null, + ), + ), + ], + ), + ); + } +} diff --git a/lib/presentation/Screens/Bottom Navigation Pages/uae_numbers.dart b/lib/presentation/Screens/Bottom Navigation Pages/uae_numbers.dart new file mode 100644 index 00000000..d7b77af8 --- /dev/null +++ b/lib/presentation/Screens/Bottom Navigation Pages/uae_numbers.dart @@ -0,0 +1,455 @@ +import 'package:flutter/material.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'; + +class UaeNumbers extends StatelessWidget { + const UaeNumbers({super.key}); + + @override + Widget build(BuildContext context) { + double myheight = MediaQuery.of(context).size.height; + double mywidth = MediaQuery.of(context).size.width; + return BaseScaffold( + title: Text("UAE Numbers"), + body: + //EconomicDashboard(), + //EconomyExpandTile() + CustomExpandableTile() + ); + } +} + +// class EconomicDashboard extends StatelessWidget { +// const EconomicDashboard({Key? key}) : super(key: key); +// +// @override +// Widget build(BuildContext context) { +// +// return SingleChildScrollView( +// child: Padding( +// padding: const EdgeInsets.all(16.0), +// child: Column( +// children: [ +// // Search Bar +// Container( +// padding: const EdgeInsets.symmetric(horizontal: 16), +// decoration: BoxDecoration( +// color: Colors.white, +// borderRadius: BorderRadius.circular(20), +// border: Border.all( +// color: Color(0xFFAA8E83), // Border color +// width: 3, // Border width +// ), +// +// ), +// child: const Row( +// children: [ +// Icon(Icons.search, color: Colors.grey), +// SizedBox(width: 8), +// Expanded( +// child: TextField( +// decoration: InputDecoration( +// hintText: 'Search', +// border: InputBorder.none, +// hintStyle: TextStyle(color: Colors.grey), +// ), +// ), +// ), +// ], +// ), +// ), +// +// const SizedBox(height: 16), +// +// // Economy Section +// _buildSection( +// 'ECONOMY', +// [ +// _buildRow( +// [ +// _buildCard('GDP (Growth)', '1.62T', Colors.blue[100]!), +// _buildCard('CPI', '1.45T', Colors.blue[100]!), +// ], +// ), +// const SizedBox(height: 8), +// const Text( +// 'International Trade', +// style: TextStyle(fontWeight: FontWeight.bold), +// ), +// _buildRow( +// [ +// _buildCard('Total Trade\nLast Year (2023) YOY', '669.9B', Colors.white), +// _buildCard('Total Import\nLast Year (2023) YOY', '686B', Colors.white), +// ], +// ), +// _buildRow( +// [ +// _buildCard('Total Export', '122.9B', Colors.white), +// _buildCard('Total Import', '161B', Colors.white), +// ], +// ), +// const SizedBox(height: 8), +// const Text( +// 'Prices', +// style: TextStyle(fontWeight: FontWeight.bold), +// ), +// _buildCard('Inflation Rate', '215.4B', Colors.white, fullWidth: true,), +// ],context +// ), +// +// const SizedBox(height: 16), +// +// // Social Section +// _buildSection('SOCIAL', [ +// _buildCard('Total Export', '122.9B', Colors.white), +// _buildCard('Total Import', '161B', Colors.white), +// ],context), +// +// const SizedBox(height: 16), +// +// // Environment Section +// _buildSection('ENVIRONMENT', [ +// _buildCard('Total Export', '122.9B', Colors.white), +// _buildCard('Total Import', '161B', Colors.white), +// ],context) +// ], +// ), +// ), +// ); +// } +// +// Widget _buildSection(String title, List children,BuildContext context) { +// double myheight = MediaQuery.of(context).size.height; +// double mywidth = MediaQuery.of(context).size.width; +// return Container( +// decoration: BoxDecoration( +// color: title == 'ECONOMY' ? Color(0xFF7DAFBC) : Color(0xFFAA8E83), +// borderRadius: BorderRadius.circular(16), +// ), +// child: +// ExpansionTile( +// iconColor: Colors.white, +// collapsedIconColor: Colors.white, +// title: Text( +// title, +// style: const TextStyle(fontWeight: FontWeight.bold,color: Colors.white), +// ), +// children: children, +// ), +// ); +// } +// +// Widget _buildRow(List children) { +// return Padding( +// padding: const EdgeInsets.symmetric(vertical: 4), +// child: Row( +// children: children.map((child) => Expanded(child: child)).toList(), +// ), +// ); +// } +// +// Widget _buildCard(String title, String value, Color color, {bool fullWidth = false}) { +// return Container( +// margin: EdgeInsets.symmetric(horizontal: fullWidth ? 0 : 4), +// padding: const EdgeInsets.all(12), +// decoration: BoxDecoration( +// color: color, +// borderRadius: BorderRadius.circular(8), +// border: Border.all(color: Colors.grey[300]!), +// ), +// child: Column( +// crossAxisAlignment: CrossAxisAlignment.start, +// children: [ +// Text( +// title, +// style: TextStyle( +// fontSize: 12, +// color: Colors.grey[600], +// ), +// ), +// const SizedBox(height: 4), +// Text( +// value, +// style: const TextStyle( +// fontSize: 16, +// fontWeight: FontWeight.bold, +// ), +// ), +// ], +// ), +// ); +// } +// } + + + +// class EconomyExpandTile extends StatefulWidget { +// @override +// _EconomyExpandTileState createState() => _EconomyExpandTileState(); +// } +// +// class _EconomyExpandTileState extends State { +// bool isExpanded = false; +// +// @override +// Widget build(BuildContext context) { +// return Card( +// elevation: 4, +// child: ExpansionTile( +// onExpansionChanged: (value) { +// setState(() { +// isExpanded = value; +// }); +// }, +// title: Container( +// color: Colors.blue, +// padding: const EdgeInsets.all(16), +// child: Text( +// 'ECONOMY', +// style: TextStyle( +// color: Colors.white, +// fontWeight: FontWeight.bold, +// fontSize: 18, +// ), +// ), +// ), +// backgroundColor: Colors.white, +// collapsedBackgroundColor: Colors.blue, +// children: [ +// Padding( +// padding: const EdgeInsets.all(16.0), +// child: Column( +// children: [ +// buildCategoryTitle('National Accounts'), +// buildCardRow([ +// buildCard('GDP (Constant)', '1.62T', '2022 (AED)'), +// buildCard('FDI', '1.45T', '2021 (AED)'), +// ]), +// buildCategoryTitle('International Trade'), +// buildCardRow([ +// buildCard('Total Trade', '669.9B', 'Jan - Mar 2024 (AED)'), +// buildCard('Total Import', '686B', 'Jan - Mar 2024 (AED)'), +// ]), +// buildCardRow([ +// buildCard('Total Export', '122.9B', 'Jan - Mar 2024 (AED)'), +// buildCard('Total ReExport', '161B', 'Jan - Mar 2024 (AED)'), +// ]), +// buildCategoryTitle('Prices'), +// buildCardRow([ +// buildCard('Inflation Rate', '215.4B', '2023'), +// ]), +// ], +// ), +// ), +// ], +// ), +// ); +// } +// +// Widget buildCategoryTitle(String title) { +// return Padding( +// padding: const EdgeInsets.symmetric(vertical: 8.0), +// child: Text( +// title, +// style: TextStyle( +// fontSize: 16, +// fontWeight: FontWeight.bold, +// color: Colors.black54, +// ), +// ), +// ); +// } +// +// Widget buildCardRow(List cards) { +// return SingleChildScrollView( +// scrollDirection: Axis.horizontal, +// child: Row( +// children: cards.map((card) { +// return Padding( +// padding: const EdgeInsets.symmetric(horizontal: 8.0), +// child: card, +// ); +// }).toList(), +// ), +// ); +// } +// +// Widget buildCard(String title, String value, String subtitle) { +// return Card( +// elevation: 2, +// child: Container( +// width: 150, // Fixed width for cards to make scrolling smoother +// padding: const EdgeInsets.all(16.0), +// child: Column( +// mainAxisAlignment: MainAxisAlignment.center, +// children: [ +// Text( +// title, +// textAlign: TextAlign.center, +// style: TextStyle(fontWeight: FontWeight.bold), +// ), +// SizedBox(height: 8), +// Text( +// value, +// style: TextStyle( +// fontSize: 18, +// color: Colors.blue, +// fontWeight: FontWeight.bold, +// ), +// ), +// SizedBox(height: 8), +// Text( +// subtitle, +// textAlign: TextAlign.center, +// style: TextStyle(color: Colors.black54, fontSize: 12), +// ), +// ], +// ), +// ), +// ); +// } +// } + +class CustomExpandableTile extends StatefulWidget { + @override + _CustomExpandableTileState createState() => _CustomExpandableTileState(); +} + +class _CustomExpandableTileState extends State { + bool isExpanded = false; + + @override + Widget build(BuildContext context) { + return Card( + elevation: 4, + child: SingleChildScrollView( + child: Column( + children: [ + // The tile header + GestureDetector( + onTap: () { + setState(() { + isExpanded = !isExpanded; + }); + }, + child: Container( + color: Colors.blue, + padding: const EdgeInsets.all(16), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Text( + 'ECONOMY', + style: TextStyle( + color: Colors.white, + fontWeight: FontWeight.bold, + fontSize: 18, + ), + ), + Icon( + isExpanded ? Icons.keyboard_arrow_up : Icons.keyboard_arrow_down, + color: Colors.white, + ), + ], + ), + ), + ), + // Animated container for expansion + AnimatedContainer( + duration: Duration(milliseconds: 300), + curve: Curves.easeInOut, + height: isExpanded ? null : 0, + child: isExpanded + ? Container( + color: Colors.white, + padding: const EdgeInsets.all(16), + child: Column( + children: [ + buildCategoryTitle('National Accounts'), + buildCardRow([ + buildCard('GDP (Constant)', '1.62T', '2022 (AED)'), + buildCard('FDI', '1.45T', '2021 (AED)'), + ]), + buildCategoryTitle('International Trade'), + buildCardRow([ + buildCard('Total Trade', '669.9B', 'Jan - Mar 2024 (AED)'), + buildCard('Total Import', '686B', 'Jan - Mar 2024 (AED)'), + ]), + buildCategoryTitle('Prices'), + buildCardRow([ + buildCard('Inflation Rate', '215.4B', '2023'), + ]), + ], + ), + ) + : Container(), + ), + ], + ), + ), + ); + } + + Widget buildCategoryTitle(String title) { + return Padding( + padding: const EdgeInsets.symmetric(vertical: 8.0), + child: Text( + title, + style: TextStyle( + fontSize: 16, + fontWeight: FontWeight.bold, + color: Colors.black54, + ), + ), + ); + } + + Widget buildCardRow(List cards) { + return SingleChildScrollView( + scrollDirection: Axis.horizontal, + child: Row( + children: cards.map((card) { + return Padding( + padding: const EdgeInsets.symmetric(horizontal: 8.0), + child: card, + ); + }).toList(), + ), + ); + } + + Widget buildCard(String title, String value, String subtitle) { + return Card( + elevation: 2, + child: Container( + width: 150, + padding: const EdgeInsets.all(16.0), + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Text( + title, + textAlign: TextAlign.center, + style: TextStyle(fontWeight: FontWeight.bold), + ), + SizedBox(height: 8), + Text( + value, + style: TextStyle( + fontSize: 18, + color: Colors.blue, + fontWeight: FontWeight.bold, + ), + ), + SizedBox(height: 8), + Text( + subtitle, + textAlign: TextAlign.center, + style: TextStyle(color: Colors.black54, fontSize: 12), + ), + ], + ), + ), + ); + } +} diff --git a/lib/presentation/components/constant/constant.dart b/lib/presentation/components/constant/constant.dart new file mode 100644 index 00000000..4b65a141 --- /dev/null +++ b/lib/presentation/components/constant/constant.dart @@ -0,0 +1,18 @@ +import 'package:flutter/material.dart'; + +const Color economyColor = Color(0xFF90B0D5); +const Color socialColor = Color(0xFFAA8E83); +const Color environmentColor = Color(0xFF7DAFBC); +const Color environmentboldColor = Color(0xFF90B0D5); +const TextStyle subtitleStyle = TextStyle( + fontFamily: 'Roboto', // Font family set to Roboto + fontWeight: FontWeight.w400, // Regular weight (w400) + fontSize: 11, + color: Color(0xFF8E8E8E) // Font size 11 + ); +const TextStyle robotoRegular11 = TextStyle( + fontFamily: 'Roboto', // Font family set to Roboto + fontWeight: FontWeight.w400, // Regular weight (w400) + fontSize: 11, + color: Color(0xFF000000) // Font size 11 + ); diff --git a/lib/presentation/routes/drawer_routes/custom_drawer_routes.dart b/lib/presentation/routes/drawer_routes/custom_drawer_routes.dart index 52fc756b..de8715ed 100644 --- a/lib/presentation/routes/drawer_routes/custom_drawer_routes.dart +++ b/lib/presentation/routes/drawer_routes/custom_drawer_routes.dart @@ -149,11 +149,11 @@ class BaseScaffold extends StatelessWidget { switch (route) { case '/': return 0; - case '/about': + case '/uaenumbers': return 1; - case '/settings': + case '/competitiveness': return 2; - case '/profile': + case '/countryprofile': return 3; default: return 0; @@ -167,13 +167,13 @@ class BaseScaffold extends StatelessWidget { context.go('/'); break; case 1: - context.go('/about'); + context.go('/uaenumbers'); break; case 2: - context.go('/settings'); + context.go('/competitiveness'); break; case 3: - context.go('/profile'); + context.go('/countryprofile'); break; } } From d84a438c0f0b240355e8d0e0183e116cd6171a5a Mon Sep 17 00:00:00 2001 From: VINISTAN Date: Mon, 6 Jan 2025 07:47:59 +0530 Subject: [PATCH 5/5] Alignment Issue UAE numbers - Fixed --- android/app/build.gradle | 4 +- android/settings.gradle | 5 +- .../competitiveness.dart | 2 + .../country_profile.dart | 245 +------ .../Bottom Navigation Pages/uae_numbers.dart | 603 +++++++----------- 5 files changed, 229 insertions(+), 630 deletions(-) diff --git a/android/app/build.gradle b/android/app/build.gradle index a5fbd77b..490ff3ac 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -29,8 +29,8 @@ android { ndkVersion = flutter.ndkVersion compileOptions { - sourceCompatibility = JavaVersion.VERSION_1_8 - targetCompatibility = JavaVersion.VERSION_1_8 + sourceCompatibility = JavaVersion.VERSION_21 + targetCompatibility = JavaVersion.VERSION_21 } defaultConfig { diff --git a/android/settings.gradle b/android/settings.gradle index 8a53adcd..2db302b0 100644 --- a/android/settings.gradle +++ b/android/settings.gradle @@ -18,8 +18,9 @@ pluginManagement { plugins { id "dev.flutter.flutter-plugin-loader" version "1.0.0" - id "com.android.application" version "7.3.0" apply false - id "org.jetbrains.kotlin.android" version "1.8.22" apply false + id "com.android.application" version "8.2.1" apply false + id "org.jetbrains.kotlin.android" version "2.1.0" apply false + } include ":app" diff --git a/lib/presentation/Screens/Bottom Navigation Pages/competitiveness.dart b/lib/presentation/Screens/Bottom Navigation Pages/competitiveness.dart index aca6ea73..1ba3fb58 100644 --- a/lib/presentation/Screens/Bottom Navigation Pages/competitiveness.dart +++ b/lib/presentation/Screens/Bottom Navigation Pages/competitiveness.dart @@ -19,3 +19,5 @@ class Competitiveness extends StatelessWidget { } Widget CompetitivenessState(BuildContext context) {return Center(child: Text("Competitiveness"));} } + + diff --git a/lib/presentation/Screens/Bottom Navigation Pages/country_profile.dart b/lib/presentation/Screens/Bottom Navigation Pages/country_profile.dart index 7967d316..8d3f1081 100644 --- a/lib/presentation/Screens/Bottom Navigation Pages/country_profile.dart +++ b/lib/presentation/Screens/Bottom Navigation Pages/country_profile.dart @@ -1,5 +1,4 @@ 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'; class CountryProfile extends StatelessWidget { @@ -15,258 +14,18 @@ class CountryProfile extends StatelessWidget { height: myheight / 5, width: mywidth / 3, child: Image(image: AssetImage('assets/logos/uae_stat.png')))), - body: CountryProfileWidget(), + body: CountryProfileWidget() ); } } - class CountryProfileWidget extends StatelessWidget { const CountryProfileWidget({super.key}); @override Widget build(BuildContext context) { - double mywidth = MediaQuery.of(context).size.width; - return Padding( - padding: const EdgeInsets.all(16.0), - child: ListView( - children: [ - CustomExpandableTile( - title: 'ECONOMY', - titleBackgroundColor: economyColor, - children: [ - buildCategoryTitle('National Accounts',economyColor), - buildCardRow([ - buildCard(context,'GDP (Constant)', '1.62T', '2022 (AED)',economyColor,economyColor,mywidth/2.5), - buildCard(context,'FDI', '1.45T', '2021 (AED)',economyColor,economyColor,mywidth/2.5), - ]), - buildCategoryTitle('International Trade',economyColor), - buildCardRow([ - buildCard(context,'Total Trade', '669.9B', 'Jan - Mar 2024 (AED)',economyColor,economyColor,mywidth/2.5), - buildCard(context,'Total Import', '686B', 'Jan - Mar 2024 (AED)',economyColor,economyColor,mywidth/2.5), - ]), - buildCardRow([ - buildCard(context,'Total Export', '669.9B', 'Jan - Mar 2024 (AED)',economyColor,economyColor,mywidth/2.5), - buildCard(context,'Total ReExport', '686B', 'Jan - Mar 2024 (AED)',economyColor,economyColor,mywidth/2.5), - ]), - buildCategoryTitle('Prices',economyColor), - buildCardRow([ - buildCard(context,'Total Export', '669.9B', 'Jan - Mar 2024 (AED)',economyColor,economyColor,mywidth/1.2), - ]), - ], - ), - CustomExpandableTile( - title: 'SOCIAL', - titleBackgroundColor: socialColor, - children: [ - buildCategoryTitle('Population',socialColor), - buildCardRow([ - InkWell(onTap: (){},child: buildCard(context,'Population', '9.89M', '2024',socialColor,socialColor,mywidth/2.5)), - buildCard(context,'Population Growth', '2.1%', '2023',socialColor,socialColor,mywidth/2.5), - ]), - 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), - ]), - buildCategoryTitle('Education',socialColor), - buildCardRow([ - buildCard(context,'General Education', '96%', '2023',socialColor,socialColor,mywidth/2.5), - buildCard(context,'Higher Education', '1.2K', '2024',socialColor,socialColor,mywidth/2.5), - ]), - buildCategoryTitle('Health',socialColor), - buildCardRow([ - buildCard(context,'Hospital', '96%', '2023',socialColor,socialColor,mywidth/2.5), - buildCard(context,'Clinic and Centres', '1.2K', '2024',socialColor,socialColor,mywidth/2.5), - ]), - ], - ), - CustomExpandableTile( - title: 'ENVIRONMENT', - titleBackgroundColor: environmentColor, - children: [ - buildCategoryTitle('Agriculture',environmentColor), - buildCardRow([ - buildCard(context,'Crops - Total Area', '27°C', 'Average 2024',environmentColor,environmentColor,mywidth/2.5), - buildCard(context,'Livestock', '120mm', '2024',environmentColor,environmentColor,mywidth/2.5), - ]), - buildCategoryTitle('Environment',environmentColor), - buildCardRow([ - buildCard(context,'Climate - Max Temp', '15%', '2024',environmentColor,environmentColor,mywidth/2.5), - buildCard(context,'Climate - Min Temp', '30%', '2023',environmentColor,environmentColor,mywidth/2.5), - ]), - buildCardRow([ - buildCard(context,'Desalinated Produced Water', '15%', '2024',environmentColor,environmentColor,mywidth/2.5), - buildCard(context,'Area of Natural Reserves', '30%', '2023',environmentColor,environmentColor,mywidth/2.5), - ]), - buildCategoryTitle('Energy',environmentColor), - buildCardRow([ - buildCard(context,'Electricity Production', '15%', '2024',environmentColor,environmentColor,mywidth/2.5), - buildCard(context,'Renewable Energy Production', '30%', '2023',environmentColor,environmentColor,mywidth/2.5), - ]), - ], - ), - ], - ), - ); - } - - Widget buildCategoryTitle(String title,Color color) { - return Padding( - padding: const EdgeInsets.symmetric(vertical: 8.0), - child: Text( - title, - style: TextStyle( - fontSize: 16, - fontWeight: FontWeight.bold, - color: color, - ), - ), - ); - } - - Widget buildCardRow(List cards) { - return SingleChildScrollView( - scrollDirection: Axis.horizontal, - child: Row( - children: cards.map((card) { - return Padding( - padding: const EdgeInsets.symmetric(horizontal: 8.0), - child: card, - ); - }).toList(), - ), - ); - } - - Widget buildCard(BuildContext context,String title, String value, String subtitle,Color bordercolor,boldColor,double mywidth) { - // double myheight = MediaQuery.of(context).size.height; - // double mywidth = MediaQuery.of(context).size.width; - return Card( - elevation: 2, - child: Container( - width: mywidth, - decoration: BoxDecoration( - color: Colors.white, // Background color - border: Border.all( - color: bordercolor, // Border color - width: 2, // Border width - ), - borderRadius: BorderRadius.circular(12), // Optional: Rounded corners - ), - padding: const EdgeInsets.all(16.0), - child: Column( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Text( - title, - textAlign: TextAlign.center, - style: robotoRegular11, - ), - SizedBox(height: 8), - Text( - subtitle, - textAlign: TextAlign.center, - style: subtitleStyle - ), - SizedBox(height: 8), - Text( - value, - style: TextStyle( - fontSize: 26, - color: boldColor, - fontWeight: FontWeight.bold, - ), - ), - ], - ), - ), - ); + return Center(child: Text("COuntry Profile"),); } } -class CustomExpandableTile extends StatefulWidget { - final String title; - final Color titleBackgroundColor; - final List children; - const CustomExpandableTile({ - required this.title, - required this.titleBackgroundColor, - required this.children, - }); - @override - _CustomExpandableTileState createState() => _CustomExpandableTileState(); -} - -class _CustomExpandableTileState extends State { - bool isExpanded = false; - - @override - Widget build(BuildContext context) { - double myheight = MediaQuery.of(context).size.height; - return Card( - elevation: 4, - child: Column( - children: [ - GestureDetector( - onTap: () { - setState(() { - isExpanded = !isExpanded; - }); - }, - child: Container( - decoration: BoxDecoration( - color: widget.titleBackgroundColor, - borderRadius: BorderRadius.all(Radius.circular(12)) - ), - padding: const EdgeInsets.all(12), - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Text( - widget.title, - style: TextStyle( - color: Colors.white, - fontWeight: FontWeight.bold, - fontSize: 18, - ), - ), - Icon( - isExpanded - ? Icons.keyboard_arrow_up - : Icons.keyboard_arrow_down, - color: Colors.white, - ), - ], - ), - ), - ), - ClipRRect( - child: AnimatedContainer( - 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)) - ), - - padding: const EdgeInsets.all(10), - child: Column( - children: widget.children, - ), - ), - ) - : null, - ), - ), - ], - ), - ); - } -} diff --git a/lib/presentation/Screens/Bottom Navigation Pages/uae_numbers.dart b/lib/presentation/Screens/Bottom Navigation Pages/uae_numbers.dart index d7b77af8..b1899ffa 100644 --- a/lib/presentation/Screens/Bottom Navigation Pages/uae_numbers.dart +++ b/lib/presentation/Screens/Bottom Navigation Pages/uae_numbers.dart @@ -1,6 +1,8 @@ import 'package:flutter/material.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'; + class UaeNumbers extends StatelessWidget { const UaeNumbers({super.key}); @@ -10,387 +12,123 @@ class UaeNumbers extends StatelessWidget { double myheight = MediaQuery.of(context).size.height; double mywidth = MediaQuery.of(context).size.width; return BaseScaffold( - title: Text("UAE Numbers"), - body: - //EconomicDashboard(), - //EconomyExpandTile() - CustomExpandableTile() - ); + title: Text("UAE Numbers"), + body: + //EconomicDashboard(), + //EconomyExpandTile() + uaenumberWidget()); } } -// class EconomicDashboard extends StatelessWidget { -// const EconomicDashboard({Key? key}) : super(key: key); -// -// @override -// Widget build(BuildContext context) { -// -// return SingleChildScrollView( -// child: Padding( -// padding: const EdgeInsets.all(16.0), -// child: Column( -// children: [ -// // Search Bar -// Container( -// padding: const EdgeInsets.symmetric(horizontal: 16), -// decoration: BoxDecoration( -// color: Colors.white, -// borderRadius: BorderRadius.circular(20), -// border: Border.all( -// color: Color(0xFFAA8E83), // Border color -// width: 3, // Border width -// ), -// -// ), -// child: const Row( -// children: [ -// Icon(Icons.search, color: Colors.grey), -// SizedBox(width: 8), -// Expanded( -// child: TextField( -// decoration: InputDecoration( -// hintText: 'Search', -// border: InputBorder.none, -// hintStyle: TextStyle(color: Colors.grey), -// ), -// ), -// ), -// ], -// ), -// ), -// -// const SizedBox(height: 16), -// -// // Economy Section -// _buildSection( -// 'ECONOMY', -// [ -// _buildRow( -// [ -// _buildCard('GDP (Growth)', '1.62T', Colors.blue[100]!), -// _buildCard('CPI', '1.45T', Colors.blue[100]!), -// ], -// ), -// const SizedBox(height: 8), -// const Text( -// 'International Trade', -// style: TextStyle(fontWeight: FontWeight.bold), -// ), -// _buildRow( -// [ -// _buildCard('Total Trade\nLast Year (2023) YOY', '669.9B', Colors.white), -// _buildCard('Total Import\nLast Year (2023) YOY', '686B', Colors.white), -// ], -// ), -// _buildRow( -// [ -// _buildCard('Total Export', '122.9B', Colors.white), -// _buildCard('Total Import', '161B', Colors.white), -// ], -// ), -// const SizedBox(height: 8), -// const Text( -// 'Prices', -// style: TextStyle(fontWeight: FontWeight.bold), -// ), -// _buildCard('Inflation Rate', '215.4B', Colors.white, fullWidth: true,), -// ],context -// ), -// -// const SizedBox(height: 16), -// -// // Social Section -// _buildSection('SOCIAL', [ -// _buildCard('Total Export', '122.9B', Colors.white), -// _buildCard('Total Import', '161B', Colors.white), -// ],context), -// -// const SizedBox(height: 16), -// -// // Environment Section -// _buildSection('ENVIRONMENT', [ -// _buildCard('Total Export', '122.9B', Colors.white), -// _buildCard('Total Import', '161B', Colors.white), -// ],context) -// ], -// ), -// ), -// ); -// } -// -// Widget _buildSection(String title, List children,BuildContext context) { -// double myheight = MediaQuery.of(context).size.height; -// double mywidth = MediaQuery.of(context).size.width; -// return Container( -// decoration: BoxDecoration( -// color: title == 'ECONOMY' ? Color(0xFF7DAFBC) : Color(0xFFAA8E83), -// borderRadius: BorderRadius.circular(16), -// ), -// child: -// ExpansionTile( -// iconColor: Colors.white, -// collapsedIconColor: Colors.white, -// title: Text( -// title, -// style: const TextStyle(fontWeight: FontWeight.bold,color: Colors.white), -// ), -// children: children, -// ), -// ); -// } -// -// Widget _buildRow(List children) { -// return Padding( -// padding: const EdgeInsets.symmetric(vertical: 4), -// child: Row( -// children: children.map((child) => Expanded(child: child)).toList(), -// ), -// ); -// } -// -// Widget _buildCard(String title, String value, Color color, {bool fullWidth = false}) { -// return Container( -// margin: EdgeInsets.symmetric(horizontal: fullWidth ? 0 : 4), -// padding: const EdgeInsets.all(12), -// decoration: BoxDecoration( -// color: color, -// borderRadius: BorderRadius.circular(8), -// border: Border.all(color: Colors.grey[300]!), -// ), -// child: Column( -// crossAxisAlignment: CrossAxisAlignment.start, -// children: [ -// Text( -// title, -// style: TextStyle( -// fontSize: 12, -// color: Colors.grey[600], -// ), -// ), -// const SizedBox(height: 4), -// Text( -// value, -// style: const TextStyle( -// fontSize: 16, -// fontWeight: FontWeight.bold, -// ), -// ), -// ], -// ), -// ); -// } -// } - - - -// class EconomyExpandTile extends StatefulWidget { -// @override -// _EconomyExpandTileState createState() => _EconomyExpandTileState(); -// } -// -// class _EconomyExpandTileState extends State { -// bool isExpanded = false; -// -// @override -// Widget build(BuildContext context) { -// return Card( -// elevation: 4, -// child: ExpansionTile( -// onExpansionChanged: (value) { -// setState(() { -// isExpanded = value; -// }); -// }, -// title: Container( -// color: Colors.blue, -// padding: const EdgeInsets.all(16), -// child: Text( -// 'ECONOMY', -// style: TextStyle( -// color: Colors.white, -// fontWeight: FontWeight.bold, -// fontSize: 18, -// ), -// ), -// ), -// backgroundColor: Colors.white, -// collapsedBackgroundColor: Colors.blue, -// children: [ -// Padding( -// padding: const EdgeInsets.all(16.0), -// child: Column( -// children: [ -// buildCategoryTitle('National Accounts'), -// buildCardRow([ -// buildCard('GDP (Constant)', '1.62T', '2022 (AED)'), -// buildCard('FDI', '1.45T', '2021 (AED)'), -// ]), -// buildCategoryTitle('International Trade'), -// buildCardRow([ -// buildCard('Total Trade', '669.9B', 'Jan - Mar 2024 (AED)'), -// buildCard('Total Import', '686B', 'Jan - Mar 2024 (AED)'), -// ]), -// buildCardRow([ -// buildCard('Total Export', '122.9B', 'Jan - Mar 2024 (AED)'), -// buildCard('Total ReExport', '161B', 'Jan - Mar 2024 (AED)'), -// ]), -// buildCategoryTitle('Prices'), -// buildCardRow([ -// buildCard('Inflation Rate', '215.4B', '2023'), -// ]), -// ], -// ), -// ), -// ], -// ), -// ); -// } -// -// Widget buildCategoryTitle(String title) { -// return Padding( -// padding: const EdgeInsets.symmetric(vertical: 8.0), -// child: Text( -// title, -// style: TextStyle( -// fontSize: 16, -// fontWeight: FontWeight.bold, -// color: Colors.black54, -// ), -// ), -// ); -// } -// -// Widget buildCardRow(List cards) { -// return SingleChildScrollView( -// scrollDirection: Axis.horizontal, -// child: Row( -// children: cards.map((card) { -// return Padding( -// padding: const EdgeInsets.symmetric(horizontal: 8.0), -// child: card, -// ); -// }).toList(), -// ), -// ); -// } -// -// Widget buildCard(String title, String value, String subtitle) { -// return Card( -// elevation: 2, -// child: Container( -// width: 150, // Fixed width for cards to make scrolling smoother -// padding: const EdgeInsets.all(16.0), -// child: Column( -// mainAxisAlignment: MainAxisAlignment.center, -// children: [ -// Text( -// title, -// textAlign: TextAlign.center, -// style: TextStyle(fontWeight: FontWeight.bold), -// ), -// SizedBox(height: 8), -// Text( -// value, -// style: TextStyle( -// fontSize: 18, -// color: Colors.blue, -// fontWeight: FontWeight.bold, -// ), -// ), -// SizedBox(height: 8), -// Text( -// subtitle, -// textAlign: TextAlign.center, -// style: TextStyle(color: Colors.black54, fontSize: 12), -// ), -// ], -// ), -// ), -// ); -// } -// } - -class CustomExpandableTile extends StatefulWidget { - @override - _CustomExpandableTileState createState() => _CustomExpandableTileState(); -} - -class _CustomExpandableTileState extends State { - bool isExpanded = false; +class uaenumberWidget extends StatelessWidget { + const uaenumberWidget({super.key}); @override Widget build(BuildContext context) { - return Card( - elevation: 4, - child: SingleChildScrollView( - child: Column( - children: [ - // The tile header - GestureDetector( - onTap: () { - setState(() { - isExpanded = !isExpanded; - }); - }, - child: Container( - color: Colors.blue, - padding: const EdgeInsets.all(16), - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Text( - 'ECONOMY', - style: TextStyle( - color: Colors.white, - fontWeight: FontWeight.bold, - fontSize: 18, - ), - ), - Icon( - isExpanded ? Icons.keyboard_arrow_up : Icons.keyboard_arrow_down, - color: Colors.white, - ), - ], - ), - ), - ), - // Animated container for expansion - AnimatedContainer( - duration: Duration(milliseconds: 300), - curve: Curves.easeInOut, - height: isExpanded ? null : 0, - child: isExpanded - ? Container( - color: Colors.white, - padding: const EdgeInsets.all(16), - child: Column( - children: [ - buildCategoryTitle('National Accounts'), - buildCardRow([ - buildCard('GDP (Constant)', '1.62T', '2022 (AED)'), - buildCard('FDI', '1.45T', '2021 (AED)'), - ]), - buildCategoryTitle('International Trade'), - buildCardRow([ - buildCard('Total Trade', '669.9B', 'Jan - Mar 2024 (AED)'), - buildCard('Total Import', '686B', 'Jan - Mar 2024 (AED)'), - ]), - buildCategoryTitle('Prices'), - buildCardRow([ - buildCard('Inflation Rate', '215.4B', '2023'), - ]), - ], - ), - ) - : Container(), - ), - ], + double myheight = MediaQuery.of(context).size.height; + double mywidth = MediaQuery.of(context).size.width; + return Padding( + padding: const EdgeInsets.all(16.0), + child: ListView( + children: [ + Container( + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(30.0), + border: Border.all(width: 1) + + ), + child: TextField( + decoration: InputDecoration( + hintText: "Search", + prefixIcon: Icon(Icons.search), + border: InputBorder.none, + contentPadding: EdgeInsets.symmetric(vertical: 15.0, horizontal: 20.0), ), ), + ), + SizedBox(height: myheight/35,), + CustomExpandableTile( + title: 'ECONOMY', + titleBackgroundColor: economyColor, + children: [ + buildCategoryTitle('National Accounts',economyColor), + buildCardRow([ + buildCard(context,'GDP (Constant)', '1.62T', '2022 (AED)',economyColor,economyColor,mywidth/2.5), + buildCard(context,'FDI', '1.45T', '2021 (AED)',economyColor,economyColor,mywidth/2.5), + ]), + buildCategoryTitle('International Trade',economyColor), + buildCardRow([ + buildCard(context,'Total Trade', '669.9B', 'Jan - Mar 2024 (AED)',economyColor,economyColor,mywidth/2.5), + buildCard(context,'Total Import', '686B', 'Jan - Mar 2024 (AED)',economyColor,economyColor,mywidth/2.5), + ]), + buildCardRow([ + buildCard(context,'Total Export', '669.9B', 'Jan - Mar 2024 (AED)',economyColor,economyColor,mywidth/2.5), + buildCard(context,'Total ReExport', '686B', 'Jan - Mar 2024 (AED)',economyColor,economyColor,mywidth/2.5), + ]), + buildCategoryTitle('Prices',economyColor), + buildCardRow([ + buildCard(context,'Total Export', '669.9B', 'Jan - Mar 2024 (AED)',economyColor,economyColor,mywidth/1.2), + ]), + ], + ), + CustomExpandableTile( + title: 'SOCIAL', + titleBackgroundColor: socialColor, + children: [ + buildCategoryTitle('Population',socialColor), + buildCardRow([ + InkWell(onTap: (){},child: buildCard(context,'Population', '9.89M', '2024',socialColor,socialColor,mywidth/2.5)), + buildCard(context,'Population Growth', '2.1%', '2023',socialColor,socialColor,mywidth/2.5), + ]), + 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), + ]), + buildCategoryTitle('Education',socialColor), + buildCardRow([ + buildCard(context,'General Education', '96%', '2023',socialColor,socialColor,mywidth/2.5), + buildCard(context,'Higher Education', '1.2K', '2024',socialColor,socialColor,mywidth/2.5), + ]), + buildCategoryTitle('Health',socialColor), + buildCardRow([ + buildCard(context,'Hospital', '96%', '2023',socialColor,socialColor,mywidth/2.5), + buildCard(context,'Clinic and Centres', '1.2K', '2024',socialColor,socialColor,mywidth/2.5), + ]), + ], + ), + CustomExpandableTile( + title: 'ENVIRONMENT', + titleBackgroundColor: environmentColor, + children: [ + buildCategoryTitle('Agriculture',environmentColor), + buildCardRow([ + buildCard(context,'Crops - Total Area', '27°C', 'Average 2024',environmentColor,environmentColor,mywidth/2.5), + buildCard(context,'Livestock', '120mm', '2024',environmentColor,environmentColor,mywidth/2.5), + ]), + buildCategoryTitle('Environment',environmentColor), + buildCardRow([ + buildCard(context,'Climate - Max Temp', '15%', '2024',environmentColor,environmentColor,mywidth/2.5), + buildCard(context,'Climate - Min Temp', '30%', '2023',environmentColor,environmentColor,mywidth/2.5), + ]), + buildCardRow([ + buildCard(context,'Desalinated Produced Water', '15%', '2024',environmentColor,environmentColor,mywidth/2.5), + buildCard(context,'Area of Natural Reserves', '30%', '2023',environmentColor,environmentColor,mywidth/2.5), + ]), + buildCategoryTitle('Energy',environmentColor), + buildCardRow([ + buildCard(context,'Electricity Production', '15%', '2024',environmentColor,environmentColor,mywidth/2.5), + buildCard(context,'Renewable Energy Production', '30%', '2023',environmentColor,environmentColor,mywidth/2.5), + ]), + ], + ), + ], + ), ); } - Widget buildCategoryTitle(String title) { + Widget buildCategoryTitle(String title,Color color) { return Padding( padding: const EdgeInsets.symmetric(vertical: 8.0), child: Text( @@ -398,7 +136,7 @@ class _CustomExpandableTileState extends State { style: TextStyle( fontSize: 16, fontWeight: FontWeight.bold, - color: Colors.black54, + color: color, ), ), ); @@ -410,7 +148,7 @@ class _CustomExpandableTileState extends State { child: Row( children: cards.map((card) { return Padding( - padding: const EdgeInsets.symmetric(horizontal: 8.0), + padding: const EdgeInsets.symmetric(horizontal: 2.0), child: card, ); }).toList(), @@ -418,11 +156,21 @@ class _CustomExpandableTileState extends State { ); } - Widget buildCard(String title, String value, String subtitle) { + Widget buildCard(BuildContext context,String title, String value, String subtitle,Color bordercolor,boldColor,double mywidth) { + // double myheight = MediaQuery.of(context).size.height; + // double mywidth = MediaQuery.of(context).size.width; return Card( elevation: 2, child: Container( - width: 150, + width: mywidth, + decoration: BoxDecoration( + color: Colors.white, // Background color + border: Border.all( + color: bordercolor, // Border color + width: 2, // Border width + ), + borderRadius: BorderRadius.circular(12), // Optional: Rounded corners + ), padding: const EdgeInsets.all(16.0), child: Column( mainAxisAlignment: MainAxisAlignment.center, @@ -430,26 +178,115 @@ class _CustomExpandableTileState extends State { Text( title, textAlign: TextAlign.center, - style: TextStyle(fontWeight: FontWeight.bold), + style: robotoRegular11, + ), + SizedBox(height: 8), + Text( + subtitle, + textAlign: TextAlign.center, + style: subtitleStyle ), SizedBox(height: 8), Text( value, style: TextStyle( - fontSize: 18, - color: Colors.blue, + fontSize: 26, + color: boldColor, fontWeight: FontWeight.bold, ), ), - SizedBox(height: 8), - Text( - subtitle, - textAlign: TextAlign.center, - style: TextStyle(color: Colors.black54, fontSize: 12), - ), ], ), ), ); } } + +class CustomExpandableTile extends StatefulWidget { + final String title; + final Color titleBackgroundColor; + final List children; + + const CustomExpandableTile({ + required this.title, + required this.titleBackgroundColor, + required this.children, + }); + + @override + _CustomExpandableTileState createState() => _CustomExpandableTileState(); +} + +class _CustomExpandableTileState extends State { + bool isExpanded = false; + + @override + Widget build(BuildContext context) { + double myheight = MediaQuery.of(context).size.height; + return Card( + elevation: 4, + child: Column( + children: [ + GestureDetector( + onTap: () { + setState(() { + isExpanded = !isExpanded; + }); + }, + child: Container( + decoration: BoxDecoration( + color: widget.titleBackgroundColor, + borderRadius: BorderRadius.all(Radius.circular(12)) + ), + padding: const EdgeInsets.all(12), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Text( + widget.title, + style: TextStyle( + color: Colors.white, + fontWeight: FontWeight.bold, + fontSize: 18, + ), + ), + Icon( + isExpanded + ? Icons.keyboard_arrow_up + : Icons.keyboard_arrow_down, + color: Colors.white, + ), + ], + ), + ), + ), + ClipRRect( + child: AnimatedContainer( + 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)) + ), + + padding: const EdgeInsets.all(10), + child: Column( + children: widget.children, + ), + ), + ) + : null, + ), + ), + ], + ), + ); + } +} + +