FlutterChannel class

作者: zhangchenzhou 时间: 2023/4/14 14:57 描述: Channel通信插件 单例类 使用极简单例写法 作用:创建一个默认预置的消息通道,从而方便flutter与原生间的方法调用及相互处理。

  1. 注册消息通道方法
  2. 移除消息通道
  3. 发送消息
  4. 接收消息

Properties

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

Methods

addMessenger<T extends BaseMessengerHandler>({required T messenger}) → void
注册 方法的消息处理器
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
removeMessenger(String methodName) → void
移除消息处理器
send({required String methodName, Map<String, dynamic>? params}) Future<Map<String, dynamic>?>
发送发送指定信息到某一个方法中。
toString() String
A string representation of this object.
inherited

Operators

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

Static Properties

instance FlutterChannel
final