stream property
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 AlwaysAliveProviderBase<Stream<S>, AsyncValue<S>> stream =
StreamProvider<S>(
(ref) => ref.watch(notifier).stream,
name: name == null ? null : '$name.stream',
);