toast method

void toast({
  1. String? message,
  2. Widget? widget,
  3. ToastAlignment alignment = ToastAlignment.bottom,
  4. Duration? duration,
  5. bool opaque = false,
  6. bool maintainState = false,
  7. bool replace = true,
})

Implementation

void toast({
  String? message,
  Widget? widget,
  ToastAlignment alignment = ToastAlignment.bottom,
  Duration? duration,
  bool opaque = false,
  bool maintainState = false,
  bool replace = true,
}) {
  var widgetView = widget;
  if (widget == null) {
    widgetView = buildDefToastOverlay(context,
        message: message, duration: 2, alignment: alignment);
  }
  _toastTier.show(context, widgetView!,
      duration: duration ?? const Duration(seconds: 2),
      opaque: opaque,
      maintainState: maintainState,
      replace: replace);
}