OptionalMethodChannel class

A MethodChannel that ignores missing platform plugins.

When invokeMethod fails to find the platform plugin, it returns null instead of throwing an exception.

Inheritance

Constructors

OptionalMethodChannel(String name, [ MethodCodec codec = const StandardMethodCodec() ])
Creates a MethodChannel that ignores missing platform plugins.
const

Properties

codec MethodCodec
The message codec used by this channel, not null.
final, inherited
hashCode int
The hash code for this object. [...]
read-only, inherited
name String
The logical channel on which communication happens, not null.
final, inherited
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited

Methods

invokeMethod(String method, [ dynamic arguments ]) Future
Invokes a method on this channel with the specified arguments. [...]
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
@pragma('vm:entry-point'), inherited
setMethodCallHandler(Future handler(MethodCall call)) → void
Sets a callback for receiving method calls on this channel. [...]
inherited
setMockMethodCallHandler(Future handler(MethodCall call)) → void
Sets a mock callback for intercepting method invocations on this channel. [...]
inherited
toString() String
Returns a string representation of this object.
inherited

Operators

operator ==(dynamic other) bool
The equality operator. [...]
inherited