showFluent2Menu<T> function

Future<T?> showFluent2Menu<T>(
  1. BuildContext context, {
  2. required List<Fluent2MenuItem<T>> items,
  3. BuildContext? anchor,
  4. String? title,
  5. String? label,
})

Opens a Fluent2Menu of items under the control context belongs to (a Builder round it) over the whole app; anchor widens the box it drops from. Completes with the value chosen, or null when it is dismissed.

final picked = await showFluent2Menu<String>(context, items: const [Fluent2MenuItem('rename', 'Rename')]);

Implementation

Future<T?> showFluent2Menu<T>(
  BuildContext context, {
  required List<Fluent2MenuItem<T>> items,
  BuildContext? anchor,
  String? title,
  String? label,
}) => Fluent2Menu.show<T>(
  context,
  items: items,
  anchor: anchor,
  title: title,
  label: label,
);