Skip to content

Commit

Permalink
add chipPressElevation
Browse files Browse the repository at this point in the history
  • Loading branch information
jenow committed Aug 2, 2022
1 parent b39169a commit df630bb
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,7 @@ MultiSelectBottomSheetField has all the parameters of MultiSelectBottomSheet plu
| `chipShape` | ShapeBorde | Define a ShapeBorder for the chips. |
| `chipShadowColor` | Color | Define the shadow color for the chips. |
| `chipElevation` | double | Define the elevation for the chips. |
| `chipPressElevation` | double | Define the press elevation for the chips. |
| `closeSearchIcon` | Icon | The icon button that hides the search field . |
| `colorator` | Color Function(V) | Set the selected chip color of individual items based on their value. |
| `decoration` | BoxDecoration | Style the surrounding Container. |
Expand Down
9 changes: 9 additions & 0 deletions lib/chip_field/multi_select_chip_field.dart
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,9 @@ class MultiSelectChipField<V> extends FormField<List<V>> {
/// Set the elevation of the Chip.
final double? chipElevation;

/// Set the press elevation of the Chip.
final double? chipPressElevation;

/// Build a custom widget that gets created dynamically for each item.
final Widget Function(MultiSelectItem<V>, FormFieldState<List<V>>)?
itemBuilder;
Expand Down Expand Up @@ -112,6 +115,7 @@ class MultiSelectChipField<V> extends FormField<List<V>> {
this.headerColor,
this.chipShadowColor,
this.chipElevation,
this.chipPressElevation,
this.key,
this.onSaved,
this.validator,
Expand Down Expand Up @@ -153,6 +157,7 @@ class MultiSelectChipField<V> extends FormField<List<V>> {
headerColor: headerColor,
chipShadowColor: chipShadowColor,
chipElevation: chipElevation,
chipPressElevation: chipPressElevation,
itemBuilder: itemBuilder,
height: height,
scrollControl: scrollControl,
Expand Down Expand Up @@ -191,6 +196,7 @@ class _MultiSelectChipFieldView<V> extends StatefulWidget
final Color? headerColor;
final Color? chipShadowColor;
final double? chipElevation;
final double? chipPressElevation;
final Widget Function(MultiSelectItem<V>, FormFieldState<List<V>>)?
itemBuilder;
final double? height;
Expand Down Expand Up @@ -224,6 +230,7 @@ class _MultiSelectChipFieldView<V> extends StatefulWidget
this.headerColor,
this.chipShadowColor,
this.chipElevation,
this.chipPressElevation,
this.itemBuilder,
this.height,
this.scrollControl,
Expand Down Expand Up @@ -258,6 +265,7 @@ class _MultiSelectChipFieldView<V> extends StatefulWidget
headerColor = field.headerColor,
chipShadowColor = field.chipShadowColor,
chipElevation = field.chipElevation,
chipPressElevation = field.chipPressElevation,
itemBuilder = field.itemBuilder,
height = field.height,
scrollControl = field.scrollControl,
Expand Down Expand Up @@ -470,6 +478,7 @@ class __MultiSelectChipFieldViewState<V>
padding: const EdgeInsets.all(2.0),
child: ChoiceChip(
elevation: widget.chipElevation,
pressElevation: widget.chipPressElevation,
shadowColor: widget.chipShadowColor,
shape: widget.chipShape as OutlinedBorder? ??
RoundedRectangleBorder(
Expand Down

0 comments on commit df630bb

Please sign in to comment.