Hi I'm having trouble with this plugin, it doesn't seem to work with other plugins. Am I doing something wrong?
Error:
[VERBOSE-2:dart_isolate.cc(1111)] Unhandled exception:
'package:flutter/src/services/platform_channel.dart': Failed assertion: line 134 pos 7: '_binaryMessenger != null || ServicesBinding.instance != null': Cannot use this MethodChannel before the binary messenger has been initialized. This happens when you invoke platform methods before the WidgetsFlutterBinding has been initialized. You can fix this by either calling WidgetsFlutterBinding.ensureInitialized() before this or by passing a custom BinaryMessenger instance to MethodChannel().
#0 _AssertionError._doThrowNew (dart:core-patch/errors_patch.dart:51:61)
#1 _AssertionError._throwNew (dart:core-patch/errors_patch.dart:40:5)
#2 MethodChannel.binaryMessenger (package:flutter/src/services/platform_channel.dart:134:7)
#3 MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:167:36)
#4 MethodChannel.invokeMethod (package:flutter/src/services/platform_channel.dart:350:12)
#5 MethodChannel.invokeListMethod (package:flutter/src/services/platform_channel.dart:363:41)
#6 MethodChannelFirebase._initializeCore (package:firebase_core_platform_interface/src/method_channel/method_channel_firebase.dart:31:37)
#7 MethodChannelFirebase.initializeApp (package:firebase_core_platform_interface/src/method_channel/method_channel_firebase.dart:73:13)
Performing await Firebase.initializeApp(); in the isolate is causing the error. Also await SharedPreferences.getInstance() causes the same error (and probably many more plugins as well).
Hi I'm having trouble with this plugin, it doesn't seem to work with other plugins. Am I doing something wrong?
Error:
Performing
await Firebase.initializeApp();
in the isolate is causing the error. Alsoawait SharedPreferences.getInstance()
causes the same error (and probably many more plugins as well).I also have this in main.dart
My plugins are:
I spawn the isolate like so in App() statefulwidget: