Skip to content

Commit

Permalink
Add shadowColor option to set the shadow color of the Chip.
Browse files Browse the repository at this point in the history
  • Loading branch information
jenow committed Aug 2, 2022
1 parent 1fd6879 commit a596cc8
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 30 deletions.
23 changes: 8 additions & 15 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 @@ -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
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"
8 changes: 8 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,9 @@ class MultiSelectChipField<V> extends FormField<List<V>> {
/// 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<V>, FormFieldState<List<V>>)?
itemBuilder;
Expand Down Expand Up @@ -104,6 +107,7 @@ class MultiSelectChipField<V> extends FormField<List<V>> {
this.searchHintStyle,
this.searchTextStyle,
this.headerColor,
this.shadowColor,
this.key,
this.onSaved,
this.validator,
Expand Down Expand Up @@ -179,6 +183,7 @@ class _MultiSelectChipFieldView<V> extends StatefulWidget
final Color? Function(V)? colorator;
final Function(List<V>)? onTap;
final Color? headerColor;
final Color? shadowColor;
final Widget Function(MultiSelectItem<V>, FormFieldState<List<V>>)?
itemBuilder;
final double? height;
Expand Down Expand Up @@ -210,6 +215,7 @@ class _MultiSelectChipFieldView<V> extends StatefulWidget
this.searchHintStyle,
this.searchTextStyle,
this.headerColor,
this.shadowColor,
this.itemBuilder,
this.height,
this.scrollControl,
Expand Down Expand Up @@ -242,6 +248,7 @@ class _MultiSelectChipFieldView<V> extends StatefulWidget
searchTextStyle = field.searchTextStyle,
searchHintStyle = field.searchHintStyle,
headerColor = field.headerColor,
shadowColor = field.shadowColor,
itemBuilder = field.itemBuilder,
height = field.height,
scrollControl = field.scrollControl,
Expand Down Expand Up @@ -453,6 +460,7 @@ class __MultiSelectChipFieldViewState<V>
margin: EdgeInsets.all(0),
padding: const EdgeInsets.all(2.0),
child: ChoiceChip(
shadowColor: widget.shadowColor,
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"

0 comments on commit a596cc8

Please sign in to comment.