pull/1530/head
Ellet 1 year ago
parent cb06402059
commit b55a5a2261
No known key found for this signature in database
GPG Key ID: C488CC70BBCEF0D1
  1. 15
      lib/src/models/documents/history.dart

@ -1,5 +1,3 @@
import 'package:meta/meta.dart' show immutable;
import '../quill_delta.dart';
import '../structs/doc_change.dart';
import '../structs/history_changed.dart';
@ -14,7 +12,7 @@ class History {
this.lastRecorded = 0,
});
final HistoryStack stack = const HistoryStack.empty();
HistoryStack stack = HistoryStack.empty();
bool get hasUndo => stack.undo.isNotEmpty;
@ -121,14 +119,13 @@ class History {
}
}
@immutable
class HistoryStack {
const HistoryStack.empty()
: undo = const [],
redo = const [];
HistoryStack.empty()
: undo = [],
redo = [];
final List<Delta> undo;
final List<Delta> redo;
List<Delta> undo;
List<Delta> redo;
void clear() {
undo.clear();

Loading…
Cancel
Save