useSearchableSheetForOptions static method
bool
useSearchableSheetForOptions({
- required List<
String> normalized, - QuestionOptionsPresentation? presentation,
- int? chipMaxCount,
Whether the UI should use the searchable sheet for this normalized option list.
Implementation
static bool useSearchableSheetForOptions({
required List<String> normalized,
QuestionOptionsPresentation? presentation,
int? chipMaxCount,
}) {
final mode = presentation ?? QuestionOptionsPresentation.automatic;
final max = chipMaxCount ?? kDefaultOptionsChipMaxCount;
switch (mode) {
case QuestionOptionsPresentation.chips:
return false;
case QuestionOptionsPresentation.searchableSheet:
return true;
case QuestionOptionsPresentation.automatic:
return normalized.length > max;
}
}