getOverlayEntry method

  1. @override
OverlayEntry getOverlayEntry(
  1. BuildContext context
)
override

Implementation

@override
getOverlayEntry(BuildContext context) {
  return OverlayEntry(builder: (ctx) {
    final pos = getOverlayPosition(context, props.align, constraints)
        .addMargin(props.margin);
    return Positioned(
      top: pos.top,
      left: pos.left,
      right: pos.right,
      bottom: pos.bottom,
      child: Container(
        constraints: constraints,
        child: TapRegion(
          groupId: props.groupId,
          onTapOutside: onTapOutside,
          child: Material(
            type: MaterialType.card,
            shape: props.shape ?? PopupMenuTheme.of(context).shape,
            color: props.color ?? PopupMenuTheme.of(context).surfaceTintColor,
            elevation:
                props.elevation ?? PopupMenuTheme.of(context).elevation ?? 4,
            shadowColor:
                props.shadowColor ?? PopupMenuTheme.of(context).shadowColor,
            surfaceTintColor: props.surfaceTintColor ??
                PopupMenuTheme.of(context).surfaceTintColor,
            clipBehavior: props.clipBehavior,
            borderRadius: props.borderRadius,
            borderOnForeground: props.borderOnForeground,
            child: child,
          ),
        ),
      ),
    );
  });
}