redo method

  1. @override
bool redo()
override

Implementation

@override
bool redo() {
  if (!canRedo()) {
    return false;
  }
  final next = _eventCursor.next;
  if (next == null) {
    throw StateError('There should have been an next link');
  }

  final nextEvent = next.value.visit(
    just: (e) => e,
    none: () => throw StateError('There should have been an next event'),
  );
  _eventCursor = next;
  _snapshot = snapshot.rebuild(nextEvent.applyTo);
  return true;
}