FollowingListBloc constructor
FollowingListBloc({
- FilterFollowingModels? filter,
- bool? paged,
- String? orderBy,
- bool? descending,
- bool? detailed,
- EliudQuery? eliudQuery,
- required FollowingRepository followingRepository,
- int followingLimit = 5,
Implementation
FollowingListBloc(
{this.filter,
this.paged,
this.orderBy,
this.descending,
this.detailed,
this.eliudQuery,
required FollowingRepository followingRepository,
this.followingLimit = 5})
: _followingRepository = followingRepository,
super(FollowingListLoading()) {
on<LoadFollowingList>((event, emit) {
if ((detailed == null) || (!detailed!)) {
_mapLoadFollowingListToState();
} else {
_mapLoadFollowingListWithDetailsToState();
}
});
on<NewPage>((event, emit) {
pages = pages +
1; // it doesn't matter so much if we increase pages beyond the end
_mapLoadFollowingListWithDetailsToState();
});
on<FollowingChangeQuery>((event, emit) {
eliudQuery = event.newQuery;
if ((detailed == null) || (!detailed!)) {
_mapLoadFollowingListToState();
} else {
_mapLoadFollowingListWithDetailsToState();
}
});
on<AddFollowingList>((event, emit) async {
await _mapAddFollowingListToState(event);
});
on<UpdateFollowingList>((event, emit) async {
await _mapUpdateFollowingListToState(event);
});
on<DeleteFollowingList>((event, emit) async {
await _mapDeleteFollowingListToState(event);
});
on<FollowingListUpdated>((event, emit) {
emit(_mapFollowingListUpdatedToState(event));
});
}