show<T> static method

Future<T?> show<T>(
  1. BuildContext context,
  2. Widget child, {
  3. Duration duration = const Duration(seconds: 3),
  4. Color? backgroundColor,
  5. double? elevation,
  6. Color? shadowColor,
  7. Color? surfaceTintColor,
  8. ShapeBorder? shape,
  9. Clip clipBehavior = Clip.none,
  10. AlignmentGeometry? alignment,
  11. EdgeInsets? margin,
  12. EdgeInsets? padding,
  13. Color? iconColor,
  14. TextStyle? textStyle,
  15. bool queue = true,
})

Emit a message for the specified duration.

Implementation

static Future<T?> show<T>(
  BuildContext context,
  Widget child, {
  Duration duration = const Duration(seconds: 3),
  Color? backgroundColor,
  double? elevation,
  Color? shadowColor,
  Color? surfaceTintColor,
  ShapeBorder? shape,
  Clip clipBehavior = Clip.none,
  AlignmentGeometry? alignment,
  EdgeInsets? margin,
  EdgeInsets? padding,
  Color? iconColor,
  TextStyle? textStyle,
  bool queue = true,
}) {
  return context.findAncestorStateOfType<_ToastState>()!.show(
      ToastMessage(
        child: child,
        duration: duration,
        backgroundColor: backgroundColor,
        elevation: elevation,
        shadowColor: shadowColor,
        surfaceTintColor: surfaceTintColor,
        shape: shape,
        clipBehavior: clipBehavior,
        alignment: alignment,
        margin: margin,
        padding: padding,
        iconColor: iconColor,
        textStyle: textStyle,
      ),
      queue: queue);
}