ezbloc_flutter 0.3.1
ezbloc_flutter: ^0.3.1 copied to clipboard

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.

0
likes
110
pub points
38%
popularity

Publisher

muha.dev

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

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (LICENSE)

Dependencies

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

More

Packages that depend on ezbloc_flutter