flutter_background_service
                                
                                
                                
                                    flutter_background_service copied to clipboard
                            
                            
                            
                        IOS: when you call Isolate.spawn, Error occur
call Isolate.spawn inner "onStart" function, you will get An error
  WidgetsFlutterBinding.ensureInitialized();
  FlutterBackgroundService.initialize(onStart);
  runApp(MyApp());
}
void onStart() {
  WidgetsFlutterBinding.ensureInitialized();
  var _mainReceiverPort = ReceivePort();
  Isolate.spawn(_sendSub, _mainReceiverPort.sendPort);
}```