Flutter Bloc await for response before continueing
Advertisements I have following code: class BidBloc extends Bloc<BidEvent, BidState> { final FirestoreRepository firestoreRepository; BidBloc({required this.firestoreRepository}) : super(BidsLoadingState()) { on<LoadAllBidsEvent>((event, emit) async { emit(BidsLoadingState()); Item item = event.item; Future getBids() async { List<Bid> bids = []; item.bids?.forEach((element) async { Bid? bid = await firestoreRepository.getBidByBidId(bidID: element); if (bid != null) { DbUser? dbUser = await firestoreRepository.getDBUserByDBUserId(… Read More Flutter Bloc await for response before continueing