toJournal method
Serializes undo and redo stacks as a journal payload.
Implementation
Map<String, Object?> toJournal() {
return <String, Object?>{
_versionKey: schemaVersion,
_undoKey: _undoStack
.map(_serializeCommandForJournal)
.toList(growable: false),
_redoKey: _redoStack
.map(_serializeCommandForJournal)
.toList(growable: false),
};
}