FutureManager<T extends Object> constructor

FutureManager<T extends Object>({
  1. FutureFunction<T>? futureFunction,
  2. bool reloading = true,
  3. bool reportError = true,
  4. ManagerCacheOption cacheOption = const ManagerCacheOption.non(),
  5. SuccessCallBack<T>? onSuccess,
  6. VoidCallback? onDone,
  7. ErrorCallBack? onError,
})

Create a FutureManager instance, You can define a futureFunction here then execute will be call immediately

Implementation

FutureManager({
  this.futureFunction,
  this.reloading = true,
  this.reportError = true,
  this.cacheOption = const ManagerCacheOption.non(),
  this.onSuccess,
  this.onDone,
  this.onError,
}) : super(FutureManagerValue<T>.initial()) {
  if (futureFunction != null) {
    execute(
      futureFunction!,
      reloading: reloading,
      onSuccess: onSuccess,
      onDone: onDone,
      onError: onError,
    );
  }
}