openCommandPalette function
void
openCommandPalette(
- List<
({String? group, String label, VoidCallback onSelect})> items, { - String placeholder = 'Type a command or search...',
- VoidCallback? onClose,
Opens the global command palette overlay.
Implementation
void openCommandPalette(
List<({String label, String? group, VoidCallback onSelect})> items, {
String placeholder = 'Type a command or search...',
VoidCallback? onClose,
}) {
activeCommandPalette.value = CommandPaletteConfig(
items: items
.map((item) => CommandItemConfig(
label: item.label,
group: item.group,
onSelect: item.onSelect,
))
.toList(),
placeholder: placeholder,
onClose: onClose,
);
}