Skip to content
pubscout

abstract_bloc

3.2.0, released 6 months ago by an unverified publisher

Abstract base classes and widgets for implementing BLoC pattern with pagination, items, and forms.

WASM-ready
$ flutter pub add abstract_bloc
Source repository

What it does

Provides abstract base classes and ready-to-use widgets for common flutter_bloc use cases including paginated lists, single items, and forms with validation. It standardizes data flow with features like cache-first strategies, snapshot/revert states, and event bus integration.

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

Use it when

  • You are using flutter_bloc and want to reduce boilerplate for paginated lists, detail items, and validated forms
  • You need built-in cache-first data loading strategies with local or remote fallback
  • You want standardized UI widgets that automatically handle loading, error, and empty states for lists and forms

Skip it when

  • You prefer Riverpod or Provider for state management
  • You need completely custom state architectures that do not fit the list/item/form abstraction pattern

Strengths

  • Eliminates boilerplate for common BLoC patterns like pagination and forms
  • Includes ready-to-use UI builder widgets with built-in state handling
  • Supports cache-first strategies and snapshot/revert state patterns out of the box

Weaknesses

  • Tightly coupled to flutter_bloc and specific package base classes
  • Opinionated structure may feel restrictive for highly customized data flows

Setup

Kind
Flutter widgets
Effort
Low
Code generation
No
Direct dependencies
4

not documented

class UsersCubit extends AbstractListCubit<UsersState> {
  final UsersRepository _repository;

  UsersCubit(this._repository) : super(_initialState());

  @override
  Future<Result<GridResult<User>>> resolveData() {
    return _repository.getUsers(state.searchModel);
  }
}

Alternatives

Packages that do the same job and could replace abstract_bloc.

  • bloc

    If you want standard BLoC state management without the opinionated abstractions and built-in widget builders provided by this package.

Works with

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