destructive static method
- BuildContext context, {
- required String label,
- Object? result,
- VoidCallback? onPressed,
A destructive action (e.g. "Delete") styled with the error color.
Implementation
static Widget destructive(
BuildContext context, {
required String label,
Object? result,
VoidCallback? onPressed,
}) => FilledButton(
style: FilledButton.styleFrom(
backgroundColor: Theme.of(context).colorScheme.error,
foregroundColor: Theme.of(context).colorScheme.onError,
),
onPressed: onPressed ?? () => Navigator.pop(context, result),
child: Text(label),
);