Closed rodrigopequeno closed 1 month ago
I'm using ChangeStackSignal and I noticed when updating to the latest version (5.2.0/5.2.1) a different behavior than version 4.5.1.
Using the example in the documentation as a basis: Link
final s = ChangeStackSignal(0, limit: 2); s.value = 1; s.value = 2; s.value = 3; print(s.value); // 3 s.undo(); s.undo(); print(s.value); // 1 print(s.canUndo); // false s.redo(); print(s.value); // 2
The test below fails on expect(s.value, 1) as the current value is 3:
expect(s.value, 1)
3
void main() { test( 'should do undo N times', () { final s = changeStack(0, limit: 2); s.value = 1; s.value = 2; s.value = 3; expect(s.value, 3); // 3 s.undo(); s.undo(); expect(s.value, 1); // 1 expect(s.canUndo, false); // false s.redo(); expect(s.value, 2); // 2 }, ); }
Thanks for reporting, will try to reproduce!
Fixed and will be on the next release!
I'm using ChangeStackSignal and I noticed when updating to the latest version (5.2.0/5.2.1) a different behavior than version 4.5.1.
Using the example in the documentation as a basis: Link
The test below fails on
expect(s.value, 1)
as the current value is3
: