      <pre class="language-dart"><code class="language-dart">@override
void execute([TParam param]) {
  if (!_canExecute) {
    return;
  }

  if (_isRunning) {
    return;
  } else {
    _isRunning = true;
    _canExecuteSubject.add(false);
  }

  _commandResultsSubject.add(CommandResult&lt;TResult&gt;(
      _emitLastResult ? lastResult : null, null, true));

  try {
    final result = _func(param);
    lastResult = result;
    _commandResultsSubject.add(CommandResult&lt;TResult&gt;(result, null, false));