show method

dynamic show(
  1. String text,
  2. BuildContext context, {
  3. Color? bgColor,
  4. Color? textColor,
  5. int duration = 3,
  6. int gravity = 0,
})

Implementation

show(String text, BuildContext context,
    {Color? bgColor, Color? textColor, int duration = 3, int gravity = 0}) {
  if (Platform.isLinux || Platform.isWindows || Platform.isMacOS) {
    FlutterToastr.show(
      text,
      context,
      duration: FlutterToastr.lengthLong,
    );
  } else {
    Fluttertoast.showToast(
        msg: text,
        toastLength: Toast.LENGTH_LONG,
        gravity: ToastGravity.BOTTOM,
        timeInSecForIosWeb: 1,
        backgroundColor: bgColor ?? AllColors().ORANGE,
        textColor: textColor ?? Colors.white,
        fontSize: 16.0);
  }
}