Refactor delete account button styles to use ButtonStyle for improved customization and consistency
This commit is contained in:
@@ -911,15 +911,34 @@ class _AccountSettingsDialogState extends State<AccountSettingsDialog> {
|
|||||||
width: 160,
|
width: 160,
|
||||||
child: ElevatedButton(
|
child: ElevatedButton(
|
||||||
onPressed: _showDeleteAccountConfirmation,
|
onPressed: _showDeleteAccountConfirmation,
|
||||||
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)) {
|
||||||
shape: RoundedRectangleBorder(
|
return Colors.transparent;
|
||||||
|
}
|
||||||
|
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),
|
||||||
),
|
),
|
||||||
padding: const EdgeInsets.symmetric(vertical: 12),
|
),
|
||||||
),
|
),
|
||||||
child: const Text(
|
child: const Text(
|
||||||
'Delete Account',
|
'Delete Account',
|
||||||
|
|||||||
Reference in New Issue
Block a user