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

Available on BinaryMessenger, provided by the TestBinaryMessengerExtension extension

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

Available on BinaryMessenger, provided by the TestBinaryMessengerExtension extension

Shim for TestDefaultBinaryMessenger.setMockMessageHandler.