RxResult<T> class

author: ZhengZaiHong email:1096877329@qq.com date: 2023/9/14 time: 16:21 describe: 响应结果包装类

Constructors

RxResult({T? value, SourcesType model = SourcesType.net})
向后兼容的构造方式,value 可能为 null
factory
RxResult.error(Object error)
factory
RxResult.success(T value, {SourcesType model = SourcesType.net})
成功结果的推荐构造方式,value 必定非 null
factory

Properties

error Object?
final
hashCode int
The hash code for this object.
no setterinherited
isError bool
no setter
isSuccess bool
no setter
model SourcesType
getter/setter pair
requiredValue → T
获取结果值(非 null 版本)。 当 isSuccess 为 true 时必定返回非 null 值;否则抛出 StateError
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
value → T?
获取结果值。 注意:返回类型为 T?,即使 isSuccess 为 true 也可能为 null(向后兼容)。 推荐使用 requiredValue 代替。
no setter

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

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