choiceChipsBuilder<T> function
A FormFieldBuilder that is the default FastChoiceChips.builder.
Uses FastChoiceChips.chipBuilder to build a ChoiceChip for every FastChoiceChip in FastChoiceChips.chips.
Returns an InputDecorator that wraps a List of ChoiceChip on any TargetPlatform.
Implementation
Widget choiceChipsBuilder<T>(FormFieldState<Set<T>> field) {
field as FastChoiceChipsState<T>;
final FastChoiceChipsState<T>(:widget) = field;
final wrap = Wrap(
alignment: widget.alignment,
crossAxisAlignment: widget.crossAlignment,
clipBehavior: widget.clipBehavior,
direction: widget.direction,
runAlignment: widget.runAlignment,
runSpacing: widget.runSpacing,
spacing: widget.spacing,
textDirection: widget.textDirection,
verticalDirection: widget.verticalDirection,
children: [
for (final chip in widget.chips) widget.chipBuilder(chip, field),
],
);
if (widget.showInputDecoration) {
return InputDecorator(
decoration: field.decoration,
child: wrap,
);
}
return wrap;
}