stream property

AutoDisposeProviderBase<Stream<S>, AsyncValue<S>> stream
latefinal

BlocProvider.stream

Listen if the Bloc.stream or Cubit.stream

Usasge:

Consumer(builder: (context, watch, __) {
  // Rebuilds if the cubit or bloc is recreated
  final _cubit = watch(counterProvider.notifier);
  return Text(
    '${_cubit.state}',
    style: Theme.of(context).textTheme.headline4,
  );
}),

Implementation

late final AutoDisposeProviderBase<Stream<S>, AsyncValue<S>> stream =
    AutoDisposeStreamProvider<S>(
  (ref) => ref.watch(notifier).stream,
  name: name == null ? null : '$name.stream',
);