single<T> static method
T?
single<T>({})
Creates a single-select grid prompt.
Implementation
static T? single<T>({
required String title,
required List<T> items,
PromptTheme theme = PromptTheme.dark,
int columns = 0,
int? cellWidth,
int? maxColumns,
String Function(T)? labelBuilder,
}) {
final prompt = SelectableGridPrompt<T>(
title: title,
items: items,
theme: theme,
multiSelect: false,
columns: columns,
cellWidth: cellWidth,
maxColumns: maxColumns,
);
final result = prompt.run(itemLabel: labelBuilder);
return result.isEmpty ? null : result.first;
}