Skip to content

Commit 05e0ea5

Browse files
feat: Add shape property to FormBuilderChoiceChip
1 parent d0bb66a commit 05e0ea5

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

packages/flutter_form_builder/lib/src/fields/form_builder_choice_chips.dart

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,21 @@ class FormBuilderChoiceChip<T> extends FormBuilderField<T> {
5353
/// The default is [Colors.black].
5454
final Color? shadowColor;
5555

56-
/// The [ShapeBorder] to draw around the chip.
56+
/// The [OutlinedBorder] to draw around the chip.
5757
///
58-
/// Defaults to the shape in the ambient [ChipThemeData].
58+
/// Defaults to the shape in the ambient [ChipThemeData]. If the theme
59+
/// shape resolves to null, the default is [StadiumBorder].
60+
///
61+
/// This shape is combined with [side] to create a shape decorated with an
62+
/// outline. If it is a [MaterialStateOutlinedBorder],
63+
/// [MaterialStateProperty.resolve] is used for the following
64+
/// [MaterialState]s:
65+
///
66+
/// * [MaterialState.disabled].
67+
/// * [MaterialState.selected].
68+
/// * [MaterialState.hovered].
69+
/// * [MaterialState.focused].
70+
/// * [MaterialState.pressed].
5971
final OutlinedBorder? shape;
6072

6173
/// Configures the minimum size of the tap target.
@@ -311,6 +323,7 @@ class FormBuilderChoiceChip<T> extends FormBuilderField<T> {
311323
for (FormBuilderChipOption<T> option in options)
312324
ChoiceChip(
313325
label: option,
326+
shape: shape,
314327
selected: field.value == option.value,
315328
onSelected: state.enabled
316329
? (selected) {

0 commit comments

Comments
 (0)