Injected<T>.future constructor

Injected<T>.future({
  1. required Future<T> creator(),
  2. T? initialState,
  3. SideEffects<T>? sideEffects,
  4. StateInterceptor<T>? stateInterceptor,
  5. bool autoDisposeWhenNotUsed = true,
  6. String? debugPrintWhenNotifiedPreMessage,
  7. Object? toDebugString(
    1. T?
    )?,
  8. int undoStackLength = 0,
  9. PersistState<T> persist()?,
  10. DependsOn<T>? dependsOn,
  11. bool isLazy = false,
})

Create an Injected state from future

Implementation

factory Injected.future({
  required Future<T> Function() creator,
  T? initialState,
  SideEffects<T>? sideEffects,
  StateInterceptor<T>? stateInterceptor,
  bool autoDisposeWhenNotUsed = true,
  String? debugPrintWhenNotifiedPreMessage,
  Object? Function(T?)? toDebugString,
  int undoStackLength = 0,
  PersistState<T> Function()? persist,
  DependsOn<T>? dependsOn,
  bool isLazy = false,
}) {
  final inj = Injected<T>.generic(
    creator: creator,
    initialState: initialState,
    sideEffects: sideEffects,
    stateInterceptor: stateInterceptor,
    autoDisposeWhenNotUsed: autoDisposeWhenNotUsed,
    debugPrintWhenNotifiedPreMessage: debugPrintWhenNotifiedPreMessage,
    toDebugString: toDebugString,
    undoStackLength: undoStackLength,
    persist: persist,
    dependsOn: dependsOn,
  );

  return inj;
}