show static method

void show(
  1. BuildContext context, {
  2. Widget? body,
  3. bool dismissible = false,
  4. Color backgroundColor = const Color(0x66000000),
})

Implementation

static void show(
    BuildContext context, {
      Widget? body,
      bool dismissible = false,
      Color backgroundColor = const Color(0x66000000),
    }) {
  if (_isShowing) return;
  _isShowing = true;

  _overlayEntry = OverlayEntry(
    builder: (_) => GestureDetector(
      onTap: dismissible ? () => hide() : null,
      child: Stack(
        alignment: Alignment.center,
        children: [
          Positioned.fill(
            child: Container(color: backgroundColor),
          ),

          _AnimatedDialogBody(
            child: body ??
                const SizedBox(
                  height: 100,
                  width: 100,
                  child: LoadingPro(), // your spinner widget
                ),
          ),
        ],
      ),
    ),
  );

  Overlay.of(context, rootOverlay: true).insert(_overlayEntry!);
}