show static method

OverlayEntry show(
  1. BuildContext context
)

Show a full-screen loading overlay and return its OverlayEntry so the caller can dismiss it later.

Implementation

static OverlayEntry show(BuildContext context) {
  final OverlayState overlay = Overlay.of(context);

  final MiniTheme theme = MiniThemeProvider.of(context);

  late final OverlayEntry entry;
  entry = OverlayEntry(
    builder: (BuildContext overlayContext) {
      return ColoredBox(
        color: const Color(0x66000000),
        child: Center(
          child: MiniCard(
            child: Padding(
              padding: EdgeInsets.all(theme.spacing.lg),
              child: const MiniLoading(),
            ),
          ),
        ),
      );
    },
  );

  overlay.insert(entry);
  return entry;
}