changeStack<T> function

ChangeStackSignal<T> changeStack<T>(
  1. T value, {
  2. String? debugLabel,
  3. int? limit,
})

Change stack signal that can be used to call undo/redo on a value.

final s = changeStack(0);
s.value = 1;
s.value = 2;
s.value = 3;
print(s.value); // 3
s.undo();
print(s.value); // 2
s.redo();
print(s.value); // 3

Implementation

ChangeStackSignal<T> changeStack<T>(
  T value, {
  String? debugLabel,
  int? limit,
}) {
  return ChangeStackSignal<T>(
    value,
    debugLabel: debugLabel,
    limit: limit,
  );
}