toast method

  1. @override
Future<void> toast(
  1. String text, {
  2. int? duration,
})
override

Implementation

@override
Future<void> toast(String text, {int? duration}) async {
  Fluttertoast.showToast(
    msg: text,
    toastLength: duration != null && duration > 2000
        ? Toast.LENGTH_LONG
        : Toast.LENGTH_SHORT,
    gravity: ToastGravity.BOTTOM,
    timeInSecForIosWeb: (duration ?? 2000) ~/ 1000,
    backgroundColor: Colors.black.withOpacity(0.7),
    textColor: Colors.white,
    fontSize: 16.0,
  );
}