showToast method

  1. @override
void showToast(
  1. String message,
  2. ToastDuration duration
)
override

Implementation

@override
void showToast(String message, ToastDuration duration) {
  Toast? length;

  switch (duration) {
    case ToastDuration.long:
      length = Toast.LENGTH_LONG;
      break;
    case ToastDuration.short:
      length = Toast.LENGTH_SHORT;
      break;
    default:
      assert(false, 'unsupported toast duration \'$duration\'');
  }

  Fluttertoast.showToast(msg: message, toastLength: length);
}