error static method

void error(
  1. BuildContext context,
  2. String message, {
  3. Duration duration = _defaultShowDuration,
})

Displays an error-themed SnackBar message.

显示带有错误主题的 SnackBar 消息。

Implementation

static void error(
  BuildContext context,
  String message, {
  Duration duration = _defaultShowDuration,
}) {
  _showStyledSnackBar(
    context,
    message,
    Colors.red,
    Icons.error,
    duration,
  );
}