build method
Build the widget.
Implementation
@override
Widget build(BuildContext context) {
final getSearchStringFunction = getSearchString;
final getWidgetFunction = getWidget;
return Cancel(
child: SimpleScaffold(
actions: actions,
title: title,
body: BuiltSearchableListView<T>(
items: values,
builder: (context, index) {
final item = values[index];
final listTile = ListTile(
autofocus: item == value || (value == null && index == 0),
selected: item == value,
title: getWidgetFunction == null
? Text(item.toString())
: getWidgetFunction(item),
onTap: () {
if (shouldPop) {
Navigator.pop(context);
}
onDone(item);
},
);
final bindings = getCallbackShortcuts?.call(item);
return SearchableListTile(
searchString:
getSearchStringFunction?.call(item) ?? item.toString(),
child: bindings == null
? listTile
: CallbackShortcuts(bindings: bindings, child: listTile),
);
},
),
),
);
}