Maksimka101/combine

Error when calling "platform.invokeMethod" inside Combine().spawn

Closed this issue · 1 comments

i want to call "platform.invokeMethod" inside the "Combine().spawn" method but it causes an exception

Combine().spawn((context) async {
final int result = await platform.invokeMethod('start_native');
print("Text from test asset:");
// Print: Text from test asset: Asset is loaded!
});

I/flutter (16188): ══╡ EXCEPTION CAUGHT BY SERVICES LIBRARY ╞══════════════════════════════════════════════════════════
I/flutter (16188): The following _CastError was thrown during a platform message response callback:
I/flutter (16188): type 'Null' is not a subtype of type 'List<dynamic>' in type cast
I/flutter (16188): 
I/flutter (16188): When the exception was thrown, this was the stack:
I/flutter (16188): #0      BackgroundIsolateBinaryMessenger.ensureInitialized.<anonymous closure> (package:flutter/src/services/_background_isolate_binary_messenger_io.dart:51:46)
I/flutter (16188): #7      _RawReceivePort._handleMessage (dart:isolate-patch/isolate_patch.dart:192:26)
I/flutter (16188): (elided 6 frames from dart:async)

Hello

Sorry for very very very long response. This issue is fixed in the combine 0.5.5