showExpressivePopover function

Future<void> showExpressivePopover(
  1. BuildContext context, {
  2. required WidgetBuilder builder,
  3. ExpressiveComponentThemeData? style,
  4. Rect? anchor,
  5. ExpressiveMenuPosition position = ExpressiveMenuPosition.below,
  6. EdgeInsetsGeometry padding = const EdgeInsets.all(ExpressiveSpacing.s16),
  7. String? label,
})

Opens a popover of builder's content against anchor, a rectangle in global coordinates, or against context's own box. Resolves when it closes.

showExpressivePopover(context, builder: (context) => const Text('Saved to your library'))

Implementation

Future<void> showExpressivePopover(
  BuildContext context, {
  required WidgetBuilder builder,
  ExpressiveComponentThemeData? style,
  Rect? anchor,
  ExpressiveMenuPosition position = ExpressiveMenuPosition.below,
  EdgeInsetsGeometry padding = const EdgeInsets.all(ExpressiveSpacing.s16),
  String? label,
}) async {
  await _showMenuRoute(
    context,
    anchor: anchor,
    position: position,
    label: label,
    content: (context) => ExpressivePopoverSurface(
      padding: padding,
      style: style,
      child: builder(context),
    ),
  );
}