WFutureConfig class

异步操作配置类

Constructors

WFutureConfig({bool showLoading = true, VoidCallback? loadingCallback, VoidCallback? loadingCompleteCallback, void errorHandler(dynamic error)?})
构造函数

Properties

errorHandler ↔ void Function(dynamic error)?
自定义错误处理回调
getter/setter pair
hashCode int
The hash code for this object.
no setterinherited
loadingCallback VoidCallback?
加载中回调函数
getter/setter pair
loadingCompleteCallback VoidCallback?
加载完成回调函数
getter/setter pair
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
showLoading bool
是否显示加载中
getter/setter pair

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
one<T, R>(Future<T> func(), {R? onSuccess(T)?, void onError(dynamic error)?, WCancelToken? cancelToken}) Future<R?>
执行单个异步操作
oneWithRetry<T, R>(Future<T> func(), {R? onSuccess(T)?, void onError(dynamic error)?, int retryCount = 3, Duration retryDelay = const Duration(seconds: 1), WCancelToken? cancelToken}) Future<R?>
执行单个异步操作并支持重试
oneWithTimeout<T, R>(Future<T> func(), Duration timeout, {R? onSuccess(T)?, void onError(dynamic error)?, WCancelToken? cancelToken}) Future<R?>
执行单个异步操作并支持超时
series<T, R>(List<Future<T> Function()> funcs, {R? onSuccess(List<T>)?, void onError(dynamic error)?, WCancelToken? cancelToken}) Future<R?>
按顺序执行多个异步操作
toString() String
A string representation of this object.
inherited
wait<T, R>(Iterable<Future<T>> futures, {R? onSuccess(List<T>)?, void onError(dynamic error)?, bool eagerError = true, WCancelToken? cancelToken}) Future<R?>
执行多个异步操作(并行)
waitWithConcurrency<T, R>(Iterable<Future<T>> futures, {R? onSuccess(List<T>)?, void onError(dynamic error)?, int concurrency = 4, WCancelToken? cancelToken}) Future<R?>
执行多个异步操作(并行,带并发控制)

Operators

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