TestMethodChannelExtension extension

Shim to support the obsolete setMockMethodCallHandler and checkMockMethodCallHandler methods on MethodChannel in tests.

The implementations defer to TestDefaultBinaryMessengerBinding.defaultBinaryMessenger.

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

on

Methods

checkMockMethodCallHandler(Object? handler) bool

Available on MethodChannel, provided by the TestMethodChannelExtension extension

Shim for TestDefaultBinaryMessenger.checkMockMessageHandler.
setMockMethodCallHandler(Future? handler(MethodCall call)?) → void

Available on MethodChannel, provided by the TestMethodChannelExtension extension

Shim for TestDefaultBinaryMessenger.setMockMethodCallHandler.