Skip to content

Commit

Permalink
feat: add missing ChoiceChip properties to FormBuilderChoiceChip
Browse files Browse the repository at this point in the history
Add surfaceTintColor, clipBehavior, and checkmarkColor properties from Flutter's ChoiceChip widget
  • Loading branch information
ahmedmandur committed Dec 22, 2024
1 parent 08ccbc9 commit bae4075
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions lib/src/fields/form_builder_choice_chips.dart
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,15 @@ class FormBuilderChoiceChip<T> extends FormBuilderFieldDecoration<T> {
/// indicate its selection status. If set to `false`, no checkmark will be shown.
final bool showCheckmark;

/// The surface tint color of the chip when it is selected.
final Color? surfaceTintColor;

/// {@macro flutter.material.Material.clipBehavior}
final Clip clipBehavior;

/// The color of the chip's check mark when selected.
final Color? checkmarkColor;

/// Creates a list of `Chip`s that acts like radio buttons
FormBuilderChoiceChip({
super.autovalidateMode = AutovalidateMode.disabled,
Expand Down Expand Up @@ -322,6 +331,9 @@ class FormBuilderChoiceChip<T> extends FormBuilderFieldDecoration<T> {
this.verticalDirection = VerticalDirection.down,
this.visualDensity,
this.showCheckmark = true,
this.surfaceTintColor,
this.clipBehavior = Clip.none,
this.checkmarkColor,
}) : super(builder: (FormFieldState<T?> field) {
final state = field as _FormBuilderChoiceChipState<T>;

Expand Down Expand Up @@ -364,6 +376,9 @@ class FormBuilderChoiceChip<T> extends FormBuilderFieldDecoration<T> {
visualDensity: visualDensity,
avatarBorder: avatarBorder,
showCheckmark: showCheckmark,
surfaceTintColor: surfaceTintColor,
clipBehavior: clipBehavior,
checkmarkColor: checkmarkColor,
),
],
),
Expand Down

0 comments on commit bae4075

Please sign in to comment.