MethodChannel constructor Null safety
- String name,
- [MethodCodec codec = const StandardMethodCodec(),
- BinaryMessenger? binaryMessenger]
Creates a MethodChannel with the specified name.
The codec used will be StandardMethodCodec, unless otherwise specified.
The name and codec arguments cannot be null. The default ServicesBinding.defaultBinaryMessenger
instance is used if binaryMessenger
is null.
Implementation
const MethodChannel(this.name, [this.codec = const StandardMethodCodec(), BinaryMessenger? binaryMessenger ])
: assert(name != null),
assert(codec != null),
_binaryMessenger = binaryMessenger;