FutureProvider<T> constructor

FutureProvider<T>({
  1. Key? key,
  2. required Create<Future<T>?> create,
  3. required T initialData,
  4. ErrorBuilder<T>? catchError,
  5. UpdateShouldNotify<T>? updateShouldNotify,
  6. bool? lazy,
  7. TransitionBuilder? builder,
  8. Widget? child,
})

Creates a Future from create and subscribes to it.

create must not be null.

Implementation

FutureProvider({
  Key? key,
  required Create<Future<T>?> create,
  required T initialData,
  ErrorBuilder<T>? catchError,
  UpdateShouldNotify<T>? updateShouldNotify,
  bool? lazy,
  TransitionBuilder? builder,
  Widget? child,
}) : super(
        key: key,
        lazy: lazy,
        builder: builder,
        create: create,
        updateShouldNotify: updateShouldNotify,
        startListening: _futureStartListening(
          catchError: catchError,
          initialData: initialData,
        ),
        child: child,
      );