ListManager<I extends ItemClassWithAccessor, T extends ItemSourceState<ItemClassWithAccessor> , B extends Bloc> constructor
const
ListManager<I extends ItemClassWithAccessor, T extends ItemSourceState<ItemClassWithAccessor> , B extends Bloc> ({})
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);