ezbloc_flutter 0.9.3 copy "ezbloc_flutter: ^0.9.3" to clipboard
ezbloc_flutter: ^0.9.3 copied to clipboard

discontinuedreplaced by: flutter_state_management

Making blocs easy again. A simplified library for the original bloc approach.

Helper widgets to work with ezbloc library

Bloc Builder #

Keeps your UI in sync with the State of your app. It's StatelessWidget widget which only rebuilds the relative child, instead of rebuilding entire page.

BlocBuilder<BlocType, BlocStateType>(
  bloc: bloc
  onUpdate: (context, data) => Text(data.toString()),
  onBusy: (_) => Text('Working'),
  onError: (_, e) => Text('Error Occurred'),
)

Or a simpler version (extension method sugar):

bloc.builder(
  onUpdate: (context, data) => Text(data.toString()),
  onError: (_, e) => Text('Error Occurred: $e'),
)

for details see example

Bloc Container #

A container where you can store all your blocs on app startup, and then access them anywhere in your app independently of the widget tree.

void main() {
  BlocContainer.add((context, args) => CounterBloc(args));
  final counterBloc = BlocContainer.get(arg: 0);
}

see example

Bloc List Builder #

A builder which builds a ListView widget backed by a data source e.g. an infinite scrollable list backed by a rest api example coming soon

Contribution ❤ #

Issues and pull requests are welcome

Please file feature requests and bugs at the issue tracker.

2
likes
0
pub points
56%
popularity

Publisher

verified publishermuha.dev

Making blocs easy again. A simplified library for the original bloc approach.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

ezbloc, flutter, hive, path, quick_log, rxdart, synchronized

More

Packages that depend on ezbloc_flutter