TMultiSelect<T, V, K> constructor
const
TMultiSelect<T, V, K> ({
- Key? key,
- String? label,
- String? tag,
- String? helperText,
- String? placeholder,
- bool isRequired = false,
- bool disabled = false,
- bool autoFocus = false,
- TTagsFieldTheme? theme,
- VoidCallback? onTap,
- FocusNode? focusNode,
- TTagsController? textController,
- List<
V> ? value, - ValueNotifier<
List< ? valueNotifier,V> ?> - ValueChanged<
List< ? onValueChanged,V> ?> - List<
String? Function(List< ? rules,V> ?)> - Duration? validationDebounce,
- TListTheme? listTheme,
- List<
T> ? items, - int? itemsPerPage = 6,
- String? search,
- int? searchDelay,
- TLoadListener<
T> ? onLoad, - TListController<
T, K> ? controller, - VoidCallback? onShow,
- VoidCallback? onHide,
- bool filterable = true,
- ItemTextAccessor<
T> ? itemSubText, - ItemTextAccessor<
T> ? itemImageUrl, - ItemChildrenAccessor<
T> ? itemChildren, - TListCardTheme? cardTheme,
- ItemValueAccessor<
T, V> ? itemValue, - ItemTextAccessor<
T> ? itemText, - ItemKeyAccessor<
T, K> ? itemKey, - bool? readOnly,
- ValueChanged<
String> ? onInputChanged,
Implementation
const TMultiSelect({
super.key,
this.label,
this.tag,
this.helperText,
this.placeholder,
this.isRequired = false,
this.disabled = false,
this.autoFocus = false,
this.theme,
this.onTap,
this.focusNode,
this.textController,
this.value,
this.valueNotifier,
this.onValueChanged,
this.rules,
this.validationDebounce,
// List
this.listTheme,
this.items,
this.itemsPerPage = 6,
this.search,
this.searchDelay,
this.onLoad,
this.controller,
// Popup
this.onShow,
this.onHide,
// Select
this.filterable = true,
this.itemSubText,
this.itemImageUrl,
this.itemChildren,
this.cardTheme,
this.itemValue,
ItemTextAccessor<T>? itemText,
ItemKeyAccessor<T, K>? itemKey,
bool? readOnly,
this.onInputChanged,
}) : readOnly = readOnly ?? !filterable,
itemText = itemText ?? _defaultItemText,
assert(
!(itemKey != null && itemValue != null),
'You cannot provide both `itemKey` and `itemValue`. '
'`itemValue` will be used as key if provided.',
),
itemKey = itemKey ?? (itemValue != null ? itemValue as ItemKeyAccessor<T, K> : null);