Interface class

A named interface for invoking platform methods directly with arguments.

In contrast to Flutter channels, there is no need to write if-else distribution logic for methods or encode and decode parameters. An Interface can automatically converts argument lists and return values between languages and supports both synchronous and asynchronous calls.

Constructors

Interface(String name)
Creates a Interface with a unique name.

Properties

hashCode int
The hash code for this object.
no setterinherited
name String
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

invokeMethod<T>(String method, {List? args}) Future<T>
Invoke a native method asynchronously.
invokeMethodSync<T>(String method, {List? args}) → T
Invoke a native method synchronously.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
setMethodCallHandler(String method, Function? function) → void
Sets a callback for receiving method calls on this interface.
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited