BasicMessageChannel<T> constructor Null safety

const BasicMessageChannel<T>(
  1. String name,
  2. MessageCodec<T> codec,
  3. {BinaryMessenger? binaryMessenger}
)

Creates a BasicMessageChannel with the specified name, codec and binaryMessenger.

The name and codec arguments cannot be null. The default ServicesBinding.defaultBinaryMessenger instance is used if binaryMessenger is null.

Implementation

const BasicMessageChannel(this.name, this.codec, { BinaryMessenger? binaryMessenger })
    : assert(name != null),
      assert(codec != null),
      _binaryMessenger = binaryMessenger;