showOverlay function
void
showOverlay(
- BuildContext context, {
- required GlobalKey<
State< key,StatefulWidget> > - bool opaque = false,
- required Widget builder(
- BuildContext context,
- VoidCallback close
- double? width,
- double? height,
Implementation
void showOverlay(
BuildContext context, {
required GlobalKey key,
bool opaque = false,
required Widget Function(BuildContext context, VoidCallback close) builder,
double? width,
double? height,
}) {
_overlayEntry = OverlayEntry(
opaque: opaque,
builder: (context) => OverlayEntryWidget(
widgetKey: key,
width: width,
height: height,
builder: (context) {
return builder(context, _closeOverlay);
},
close: _closeOverlay,
),
);
Overlay.of(context).insert(_overlayEntry!);
}