AnchoredOverlay constructor
AnchoredOverlay({})
Implementation
AnchoredOverlay({
super.key,
required this.show,
this.hideDelay = Duration.zero,
bool barrierDismissible = true,
bool interceptPointer = true,
required List<Widget> entries,
required this.child,
}) : overlayBuilder = ((context, anchor, overlay) {
final content = Material(
type: MaterialType.transparency,
child: SizedBox.expand(
child: Stack(alignment: Alignment.center, children: [
if (barrierDismissible)
Positioned.fill(
child: GestureDetector(
behavior: HitTestBehavior.translucent,
onTapUp: (event) => anchor.contains(event.globalPosition) ? show.value = false : null,
onTapDown: (event) => anchor.contains(event.globalPosition) ? null : show.value = false)),
...entries,
]),
));
return AnchoredOverlayData._(
anchor: anchor, overlay: overlay, child: interceptPointer ? PointerInterceptor(child: content) : content);
});