executeCommand method
Implementation
bool executeCommand(
String id,
FluentDocument document, {
BuildContext? buildContext,
}) {
final command = _commands[id];
if (command == null) return false;
final context = FluentCommandContext(document, buildContext: buildContext);
if (command.canExecute?.call(context) == false) return false;
if (command.undoDescription != null) {
document.saveState(
description: command.undoDescription!,
forceNewAction: command.forceNewUndoAction,
);
}
command.execute(context);
return true;
}