checkMessageHandler method Null safety

  1. @override
bool checkMessageHandler (
  1. String channel,
  2. MessageHandler? handler

Returns true if the handler argument matches the handler previously passed to setMessageHandler.

This method is useful for tests or test harnesses that want to assert the handler for the specified channel has not been altered by a previous test.

Passing null for the handler returns true if the handler for the channel is not set.


bool checkMessageHandler(String channel, MessageHandler? handler) => _handlers[channel] == handler;