replay_cubit 0.1.0 copy "replay_cubit: ^0.1.0" to clipboard
replay_cubit: ^0.1.0 copied to clipboard

discontinued
outdated

An extension to the cubit state management library which adds support for undo and redo.

Cubit

Pub build coverage Star on GitHub License: MIT Starware

An extension to the cubit state management library which adds support for undo and redo.

Creating a ReplayCubit #

class CounterCubit extends ReplayCubit<int> {
  CounterCubit() : super(0);

  void increment() => emit(state + 1);
}

Using a ReplayCubit #

void main() async {
  final cubit = CounterCubit();

  // trigger a state change
  cubit.increment();
  print(cubit.state); // 1

  // undo the change
  cubit.undo();
  print(cubit.state); // 0

  // redo the change
  cubit.redo();
  print(cubit.state); // 1
}

Dart Versions #

  • Dart 2: >= 2.7.0

Maintainers #

Starware #

ReplayCubit is Starware.
This means you're free to use the project, as long as you star its GitHub repository.
Your appreciation makes us grow and glow up. ⭐

11
likes
40
pub points
50%
popularity

Publisher

verified publisherbloc-dev.com

An extension to the cubit state management library which adds support for undo and redo.

Repository (GitHub)
View/report issues
Contributing

License

MIT (LICENSE)

Dependencies

cubit

More

Packages that depend on replay_cubit