diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b67d42e7c..aeb6a53b3 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -27,7 +27,7 @@ name: Build Web on: pull_request: - branches: [master] + branches: [none-null-safe] # push: # branches: [ master ] # release: diff --git a/CHANGELOG.md b/CHANGELOG.md index 47f852b2a..b11b5a3de 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,15 @@ All notable changes to the **FlexColorScheme** package will be documented in this file. +## [2.1.1] - March 30, 2021 + +* **Change:** Made the VoidCallback `onSelect` in `FlexThemeModeOptionButton` nullable. + The optional callback allows for the button to be used e.g. as a trailing + widget in a ListTile. Keep it null to not have any callback, nor hover or Ink of its own, and use + the select event of the parent instead. When it is used as standalone button you + normally want to use this callback, but not if you want the parent to handle it, that use case was + not allowed with previous version. + ## [2.1.0] - March 22, 2021 * **Fix:** Toggling `FlexColorScheme(transparentStatusBar)` from true to false, did not restore the diff --git a/example/lib/shared/constants.dart b/example/lib/shared/constants.dart index beb44a0e6..9244bf911 100644 --- a/example/lib/shared/constants.dart +++ b/example/lib/shared/constants.dart @@ -12,7 +12,7 @@ class AppConst { // When I build a new public version I just make sure to update this info // before building them. static const String appName = 'FlexColorScheme'; - static const String version = '2.1.0'; + static const String version = '2.1.1'; static const String packageVersion = 'FlexColorScheme package $version'; static const String packageUrl = 'https://pub.dev/packages/flex_color_scheme'; static const String flutterVersion = 'Channel dev, 2.1.0-12.1.pre, CanvasKit'; diff --git a/example/pubspec.lock b/example/pubspec.lock index 55dff2ed6..c4c84153e 100644 --- a/example/pubspec.lock +++ b/example/pubspec.lock @@ -63,7 +63,7 @@ packages: path: ".." relative: true source: path - version: "2.1.0" + version: "2.1.1" flutter: dependency: "direct main" description: flutter diff --git a/example/pubspec.yaml b/example/pubspec.yaml index 161d92796..0035f6cc1 100644 --- a/example/pubspec.yaml +++ b/example/pubspec.yaml @@ -1,6 +1,6 @@ name: flex_color_scheme_example description: Five examples that demonstrate how to use the FlexColorScheme package. -version: 2.1.0 +version: 2.1.1 publish_to: 'none' environment: sdk: '>=2.12.0 <3.0.0' @@ -11,7 +11,7 @@ dependencies: cupertino_icons: ^1.0.2 # Color scheme package (by Mike Rydstrom, rydmike.com). - flex_color_scheme: ^2.1.0 + flex_color_scheme: ^2.1.1 # The Flutter SDK (by Google flutter.dev). flutter: diff --git a/lib/src/flex_theme_mode_switch.dart b/lib/src/flex_theme_mode_switch.dart index c092a2793..a961fb535 100644 --- a/lib/src/flex_theme_mode_switch.dart +++ b/lib/src/flex_theme_mode_switch.dart @@ -290,7 +290,7 @@ class FlexThemeModeOptionButton extends StatelessWidget { this.labelStyle, this.labelAbove = true, required this.selected, - required this.onSelect, + this.onSelect, this.selectedBorder, this.unselectedBorder, this.elevation = 0, @@ -326,7 +326,11 @@ class FlexThemeModeOptionButton extends StatelessWidget { final bool selected; /// The button was clicked and selected. - final VoidCallback onSelect; + /// + /// The optional callback allows for the button to be used eg as a trailing + /// widget in a ListTile. Keep it null to not have any callback and use the + /// click event in the parent instead. + final VoidCallback? onSelect; /// Border side for the selected option state. /// If null, defaults to diff --git a/pubspec.yaml b/pubspec.yaml index e16e187c1..bcbfaa2eb 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: flex_color_scheme description: A Flutter package to make and use beautiful color scheme based MaterialApp themes. -version: 2.1.0 +version: 2.1.1 homepage: https://github.com/rydmike/flex_color_scheme environment: