rmawatson/flutter_isolate

userMessage can only be String?

Closed this issue · 1 comments

https://github.com/rmawatson/flutter_isolate/blob/master/lib/flutter_isolate.dart#L121

E/flutter ( 6189): [ERROR:flutter/lib/ui/ui_dart_state.cc(148)] Unhandled Exception: type '_SendPortImpl' is not a subtype of type 'String'
E/flutter ( 6189): #0      FlutterIsolate._isolateInitialize.<anonymous closure>.<anonymous closure> (package:flutter_isolate/flutter_isolate.dart:121:22)
E/flutter ( 6189): #1      _rootRunUnary (dart:async/zone.dart:1136:13)
E/flutter ( 6189): #2      _CustomZone.runUnary (dart:async/zone.dart:1029:19)
E/flutter ( 6189): #3      _CustomZone.runUnaryGuarded (dart:async/zone.dart:931:7)
E/flutter ( 6189): #4      _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:336:11)
E/flutter ( 6189): #5      _BufferingStreamSubscription._add (dart:async/stream_impl.dart:263:7)
E/flutter ( 6189): #6      _SyncStreamController._sendData (dart:async/stream_controller.dart:764:19)
E/flutter ( 6189): #7      _StreamController._add (dart:async/stream_controller.dart:640:7)
E/flutter ( 6189): #8      _StreamController.add (dart:async/stream_controller.dart:586:5)
E/flutter ( 6189): #9      _RawReceivePortImpl._handleMessage (dart:isolate/runtime/libisolate_patch.dart:171:12)

No, my mistake, that should be any Object. You'll notice that a regular SendPort is used to pass across the user message after the isolate is setup, so it can send whatever you can send with a dart SendPort