showMySnackBar static method

dynamic showMySnackBar(
  1. BuildContext context,
  2. String text, {
  3. Color? color,
})

Implementation

static showMySnackBar(BuildContext context,String text, {Color? color}){
  ScaffoldMessenger.of(context)
    .showSnackBar(
      SnackBar(
        content: Text(text, textAlign: TextAlign.center),
        backgroundColor: color ?? Theme.of(context).errorColor,
        behavior: SnackBarBehavior.floating,
      ),
    );
}