showErrorFlashbar method

Future<void> showErrorFlashbar({
  1. String message = 'Oops, something went wrong.',
  2. Duration duration = const Duration(seconds: 3),
})

Shows an error flashbar/toast with a customizable info message (optional).

It uses the following theme values for styling:

  • dialogBackgroundColor
  • textTheme.bodyText2
  • iconTheme.size

Implementation

Future<void> showErrorFlashbar({
  String message = 'Oops, something went wrong.',
  Duration duration = const Duration(seconds: 3),
}) {
  return _showFlashbar(
    message,
    duration: duration,
    icon: Icons.error_outline_rounded,
    iconColor: Colors.red.shade400,
  );
}