Skip to content

Commit

Permalink
Version 8.1.1 FIX button icon color issue
Browse files Browse the repository at this point in the history
  • Loading branch information
rydmike committed Feb 15, 2025
1 parent 5e74aa3 commit f6f1512
Show file tree
Hide file tree
Showing 17 changed files with 631 additions and 162 deletions.
20 changes: 20 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,26 @@

All changes to the **FlexColorScheme** (FCS) package are documented here.

## 8.1.1

**Feb 15, 2025**

**NOTE**

This fix release only contains a critical **Flutter BUG** workaround solution for users of Flutter versions 3.27.0 to 3.27.4 and 3.29.0.

This release does not contain any support for new theming features released in Flutter 3.29.0, nor does it address theming properties that were deprecated in Flutter 3.29.0. **FlexColorScheme** v8.1.1 and v8.1.0, sans the useful workaround released here, are verified to work with Flutter v3.29 as is. A later **FlexColorScheme** release v8.2.0, will add new theming features and also remove the theming properties that were deprecated in Flutter 3.29.0. Removing them has no impact on FlexColorScheme produced Material-3 themes in Flutter 3.29. Removing and fixing all the deprecations will break things in Flutter 3.27 versions, since some of their replacements do not exist in Flutter 3.27. The issue workaround and fix added here is intended to also support the issue in Flutter 3.27 versions, not only in Flutter 3.29, thus we cannot address the 3.29 deprecations in this release.

### Package

**FIX**

* In Flutter **3.27.0** to at least Flutter **3.29.0** the `iconColor` on buttons `ElevatedButton`, `FilledButton`, `OutlinedButton`, `TextButton` and `SegmentedButton` no longer default to `foregroundColor` when `iconColor` is not defined. This is caused by a **BREAKING REGRESSION BUG** in Flutter SDK, see [issue 162839](https://github.com/flutter/flutter/issues/162839). The issue in Flutter SDK has been fixed via [PR 162880](https://github.com/flutter/flutter/pull/162880). However, this fix will never apply to Flutter versions 3.27.0 to at least 3.29.0. It may land as a cherry-picked hotfix in Flutter 3.29.1 or later minor release of Flutter 3.29. The FIX released here in this version of FlexColorScheme, adds a workaround to this issue. Without this workaround patch, the icon color on the above-mentioned buttons will not work correctly. The used workaround patch will also work correctly after Flutter [PR 162880](https://github.com/flutter/flutter/pull/162880) lands in Flutter.

### Themes Playground

* The above-mentioned Flutter SDK issue was added to "Known issues" in info expands on the Buttons and Segmented Buttons Playground panels.

## 8.1.0

**Dec 29, 2024**
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
BSD 3-Clause License

FlexColorScheme Copyright (c) 2020 - 2024
FlexColorScheme Copyright (c) 2020 - 2025
Mike Rydstrom (Twitter @RydMike GitHub rydmike)
All rights reserved.

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ You should use the same major version of **Themes Playground** as the `flex_colo

| Name | Version | Link |
|-------|---------|--------------------------------------------------------------|
| V8.1 | V8.1.0 | https://rydmike.com/flexcolorscheme/themesplayground-latest |
| V8.1 | V8.1.1 | https://rydmike.com/flexcolorscheme/themesplayground-latest |
| V8.0 | V8.0.2 | https://rydmike.com/flexcolorscheme/themesplayground-v8-0 |
| V7.3 | V7.3.1 | https://rydmike.com/flexcolorscheme/themesplayground-v7-3 |
| V7.2 | V7.2.0 | https://rydmike.com/flexcolorscheme/themesplayground-v7-2 |
Expand Down
2 changes: 1 addition & 1 deletion example/LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
BSD 3-Clause License

FlexColorScheme usage examples Copyright (c) 2020, 2021, 2022
FlexColorScheme usage examples Copyright (c) 2020 - 2025
Mike Rydstrom (Twitter @RydMike GitHub rydmike)
All rights reserved.

Expand Down
3 changes: 3 additions & 0 deletions example/devtools_options.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
description: This file stores settings for Dart & Flutter DevTools.
documentation: https://docs.flutter.dev/tools/devtools/extensions#configure-extension-enablement-states
extensions:
Original file line number Diff line number Diff line change
Expand Up @@ -2387,7 +2387,6 @@ String generateThemeDartCode(ThemeController controller) {
'/// MaterialApp(\n'
'/// theme: AppTheme.light,\n'
'/// darkTheme: AppTheme.dark,\n'
'/// :\n'
'/// );\n'
'abstract final class AppTheme {\n'
' // The defined light theme.\n'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,18 @@ class ButtonsPanel extends StatelessWidget {
});
final ThemeController controller;

static final Uri _iconColorIssue162839 = Uri(
scheme: 'https',
host: 'github.com',
path: 'flutter/flutter/issues/162839',
);

static final Uri _iconColorPR162880 = Uri(
scheme: 'https',
host: 'github.com',
path: 'flutter/flutter/pull/162880',
);

static final Uri _fcsFlutterIssue118063 = Uri(
scheme: 'https',
host: 'github.com',
Expand Down Expand Up @@ -297,6 +309,44 @@ class ButtonsPanel extends StatelessWidget {
valueDefaultDisabledLabel: useMaterial3 ? 'stadium' : '4 dp',
),
const Divider(),
ListTileReveal(
dense: true,
title: const Text('Known issue on ALL Buttons'),
subtitleReveal: RichText(
text: TextSpan(
children: <TextSpan>[
TextSpan(
style: spanTextStyle,
text: 'In Flutter 3.27.0 to 3.27.4 and also at least 3.29.0 '
'the color of icons on ElevatedButton, FilledButton, '
'OutlinedButton and TextButton do not follow the '
'foreground color of the button, see ',
),
LinkTextSpan(
style: linkStyle,
uri: _iconColorIssue162839,
text: '(issue #162839)',
),
TextSpan(
style: spanTextStyle,
text: '. This issue has been corrected via ',
),
LinkTextSpan(
style: linkStyle,
uri: _iconColorPR162880,
text: '(PR #162880)',
),
//
TextSpan(
style: spanTextStyle,
text: '. This fix has not yet landed in Flutter stable 3.29. '
'FlexColorScheme 8.1.1 and later, include a workaround '
'patch for this issue.',
),
],
),
),
),
const ListTileReveal(
dense: true,
title: Text('More settings with the API'),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,25 +14,37 @@ class SegmentedButtonsPanel extends StatelessWidget {
const SegmentedButtonsPanel(this.controller, {super.key});
final ThemeController controller;

static final Uri _iconColorIssue162839 = Uri(
scheme: 'https',
host: 'github.com',
path: 'flutter/flutter/issues/162839',
);

static final Uri _iconColorPR162880 = Uri(
scheme: 'https',
host: 'github.com',
path: 'flutter/flutter/pull/162880',
);

static final Uri _segmentNotTransparentIssue123292 = Uri(
scheme: 'https',
host: 'github.com',
path: 'flutter/flutter/pull/123292',
path: 'flutter/flutter/issues/123292',
);
static final Uri _segmentWrongHeightIssue121493 = Uri(
scheme: 'https',
host: 'github.com',
path: 'flutter/flutter/pull/121493',
path: 'flutter/flutter/issues/121493',
);
static final Uri _segmentWrongOverlayIssue123308 = Uri(
scheme: 'https',
host: 'github.com',
path: 'flutter/flutter/pull/123308',
path: 'flutter/flutter/issues/123308',
);
static final Uri _segmentNotM3SpecIssue119733 = Uri(
scheme: 'https',
host: 'github.com',
path: 'flutter/flutter/pull/119733',
path: 'flutter/flutter/issues/119733',
);

@override
Expand Down Expand Up @@ -221,7 +233,32 @@ class SegmentedButtonsPanel extends StatelessWidget {
children: <TextSpan>[
TextSpan(
style: spanTextStyle,
text: 'In Flutter 3.7 the SegmentedButton has a few '
text: 'In Flutter 3.27.0 to 3.27.4 and also at least 3.29.0 '
'the color of icons on SegmentedButton do not follow the '
'foreground color of the button, see ',
),
LinkTextSpan(
style: linkStyle,
uri: _iconColorIssue162839,
text: '(issue #162839)',
),
TextSpan(
style: spanTextStyle,
text: '. This issue has been corrected via ',
),
LinkTextSpan(
style: linkStyle,
uri: _iconColorPR162880,
text: '(PR #162880)',
),
//
TextSpan(
style: spanTextStyle,
text: '. This fix has not yet landed in Flutter stable 3.29. '
'FlexColorScheme 8.1.1 and later, include a workaround '
'patch for this issue.'
'\n\n'
'In Flutter 3.7 the SegmentedButton has a few '
'small issues, like background is not transparent ',
),
LinkTextSpan(
Expand All @@ -241,9 +278,8 @@ class SegmentedButtonsPanel extends StatelessWidget {
),
TextSpan(
style: spanTextStyle,
text: ', these issues are fixed in Flutter 3.10.\n'
'Additionally min height or size '
'cannot be set ',
text: ', these issues are fixed in Flutter 3.10.\n\n'
'The minimum height or size cannot be set, see ',
),
LinkTextSpan(
style: linkStyle,
Expand All @@ -261,7 +297,10 @@ class SegmentedButtonsPanel extends StatelessWidget {
),
TextSpan(
style: spanTextStyle,
text: ', these have no fixes yet.',
text: '. The former issue is closed, but NOT fixed! '
'The PR that closed it only fixed the wrong spec '
'default size, but did not make it customizable. The '
'latter issue is still open and has no fix yet.',
),
],
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,13 @@ import 'package:flutter/material.dart';
/// Use same major flex_color_scheme package version. If you use a
/// lower minor version, some properties may not be supported.
/// In that case, remove them after copying this theme to your
/// app or upgrade package to version 8.0.2.
/// app or upgrade package to version 8.1.1.
///
/// Use in [MaterialApp] like this:
///
/// MaterialApp(
/// theme: AppTheme.light,
/// darkTheme: AppTheme.dark,
/// :
/// );
abstract final class AppTheme {
// The defined light theme.
Expand Down
6 changes: 3 additions & 3 deletions example/lib/shared/const/app.dart
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,13 @@ abstract final class App {
// build numbers.
static const String versionMajor = '8';
static const String versionMinor = '1';
static const String versionPatch = '0';
static const String versionPatch = '1';
static const String versionBuild = '01';
static const String versionFull = '$versionMajor.$versionMinor.$versionPatch'
'\nBuild-$versionBuild';
static const String version = '$versionMajor.$versionMinor.$versionPatch';
static const String flutterVersion = 'stable 3.27.1 (canvaskit$buildType)';
static const String copyright = '© 2020 - 2024';
static const String flutterVersion = 'stable 3.29.0 (canvaskit$buildType)';
static const String copyright = '© 2020 - 2025';
static const String author = 'Mike Rydstrom';
static const String license = 'BSD 3-Clause License';
static const String icon = 'assets/images/app_icon.png';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
enableGPUValidationMode = "1"
allowLocationSimulation = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
Expand Down
Loading

0 comments on commit f6f1512

Please sign in to comment.