LabelledBodyComponentListBloc constructor
LabelledBodyComponentListBloc({
- FilterLabelledBodyComponentModels? filter,
- bool? paged,
- String? orderBy,
- bool? descending,
- bool? detailed,
- EliudQuery? eliudQuery,
- required LabelledBodyComponentRepository labelledBodyComponentRepository,
- int labelledBodyComponentLimit = 5,
Implementation
LabelledBodyComponentListBloc(
{this.filter,
this.paged,
this.orderBy,
this.descending,
this.detailed,
this.eliudQuery,
required LabelledBodyComponentRepository labelledBodyComponentRepository,
this.labelledBodyComponentLimit = 5})
: _labelledBodyComponentRepository = labelledBodyComponentRepository,
super(LabelledBodyComponentListLoading()) {
on<LoadLabelledBodyComponentList>((event, emit) {
if ((detailed == null) || (!detailed!)) {
_mapLoadLabelledBodyComponentListToState();
} else {
_mapLoadLabelledBodyComponentListWithDetailsToState();
}
});
on<NewPage>((event, emit) {
pages = pages +
1; // it doesn't matter so much if we increase pages beyond the end
_mapLoadLabelledBodyComponentListWithDetailsToState();
});
on<LabelledBodyComponentChangeQuery>((event, emit) {
eliudQuery = event.newQuery;
if ((detailed == null) || (!detailed!)) {
_mapLoadLabelledBodyComponentListToState();
} else {
_mapLoadLabelledBodyComponentListWithDetailsToState();
}
});
on<AddLabelledBodyComponentList>((event, emit) async {
await _mapAddLabelledBodyComponentListToState(event);
});
on<UpdateLabelledBodyComponentList>((event, emit) async {
await _mapUpdateLabelledBodyComponentListToState(event);
});
on<DeleteLabelledBodyComponentList>((event, emit) async {
await _mapDeleteLabelledBodyComponentListToState(event);
});
on<LabelledBodyComponentListUpdated>((event, emit) {
emit(_mapLabelledBodyComponentListUpdatedToState(event));
});
}