If you're running an application and need to access the binary messenger before `runApp()` has been called (for example, during plugin initialization), then you need to explicitly call the `WidgetsFlutterBinding.ensureInitialized()` first.
Example: ServicesBinding.defaultBinaryMessenger was accessed before the binding was initialized.
// add this, and it should be the first line in main method
WidgetsFlutterBinding.ensureInitialized();