From a596cc864b0121211e6943e86bc38e613d3aa7ce Mon Sep 17 00:00:00 2001 From: Kevin Blondel Date: Tue, 2 Aug 2022 14:48:58 +0200 Subject: [PATCH 1/4] Add shadowColor option to set the shadow color of the Chip. --- example/pubspec.lock | 23 +++++++-------------- lib/chip_field/multi_select_chip_field.dart | 8 +++++++ pubspec.lock | 23 +++++++-------------- 3 files changed, 24 insertions(+), 30 deletions(-) diff --git a/example/pubspec.lock b/example/pubspec.lock index 31e424f..1f58269 100644 --- a/example/pubspec.lock +++ b/example/pubspec.lock @@ -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: @@ -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 @@ -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: @@ -101,7 +101,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 @@ -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: @@ -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" diff --git a/lib/chip_field/multi_select_chip_field.dart b/lib/chip_field/multi_select_chip_field.dart index 1f420ce..b2387ca 100644 --- a/lib/chip_field/multi_select_chip_field.dart +++ b/lib/chip_field/multi_select_chip_field.dart @@ -59,6 +59,9 @@ class MultiSelectChipField extends FormField> { /// Set the header color. final Color? headerColor; + /// Set the shadow color of the Chip. + final Color? shadowColor; + /// Build a custom widget that gets created dynamically for each item. final Widget Function(MultiSelectItem, FormFieldState>)? itemBuilder; @@ -104,6 +107,7 @@ class MultiSelectChipField extends FormField> { this.searchHintStyle, this.searchTextStyle, this.headerColor, + this.shadowColor, this.key, this.onSaved, this.validator, @@ -179,6 +183,7 @@ class _MultiSelectChipFieldView extends StatefulWidget final Color? Function(V)? colorator; final Function(List)? onTap; final Color? headerColor; + final Color? shadowColor; final Widget Function(MultiSelectItem, FormFieldState>)? itemBuilder; final double? height; @@ -210,6 +215,7 @@ class _MultiSelectChipFieldView extends StatefulWidget this.searchHintStyle, this.searchTextStyle, this.headerColor, + this.shadowColor, this.itemBuilder, this.height, this.scrollControl, @@ -242,6 +248,7 @@ class _MultiSelectChipFieldView extends StatefulWidget searchTextStyle = field.searchTextStyle, searchHintStyle = field.searchHintStyle, headerColor = field.headerColor, + shadowColor = field.shadowColor, itemBuilder = field.itemBuilder, height = field.height, scrollControl = field.scrollControl, @@ -453,6 +460,7 @@ class __MultiSelectChipFieldViewState margin: EdgeInsets.all(0), padding: const EdgeInsets.all(2.0), child: ChoiceChip( + shadowColor: widget.shadowColor, shape: widget.chipShape as OutlinedBorder? ?? RoundedRectangleBorder( side: BorderSide( diff --git a/pubspec.lock b/pubspec.lock index e4e496b..4714166 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -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 @@ -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: @@ -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 @@ -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: @@ -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" From b39169acc8b2f2d7a0516d6dc392e3ffc1903212 Mon Sep 17 00:00:00 2001 From: Kevin Blondel Date: Tue, 2 Aug 2022 15:15:19 +0200 Subject: [PATCH 2/4] Add chipElevation for the chips. --- README.md | 2 ++ lib/chip_field/multi_select_chip_field.dart | 22 +++++++++++++++------ 2 files changed, 18 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 59f4b04..6da149a 100644 --- a/README.md +++ b/README.md @@ -270,6 +270,8 @@ 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. | | `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. | diff --git a/lib/chip_field/multi_select_chip_field.dart b/lib/chip_field/multi_select_chip_field.dart index b2387ca..8a7a7bd 100644 --- a/lib/chip_field/multi_select_chip_field.dart +++ b/lib/chip_field/multi_select_chip_field.dart @@ -60,7 +60,10 @@ class MultiSelectChipField extends FormField> { final Color? headerColor; /// Set the shadow color of the Chip. - final Color? shadowColor; + final Color? chipShadowColor; + + /// Set the elevation of the Chip. + final double? chipElevation; /// Build a custom widget that gets created dynamically for each item. final Widget Function(MultiSelectItem, FormFieldState>)? @@ -107,7 +110,8 @@ class MultiSelectChipField extends FormField> { this.searchHintStyle, this.searchTextStyle, this.headerColor, - this.shadowColor, + this.chipShadowColor, + this.chipElevation, this.key, this.onSaved, this.validator, @@ -147,6 +151,8 @@ class MultiSelectChipField extends FormField> { searchHintStyle: searchHintStyle, searchTextStyle: searchTextStyle, headerColor: headerColor, + chipShadowColor: chipShadowColor, + chipElevation: chipElevation, itemBuilder: itemBuilder, height: height, scrollControl: scrollControl, @@ -183,7 +189,8 @@ class _MultiSelectChipFieldView extends StatefulWidget final Color? Function(V)? colorator; final Function(List)? onTap; final Color? headerColor; - final Color? shadowColor; + final Color? chipShadowColor; + final double? chipElevation; final Widget Function(MultiSelectItem, FormFieldState>)? itemBuilder; final double? height; @@ -215,7 +222,8 @@ class _MultiSelectChipFieldView extends StatefulWidget this.searchHintStyle, this.searchTextStyle, this.headerColor, - this.shadowColor, + this.chipShadowColor, + this.chipElevation, this.itemBuilder, this.height, this.scrollControl, @@ -248,7 +256,8 @@ class _MultiSelectChipFieldView extends StatefulWidget searchTextStyle = field.searchTextStyle, searchHintStyle = field.searchHintStyle, headerColor = field.headerColor, - shadowColor = field.shadowColor, + chipShadowColor = field.chipShadowColor, + chipElevation = field.chipElevation, itemBuilder = field.itemBuilder, height = field.height, scrollControl = field.scrollControl, @@ -460,7 +469,8 @@ class __MultiSelectChipFieldViewState margin: EdgeInsets.all(0), padding: const EdgeInsets.all(2.0), child: ChoiceChip( - shadowColor: widget.shadowColor, + elevation: widget.chipElevation, + shadowColor: widget.chipShadowColor, shape: widget.chipShape as OutlinedBorder? ?? RoundedRectangleBorder( side: BorderSide( From df630bb256bf9dbe136f98917bba4f531110d069 Mon Sep 17 00:00:00 2001 From: Kevin Blondel Date: Tue, 2 Aug 2022 15:37:26 +0200 Subject: [PATCH 3/4] add chipPressElevation --- README.md | 1 + lib/chip_field/multi_select_chip_field.dart | 9 +++++++++ 2 files changed, 10 insertions(+) diff --git a/README.md b/README.md index 6da149a..a46f358 100644 --- a/README.md +++ b/README.md @@ -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. | diff --git a/lib/chip_field/multi_select_chip_field.dart b/lib/chip_field/multi_select_chip_field.dart index 8a7a7bd..c8c0987 100644 --- a/lib/chip_field/multi_select_chip_field.dart +++ b/lib/chip_field/multi_select_chip_field.dart @@ -65,6 +65,9 @@ class MultiSelectChipField extends FormField> { /// 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, FormFieldState>)? itemBuilder; @@ -112,6 +115,7 @@ class MultiSelectChipField extends FormField> { this.headerColor, this.chipShadowColor, this.chipElevation, + this.chipPressElevation, this.key, this.onSaved, this.validator, @@ -153,6 +157,7 @@ class MultiSelectChipField extends FormField> { headerColor: headerColor, chipShadowColor: chipShadowColor, chipElevation: chipElevation, + chipPressElevation: chipPressElevation, itemBuilder: itemBuilder, height: height, scrollControl: scrollControl, @@ -191,6 +196,7 @@ class _MultiSelectChipFieldView extends StatefulWidget final Color? headerColor; final Color? chipShadowColor; final double? chipElevation; + final double? chipPressElevation; final Widget Function(MultiSelectItem, FormFieldState>)? itemBuilder; final double? height; @@ -224,6 +230,7 @@ class _MultiSelectChipFieldView extends StatefulWidget this.headerColor, this.chipShadowColor, this.chipElevation, + this.chipPressElevation, this.itemBuilder, this.height, this.scrollControl, @@ -258,6 +265,7 @@ class _MultiSelectChipFieldView extends StatefulWidget headerColor = field.headerColor, chipShadowColor = field.chipShadowColor, chipElevation = field.chipElevation, + chipPressElevation = field.chipPressElevation, itemBuilder = field.itemBuilder, height = field.height, scrollControl = field.scrollControl, @@ -470,6 +478,7 @@ class __MultiSelectChipFieldViewState padding: const EdgeInsets.all(2.0), child: ChoiceChip( elevation: widget.chipElevation, + pressElevation: widget.chipPressElevation, shadowColor: widget.chipShadowColor, shape: widget.chipShape as OutlinedBorder? ?? RoundedRectangleBorder( From 5e8098f75361fd85c5a1faa0a3d0cab2cd84c9d3 Mon Sep 17 00:00:00 2001 From: Kevin Blondel Date: Tue, 2 Aug 2022 15:46:42 +0200 Subject: [PATCH 4/4] bump version --- example/pubspec.lock | 2 +- pubspec.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/example/pubspec.lock b/example/pubspec.lock index 1f58269..d9818f4 100644 --- a/example/pubspec.lock +++ b/example/pubspec.lock @@ -94,7 +94,7 @@ packages: path: ".." relative: true source: path - version: "4.1.2" + version: "4.1.3" path: dependency: transitive description: diff --git a/pubspec.yaml b/pubspec.yaml index 50eff1c..1e676fd 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -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