TestBinaryMessengerExtension extension

Shim to support the obsolete setMockMessageHandler and checkMockMessageHandler methods on BinaryMessenger in tests.

The implementations defer to TestDefaultBinaryMessengerBinding.defaultBinaryMessenger.

Rather than calling setMockMessageHandler on the ServicesBinding.defaultBinaryMessenger, use tester.binding.defaultBinaryMessenger.setMockMessageHandler directly. This more accurately represents the actual method invocation.

on

Methods

checkMockMessageHandler(String channel, Object? handler) bool
Shim for TestDefaultBinaryMessenger.checkMockMessageHandler.
setMockMessageHandler(String channel, MessageHandler? handler) → void
Shim for TestDefaultBinaryMessenger.setMockMessageHandler.