MonaStyleAttributesListBloc constructor
MonaStyleAttributesListBloc({
- FilterMonaStyleAttributesModels? filter,
- bool? paged,
- String? orderBy,
- bool? descending,
- bool? detailed,
- EliudQuery? eliudQuery,
- required MonaStyleAttributesRepository monaStyleAttributesRepository,
- int monaStyleAttributesLimit = 5,
Implementation
MonaStyleAttributesListBloc(
{this.filter,
this.paged,
this.orderBy,
this.descending,
this.detailed,
this.eliudQuery,
required MonaStyleAttributesRepository monaStyleAttributesRepository,
this.monaStyleAttributesLimit = 5})
: _monaStyleAttributesRepository = monaStyleAttributesRepository,
super(MonaStyleAttributesListLoading()) {
on<LoadMonaStyleAttributesList>((event, emit) {
if ((detailed == null) || (!detailed!)) {
_mapLoadMonaStyleAttributesListToState();
} else {
_mapLoadMonaStyleAttributesListWithDetailsToState();
}
});
on<NewPage>((event, emit) {
pages = pages +
1; // it doesn't matter so much if we increase pages beyond the end
_mapLoadMonaStyleAttributesListWithDetailsToState();
});
on<MonaStyleAttributesChangeQuery>((event, emit) {
eliudQuery = event.newQuery;
if ((detailed == null) || (!detailed!)) {
_mapLoadMonaStyleAttributesListToState();
} else {
_mapLoadMonaStyleAttributesListWithDetailsToState();
}
});
on<AddMonaStyleAttributesList>((event, emit) async {
await _mapAddMonaStyleAttributesListToState(event);
});
on<UpdateMonaStyleAttributesList>((event, emit) async {
await _mapUpdateMonaStyleAttributesListToState(event);
});
on<DeleteMonaStyleAttributesList>((event, emit) async {
await _mapDeleteMonaStyleAttributesListToState(event);
});
on<MonaStyleAttributesListUpdated>((event, emit) {
emit(_mapMonaStyleAttributesListUpdatedToState(event));
});
}