Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add chipShadowColor, chipElevation and chipPressElevationoptions in MultiSelectChipField #124

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,9 @@ MultiSelectBottomSheetField has all the parameters of MultiSelectBottomSheet plu
| `autovalidateMode` | AutovalidateMode | If enabled, form fields will validate and update their error text immediately after every change. Default is disabled. |
| `chipColor` | Color | Set the chip color. |
| `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
25 changes: 9 additions & 16 deletions example/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ packages:
name: collection
url: "https://pub.dartlang.org"
source: hosted
version: "1.15.0"
version: "1.16.0"
cupertino_icons:
dependency: "direct main"
description:
Expand All @@ -56,7 +56,7 @@ packages:
name: fake_async
url: "https://pub.dartlang.org"
source: hosted
version: "1.2.0"
version: "1.3.0"
flutter:
dependency: "direct main"
description: flutter
Expand All @@ -80,7 +80,7 @@ packages:
name: material_color_utilities
url: "https://pub.dartlang.org"
source: hosted
version: "0.1.3"
version: "0.1.4"
meta:
dependency: transitive
description:
Expand All @@ -94,14 +94,14 @@ packages:
path: ".."
relative: true
source: path
version: "4.1.2"
version: "4.1.3"
path:
dependency: transitive
description:
name: path
url: "https://pub.dartlang.org"
source: hosted
version: "1.8.0"
version: "1.8.1"
sky_engine:
dependency: transitive
description: flutter
Expand All @@ -113,7 +113,7 @@ packages:
name: source_span
url: "https://pub.dartlang.org"
source: hosted
version: "1.8.1"
version: "1.8.2"
stack_trace:
dependency: transitive
description:
Expand Down Expand Up @@ -148,20 +148,13 @@ packages:
name: test_api
url: "https://pub.dartlang.org"
source: hosted
version: "0.4.8"
typed_data:
dependency: transitive
description:
name: typed_data
url: "https://pub.dartlang.org"
source: hosted
version: "1.3.0"
version: "0.4.9"
vector_math:
dependency: transitive
description:
name: vector_math
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.1"
version: "2.1.2"
sdks:
dart: ">=2.14.0 <3.0.0"
dart: ">=2.17.0-0 <3.0.0"
27 changes: 27 additions & 0 deletions lib/chip_field/multi_select_chip_field.dart
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,15 @@ class MultiSelectChipField<V> extends FormField<List<V>> {
/// Set the header color.
final Color? headerColor;

/// Set the shadow color of the Chip.
final Color? chipShadowColor;

/// 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 @@ -104,6 +113,9 @@ class MultiSelectChipField<V> extends FormField<List<V>> {
this.searchHintStyle,
this.searchTextStyle,
this.headerColor,
this.chipShadowColor,
this.chipElevation,
this.chipPressElevation,
this.key,
this.onSaved,
this.validator,
Expand Down Expand Up @@ -143,6 +155,9 @@ class MultiSelectChipField<V> extends FormField<List<V>> {
searchHintStyle: searchHintStyle,
searchTextStyle: searchTextStyle,
headerColor: headerColor,
chipShadowColor: chipShadowColor,
chipElevation: chipElevation,
chipPressElevation: chipPressElevation,
itemBuilder: itemBuilder,
height: height,
scrollControl: scrollControl,
Expand Down Expand Up @@ -179,6 +194,9 @@ class _MultiSelectChipFieldView<V> extends StatefulWidget
final Color? Function(V)? colorator;
final Function(List<V>)? onTap;
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 @@ -210,6 +228,9 @@ class _MultiSelectChipFieldView<V> extends StatefulWidget
this.searchHintStyle,
this.searchTextStyle,
this.headerColor,
this.chipShadowColor,
this.chipElevation,
this.chipPressElevation,
this.itemBuilder,
this.height,
this.scrollControl,
Expand Down Expand Up @@ -242,6 +263,9 @@ class _MultiSelectChipFieldView<V> extends StatefulWidget
searchTextStyle = field.searchTextStyle,
searchHintStyle = field.searchHintStyle,
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 @@ -453,6 +477,9 @@ class __MultiSelectChipFieldViewState<V>
margin: EdgeInsets.all(0),
padding: const EdgeInsets.all(2.0),
child: ChoiceChip(
elevation: widget.chipElevation,
pressElevation: widget.chipPressElevation,
shadowColor: widget.chipShadowColor,
shape: widget.chipShape as OutlinedBorder? ??
RoundedRectangleBorder(
side: BorderSide(
Expand Down
23 changes: 8 additions & 15 deletions pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,14 @@ packages:
name: collection
url: "https://pub.dartlang.org"
source: hosted
version: "1.15.0"
version: "1.16.0"
fake_async:
dependency: transitive
description:
name: fake_async
url: "https://pub.dartlang.org"
source: hosted
version: "1.2.0"
version: "1.3.0"
flutter:
dependency: "direct main"
description: flutter
Expand All @@ -73,7 +73,7 @@ packages:
name: material_color_utilities
url: "https://pub.dartlang.org"
source: hosted
version: "0.1.3"
version: "0.1.4"
meta:
dependency: transitive
description:
Expand All @@ -87,7 +87,7 @@ packages:
name: path
url: "https://pub.dartlang.org"
source: hosted
version: "1.8.0"
version: "1.8.1"
sky_engine:
dependency: transitive
description: flutter
Expand All @@ -99,7 +99,7 @@ packages:
name: source_span
url: "https://pub.dartlang.org"
source: hosted
version: "1.8.1"
version: "1.8.2"
stack_trace:
dependency: transitive
description:
Expand Down Expand Up @@ -134,20 +134,13 @@ packages:
name: test_api
url: "https://pub.dartlang.org"
source: hosted
version: "0.4.8"
typed_data:
dependency: transitive
description:
name: typed_data
url: "https://pub.dartlang.org"
source: hosted
version: "1.3.0"
version: "0.4.9"
vector_math:
dependency: transitive
description:
name: vector_math
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.1"
version: "2.1.2"
sdks:
dart: ">=2.14.0 <3.0.0"
dart: ">=2.17.0-0 <3.0.0"
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: multi_select_flutter
description: A flexible multi select package for Flutter. Make multi select widgets the way you want.
version: 4.1.2
version: 4.1.3
repository: https://github.com/CHB61/flutter-multi-select
issue_tracker: https://github.com/CHB61/flutter-multi-select
documentation: https://github.com/CHB61/flutter-multi-select
Expand Down