redo method

bool redo(
  1. FluentDocument document
)

Implementation

bool redo(FluentDocument document) {
  if (!canRedo) return false;

  final delta = _redoStack.removeLast();
  _undoStack.add(delta);

  _isRestoringState = true;
  try {
    delta.apply(document);
  } catch (e, st) {
    print('[UNDO_ERROR] apply failed: $e\n$st');
    _undoStack.removeLast();
    return false;
  } finally {
    _isRestoringState = false;
  }
  // Notify only the widgets whose nodes were touched by this delta.
  final affectedIds = _collectAffectedIds(delta, document);
  document.notifyDocumentChanged(affectedIds: affectedIds);
  _resetGrouping();
  return true;
}