MethodChannel constructor

const MethodChannel(
  1. String name,
  2. [MethodCodec codec = const StandardMethodCodec(),
  3. BinaryMessenger? binaryMessenger]
)

Creates a MethodChannel with the specified name.

The codec used will be StandardMethodCodec, unless otherwise specified.

The default ServicesBinding.defaultBinaryMessenger instance is used if binaryMessenger is null.

Implementation

const MethodChannel(this.name, [this.codec = const StandardMethodCodec(), BinaryMessenger? binaryMessenger ])
    : _binaryMessenger = binaryMessenger;