showCommandMenuDialog function

Future<PluginCommandConfig?> showCommandMenuDialog({
  1. required BuildContext context,
  2. required String title,
  3. required List<PluginCommandConfig> commands,
})

Implementation

Future<PluginCommandConfig?> showCommandMenuDialog({
  required BuildContext context,
  required String title,
  required List<PluginCommandConfig> commands,
}) => showOverlayDialog<PluginCommandConfig>(
  context: context,
  builder: (context, completer, entry) => CommandMenuDialog(
    title: title,
    commands: commands,
    onSelect: (command) {
      completer.complete(command);
      entry?.remove();
    },
    onCancel: () {
      completer.complete(null);
      entry?.remove();
    },
  ),
);