showToast static method

OverlayShower showToast(
  1. String text, {
  2. String? key,
  3. bool isStateful = false,
  4. BoxShadow? shadow,
  5. EdgeInsets? padding,
  6. TextStyle? textStyle,
  7. BorderRadius? radius,
  8. Decoration? decoration,
  9. Color? backgroundColor,
  10. void onWidgetBuild(
    1. Widget widget
    )?,
  11. Curve? curve,
  12. Duration? appearDuration,
  13. Duration? dismissDuration,
  14. Duration? onScreenDuration,
  15. Offset? slideBegin,
  16. double? opacityBegin,
  17. Widget appearAnimatedBuilder(
    1. OverlayShower shower,
    2. AnimationController controller,
    3. Widget widget
    )?,
  18. Widget dismissAnimatedBuilder(
    1. OverlayShower shower,
    2. AnimationController controller,
    3. Widget widget
    )?,
})

Toast

Implementation

static OverlayShower showToast(
  String text, {
  String? key,
  bool isStateful = false,
  // widget properties
  BoxShadow? shadow,
  EdgeInsets? padding,
  TextStyle? textStyle,
  BorderRadius? radius,
  Decoration? decoration,
  Color? backgroundColor,
  void Function(Widget widget)? onWidgetBuild,
  // animation properties
  Curve? curve,
  Duration? appearDuration,
  Duration? dismissDuration,
  Duration? onScreenDuration, // if set to Duration.zero, should dismiss manually
  // animation settings
  Offset? slideBegin,
  double? opacityBegin,
  Widget Function(OverlayShower shower, AnimationController controller, Widget widget)? appearAnimatedBuilder,
  Widget Function(OverlayShower shower, AnimationController controller, Widget widget)? dismissAnimatedBuilder,
}) {
  Widget widget = isStateful ? AnyToastWidget(text: text) : AnyToastView(text: text);
  (widget as AnyToastWidgetProperties)
    ..radius = radius
    ..shadow = shadow
    ..padding = padding
    ..textStyle = textStyle
    ..decoration = decoration
    ..backgroundColor = backgroundColor;
  onWidgetBuild?.call(widget);
  return show(
    key: key,
    child: widget,
    curve: curve,
    appearDuration: appearDuration,
    dismissDuration: dismissDuration,
    onScreenDuration: onScreenDuration,
    slideBegin: slideBegin,
    opacityBegin: opacityBegin,
    appearAnimatedBuilder: appearAnimatedBuilder,
    dismissAnimatedBuilder: dismissAnimatedBuilder,
  );
}