PreloadTask<T> constructor

const PreloadTask<T>({
  1. ProviderListenable<T>? provider,
  2. Future<void> method()?,
  3. String? id,
  4. List<String> dependencies = const [],
  5. Future<bool> checkBeforeExecute()?,
  6. Duration checkRetryDelay = const Duration(milliseconds: 300),
  7. int maxCheckRetries = 10,
  8. TaskConfig? config,
})

Implementation

const PreloadTask({
  this.provider,
  this.method,
  String? id,
  this.dependencies = const [],
  this.checkBeforeExecute,
  this.checkRetryDelay = const Duration(milliseconds: 300),
  this.maxCheckRetries = 10,
  TaskConfig? config,
}) : _explicitId = id,
     config = config ?? const TaskConfig(),
     assert(
       provider != null || method != null,
       '任务必须提供 provider 或 method 之一',
     );