Invalid argument(s): Illegal argument in isolate message: object is unsendable when trying to rotate an image

Issue I’ve created a basic example to simulate my issue, here is the code: import ‘dart:async’; import ‘dart:isolate’; import ‘package:flutter/material.dart’; import ‘package:flutter/services.dart’; import ‘package:image/image.dart’ as img; class Home extends StatefulWidget { const Home({super.key}); @override State<Home> createState() => _HomeState(); } class

Continue reading

Flutter Bloc await for response before continueing

Issue 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?

Continue reading

Flutter Riverpod StreamProvider not waiting for for loop to finish before building Widget

Issue I have a StreamProvider here: final secondTabProvider = StreamProvider((ref){ EmergencyContactsController contacts = EmergencyContactsController(currentUserID: ref.read(authProvider).currentUser!.uid); return contacts.getUserEmergencyContacts(); }); And I call it in my build method like so: _secondTab.when( data: (data) { if (!data.exists){ return Text("no data") } Map<String, dynamic

Continue reading