ListManager<I extends ItemClassWithAccessor, T extends ItemSourceState<ItemClassWithAccessor>, B extends Bloc> constructor

const ListManager<I extends ItemClassWithAccessor, T extends ItemSourceState<ItemClassWithAccessor>, B extends Bloc>({
  1. required Widget child,
  2. B? sourceBloc,
  3. List<String> filterProperties = const [],
  4. List<String> searchProperties = const [],
  5. Key? key,
})

Intended to be the main entry point and the only widget one should ever construct when using this package. UI needing to consume the child blocs should do so via traditional BlocBuilder implementations.

class YourListWidget extends StatelessWidget {
  @override
  build(context) {
    return Scaffold(
      appBar: AppBar(
        title: Text('List Widget'),
      ),
      body: BlocProvider<YourItemSourceBloc>(
        create: (_) => YourItemSourceBloc(),
        child: ListManager<
            YourItemClass,
            YourSourceBlocStateWithItems,
            YourItemSourceBloc>(
          filterProperties: ['property1'],
          searchProperties: ['property2'],
          child: Column(
            children: [
              BlocBuilder<FilterConditionsBloc, FilterConditionsState>(
                builder: (context, state) {
                  return Text('Render your filter conditions UI.');
                },
              ),
              BlocBuilder<SearchQueryCubit, String>(
                builder: (context, state) {
                  return Text('Render your Search UI.');
                },
              ),
              BlocBuilder<ItemListBloc, ItemListState>(
                builder: (context, state) {
                  return Text('Render your list UI.');
                },
              ),
            ],
          ),
        ),
      ),
    );
  }
}

Implementation

const ListManager({
  required this.child,
  this.sourceBloc,
  this.filterProperties = const [],
  this.searchProperties = const [],
  Key? key,
}) : super(key: key);