From c4c6322507c91799e51baa32b3a403c1ef45efe2 Mon Sep 17 00:00:00 2001 From: pradeepkumar Date: Mon, 16 Mar 2026 10:47:42 +0530 Subject: [PATCH] refactor: Adjust button layouts and text handling for logout and profile save/cancel actions. --- .../presentation/widgets/home_header.dart | 38 +++++++++++-------- .../widgets/profile_shared_widgets.dart | 23 +++++++---- 2 files changed, 39 insertions(+), 22 deletions(-) diff --git a/lib/features/home/presentation/widgets/home_header.dart b/lib/features/home/presentation/widgets/home_header.dart index 735ad8c..7bdb3ff 100644 --- a/lib/features/home/presentation/widgets/home_header.dart +++ b/lib/features/home/presentation/widgets/home_header.dart @@ -325,25 +325,11 @@ class _MenuDrawer extends ConsumerWidget { SizedBox( width: double.infinity, height: 54, - child: ElevatedButton.icon( + child: ElevatedButton( onPressed: () { Navigator.pop(context); ref.read(authProvider.notifier).logout(); }, - icon: const Icon( - Icons.logout_rounded, - color: AppColors.primaryDark, - size: 24, - ), - label: const Text( - 'Log Out', - style: TextStyle( - fontFamily: 'Fractul', - fontSize: 14, - fontWeight: FontWeight.w700, - color: AppColors.primaryDark, - ), - ), style: ElevatedButton.styleFrom( backgroundColor: AppColors.accentOrange, elevation: 0, @@ -351,6 +337,28 @@ class _MenuDrawer extends ConsumerWidget { borderRadius: BorderRadius.circular(15), ), ), + child: Row( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center, + mainAxisSize: MainAxisSize.min, + children: const [ + Icon( + Icons.logout_rounded, + color: AppColors.primaryDark, + size: 20, + ), + SizedBox(width: 8), + Text( + 'Log Out', + style: TextStyle( + fontFamily: 'Fractul', + fontSize: 14, + fontWeight: FontWeight.w700, + color: AppColors.primaryDark, + ), + ), + ], + ), ), ), ] else ...[ diff --git a/lib/features/profile/presentation/widgets/profile_shared_widgets.dart b/lib/features/profile/presentation/widgets/profile_shared_widgets.dart index 7d1c72c..9dc3c4c 100644 --- a/lib/features/profile/presentation/widgets/profile_shared_widgets.dart +++ b/lib/features/profile/presentation/widgets/profile_shared_widgets.dart @@ -112,6 +112,7 @@ class ProfileActionButtons extends StatelessWidget { child: Row( children: [ Expanded( + flex: 2, child: GestureDetector( onTap: onCancel, child: Container( @@ -125,6 +126,8 @@ class ProfileActionButtons extends StatelessWidget { ), alignment: Alignment.center, child: const Text('Cancel', + maxLines: 1, + overflow: TextOverflow.ellipsis, style: TextStyle( fontFamily: 'Fractul', fontSize: 14, @@ -136,10 +139,12 @@ class ProfileActionButtons extends StatelessWidget { ), const SizedBox(width: 10), Expanded( + flex: 3, child: GestureDetector( onTap: isSaving ? null : onSave, child: Container( height: 31, + padding: const EdgeInsets.symmetric(horizontal: 8), decoration: BoxDecoration( color: AppColors.accentOrange, borderRadius: BorderRadius.circular(7), @@ -152,13 +157,17 @@ class ProfileActionButtons extends StatelessWidget { child: CircularProgressIndicator( strokeWidth: 2, color: AppColors.primaryDark), ) - : Text(saveLabel, - style: const TextStyle( - fontFamily: 'Fractul', - fontSize: 14, - fontWeight: FontWeight.w400, - color: AppColors.primaryDark, - )), + : FittedBox( + fit: BoxFit.scaleDown, + child: Text(saveLabel, + maxLines: 1, + style: const TextStyle( + fontFamily: 'Fractul', + fontSize: 14, + fontWeight: FontWeight.w400, + color: AppColors.primaryDark, + )), + ), ), ), ),