Answers for "FlutterError (ServicesBinding.defaultBinaryMessenger was accessed before the binding was initialized. If you're running an application and need to access the binary messenger before `runApp()` has been called"

7

ServicesBinding.defaultBinaryMessenger was accessed before the binding was initialized.

// add this, and it should be the first line in main method
  WidgetsFlutterBinding.ensureInitialized();
Posted by: Guest on June-20-2020

Code answers related to "FlutterError (ServicesBinding.defaultBinaryMessenger was accessed before the binding was initialized. If you're running an application and need to access the binary messenger before `runApp()` has been called"

Browse Popular Code Answers by Language