visibleOptions property

List<_VisibleOption<T>> get visibleOptions

Get the visible options for rendering.

Implementation

// ignore: library_private_types_in_public_api
List<_VisibleOption<T>> get visibleOptions {
  final from = visibleFromIndex.value;
  final to = math.min(visibleToIndex.value, options.length);
  final result = <_VisibleOption<T>>[];

  for (int i = from; i < to; i++) {
    result.add(
      _VisibleOption(
        option: options[i],
        index: i,
        isFocused: options[i].value == focusedValue.value,
        isSelected: options[i].value == selectedValue.value,
      ),
    );
  }
  return result;
}