Skip to content

Commit 15608ca

Browse files
committed
Version 2.1.1 Made the VoidCallback onSelect in FlexThemeModeOptionButton nullable
1 parent 64bfc66 commit 15608ca

File tree

7 files changed

+21
-8
lines changed

7 files changed

+21
-8
lines changed

.github/workflows/build.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
name: Build Web
2828
on:
2929
pull_request:
30-
branches: [master]
30+
branches: [none-null-safe]
3131
# push:
3232
# branches: [ master ]
3333
# release:

CHANGELOG.md

+9
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,15 @@
22

33
All notable changes to the **FlexColorScheme** package will be documented in this file.
44

5+
## [2.1.1] - March 30, 2021
6+
7+
* **Change:** Made the VoidCallback `onSelect` in `FlexThemeModeOptionButton` nullable.
8+
The optional callback allows for the button to be used e.g. as a trailing
9+
widget in a ListTile. Keep it null to not have any callback, nor hover or Ink of its own, and use
10+
the select event of the parent instead. When it is used as standalone button you
11+
normally want to use this callback, but not if you want the parent to handle it, that use case was
12+
not allowed with previous version.
13+
514
## [2.1.0] - March 22, 2021
615

716
* **Fix:** Toggling `FlexColorScheme(transparentStatusBar)` from true to false, did not restore the

example/lib/shared/constants.dart

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ class AppConst {
1212
// When I build a new public version I just make sure to update this info
1313
// before building them.
1414
static const String appName = 'FlexColorScheme';
15-
static const String version = '2.1.0';
15+
static const String version = '2.1.1';
1616
static const String packageVersion = 'FlexColorScheme package $version';
1717
static const String packageUrl = 'https://pub.dev/packages/flex_color_scheme';
1818
static const String flutterVersion = 'Channel dev, 2.1.0-12.1.pre, CanvasKit';

example/pubspec.lock

+1-1
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ packages:
6363
path: ".."
6464
relative: true
6565
source: path
66-
version: "2.1.0"
66+
version: "2.1.1"
6767
flutter:
6868
dependency: "direct main"
6969
description: flutter

example/pubspec.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: flex_color_scheme_example
22
description: Five examples that demonstrate how to use the FlexColorScheme package.
3-
version: 2.1.0
3+
version: 2.1.1
44
publish_to: 'none'
55
environment:
66
sdk: '>=2.12.0 <3.0.0'
@@ -11,7 +11,7 @@ dependencies:
1111
cupertino_icons: ^1.0.2
1212

1313
# Color scheme package (by Mike Rydstrom, rydmike.com).
14-
flex_color_scheme: ^2.1.0
14+
flex_color_scheme: ^2.1.1
1515

1616
# The Flutter SDK (by Google flutter.dev).
1717
flutter:

lib/src/flex_theme_mode_switch.dart

+6-2
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,7 @@ class FlexThemeModeOptionButton extends StatelessWidget {
290290
this.labelStyle,
291291
this.labelAbove = true,
292292
required this.selected,
293-
required this.onSelect,
293+
this.onSelect,
294294
this.selectedBorder,
295295
this.unselectedBorder,
296296
this.elevation = 0,
@@ -326,7 +326,11 @@ class FlexThemeModeOptionButton extends StatelessWidget {
326326
final bool selected;
327327

328328
/// The button was clicked and selected.
329-
final VoidCallback onSelect;
329+
///
330+
/// The optional callback allows for the button to be used eg as a trailing
331+
/// widget in a ListTile. Keep it null to not have any callback and use the
332+
/// click event in the parent instead.
333+
final VoidCallback? onSelect;
330334

331335
/// Border side for the selected option state.
332336
/// If null, defaults to

pubspec.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: flex_color_scheme
22
description: A Flutter package to make and use beautiful color scheme based MaterialApp themes.
3-
version: 2.1.0
3+
version: 2.1.1
44
homepage: https://github.com/rydmike/flex_color_scheme
55

66
environment:

0 commit comments

Comments
 (0)