EngineCallResult class

engine.call 的统一返回结构体。

同时携带 native 返回的 code / message / data 三个字段:

  • code:0 表示成功,其他为 native 错误码或 -1(Dart 侧异常);
  • message:失败时的错误描述,成功时为 null
  • data:native 层透传的业务 JSON 字符串,默认 ''

Constructors

EngineCallResult({required int code, String? message, String data = ''})
const

Properties

code int
调用错误码,0 表示成功。
final
data String
native 层透传的业务 JSON 字符串。
final
hashCode int
The hash code for this object.
no setterinherited
isSuccess bool
是否成功。
no setter
message String?
调用失败描述,成功时为 null
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toCompletionHandler() CompletionHandler
将当前结果转换为对外的 CompletionHandler
toString() String
A string representation of this object.
inherited

Operators

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