setMockMessageHandler method Null safety

void setMockMessageHandler(
  1. String channel,
  2. MessageHandler? handler
)

Shim for TestDefaultBinaryMessenger.setMockMessageHandler.

Implementation

// HYPERLINK ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
// TODO(ianh): deprecate this method: @NotYetDeprecated(
//   'Use tester.binding.defaultBinaryMessenger.setMockMessageHandler or '
//   'TestDefaultBinaryMessengerBinding.instance.defaultBinaryMessenger.setMockMessageHandler instead. '
//   'This feature was deprecated after v2.1.0-10.0.pre.'
// )
void setMockMessageHandler(String channel, MessageHandler? handler) {
  TestDefaultBinaryMessengerBinding.instance!.defaultBinaryMessenger.setMockMessageHandler(channel, handler);
}