Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix issue can't undo first item in history #6

Merged
merged 1 commit into from
Nov 16, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions lib/src/undo_stack.dart
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ class ChangeStack {
/// Can redo the previous change
bool get canRedo => _redos.isNotEmpty;

/// Can undo the previous change. If the history is equal to 1 this you cannot undo to null.
bool get canUndo => _history.isNotEmpty && _history.length > 1;
/// Can undo the previous change
bool get canUndo => _history.isNotEmpty;

/// Add New Change and Clear Redo Stack
FutureOr<void> add<T>(Change<T> change) async {
Expand Down