From 97e981d773e333437b4ede098075bf0a3a5821d8 Mon Sep 17 00:00:00 2001 From: Juki-shiba Date: Thu, 13 Feb 2025 18:11:37 +0530 Subject: [PATCH] bug fix appbar --- .../auth_verification/registration.dart | 2 +- lib/presentation/Screens/profilepage.dart | 29 +++++ .../routes/auth_routes/login_route.dart | 2 +- .../tab_routes/home_route.dart | 4 +- .../Drawer Items/edit_profile.dart | 24 +++- .../drawer_routes/custom_drawer_routes.dart | 115 ++++++++++-------- .../drawer_routes/profile/reset_pw_route.dart | 4 +- 7 files changed, 117 insertions(+), 63 deletions(-) diff --git a/lib/presentation/Screens/auth_verification/registration.dart b/lib/presentation/Screens/auth_verification/registration.dart index f80344a6..d6384345 100644 --- a/lib/presentation/Screens/auth_verification/registration.dart +++ b/lib/presentation/Screens/auth_verification/registration.dart @@ -1191,7 +1191,7 @@ class _RegisterScreenState extends ConsumerState { width: screenwidth / 1, child: ElevatedButton( onPressed: () { - context.go('/'); + context.pop(); }, style: ElevatedButton.styleFrom( backgroundColor: Color( diff --git a/lib/presentation/Screens/profilepage.dart b/lib/presentation/Screens/profilepage.dart index e3bcbe60..f88960d8 100644 --- a/lib/presentation/Screens/profilepage.dart +++ b/lib/presentation/Screens/profilepage.dart @@ -1,6 +1,7 @@ import 'dart:convert'; import 'dart:io'; +import 'package:external_repos/external_repos.dart'; import 'package:flutter/gestures.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; @@ -10,6 +11,7 @@ import 'package:image_picker/image_picker.dart'; import 'package:intl/intl.dart'; import 'package:pocketbase/pocketbase.dart'; import 'package:shared_preferences/shared_preferences.dart'; +import 'package:uae_stat/config/my_theme.dart'; import 'package:uae_stat/domain/use_cases/language.dart'; import 'package:uae_stat/infrastructure/data/p_auth_repo.dart'; import 'package:uae_stat/infrastructure/services/img_asset_paths/icons/misc_icon_asset_path.dart'; @@ -643,6 +645,15 @@ class _ProfileScreenState extends State { controller: _fullNameController, focusNode: _focusNodes[2], decoration: InputDecoration( + enabledBorder:OutlineInputBorder( + borderRadius: + BorderRadius.circular(10), + borderSide: BorderSide( + color: MyTheme.topicColor( + IndicatorTopic.economy) + .shade400, + width: 1), // Enabled border + ), hintText: _showHints[2] ? 'Enter the name' : null, hintStyle: TextStyle(color: Colors.grey), border: OutlineInputBorder( @@ -674,6 +685,15 @@ class _ProfileScreenState extends State { controller: _dateController, focusNode: _focusNodes[3], decoration: InputDecoration( + enabledBorder:OutlineInputBorder( + borderRadius: + BorderRadius.circular(10), + borderSide: BorderSide( + color: MyTheme.topicColor( + IndicatorTopic.economy) + .shade400, + width: 1), // Enabled border + ), border: OutlineInputBorder( borderSide:BorderSide(color: Color(0xFF7296BE), ), @@ -717,6 +737,15 @@ class _ProfileScreenState extends State { child: DropdownButtonFormField( value: _selectedCountry, decoration: InputDecoration( + enabledBorder:OutlineInputBorder( + borderRadius: + BorderRadius.circular(10), + borderSide: BorderSide( + color: MyTheme.topicColor( + IndicatorTopic.economy) + .shade400, + width: 1), // Enabled border + ), border: OutlineInputBorder( borderSide:BorderSide(color: Color(0xFF7296BE), ), diff --git a/lib/presentation/routes/auth_routes/login_route.dart b/lib/presentation/routes/auth_routes/login_route.dart index 8fc864c1..29618deb 100644 --- a/lib/presentation/routes/auth_routes/login_route.dart +++ b/lib/presentation/routes/auth_routes/login_route.dart @@ -547,7 +547,7 @@ class LoginRoute extends HookConsumerWidget { ], ); final dontHaveAnAccountRegisterBtn = TextButton( - onPressed: () => {context.go('/register')}, + onPressed: () => {context.push('/register')}, child: Text.rich( textAlign: TextAlign.center, TextSpan( diff --git a/lib/presentation/routes/bottom_bar_routes/tab_routes/home_route.dart b/lib/presentation/routes/bottom_bar_routes/tab_routes/home_route.dart index b7760198..421a59f9 100644 --- a/lib/presentation/routes/bottom_bar_routes/tab_routes/home_route.dart +++ b/lib/presentation/routes/bottom_bar_routes/tab_routes/home_route.dart @@ -1028,7 +1028,7 @@ class EconomyStatsState extends ConsumerState { crossAxisAlignment: CrossAxisAlignment.start, children: [ RoundedCornerContainer( - key: mainTopic['main_topic'] == 'ECONOMY' + key: mainTopic['main_topic'] == 'ECONOMY' || mainTopic['main_topic'] == 'اقتصاد' ? cardTopicKey : null, text: mainTopic['main_topic'], @@ -1042,7 +1042,7 @@ class EconomyStatsState extends ConsumerState { SizedBox( height: myheight / 4.8, // Set dynamic height child: Container( - key: mainTopic['main_topic'] == 'ECONOMY' + key: mainTopic['main_topic'] == 'ECONOMY' || mainTopic['main_topic'] == 'اقتصاد' ? cardsKey : null, // color: Colors.grey[200], // Set a background color for the scrollable container diff --git a/lib/presentation/routes/drawer_routes/Drawer Items/edit_profile.dart b/lib/presentation/routes/drawer_routes/Drawer Items/edit_profile.dart index b9e17849..42280b3b 100644 --- a/lib/presentation/routes/drawer_routes/Drawer Items/edit_profile.dart +++ b/lib/presentation/routes/drawer_routes/Drawer Items/edit_profile.dart @@ -712,10 +712,10 @@ class _EditProfileState extends State { // counterText: '', enabled: !_isProfileCompleted, ), - maxLength: - 40, // Set the maximum length to 20 characters - maxLengthEnforcement: - MaxLengthEnforcement.enforced, + // maxLength: + // 40, // Set the maximum length to 20 characters + // maxLengthEnforcement: + // MaxLengthEnforcement.enforced, ), SizedBox(height: 10), Row( @@ -777,8 +777,23 @@ class _EditProfileState extends State { onExit: (_) => setState( () => _isHoveringDropdown = false), child: DropdownButtonFormField( + style: TextStyle( + fontFamily: 'Roboto', + fontSize: 16, + fontWeight: FontWeight.normal, + color: Color(0xFF544C4C), + ), value: _selectedCountry, decoration: InputDecoration( + enabledBorder:OutlineInputBorder( + borderRadius: + BorderRadius.circular(10), + borderSide: BorderSide( + color: MyTheme.topicColor( + IndicatorTopic.economy) + .shade400, + width: 1), // Enabled border + ), border: OutlineInputBorder( borderSide:BorderSide(color: Color(0xFF7296BE), ), @@ -937,7 +952,6 @@ class _EditProfileState extends State { ), ], ), - SizedBox(height: 20), Center( child: GestureDetector( onTap: () { diff --git a/lib/presentation/routes/drawer_routes/custom_drawer_routes.dart b/lib/presentation/routes/drawer_routes/custom_drawer_routes.dart index 6f217571..a35aeb93 100644 --- a/lib/presentation/routes/drawer_routes/custom_drawer_routes.dart +++ b/lib/presentation/routes/drawer_routes/custom_drawer_routes.dart @@ -1,7 +1,7 @@ import 'dart:async'; import 'dart:convert'; import 'dart:math'; - +import 'package:iconify_design/iconify_design.dart'; import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; @@ -686,45 +686,50 @@ class _BaseScaffoldState extends ConsumerState { }, ), ], - leading: Stack( - children: [ - if (widget.showBackButton == true) - Align( - alignment: Alignment.centerLeft, - child: Padding( - padding: EdgeInsets.only(left: 8), - - child: IconButton( - color: Colors.white, - icon: const Icon(Icons.arrow_back_ios_new, size: 26), - onPressed: () { - if ((widget.navBackArrow as Text).data == 'home') { - context.go('/myhomepage'); - } else { - context.go('/uaenumbers'); - } - }, - ), - ),), - - Align( - alignment: Alignment.centerRight, - child: Padding( - padding: EdgeInsets.only(right: 10), - child: Builder( - builder: (BuildContext context) { - return IconButton( - key: drawerKey, - color: widget.colorChange ? Colors.white : Colors.black, - icon: const Icon(Icons.menu, size: 30), + leading: Padding( + padding: const EdgeInsets.only(top: 7.0,left: 4), + child: Row( + mainAxisSize:MainAxisSize.min, + children: [ + if (widget.showBackButton == true) + SizedBox( + width: 25, + height: 25, + child: IconButton( + padding: EdgeInsets.zero, + constraints: BoxConstraints(), + color: Colors.white, + icon: const Icon(Icons.arrow_back_ios_new, size: 24), onPressed: () { - Scaffold.of(context).openDrawer(); + if ((widget.navBackArrow as Text).data == 'home') { + context.go('/myhomepage'); + } else { + context.go('/uaenumbers'); + } }, + ), + ), + SizedBox(width: 7,), + Builder( + builder: (BuildContext context) { + return SizedBox( + width: 30, + height: 30, + child: IconButton( + padding: EdgeInsets.zero, + constraints: BoxConstraints(), + key: drawerKey, + color: widget.colorChange ? Colors.white : Colors.black, + icon: const Icon(Icons.menu, size: 30), + onPressed: () { + Scaffold.of(context).openDrawer(); + }, + ), ); }, ), - ),), - ], + ], + ), ), @@ -737,6 +742,7 @@ class _BaseScaffoldState extends ConsumerState { children: [ DrawerHeader( child: Column( + mainAxisAlignment: MainAxisAlignment.spaceEvenly, crossAxisAlignment: CrossAxisAlignment.stretch, children: [ Row( @@ -810,24 +816,26 @@ class _BaseScaffoldState extends ConsumerState { onTap: () => context.go('/notification'), ), ListTile( - leading: Image.asset( - DrawerAssetIconPath.feedback, - color: Colors.black, - width: 20, - height: 20, - ), + leading: Icon(Icons.message_outlined), + // leading: Image.asset( + // DrawerAssetIconPath.feedback, + // color: Colors.black, + // width: 20, + // height: 20, + // ), // title: const Text('Feedback'), title: Text(AppLocalizations.of(context)!.feedback_title), onTap: () => context.go('/feedback', extra: userName), ), if (role == 'admin') ListTile( - leading: Image.asset( - DrawerAssetIconPath.manageUser, - color: Colors.black, - width: 20, - height: 20, - ), + leading: Icon(Icons.manage_accounts_outlined), + // leading: Image.asset( + // DrawerAssetIconPath.manageUser, + // color: Colors.black, + // width: 20, + // height: 20, + // ), // title: Text('Manage User'), title: Text( AppLocalizations.of(context)!.manage_user, @@ -843,12 +851,13 @@ class _BaseScaffoldState extends ConsumerState { onTap: () => context.go('/bookmark'), ), ListTile( - leading: Image.asset( - DrawerAssetIconPath.guide, - color: Colors.black, - width: 20, - height: 20, - ), + leading: Icon(Icons.menu_book_outlined), + // leading: Image.asset( + // DrawerAssetIconPath.guide, + // color: Colors.black, + // width: 20, + // height: 20, + // ), // title: const Text('User Guide'), title: Text(AppLocalizations.of(context)!.guide_title), onTap: () => context.go('/user-guide'), diff --git a/lib/presentation/routes/drawer_routes/profile/reset_pw_route.dart b/lib/presentation/routes/drawer_routes/profile/reset_pw_route.dart index c8e170b0..db4f1380 100644 --- a/lib/presentation/routes/drawer_routes/profile/reset_pw_route.dart +++ b/lib/presentation/routes/drawer_routes/profile/reset_pw_route.dart @@ -113,7 +113,9 @@ class ResetPwRoute extends HookConsumerWidget { } }, ); - await Fluttertoast.showToast(msg: 'Password changed successfully'); + await Fluttertoast.showToast(msg: 'Password changed successfully', + gravity: ToastGravity.CENTER, + ); if (!context.mounted) return; context.pop(); },