mirror of
https://github.com/FoggedLens/deflock-app.git
synced 2026-06-10 16:57:48 +02:00
Make suggestion limit configurable and remove redundant .take(10) from widget
Move hardcoded suggestion limit to kNSIMaxSuggestions in dev_config, and remove the redundant .take(10) from optionsBuilder since the fetch stage already caps results. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -110,12 +110,9 @@ class _NSITagValueFieldState extends State<NSITagValueField> {
|
||||
focusNode: _focusNode,
|
||||
optionsBuilder: (TextEditingValue textEditingValue) {
|
||||
if (_suggestions.isEmpty) return const Iterable<String>.empty();
|
||||
if (textEditingValue.text.isEmpty) {
|
||||
return _suggestions.take(10);
|
||||
}
|
||||
if (textEditingValue.text.isEmpty) return _suggestions;
|
||||
return _suggestions
|
||||
.where((s) => s.contains(textEditingValue.text))
|
||||
.take(10);
|
||||
.where((s) => s.contains(textEditingValue.text));
|
||||
},
|
||||
onSelected: (String selection) {
|
||||
widget.onChanged(selection);
|
||||
|
||||
Reference in New Issue
Block a user