bloc_list 0.0.2 copy "bloc_list: ^0.0.2" to clipboard
bloc_list: ^0.0.2 copied to clipboard

A flexible and customizable list widget for Flutter applications using the BLoC pattern for state management. It offers dynamic data loading, state-dependent rendering, custom loader support, and erro [...]

Getting started #

TODO: A flexible and customizable list widget for Flutter applications using the BLoC pattern for state management. It offers dynamic data loading, state-dependent rendering, custom loader support, and error handling, ideal for creating responsive and user-friendly list views.

Usage #

TODO: Quick examples

  @override
  Widget build(BuildContext context) {
    return BlocList<AnnouncementModel, AnnouncementBloc, ListState>(
      title: "My todo list",
        emptyBuilder: (context, state) {
            return const Center(child: Text('Todo is empty'));
        },
      loadBuilder: (context, state) {
        return const Center(
            child: CircularProgressIndicator(
          color: Colors.black,
        ));
      },
      itemBuilder: (context, index, item) {
        var description = item.description.trim();
        var outputFormat = DateFormat('dd MMM yyyy HH:mm');
        var date = outputFormat.format(item.created);
        return ListTile(
          title: Text(description),
          subtitle: Padding(
            padding: const EdgeInsets.only(top: 5.0),
            child: Text(date),
          ),
        );
      },
      loadData: () async {
        BlocProvider.of<TodoBloc>(context).add(LoadDataEvent());
      },
      stateCondition: (state) => state,
    );
  }
class TodoBloc extends ListBloc<TodoModel> {
  TodoBloc(this.firebaseService)
      : super(
          dataProvider: () => [],
        );
}
3
likes
0
points
23
downloads

Publisher

unverified uploader

Weekly Downloads

A flexible and customizable list widget for Flutter applications using the BLoC pattern for state management. It offers dynamic data loading, state-dependent rendering, custom loader support, and error handling, ideal for creating responsive and user-friendly list views.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

flutter, flutter_bloc, meta

More

Packages that depend on bloc_list