when method

Target<Notifier, bool> when(
  1. _BuildWhen<S> callback
)

use this method to rebuild your Consumer using the previous state and the current state to return a boolean

Implementation

Target<Notifier, bool> when(_BuildWhen<S> callback) {
  final target = Target<Notifier, bool>(read);
  target.filter = Filter.when;
  target.callback = callback;
  target.listenWhenTheCallbackReturnsTrue = false;
  return target;
}