Refactor button styles in account settings dialog to use ButtonStyle for improved customization and consistency
This commit is contained in:
@@ -327,9 +327,21 @@ class _AccountSettingsDialogState extends State<AccountSettingsDialog> {
|
|||||||
Expanded(
|
Expanded(
|
||||||
child: TextButton(
|
child: TextButton(
|
||||||
onPressed: () => Navigator.of(context).pop(),
|
onPressed: () => Navigator.of(context).pop(),
|
||||||
style: TextButton.styleFrom(
|
style: ButtonStyle(
|
||||||
padding: const EdgeInsets.symmetric(vertical: 12),
|
splashFactory: NoSplash.splashFactory,
|
||||||
shape: RoundedRectangleBorder(
|
overlayColor: WidgetStateProperty.resolveWith<Color?>((
|
||||||
|
Set<WidgetState> states,
|
||||||
|
) {
|
||||||
|
if (states.contains(WidgetState.pressed)) {
|
||||||
|
return Colors.transparent;
|
||||||
|
}
|
||||||
|
return null; // Use default for other states (like hover)
|
||||||
|
}),
|
||||||
|
padding: WidgetStateProperty.all(
|
||||||
|
const EdgeInsets.symmetric(vertical: 12),
|
||||||
|
),
|
||||||
|
shape: WidgetStateProperty.all(
|
||||||
|
RoundedRectangleBorder(
|
||||||
borderRadius: BorderRadius.circular(12),
|
borderRadius: BorderRadius.circular(12),
|
||||||
side: BorderSide(
|
side: BorderSide(
|
||||||
color: AppTheme.secondaryText.withValues(
|
color: AppTheme.secondaryText.withValues(
|
||||||
@@ -338,6 +350,7 @@ class _AccountSettingsDialogState extends State<AccountSettingsDialog> {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
),
|
||||||
child: Text(
|
child: Text(
|
||||||
'Cancel',
|
'Cancel',
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
@@ -355,16 +368,35 @@ class _AccountSettingsDialogState extends State<AccountSettingsDialog> {
|
|||||||
Navigator.of(context).pop();
|
Navigator.of(context).pop();
|
||||||
_deleteAccount();
|
_deleteAccount();
|
||||||
},
|
},
|
||||||
style: ElevatedButton.styleFrom(
|
style: ButtonStyle(
|
||||||
backgroundColor: AppTheme.errorColor,
|
splashFactory: NoSplash.splashFactory,
|
||||||
foregroundColor: Colors.white,
|
overlayColor: WidgetStateProperty.resolveWith<Color?>(
|
||||||
elevation: 0,
|
(Set<WidgetState> states) {
|
||||||
shadowColor: Colors.transparent,
|
if (states.contains(WidgetState.pressed)) {
|
||||||
padding: const EdgeInsets.symmetric(vertical: 12),
|
return Colors.transparent;
|
||||||
shape: RoundedRectangleBorder(
|
}
|
||||||
|
return null;
|
||||||
|
},
|
||||||
|
),
|
||||||
|
backgroundColor: WidgetStateProperty.all(
|
||||||
|
AppTheme.errorColor,
|
||||||
|
),
|
||||||
|
foregroundColor: WidgetStateProperty.all(
|
||||||
|
Colors.white,
|
||||||
|
),
|
||||||
|
elevation: WidgetStateProperty.all(0),
|
||||||
|
shadowColor: WidgetStateProperty.all(
|
||||||
|
Colors.transparent,
|
||||||
|
),
|
||||||
|
padding: WidgetStateProperty.all(
|
||||||
|
const EdgeInsets.symmetric(vertical: 12),
|
||||||
|
),
|
||||||
|
shape: WidgetStateProperty.all(
|
||||||
|
RoundedRectangleBorder(
|
||||||
borderRadius: BorderRadius.circular(12),
|
borderRadius: BorderRadius.circular(12),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
),
|
||||||
child: const Text(
|
child: const Text(
|
||||||
'Delete Account',
|
'Delete Account',
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
|
|||||||
Reference in New Issue
Block a user