FormItemChipsField constructor
FormItemChipsField({
- Key? key,
- TextEditingController? controller,
- List<
String> ? initialItems, - Color? backgroundColor,
- String separator = ",",
- bool enabled = true,
- bool dense = false,
- EdgeInsetsGeometry padding = const EdgeInsets.symmetric(vertical: 10),
- EdgeInsetsGeometry contentPadding = const EdgeInsets.all(10),
- Color? color,
- bool allowEmpty = false,
- InputBorder? border,
- InputBorder? disabledBorder,
- Color? subColor,
- String? hintText,
- String? counterText = "",
- String? labelText,
- String? lengthErrorText = "",
- Widget? prefix,
- Widget? suffix,
- bool readOnly = false,
- required Widget chipBuilder(
- BuildContext context,
- _ChipsInputState<
String> state, - String value
- required Widget suggestionBuilder(
- BuildContext context,
- _ChipsInputState<
String> state, - String value
- FutureOr<
List< findSuggestions(String> >- String searchText
- void onChanged()?,
- void onChipTapped(
- String value
- int? maxChips,
- double? suggestionsBoxMaxHeight,
- TextInputType inputType = TextInputType.text,
- bool obscureText = false,
- bool autocorrect = true,
- void onSaved()?,
- String validator(
- String? value
- String? initialURI,
Implementation
FormItemChipsField({
Key? key,
this.controller,
this.initialItems,
this.backgroundColor,
this.separator = ",",
bool enabled = true,
this.dense = false,
this.padding = const EdgeInsets.symmetric(vertical: 10),
this.contentPadding = const EdgeInsets.all(10),
this.color,
this.allowEmpty = false,
this.border,
this.disabledBorder,
this.subColor,
this.hintText,
this.counterText = "",
this.labelText,
this.lengthErrorText = "",
this.prefix,
this.suffix,
this.readOnly = false,
required this.chipBuilder,
required this.suggestionBuilder,
this.findSuggestions,
this.onChanged,
this.onChipTapped,
this.maxChips,
this.suggestionsBoxMaxHeight,
this.inputType = TextInputType.text,
this.obscureText = false,
this.autocorrect = true,
void Function(List<String> value)? onSaved,
String Function(String? value)? validator,
String? initialURI,
}) : super(
key: key,
builder: (state) {
return const Empty();
},
onSaved: (value) {
onSaved?.call(value?.split(separator) ?? const []);
},
validator: validator,
initialValue: initialURI,
enabled: enabled);