onMessage method Null safety

dynamic onMessage(
  1. String event,
  2. dynamic payload,
  3. {String? ref}
)

Overridable message hook

Receives all events for specialized message handling before dispatching to the channel callbacks. Must return the payload, modified or unmodified.

Implementation

dynamic onMessage(String event, dynamic payload, {String? ref}) {
  return payload;
}