multiSelect<T, V, K> static method
TFormField<List<V> >
multiSelect<T, V, K>(
- TFieldProp<
List< prop,V> > - String? label, {
- String? tag,
- String? placeholder,
- String? helperText,
- String? info,
- bool isRequired = false,
- bool disabled = false,
- bool autoFocus = false,
- bool readOnly = false,
- bool clearable = false,
- TTagsFieldTheme? theme,
- FocusNode? focusNode,
- VoidCallback? onTap,
- TTagsController? textController,
- List<
String? Function(List< ? rules,V> ?)> - List<
T> ? items, - ItemKeyAccessor<
T, K> ? itemKey, - ItemValueAccessor<
T, V> ? itemValue, - ItemTextAccessor<
T> ? itemText, - ItemTextAccessor<
T> ? itemSubText, - ItemTextAccessor<
T> ? itemImageUrl, - ItemChildrenAccessor<
T> ? itemChildren, - int itemsPerPage = 10,
- TLoadListener<
T> ? onLoad, - TRefLoadListener<
T> ? onRefLoad, - int? searchDelay,
- TControllerReadyListener<
T, K> ? onControllerReady, - TRefControllerReadyListener<
T, K> ? onRefControllerReady,
Implementation
static TFormField<List<V>> multiSelect<T, V, K>(
TFieldProp<List<V>> prop,
String? label, {
String? tag,
String? placeholder,
String? helperText,
String? info,
bool isRequired = false,
bool disabled = false,
bool autoFocus = false,
bool readOnly = false,
bool clearable = false,
TTagsFieldTheme? theme,
FocusNode? focusNode,
VoidCallback? onTap,
TTagsController? textController,
List<String? Function(List<V>?)>? rules,
List<T>? items,
ItemKeyAccessor<T, K>? itemKey,
ItemValueAccessor<T, V>? itemValue,
ItemTextAccessor<T>? itemText,
ItemTextAccessor<T>? itemSubText,
ItemTextAccessor<T>? itemImageUrl,
ItemChildrenAccessor<T>? itemChildren,
int itemsPerPage = 10,
TLoadListener<T>? onLoad,
TRefLoadListener<T>? onRefLoad,
int? searchDelay,
TControllerReadyListener<T, K>? onControllerReady,
TRefControllerReadyListener<T, K>? onRefControllerReady,
}) {
return TFormField<List<V>>(
prop: prop,
builder: (onValueChanged) {
Widget buildMultiSelect([WidgetRef? ref]) {
final effectiveOnLoad = (onRefLoad != null && ref != null)
? (TLoadOptions<T> options) => onRefLoad(ref, options)
: onLoad;
final effectiveOnControllerReady = (onRefControllerReady != null && ref != null)
? (TListController<T, K> controller) => onRefControllerReady(ref, controller)
: onControllerReady;
return TMultiSelect<T, V, K>(
label: label,
tag: tag,
placeholder: placeholder,
helperText: helperText,
info: info,
isRequired: isRequired,
disabled: disabled,
autoFocus: autoFocus,
readOnly: readOnly,
clearable: clearable,
theme: theme,
focusNode: focusNode,
onTap: onTap,
textController: textController,
rules: rules,
items: items,
itemText: itemText,
itemSubText: itemSubText,
itemImageUrl: itemImageUrl,
itemChildren: itemChildren,
itemValue: itemValue,
itemKey: itemKey,
itemsPerPage: itemsPerPage,
onLoad: effectiveOnLoad,
searchDelay: searchDelay,
value: prop.value,
valueNotifier: prop.valueNotifier,
onValueChanged: onValueChanged,
onControllerReady: effectiveOnControllerReady,
);
}
if (onRefControllerReady != null || onRefLoad != null) {
return Consumer(
builder: (context, ref, child) => buildMultiSelect(ref),
);
}
return buildMultiSelect();
},
);
}