diff --git a/CHANGELOG.md b/CHANGELOG.md index e100e11..14b2abb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +## [1.2.0] - 2020-04-05 + +* Add `labelStyle` to `ChipsChoiceItemConfig` + ## [1.1.0] - 2020-03-07 * Improve performance, since `Theme.of(context)` in default choice widget is moved outside, so this only fired once diff --git a/example/lib/main.dart b/example/lib/main.dart index 67c5bef..07635c0 100644 --- a/example/lib/main.dart +++ b/example/lib/main.dart @@ -169,6 +169,9 @@ class _MyHomePageState extends State { )..insert(0, ChipsChoiceOption(value: -1, label: 'All')), itemConfig: const ChipsChoiceItemConfig( showCheckmark: false, + labelStyle: TextStyle( + fontSize: 20 + ), selectedBrightness: Brightness.dark, // unselectedBrightness: Brightness.dark, ), diff --git a/example/pubspec.lock b/example/pubspec.lock index e7cc0e9..94fef77 100644 --- a/example/pubspec.lock +++ b/example/pubspec.lock @@ -42,7 +42,7 @@ packages: path: ".." relative: true source: path - version: "1.1.0" + version: "1.2.0" collection: dependency: transitive description: diff --git a/lib/chips_choice.dart b/lib/chips_choice.dart index c9e050e..59b5243 100644 --- a/lib/chips_choice.dart +++ b/lib/chips_choice.dart @@ -199,7 +199,7 @@ class _ChipsChoiceItem extends StatelessWidget { child: FilterChip( label: Text( item.label, - style: TextStyle(color: textColor), + style: config?.labelStyle?.copyWith(color: textColor) ?? TextStyle(color: textColor), ), avatar: item.avatar, shape: config.shapeBuilder?.call(selected) ?? StadiumBorder( @@ -302,6 +302,9 @@ class ChipsChoiceItemConfig { /// whether the chips use checkmark or not final bool showCheckmark; + /// label style + final TextStyle labelStyle; + /// Selected item color final Color selectedColor; @@ -336,6 +339,7 @@ class ChipsChoiceItemConfig { this.elevation = 0, this.pressElevation = 0, this.showCheckmark = true, + this.labelStyle = const TextStyle(), this.selectedColor, this.unselectedColor, this.selectedBrightness = Brightness.light, diff --git a/pubspec.yaml b/pubspec.yaml index 8105a9f..032690b 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: chips_choice description: Lite version of smart_select package, zero dependencies, an easy way to provide a single or multiple choice chips. -version: 1.1.0 +version: 1.2.0 author: Irfan Vigma Taufik homepage: https://github.com/davigmacode/flutter_chips_choice