Skip to content
pubscout

replay_bloc

0.3.0, released 2 years ago by bloclibrary.dev

Adds automatic undo and redo support to bloc and cubit states.

WASM-readyQuiet but busy
$ flutter pub add replay_bloc
Source repository

What it does

Extends the bloc state management library to provide automatic undo and redo capabilities for blocs and cubits. It offers classes like ReplayCubit and ReplayBloc, along with mixins for integration with other classes like HydratedBloc.

AI-written summary of version 0.3.0, based on the package's README and metadata. Report an inaccuracy

Use it when

  • You are using the bloc state management library and need undo/redo functionality.
  • You want to allow users to revert or reapply state changes in your application.

Skip it when

  • You are not using the bloc or cubit state management library.
  • Your application does not require undo or redo capabilities.

Strengths

  • Seamless integration with package:bloc
  • Provides both dedicated classes and mixins for use with other bloc variants like HydratedBloc

Weaknesses

  • Limited strictly to the bloc ecosystem

Setup

Kind
Pure Dart
Effort
Low
Code generation
No
Direct dependencies
1
class CounterCubit extends ReplayCubit<int> {
  CounterCubit() : super(0);

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

Alternatives

Packages that do the same job and could replace replay_bloc.

  • yx_state

    A state management library for Dart and Flutter applications.

  • undo

    A clean and robust undo/redo library for Dart and Flutter using the Command Pattern.

  • bloc_tools

    Command-line tools for generating and linting bloc and cubit components.

  • bloc_signals_flutter

    Flutter UI extensions, providers, and bindings for the bloc_signals state management library.

Works with

Packages commonly used together with replay_bloc: ones it builds on, ones built on it, and its own family.