toast static method

Future<bool?> toast({
  1. required String msg,
  2. Color backgroundColor = Colors.black,
  3. Color textColor = Colors.white,
  4. ToastGravity? gravity,
  5. Toast? toastLength,
})

Implementation

static Future<bool?> toast({
  required String msg,
  Color backgroundColor = Colors.black,
  Color textColor = Colors.white,
  ToastGravity? gravity,
  Toast? toastLength,
}) =>
    Fluttertoast.showToast(
      msg: msg,
      toastLength: toastLength ?? Toast.LENGTH_SHORT,
      gravity: gravity ?? ToastGravity.TOP,
      timeInSecForIosWeb: 1,
      backgroundColor: backgroundColor,
      webBgColor: '#${backgroundColor.value.toRadixString(16).substring(2, 8)}',
      textColor: textColor,
      fontSize: 16,
    );