copyWith method

CommandProps copyWith({
  1. bool? isOpen,
  2. void onClose()?,
  3. List<CommandGroupProps>? groups,
  4. String? placeholder,
  5. String? emptyMessage,
  6. String? searchQuery,
  7. List<CommandItemProps>? filteredItems,
  8. void onSearch(
    1. String
    )?,
  9. void onSelectItem(
    1. CommandItemProps
    )?,
})

Implementation

CommandProps copyWith({
  bool? isOpen,
  void Function()? onClose,
  List<CommandGroupProps>? groups,
  String? placeholder,
  String? emptyMessage,
  String? searchQuery,
  List<CommandItemProps>? filteredItems,
  void Function(String)? onSearch,
  void Function(CommandItemProps)? onSelectItem,
}) {
  return CommandProps(
    isOpen: isOpen ?? this.isOpen,
    onClose: onClose ?? this.onClose,
    groups: groups ?? this.groups,
    placeholder: placeholder ?? this.placeholder,
    emptyMessage: emptyMessage ?? this.emptyMessage,
    searchQuery: searchQuery ?? this.searchQuery,
    filteredItems: filteredItems ?? this.filteredItems,
    onSearch: onSearch ?? this.onSearch,
    onSelectItem: onSelectItem ?? this.onSelectItem,
  );
}