showSnackbarError static method

dynamic showSnackbarError(
  1. String message, {
  2. TextStyle? style,
})

muestra mensaje con backgroundColor color rojo, para representar mensaje de error, recibe message style Puede ser nulo y pode defecto toma un valor

Implementation

static showSnackbarError(String message, {TextStyle? style}) {
  messagerKey.currentState!.clearSnackBars();

  ///Se define el mensaje que mostrara
  final snackbar = SnackBar(
    shape: _custoBorder,
    behavior: SnackBarBehavior.floating,
    backgroundColor: Colors.red.withOpacity(0.9),
    content: Text(
      message,
      style: style ??
          const TextStyle(
            color: Colors.white,
          ),
    ),
  );
  messagerKey.currentState!.showSnackBar(snackbar);
}