showOverlay method

ExtendedOverlayEntry? showOverlay(
  1. Widget widget, {
  2. bool autoOff = false,
})

********* Overlay ********* /// 自定义Overlay

Implementation

/// 自定义Overlay
ExtendedOverlayEntry? showOverlay(Widget widget, {bool autoOff = false}) {
  assert(FlExtended().navigatorKey.currentState != null,
      'Set FlExtended().navigatorKey to one of [MaterialApp CupertinoApp WidgetsApp]');
  final OverlayState? overlay =
      FlExtended().navigatorKey.currentState!.overlay;
  if (overlay == null) return null;
  final ExtendedOverlayEntry entry =
      ExtendedOverlayEntry(autoOff: autoOff, widget: widget);
  overlay.insert(entry);
  if (!autoOff) _overlayEntryList.add(entry);
  return entry;
}