checkMockMessageHandler

myMethodChannel

...);

Tests that use package:test and test()
can be changed to use package:flutter_test and testWidgets()
to get access to a WidgetTester.

Code that does not have access to a WidgetTester can refer to
TestDefaultBinaryMessengerBinding.instance!.defaultBinaryMessenger
instead of tester.binding.defaultBinaryMessenger.

Tests that do not use the default test widgets binding
(AutomatedTestWidgetsFlutterBinding,
which is initialized by testWidgets) can mix the
TestDefaultBinaryMessengerBinding mixin into their
binding to get the same results.

Tests that manipulate onPlatformMessage will no longer
function as designed. To send mock messages to the framework,
consider using ChannelBuffers.push.
There is no mechanism to intercept messages from the plugins
and forward them to the framework in the new API.
If your use case requires such a mechanism, please file a bug.