StreamProvider<T> constructor

StreamProvider<T>({
  1. Key? key,
  2. required Create<Stream<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 Stream using create and subscribes to it.

The parameter create must not be null.

Implementation

StreamProvider({
  Key? key,
  required Create<Stream<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: _streamStartListening(
          catchError: catchError,
          initialData: initialData,
        ),
        child: child,
      );