showToast static method
void
showToast(
- BuildContext context,
- String text, {
- ToastType type = ToastType.success,
- ToastDurationType durationType = ToastDurationType.short,
- Icon? icon,
Static convenience method to display a toast without manually creating a Toast instance.
Example:
Toast.showToast(
context,
"Hello World",
type: ToastType.success,
);
Implementation
static void showToast(
BuildContext context,
String text, {
ToastType type = ToastType.success,
ToastDurationType durationType = ToastDurationType.short,
Icon? icon,
}) {
Toast.create(context).show(
text,
type: type,
durationType: durationType,
icon: icon,
);
}