invokeCommandFromSemantics method

Future<void> invokeCommandFromSemantics(
  1. AppCommand command, {
  2. BuildContext? buildContext,
})

invokeCommand for a semantic action, as invokeFromSemantics.

Implementation

Future<void> invokeCommandFromSemantics(
  AppCommand command, {
  BuildContext? buildContext,
}) async {
  final result = await invokeCommand(command, buildContext: buildContext);
  if (!semanticOutcomeOf(result)) throw const SemanticActionDeclined();
}