bindOneByIndex method

void bindOneByIndex(
  1. Iterable<E> options,
  2. RxValue<int> other
)

Implementation

void bindOneByIndex(Iterable<E> options, RxValue<int> other) {
  {
    int? value = other.value;
    for (int i = 0; i < options.length; i++) {
      if (value == i) {
        add(options.elementAt(i));
      } else {
        remove(options.elementAt(i));
      }
    }
  }
  other.values.listen((int? value) {
    for (int i = 0; i < options.length; i++) {
      if (value == i) {
        add(options.elementAt(i));
      } else {
        remove(options.elementAt(i));
      }
    }
  });
}