subscribe method

StreamSubscription<S> subscribe(
  1. BuildContext context,
  2. dynamic onData(
    1. S state
    )
)

Subscribe to listener

Implementation

StreamSubscription<S> subscribe(BuildContext context, Function(S state) onData) {
  return context.read<B>().stream.listen(onData);
}