showSnackBar method

void showSnackBar(
  1. String message, {
  2. bool isError = false,
  3. Duration duration = const Duration(seconds: 3),
})

Implementation

void showSnackBar(
  String message, {
  bool isError = false,
  Duration duration = const Duration(seconds: 3),
}) {
  ScaffoldMessenger.of(this)
    ..hideCurrentSnackBar()
    ..showSnackBar(
      SnackBar(
        content: Text(message),
        backgroundColor: isError ? colors.error : colors.textPrimary,
        duration: duration,
      ),
    );
}