ImageResult<T> class

统一的图片操作结果包装器

替代所有返回 dynamic / null 的旧设计。 调用方通过 result.isSuccess 判断是否成功, 成功时读取 result.data,失败时读取 result.error

Constructors

ImageResult.failure(String? error)
const
ImageResult.success(T? data)
const

Properties

data → T?
final
error String?
final
hashCode int
The hash code for this object.
no setterinherited
isSuccess bool
no setter
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
toString() String
A string representation of this object.
override
when<R>({required R success(T data), required R failure(String error)}) → R

Operators

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