refactor: Adjust button layouts and text handling for logout and profile save/cancel actions.

This commit is contained in:
pradeepkumar
2026-03-16 10:47:42 +05:30
parent aaed88d51d
commit c4c6322507
2 changed files with 39 additions and 22 deletions

View File

@@ -325,17 +325,30 @@ 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(
style: ElevatedButton.styleFrom(
backgroundColor: AppColors.accentOrange,
elevation: 0,
shape: RoundedRectangleBorder(
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: 24,
size: 20,
),
label: const Text(
SizedBox(width: 8),
Text(
'Log Out',
style: TextStyle(
fontFamily: 'Fractul',
@@ -344,12 +357,7 @@ class _MenuDrawer extends ConsumerWidget {
color: AppColors.primaryDark,
),
),
style: ElevatedButton.styleFrom(
backgroundColor: AppColors.accentOrange,
elevation: 0,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(15),
),
],
),
),
),

View File

@@ -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,7 +157,10 @@ class ProfileActionButtons extends StatelessWidget {
child: CircularProgressIndicator(
strokeWidth: 2, color: AppColors.primaryDark),
)
: Text(saveLabel,
: FittedBox(
fit: BoxFit.scaleDown,
child: Text(saveLabel,
maxLines: 1,
style: const TextStyle(
fontFamily: 'Fractul',
fontSize: 14,
@@ -162,6 +170,7 @@ class ProfileActionButtons extends StatelessWidget {
),
),
),
),
],
),
);