bindBool method

void bindBool(
  1. E element,
  2. Stream<bool> stream, [
  3. bool initial = false
])

Implementation

void bindBool(E element, Stream<bool> stream, [bool initial = false]) {
  if (initial) {
    add(element);
  } else {
    remove(element);
  }
  stream.listen((bool value) {
    if (value) {
      add(element);
    } else {
      remove(element);
    }
  });
}