MethodChannel class Null safety
A named channel for communicating with platform plugins using asynchronous method calls.
Method calls are encoded into binary before being sent, and binary results
received are decoded into Dart values. The MethodCodec used must be
compatible with the one used by the platform plugin. This can be achieved
by creating a method channel counterpart of this channel on the
platform side. The Dart type of arguments and results is
but only values supported by the specified MethodCodec can be used.
The use of unsupported values should be considered programming errors, and
will result in exceptions being thrown. The null value is supported
for all codecs.
The logical identity of the channel is given by its name. Identically named channels will interfere with each other's communication.
All MethodChannels provided by the Flutter framework guarantee FIFO ordering. Applications can assume method calls sent via a built-in MethodChannel are received by the platform plugins in the same order as they're sent.
- binaryMessenger → BinaryMessenger
The messenger used by this channel to send platform messages.
- codec → MethodCodec
The message codec used by this channel, not null.
- hashCode → int
The hash code for this object.
- name → String
The logical channel on which communication happens, not null.
- runtimeType → Type
A representation of the runtime type of the object.
T>( String method, [dynamic arguments]) → Future< List< T>?>
- An implementation of invokeMethod that can return typed lists.
K, V>( String method, [dynamic arguments]) → Future< Map< K, V>?>
- An implementation of invokeMethod that can return typed maps.
T>( String method, [dynamic arguments]) → Future< T?>
methodon this channel with the specified
Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed.
Future handler(MethodCall call)?) → void
- Sets a callback for receiving method calls on this channel.
) → String
A string representation of this object.