useFuture<T> function

AsyncSnapshot<T> useFuture<T>(
  1. Future<T>? future,
  2. {T? initialData,
  3. bool preserveState = true}

Subscribes to a Future and returns its current state as an AsyncSnapshot.

  • preserveState determines if the current value should be preserved when changing the Future instance.

See also:


AsyncSnapshot<T> useFuture<T>(
  Future<T>? future, {
  T? initialData,
  bool preserveState = true,
}) {
  return use(
      initialData: initialData,
      preserveState: preserveState,