ChatMemberInfoListBloc constructor
ChatMemberInfoListBloc({
- FilterChatMemberInfoModels? filter,
- bool? paged,
- String? orderBy,
- bool? descending,
- bool? detailed,
- EliudQuery? eliudQuery,
- required ChatMemberInfoRepository chatMemberInfoRepository,
- int chatMemberInfoLimit = 5,
Implementation
ChatMemberInfoListBloc(
{this.filter,
this.paged,
this.orderBy,
this.descending,
this.detailed,
this.eliudQuery,
required ChatMemberInfoRepository chatMemberInfoRepository,
this.chatMemberInfoLimit = 5})
: _chatMemberInfoRepository = chatMemberInfoRepository,
super(ChatMemberInfoListLoading()) {
on<LoadChatMemberInfoList>((event, emit) {
if ((detailed == null) || (!detailed!)) {
_mapLoadChatMemberInfoListToState();
} else {
_mapLoadChatMemberInfoListWithDetailsToState();
}
});
on<NewPage>((event, emit) {
pages = pages +
1; // it doesn't matter so much if we increase pages beyond the end
_mapLoadChatMemberInfoListWithDetailsToState();
});
on<ChatMemberInfoChangeQuery>((event, emit) {
eliudQuery = event.newQuery;
if ((detailed == null) || (!detailed!)) {
_mapLoadChatMemberInfoListToState();
} else {
_mapLoadChatMemberInfoListWithDetailsToState();
}
});
on<AddChatMemberInfoList>((event, emit) async {
await _mapAddChatMemberInfoListToState(event);
});
on<UpdateChatMemberInfoList>((event, emit) async {
await _mapUpdateChatMemberInfoListToState(event);
});
on<DeleteChatMemberInfoList>((event, emit) async {
await _mapDeleteChatMemberInfoListToState(event);
});
on<ChatMemberInfoListUpdated>((event, emit) {
emit(_mapChatMemberInfoListUpdatedToState(event));
});
}