refactor: Adjust button layouts and text handling for logout and profile save/cancel actions.
This commit is contained in:
@@ -325,25 +325,11 @@ class _MenuDrawer extends ConsumerWidget {
|
|||||||
SizedBox(
|
SizedBox(
|
||||||
width: double.infinity,
|
width: double.infinity,
|
||||||
height: 54,
|
height: 54,
|
||||||
child: ElevatedButton.icon(
|
child: ElevatedButton(
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
Navigator.pop(context);
|
Navigator.pop(context);
|
||||||
ref.read(authProvider.notifier).logout();
|
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(
|
style: ElevatedButton.styleFrom(
|
||||||
backgroundColor: AppColors.accentOrange,
|
backgroundColor: AppColors.accentOrange,
|
||||||
elevation: 0,
|
elevation: 0,
|
||||||
@@ -351,6 +337,28 @@ class _MenuDrawer extends ConsumerWidget {
|
|||||||
borderRadius: BorderRadius.circular(15),
|
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 ...[
|
] else ...[
|
||||||
|
|||||||
@@ -112,6 +112,7 @@ class ProfileActionButtons extends StatelessWidget {
|
|||||||
child: Row(
|
child: Row(
|
||||||
children: [
|
children: [
|
||||||
Expanded(
|
Expanded(
|
||||||
|
flex: 2,
|
||||||
child: GestureDetector(
|
child: GestureDetector(
|
||||||
onTap: onCancel,
|
onTap: onCancel,
|
||||||
child: Container(
|
child: Container(
|
||||||
@@ -125,6 +126,8 @@ class ProfileActionButtons extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
alignment: Alignment.center,
|
alignment: Alignment.center,
|
||||||
child: const Text('Cancel',
|
child: const Text('Cancel',
|
||||||
|
maxLines: 1,
|
||||||
|
overflow: TextOverflow.ellipsis,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontFamily: 'Fractul',
|
fontFamily: 'Fractul',
|
||||||
fontSize: 14,
|
fontSize: 14,
|
||||||
@@ -136,10 +139,12 @@ class ProfileActionButtons extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
const SizedBox(width: 10),
|
const SizedBox(width: 10),
|
||||||
Expanded(
|
Expanded(
|
||||||
|
flex: 3,
|
||||||
child: GestureDetector(
|
child: GestureDetector(
|
||||||
onTap: isSaving ? null : onSave,
|
onTap: isSaving ? null : onSave,
|
||||||
child: Container(
|
child: Container(
|
||||||
height: 31,
|
height: 31,
|
||||||
|
padding: const EdgeInsets.symmetric(horizontal: 8),
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: AppColors.accentOrange,
|
color: AppColors.accentOrange,
|
||||||
borderRadius: BorderRadius.circular(7),
|
borderRadius: BorderRadius.circular(7),
|
||||||
@@ -152,13 +157,17 @@ class ProfileActionButtons extends StatelessWidget {
|
|||||||
child: CircularProgressIndicator(
|
child: CircularProgressIndicator(
|
||||||
strokeWidth: 2, color: AppColors.primaryDark),
|
strokeWidth: 2, color: AppColors.primaryDark),
|
||||||
)
|
)
|
||||||
: Text(saveLabel,
|
: FittedBox(
|
||||||
style: const TextStyle(
|
fit: BoxFit.scaleDown,
|
||||||
fontFamily: 'Fractul',
|
child: Text(saveLabel,
|
||||||
fontSize: 14,
|
maxLines: 1,
|
||||||
fontWeight: FontWeight.w400,
|
style: const TextStyle(
|
||||||
color: AppColors.primaryDark,
|
fontFamily: 'Fractul',
|
||||||
)),
|
fontSize: 14,
|
||||||
|
fontWeight: FontWeight.w400,
|
||||||
|
color: AppColors.primaryDark,
|
||||||
|
)),
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|||||||
Reference in New Issue
Block a user