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

code int
状态吗
final
data → T?
数据
final
hashCode int
The hash code for this object.
no setterinherited
message String
消息
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
success bool
是否成功
final

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