toastOf function
Implementation
Duration? toastOf(ToastLength? toastLength) {
if (toastLength == null) {
return null;
}
switch (toastLength) {
case ToastLength.LENGTH_SHORT:
return Duration(seconds: 2);
case ToastLength.LENGTH_LONG:
return Duration(seconds: 6);
default:
throw UnsupportedError(toastLength.toString());
}
}