FlutterChannelJson<T> class
规范 Flutter 通道消息格式
Constructors
- FlutterChannelJson({required int code, required String message, T? data, required bool success})
-
默认初始化
code 状态码
message 消息
data 数据
success 是否成功
const
- FlutterChannelJson.failure(String message)
-
初始化失败格式
message
消息factory -
FlutterChannelJson.fromJson(Map<
String, dynamic> json) -
根据字典初始化
json
字典factory - FlutterChannelJson.fromJsonString(String jsonString)
-
根据 JSON 字符串初始化
jsonString
JSON 字符串factory - FlutterChannelJson.success(T data)
-
初始化成功格式
data
数据factory
Properties
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toJson(
) → Map< String, dynamic> - 将对象转换为字典
-
toJsonString(
) → String - 将对象转换为字符串
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited