TaskExecutionContext class
任务执行上下文 — 管理单个任务的执行状态 替代原 PreloadTask 的可变内部状态
Constructors
- TaskExecutionContext({required String taskId, required String taskName, required bool isRequired, Duration? timeout})
Properties
- endTime → DateTime?
-
结束时间
no setter
- error → Object?
-
错误
no setter
- executionTime → Duration?
-
执行耗时
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- isFailed → bool
-
是否失败
no setter
- isFinished → bool
-
是否已完成(成功或失败)
no setter
- isRequired → bool
-
是否为必需任务
final
- isSuccessful → bool
-
是否成功完成
no setter
- result → dynamic
-
执行结果
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- startTime → DateTime?
-
开始时间
no setter
- state ↔ PreloadTaskState
-
当前状态
getter/setter pair
- taskId → String
-
任务唯一标识
final
- taskName → String
-
任务显示名称
final
- timeout → Duration?
-
超时时长
no setter
Methods
-
markCancelled(
) → void - 标记为取消
-
markCompleted(
dynamic result) → void - 标记为完成
-
markFailed(
Object error) → void - 标记为失败
-
markLoading(
) → void - 标记为加载中
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited