PresentationListBloc constructor
PresentationListBloc({
- FilterPresentationModels? filter,
- bool? paged,
- String? orderBy,
- bool? descending,
- bool? detailed,
- EliudQuery? eliudQuery,
- required PresentationRepository presentationRepository,
- int presentationLimit = 5,
Implementation
PresentationListBloc(
{this.filter,
this.paged,
this.orderBy,
this.descending,
this.detailed,
this.eliudQuery,
required PresentationRepository presentationRepository,
this.presentationLimit = 5})
: _presentationRepository = presentationRepository,
super(PresentationListLoading()) {
on<LoadPresentationList>((event, emit) {
if ((detailed == null) || (!detailed!)) {
_mapLoadPresentationListToState();
} else {
_mapLoadPresentationListWithDetailsToState();
}
});
on<NewPage>((event, emit) {
pages = pages +
1; // it doesn't matter so much if we increase pages beyond the end
_mapLoadPresentationListWithDetailsToState();
});
on<PresentationChangeQuery>((event, emit) {
eliudQuery = event.newQuery;
if ((detailed == null) || (!detailed!)) {
_mapLoadPresentationListToState();
} else {
_mapLoadPresentationListWithDetailsToState();
}
});
on<AddPresentationList>((event, emit) async {
await _mapAddPresentationListToState(event);
});
on<UpdatePresentationList>((event, emit) async {
await _mapUpdatePresentationListToState(event);
});
on<DeletePresentationList>((event, emit) async {
await _mapDeletePresentationListToState(event);
});
on<PresentationListUpdated>((event, emit) {
emit(_mapPresentationListUpdatedToState(event));
});
}