dropdownHeight property

  1. @override
double get dropdownHeight
override

Gets the height of the dropdown suggestions list.

Currently set to a fixed height of 200 pixels.

Implementation

@override
double get dropdownHeight {
  double height = 0;

  int dataLength = baseSearchResults.isNotEmpty ||
          selectorTextEditingController.text.isNotEmpty
      ? baseSearchResults.length
      : initData.length;

  if (suggestionsExpanded) {
    if (dataLength < 5) {
      height = (dataLength * 40) + 40;
    } else {
      height = selectorMaxHeight ?? 200;
    }
  }

  return height;
}