AsynchronousMethodChannel constructor

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

Creates a AsynchronousMethodChannel 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

AsynchronousMethodChannel(
  String name, [
  MethodCodec codec = const StandardMethodCodec(),
  BinaryMessenger? binaryMessenger,
])  : this._channel = MethodChannel(name, codec, binaryMessenger) {
  setMethodCallHandler((call) async {
    throw UnimplementedError(
        "This method ${call.method} has not been implemented yet");
  });
}