show static method

Future<void> show(
  1. BuildContext context,
  2. String message, {
  3. Duration duration = const Duration(seconds: 2),
})

Show a toast at the bottom of the page using Overlay.

Implementation

static Future<void> show(
  BuildContext context,
  String message, {
  Duration duration = const Duration(seconds: 2),
}) async {
  final OverlayState overlay = Overlay.of(context);

  final MiniTheme theme = MiniThemeProvider.of(context);

  await miniShowOverlayEntry(
    overlay: overlay,
    duration: duration,
    builder: (BuildContext overlayContext) {
      return Positioned.fill(
        child: IgnorePointer(
          child: SafeArea(
            child: Align(
              alignment: Alignment.bottomCenter,
              child: Padding(
                padding: EdgeInsets.only(bottom: theme.spacing.xl),
                child: MiniToast(message: message),
              ),
            ),
          ),
        ),
      );
    },
  );
}