Releases: rydmike/flex_color_scheme
Version 7.0.0-dev.3
7.0.0-dev.3
Mar 18, 2023
This is the final beta v7 release before stable v7. There will be no new features or API changes in the FlexColorScheme package from this version to stable version 7.0.0. The only changes to stable will be potential bug fixes, typo corrections, API doc comment improvements and adding more tests.
The companion app Themes Playground, may get label improvements plus spelling and grammar corrections. Layouts in it may also be modified and improved as needed. It will not get any new features, but it may of course receive bug fixes.
The Themes Playground app built for this beta release is unfortunately not a SKIA renderer build, it is using the HTML renderer. This makes it less performant than the app would otherwise be. Additionally, scaled content, like the Themes Simulator panel in the Playground, is also fuzzier than it would be with the SKIA renderer. Due to an issue in Flutter stable (3.7.7), builds made with the SKIA renderer performs very poorly and crashes quite quickly. For more information see Flutter issue #122189. Hopefully, before the stable v7.0.0 release, a fix will be available. If not, a new build using the same package version will be made later and released when a fix is available.
FIX
-
Fixed bug in legacy theme secondary and tertiary color swapping when using seed generated ColorScheme. In dark mode, combining legacy swapping and seed generation did not swap secondary and tertiary colors for schemes where it should do so. This is now fixed. If seed generation was not used, the swapping worked correctly in dark mode. In light mode it worked correctly also when seed generated schemes were used. The
swapLegacyOnMaterial3
feature was introduced in version 6.1.0, it has had this bug for this case since it was introduced. -
Fixed bug where
FlexSubThemes.drawerTheme
was usingBorderRadiusDirectional.horizontal
withend
radius instead ofstart
radius as itsendShape
. This bug was introduced by version 7.0.0-dev.1 and has not been in any stable version. -
The
FlexThemeModeOptionButton
now correctly displays itshoverColor
, previously it was obscured by the colored boxes inside it. -
The systemNavigationBarDividerColor issue #100027 in Flutter that in FCS v5 forced removing support for divider on the system navigation bar in Android, that was available via
FlexColorScheme.themedSystemNavigationBar
has been fixed. The issue could no longer be observed on Android versions 8 to 13 on Flutter 3.7.7 stable. The divider has been enabled again, and its test setting is also available in the Themes Playground app again. The extraSystemUiOverlayStyle
call used as a work-around, for the same issue to fix an issue with Android 11, has also been removed, since the workaround was no longer needed. -
Fixed a bug where when passing in a custom
textTheme
orprimaryTextTheme
, instead of defining text theme viafontFamily
, that FCS tinted text feature, viasubThemesData.blendTextTheme
, was not being correctly applied to the custom text themes. This is now fixed. IfsubThemesData.blendTextTheme
is not being used, then the used Typography, either viasubThemesData.useTextTheme
, or by using a customFlexColorScheme.typography
override, always gets correct brightness for bothtextTheme
andprimaryTextTheme
, regardless of brightness on passed in text themes. They also get the used Typography appropriate opacities on their text styles. In practice, this means that M2 style 2018 typography has opacity on some text styles, while M3 style 2021 typography, is fully opaque for all text styles.
NEW
-
Add:
drawerIndicatorOpacity
toFlexSubThemesData
.
It controls theindicatorOpacity
property in theFlexSubThemes.navigationDrawerTheme
used to customize the opacity of used color on theNavigationDrawer
indicator. -
Add:
segmentedButtonUnselectedForegroundSchemeColor
toFlexSubThemesData
.
It controls theunselectedForegroundSchemeColor
property in the newFlexSubThemes.segmentedButtonTheme
used to customize theSegmentedButton
. -
Add:
usedColors
value 7.
InFlexColorScheme
andFlexThemeData
light/dark constructors, theusedColors
now accepts value 7. When used, theprimary
,secondary
andtertiary
colors in the used input scheme, are used as defined, butprimaryContainer
,secondaryContainer
andtertiaryContainer
are computed. This is FlexColorScheme's own more Material2 version of seed generation of the container colors by using their main colors as input colors. -
Add:
bottomAppBarTheme
,menuBarTheme
andmenuButtonTheme
toFlexSubThemes
. -
Add:
inputDecoratorPrefixIconSchemeColor
,drawerWidth
,drawerIndicatorWidth
,drawerIndicatorRadius
,drawerIndicatorSchemeColor
,navigationBarIndicatorRadius
,navigationRailIndicatorRadius
,menuBarRadius
,menuBarElevation
,menuBarShadowColor
,snackBarActionSchemeColor
andbottomAppBarSchemeColor
toFlexSubThemesData
. -
Add:
menuRadius
,menuElevation
,menuOpacity
,menuSchemeColor
anddropdownMenuTextStyle
toFlexSubThemesData
. -
Add:
drawerSelectedItemSchemeColor
,drawerUnselectedItemSchemeColor
,tabBarIndicatorSize
, andtabBarDividerColor
toFlexSubThemesData
. -
Add: Static helper function
onSchemeColor
toFlexSubThemes
. -
Add: To
FlexThemeModeOptionButton
added propertiessemanticLabel
,focusColor
andsetFocusOnTap
. IfsetFocusOnTap
is set to true, the button will request focus when it is tapped. Display of previously not shown hover and focus effects where fixed, they now correctly usehoverColor
and the newfocusColor
. -
Add: Property
snackBarRadius
toFlexSubThemesData
, it controls the border radius viaFlexSubThemes.snackBarTheme
by using itsradius
property.- NOTE: If this property is set, both SnackBars with behavior fixed and floating will get the assigned radius. See Flutter issue: flutter/flutter#108539
-
Add: Properties
tabBarUnselectedItemSchemeColor
,tabBarUnselectedItemOpacity
,tabBarIndicatorWeight
andtabBarIndicatorTopRadius
toFlexSubThemesData
. -
Add: New configuration class
FlexAdaptive
used to configure on which platforms adaptive theming features are used. Including 100% unit test coverage for the new class. -
Add: Four new
FlexSubThemesData
properties that uses theFlexAdaptive
configuration class, to configure the featuresadaptiveRemoveElevationTint
,adaptiveElevationShadowsBack
,adaptiveAppBarScrollUnderOff
andadaptiveRadius
. TheadaptiveRadius
controls if thedefaultRadiusAdaptive
is used as value for effective global border radius instead ofdefaultRadius
. -
Add: Seven new
FlexSubThemesData
propertiesmenuBarBackgroundSchemeColor
,menuPadding
,menuItemBackgroundSchemeColor
,menuItemForegroundSchemeColor
,menuIndicatorBackgroundSchemeColor
,menuIndicatorForegroundSchemeColor
andmenuIndicatorRadius
. -
Add: Boolean property
useInputDecoratorThemeInDialogs
toFlexSubThemesData
. Used to control if the application's themed input decoration is used or not, on time picker dialog theme text input fields. If not used, the time picker dialog uses null as input to its input decorator, in order to get the Flutter time picker default style. This toggle will also be used on date picker when/if it gets supported.
CHANGE
-
Style breaking:
FlexSubThemes.blendTextTheme
defaults to false.
In FCS before version 7, the default forblendTextTheme
inFlexSubThemes
was true, and blended text themes were used by default. Going forward if you want it, and also if you had not defined earlier and do not want to break your apps past style, setblendTextTheme
to true. -
Style breaking:
Card
elevation default 1 dp.
TheCard
opinionated sub-theme now defaults to null elevation, resulting in same default of 1 dp elevation as Flutter SDK in both M2 and M3 mode. Previously, FCS defaulted to elevation 0 dp onCards
when opting in on sub-themes. -
Style breaking:
ColorScheme.outline
andColorScheme.outlineVariant
.
The FCS built-in computed none seeded values forColorScheme.outline
andColorScheme.outlineVariant
were modified. The new values are more in line with what you get with the M3 default seed algorithm, but plain grey-scale variants of them without any primary color blend. Technically light mode color foroutline
was changed from 30% lighten of light modeonBackground
color to 45%, andoutlineVariant
from 60% lighten ofonBackground
to 75%. Likewise for the dark mode, but with darkening of theonBackground
with the same percentage changes. The new values match the M3 design intent better. -
Style breaking:
lightSurfaceVariant
anddarkSurfaceVariant
.
FCS v7 introducesFlexColor.lightSurfaceVariant
andFlexColor.darkSurfaceVariant
colors that are used when making none-seeded ColorSchemes. The colors are plain not tinted light and greys, matching the grey level of the tinted versions you get with seed-generated M3 colors. The colors are used as defaults for light and darksurfaceVariant
color in none-seeded versions of generated FlexColorScheme color schemes. In previous versionssurfaceVariant
was just white and black in light and dark theme mode. To be able to better match the M3 color system, without using seed generation, this surface color should not be just white or black. The newsurfaceVariant
corrects this past design to improve compatibility with the M3 color system when not using seed generated color schemes. -
Style breaking:
NavigationBar
Changed the defaultNavigationBar
h...
Version 7.0.0-dev.2
7.0.0-dev.2
Jan 25, 2023
CHANGE
- Updated to require minimum Flutter stable 3.7.0, compared to 7.0.0-dev.1 that required beta 3.7.0-1.4.pre.
- Updated to stable release of FlexSeedScheme ^1.2.0.
FIX
- Fix new scheme
redM3
faulty dark mode colors.
THEMES PLAYGROUND
- CHANGE: Explanation for
SegmentedButton
. - CHANGE: Intro text, to say that M3 in Flutter SDK is now ready for production.
- FIX: Wrap for
PopupMenuButton
. - ADD: ThemeShowcase now includes
Badge
, so it gets featured as well.
TODO BEFORE FCS STABLE 7.0 RELEASE
-
MUST DO: Review and do actionable TODOs in the code.
-
MUST DO: Review and fix test coverage. Test new colors too.
-
MUST DO: Review and test all tutorial examples.
-
MUST DO: Add important changes to docs.flexcolorscheme.com:
- Changelog.
- ListTile transparent added to core defaults, may not be needed. Review before release.
- Update known Flutter M3 and theming impacting issues. Remove fixed ones, add new known ones. (Slider update issue, not yet reported.)
- Info section (plus article later) about what is still missing in Flutter 3.7 from M3.
-
After release, more updates to FlexColorScheme docs:
- New color scheme images
- Review and update older screenshots and GIFs.
- Use image zoom feature in docs.page more on current images.
- Use new highlight banners feature, in the docs.page tool when appropriate.
-
MAYBE: Make tinted disabled controls apply consistently to all controls when applied.
-
MAYBE: Make tinted interaction effect apply consistently to all controls. New M3 widgets need to define it in their own sub-themes to get them, they don't use the hover, focus, highlight color from ThemeData for their defaults.
Postponed TODOs, that were planned for FCS stable 7.0, but moved forward to 7.1 or later.
- Add more sub-theme component color presentations to the Playground's Component Themes panel.
- Add some theming options for the new NavigationDrawer theme.
- Add some theming options for the new MenuBar theme.
- Add more "Set to M3 design" buttons like on Text Field panel, e.g. to Navigation Bar and Navigation Rail panels.
- To TabBar theming, add unselected color, not selected dim/undim and custom bottom borderline color.
Version 7.0.0-dev.1
7.0.0-dev.1
Work in progress!
Jan 23, 2023
This major release does not contain any breaking API changes. However, the major version is bumped because some past styles and defaults, when opting in on Material 3, have been slightly tuned to better align with new Material 3 widgets and design, included in the Flutter 3.8/4.0 (?) release. The new features are also significant.
NEW
-
Added 12 new Material 3 color schemes:
redM3
,pinkM3
,purpleM3
,indigoM3
,blueM3
,cyanM3
,tealM3
,greenM3
,limeM3
,yellowM3
,orangeM3
anddeepOrangeM3
for a total of 52 built-in light and dark theme pairs. These schemes work well in Material 3 with or without seed generation. But using FCS advanced and flexible key color-based seed generation is recommended when using Material 3. You can always lock e.g. primary and tertiary color to custom brand color values you used as keys. -
Added support for new
ColorScheme
colorsscrim
andoutlineVariant
. -
Added support for
fontFamilyFallback
andpackage
so that acopyWith
onFlexColorScheme
generatedThemeData
is not needed to use them. -
Added support for Material 3 buttons
FilledButton
andFilledButton.tonal
.- Supported via
FlexSubThemes.filledButtonTheme
that is controlled viaFlexSubThemesData
propertiesfilledButtonRadius
,filledButtonSchemeColor
andfilledButtonTextStyle
. - When setting up theming for
FilledButton
it was noticed that variantFilledButton.tonal
cannot be themed separately, see issue: flutter/flutter#115827.
- Supported via
-
Added option to keep using the M2 style Divider in M3. The in M3 used primary color tinted outlineVariant does not fit on any color. The M2 style based on black or white with opacity does. It is also less prominent than the M3 style and may be preferred. Set
FlexSubThemesData
propertyuseM2StyleDividerInM3
to true to use the M2 style in M3. Defaults to false.- FlexColorScheme also sets
ThemeData.dividerColor
toThemeData.colorScheme.outlineVariant
whenThemeData.useMaterial3
istrue
. This keeps the in Flutter SDK to be deprecatedThemeData.dividerColor
always same as actually used effectiveDivider
color. Thus, if an app usesTheme.of(context).dividerColor
while it still exists, to set a color to it, and expects it be the same color as effectiveDivider
color, it will be so in FCS, regardless of if M2 or M3 is being used. This is not the case in Flutter SDK by default, see issue flutter/flutter#117755 for more information.
- FlexColorScheme also sets
-
Added
elevation
toFlexSubThemes.timePickerTheme
, and make it use the dialog sharedFlexSubThemesData.dialogElevation
setting. This property does not yet exist in Flutter beta 3.7.0-1.4.pre. It is thus unsure if it will land in next stable Flutter, if it does not it will be commented and removed for the next FCS release as well. -
Added boolean
tintedDisabledControls
toFlexSubThemesData
. If set to true, disabled widgets will get a hint of their active main color when disabled. In future minor versions, this will also apply to components that use own themed settings for disabled color, not only to the ones where disabled color controlled byThemeData.disabledColor
. Previously tinted disabled color forThemeData.disabledColor
was included and defined whenFlexSubThemesData.interactionEffects
was set to true. It is now instead controlled by this separate tinted disabled-controls setting. Defaults to true, for an FCS opinionated default. This matches past default when it was included inFlexSubThemesData.interactionEffects
. -
Added boolean
inputDecoratorFocusedHasBorder
toFlexSubThemesData
. Default to true. If set to false, there is no border on theInputDecorator
, typically used by text fields, when the input decorator is focused. It controls the new parameterfocusedHasBorder
inFlexSubThemes.inputDecorationTheme
. -
Added
SchemeColor
valueinputDecoratorBorderSchemeColor
toFlexSubThemesData
. It is used to define and customize the border color ofInputDecorator
on e.g. TextField. It controls the new parameterborderSchemeColor
inFlexSubThemes.inputDecorationTheme
. -
Added
appBarTheme
andtabBarTheme
toFlexSubThemes
. -
Added Material 3 styling to
TabBar
when M3 is used. UseFlexTabBarStyle.flutterDefault
to get the SDK default colors in M3 mode.TabBar
may get more configuration options in the next FCS version. -
Added
double
valueappBarScrolledUnderElevation
toFlexSubThemesData
. It is used to define and customize the themed scrolled under elevation of theAppBar
. It controls the new parameterscrolledUnderElevation
inFlexSubThemes.appBarTheme
. -
Added
SchemeColor
valuetoggleButtonsUnselectedSchemeColor
andtoggleButtonsBorderSchemeColor
toFlexSubThemesData
. They are used to define and customize the themed unselected button and border color ofToggleButtons
. They control the new parametersunselectedSchemeColor
andborderSchemeColor
inFlexSubThemes.toggleButtonsTheme
. -
Added
SchemeColor
valuesliderIndicatorSchemeColor
, and enumFlexSliderIndicatorType
valuesliderValueIndicatorType
, plus enumShowValueIndicator
valuesliderShowValueIndicator
toFlexSubThemesData
. They control the new parametersvalueIndicatorColor
,valueIndicatorType
andshowValueIndicator
inFlexSubThemes.sliderTheme
. -
Added
SchemeColor
valuedrawerBackgroundSchemeColor
and double valuesdrawerRadius
,drawerElevation
toFlexSubThemesData
. They control the new parametersbackgroundSchemeColor
,radius
andelevation
in new sub-themeFlexSubThemes.drawerTheme
. -
Added
menuTheme
toFlexSubThemes
, it provides styling for elevation, radius and background color with optional opacity for the new Mw componentsMenuAnchor
,MenuBar
andDropDownMenu
. The sameFlexSubThemesData
that are used forPopupMenuButton
are used to control this theme. Those arepopupMenuRadius
,popupMenuElevation
,popupMenuSchemeColor
, andpopupMenuOpacity
. -
Added
timePickerElementRadius
toFlexSubThemesData
that can be used to controlelementRadius
inFlexSubThemes.timePickerTheme
, it changes the themed border radius of the time input entry elements. -
Added
segmentedButtonRadius
,segmentedButtonSchemeColor
,segmentedButtonUnselectedSchemeColor
,segmentedButtonBorderSchemeColor
andsegmentedButtonBorderWidth
toFlexSubThemesData
they control the equivalent properties in the newFlexSubThemes.segmentedButtonTheme
used to customize theSegmentedButton
.
CHANGE
-
Style change on tinted disabled components when opting in on
tintedDisabledControls
. It is visually breaking, but subtle. Disable opacity alpha and alpha blend constants where tuned, kDisabledAlphaBlend from 0xAA (67%) to 0xCC (80%) and kDisabledBackgroundAlpha from 0x31 (19%) to 0x26 (15%). The new tinted disable colors look better. They are close in style to default grey ones, with a subtle primary tint, while still being more legible than in previous versions. Opting in on tinted disabled components is still not yet available on all components. It is more available in M2 mode. In upcoming minor releases, tinted disabled components will be made available on all themed components and consistently applied in both M2 and M3 mode. More visual tuning of this feature may be required in later releases. -
Removed in version 6.1.0 included manual M3 elevation tint for
BottomSheet
andPopupMenuButton
, in Flutter 3.7.0, the tint is included automatically as it should be and we no longer need the workaround. -
The
ListTileThemeData
was added to core defaults. It setsListTileThemeData.tileColor
toColors.transparent
ifThemeData.useMaterial3
is true. This is done to avoid issue: flutter/flutter#117700. This extra M3 core default theme fix will be removed as soon as the issue is fixed. -
Changed
FlexColorScheme.bottomAppBarElevation
to be nullable. In M2 mode if is null, it follows definedappBarElevation
as before. In M3, it is kept null in order to default to M3's default elevation of 3, so thatBottomAppBar
get elevation tint by default. In M3 mode a minor spec deviation was noted in Flutter SDK and reported here flutter/flutter#118150. -
Changed FlexColorScheme default
BottomAppBar
color to becolorScheme.surface
, same as Flutter default. Previously FlexColorScheme usedcolorScheme.background
color as an opinionated default. The change is minor, and in many designs the color values are the same. -
The Material buttons
ElevatedButton
,OutlinedButton
andTextButon
, now only create custom sub-theme properties in Material 3 mode when using none default (none null) values. Previously, they created sub-themes for some properties corresponding to the default values. This task now falls back to the role of default widget behaviour, as it should. Effective styles are unchanged. -
Previously existing "native" Material 3 color schemes,
materialBaseline
,verdunHemlock
anddellGenoa
were changed to use Material 3 error colors, also in Material 2 mode and when not using seed colors. -
When making seed generated
ColorScheme
with a customsurfaceTint
color. This tint color is now also used as seed-key for the neutral and neutral variant tonal palettes. Flutter SDK can only use
primary color as seed-key for the neutral colors. This limitation in Flutter makes using a customsurfaceTint
in seededColorSchemes
less usable with often unappealing results. This happens because the custom tint color then differs from the slightprimary
tint that is hard coded into Flutter's seeded neutral colors used for surfaces and backgrounds, and the colors may clash. In FlexColorScheme the custom tint color is automatically also used to slightly tint the ne...
Version 6.1.2
6.1.2
Dec 26, 2022
FIX
- Fix for issue #106 bottomSheetModalBackgroundColor not correctly set. Thanks mcssym for the fix PR #107.
Version 6.1.1
6.1.1
Nov 22, 2022
FIX
- Themes Playground (Example 5): Fixed scroll issue in page view mode on Web builds. Only examples related, no package impact.
- API doc updates.
Version 6.1.0
6.1.0
Nov 20, 2022
FlexColorScheme version 6.1.0 contains many new features, more component sub-themes and configurable properties. It improves seed-generated color scheme capabilities by adding more pre-configured seed generation configurations and color contrast accessibility options.
A criticism of Material 3's color system and seed-generated color schemes, is that using colored contrasting colors may be less accessible. FlexColorScheme offers a way to enable in-app modification of its seed-generated color schemes, any seed generation configuration can optionally return results with plain white and black contrasting on colors. This can be applied separately for main on colors and on surfaces.
The Themes Playground application, has been updated to include most of the new features. It has been improved to make it easier to discover some of its previously existing features, like using custom colors in the Playground to define your own theme.
NEW
- Scaffold background color can now be used as the themed AppBar background color. The enum
FlexAppBarStyle
that is used by propertyappBarStyle
got a new valuescaffoldBackground
that enables this. This is useful for matching the AppBar color exactly to the Scaffold background color, when Scaffold background uses different surface blends than the theme'sColorScheme
surface or background colors. - Added properties
materialTapTargetSize
andpageTransitionsTheme
toFlexColorScheme
andFlexThemeData
. They are only convenience properties to avoid having to use acopyWith
on FlexColorScheme producedThemeData
, to define them. - Property
swapLegacyOnMaterial3
inFlexColorScheme.light/dark
andFlexThemeData.light/dark
allows for better automatic adjustment of built-in scheme colors to the Material 3 color-system. It applies to color schemes that were originally designed for Material 2, when using the Material 3 mode with or without seed-generated ColorSchemes.- Setting
swapLegacyOnMaterial3
totrue
, will whenuseMaterial3
istrue
, swap the built-in scheme colorssecondary
andtertiary
and also their container colors. - This only happens for built-in schemes where this swap makes the color design more compatible with the intended design and usage of the
secondary
andtertiary
colors in Material 3 color system. - To implement this, the class
FlexSchemeColor
has a new boolean meta-data property calledswapOnMaterial3
, that has been defined to betrue
, if theFlexSchemeColor
it defines, benefits design compliance wise from swapping itssecondary
andtertiary
colors when using Material 3. - For backwards compatibility the
swapLegacyOnMaterial3
isfalse
by default, but it is recommended to always set it totrue
. The flag has no impact when using Material 2. - The
swapLegacyOnMaterial3
flag can also be toggled in the Themes Playground, it is on by default there. - When the swap is done for a
FlexSchemeColor
, it is done before any other built-in scheme modifier properties, includingswapColor
andusedColors
.
- Setting
- The
FloatingActionButton
can now be set to always be circular, also in Material 3 and without assigning a high-radius setting. If you always want a circular FAB, and stadium on extended FAB, then setfabAlwaysCircular
inFlexSubThemesData
totrue
, and FAB stays circular regardless of if you use M2 or M3, or how you modify the global default border radius. You could get this effect before too by setting a very high themed radius on the FAB, but this is more convenient. - Additional new
FlexSubThemesData
properties:Slider
theme can now be adjusted viaFlexSubThemesData
propertiessliderBaseSchemeColor
,sliderValueTinted
andsliderTrackHeight
.- The
chipSelectedSchemeColor
was added as themed background color, it is used by Chips that are selectable. ThechipDeleteIconSchemeColor
can be used to theme the "Delete" icon color on Chips. While adding these features, some Flutter M3 Chip spec and theming issues were found, see issue #115364 for more information. - Switch got a
switchThumbSchemeColor
property, to control the thumb color separately. A switch custom color theme was prepared for M3Switch
, which is not yet available in Flutter 3.3. Tooltip
theme now hasFlexSubThemesData
propertiestooltipRadius
,tooltipWaitDuration
,tooltipShowDuration
,tooltipSchemeColor
andtooltipSchemeColor
.- The
bottomSheetBackgroundColor
andbottomSheetModalBackgroundColor
can be used to theme the background color of theBottomSheet
. - Use
navigationBarElevation
to adjust the themed elevation ofNavigationBar
. - Use
popupMenuElevation
andpopupMenuSchemeColor
to further quick theme thePopupMenuButton
. - The
outlinedButtonBorderWidth
,outlinedButtonPressedBorderWidth
,toggleButtonsBorderWidth
,inputDecoratorBorderWidth
andinputDecoratorFocusedBorderWidth
define the themed outline border thickness in different states of their respective components. These properties use previously existing propertiesthinBorderWidth
andthickBorderWidth
as their defaults. Resulting in that, the new properties are API backwards compatible, and they have shared global default settings. The new part is that you can now define themed outline border thickness separately for these components. - The
elevatedButtonTextStyle
,outlinedButtonTextStyle
andtextButtonTextStyle
were added to be able to themeTextStyle
onElevatedButton
,OutlinedButton
,TextButton
. These are convenience properties to allow different text styles on buttons without having to usecopyWith
on the overallThemeData
and its button component themes to modify the text styles, often sizes.- These properties do not offer any simplification over standard
ThemeData
and its button themes. The current version does not include adjusting them in the Themes Playground. Adding all possible usage of them is currently not in the scope of the Playground app. However, button font size changes may be added later as a usage example of these properties. These properties are using the trickyMaterialStateProperty
, that have so far been avoided in this flattened simplified theming. It was used for the benefit of offering the text styles asThemeData
pass along properties. Modifying theButtonStyle
theme usingcopyWith
, is a bit more involved than for other sub themes, with these properties you can customize the button text style usingFlexSubThemesData
properties instead. If you need to modify theFlexColorScheme
created buttons themes even further for some not included properties, an example of how to do that can be found here.
- These properties do not offer any simplification over standard
CHANGE
- FlexColorScheme now uses FlexSeedScheme version 1.1. It includes the following new features and changes:
- Features that enabled implementation of just black and white seeded on colors.
- Additional
FlexTones
, theFlexTones.oneHue
andFlexTones.vividBackground
. - See FlexSeedScheme on pub.dev for more information.
- In
FlexSubThemesData
all component controlling properties except booleans, are now nullable and null by default. FlexColorScheme made sub themes still default to same values as before when assigning a defaultFlexSubThemesData()
toFlexColorScheme.subThemesData
. The properties are nullable to enable using different defaults in FlexColorScheme made sub-themes for Material 2 and Material 3 modes. - Style breaking: Changed component themes
thinBorderWidth
to default to 1.0. It was 1.5 before. This is a style breaking change from previous thin outline style in FlexColorScheme.- Using fractional values may cause artefacts on monitors using native resolution where 1 dp = 1 physical display pixel (common on desktop PC/Linux monitors). We see the new default as a design FIX to avoid such issues with default settings. You can still set
thinBorderWidth
to 1.5, to get the same result as previous default theme.
- Using fractional values may cause artefacts on monitors using native resolution where 1 dp = 1 physical display pixel (common on desktop PC/Linux monitors). We see the new default as a design FIX to avoid such issues with default settings. You can still set
- Style breaking: When opting in on opinionated sub-themes, the
Chip
style is slightly modified from previous versions. The new opinionated FCS default style is more distinct than before and more aligned with styling borrowed from the Material 3 modeChip
design. ThedeleteIconnColor
now defaults toonSurface
instead ofprimary
and it can be defined to be any color scheme based color. The Chips revised style, look better than before. Using Material 3 and with it themedChips
is also fully supported, also customizing color on selected state of selectable Chips is available. Color-tinted chips are also available as before. Be aware though that Material 3 theming in the current 3.3 version of Flutter has some limitations. If you assign a custom color to selected chips, the disabled state of Chips can no longer conform, to M3 spec of disabled selected Chips.- For more information, see issue #115364. Note that if you deviate on Chips from its expected designed background brightness, which is now possible to do for selected Chips with the new theming capabilities in the Playground. There is no way via theming to set correct text and icon contrasting brightness for selected Chips that require dark text and icons on bright Chips in dark theme mode. Wise versa for light theme mode, setting light text on dark selected Chips in light mode, is also not possible. This limitation applies to selected
FilterChip
andInputeChip
, there is simple not enough theme properties inChipTheme
to support this. Due to this limitation, we recommend only using Chip theme designs that work with dark text in light mode, and light text in dark mode.
- For more information, see issue #115364. Note that if you deviate on Chips from its expected designed background brightness, which is now possible to do for selected Chips with the new theming capabilities in the Playground. There is no way via theming to set correct text and icon contrasting brightness for selected Chips that require dark text and icons on bright Chips in dark theme mode. Wise versa for light theme mode, setting light text on dark selected Chips in light mode, is also not possible. This limitation applies to selected
- Style breaking: Wh...
Version 6.0.1
6.0.1
Sep 21, 2022
FIX
-
A null check was fixed by sososdk in
FlexColorScheme.light
when using custom scheme PR #90. Issue did not exist inFlexColorScheme.dark
. -
Cam16 from Material Color Utilities was exported by accident by FlexColorScheme in version 6.0.0 via its FlexSeedScheme package export. This export was removed. Cam16 was not exported before moving features to FlexSeedScheme and should not have been now either. FlexSeedScheme does however export it as before, it is used by the FlexColorPicker.
Version 6.0.0
6.0.0
Aug 31, 2022
- Updated minimum dependencies to Dart >=2.18.0 and Flutter >= 3.3.0.
Due to a number of known and below documented Flutter SDK issues when using useMaterial3
set to
true
, we cannot yet recommend using the option in production. Use it only if you are willing to
accept the still incomplete Material 3 implementation in Flutter and the issues. If you
keep useMaterial3
set to false
, and use FCS opinionated component themes, you can create a
theme that is visually fairly similar to M3, but still using M2 ThemeData
mode to avoid many
issues.
BREAKING
-
This FlexColorScheme version no longer directly depends on package Material Color Utilities package, which is also used by Flutter SDK. Instead, it uses package
FlexSeedScheme that depends on it. As a part of this change classesFlexTones
,FlexTonalPalette
andFlexCorePalette
where moved into the package FlexSeedScheme. FlexColorScheme still exports these classes. If you were using them directly before, you can still do so without adding the FlexSeedScheme package. -
In FlexSeedScheme,
FlexTones
contains a minor breaking change to make the API cleaner. TheFlexTones.light
andFlexTones.dark
no longer produce the config for the Material 3 tone and chroma setup. They no longer lock the chroma values to the default values for M3, but use null in their configs for their chroma values. Resulting in that chroma from key colors will be used, as long as they are over set minimum values. These named constructors then provide a cleaner starting API for defining additional configurations, by not forcingnull
to be passed to use chroma value in key colors. To get the Material 3 configuration, use the factoryFlexTones.material
instead ofFlexTones.light
andFlexTones.light
. It as before produces the correct Material 3 configuration, by definingsecondaryChroma: 16
andtertiaryChroma: 24
usingFlexTones.light
andFlexTones.dark
to return the correct Material 3 matchingFlexTones
configuration as before. This change was introduced to prepare for extractingFlexTones
andFlexSeedScheme
to their own package that will provide afromFlexSeeds
extension onColorScheme
. It is unlikely to impact any normal usage of FlexColorScheme, but it is still a breaking change. -
In FlexSeedScheme
FlexCorePalette.fromSeeds
propertiessecondaryChroma
andtertiaryChroma
now default to null instead of previous M3 palette default generating values 16 and 24 respectively. Set them to values 16 and 24 to create same tonal palettes as Material Color UtilitiesCorePalette
and previous versions ofFlexCorePalette
. -
To allow for greater flexibility and addition of tonal palette tones 5 (custom for FCS) and 98 (Google Material 3 Web theme builder app includes tone 98 to, but not Flutter SDK),
FlexCorePalette
no longer extendsCorePalette
, it is a modified re-implementation. -
In FlexSeedScheme the
FlexTonalPalette
methodasList
and constructorfromList
, now include the values of the error color in produced asList, and as required values in fromList.
NEW
-
In FlexSeedScheme, added customization possibility of
error
tonal palette to the defaultFlexTonalPalette
constructor. -
In FlexSeedScheme, added two new
FlexTones
:FlexTones.ultraContrast
with even more contrast thathighContrast
.FlexTones.jolly
for a seededColorScheme
with more poppy and jolly seed colors.
-
In FlexSeedScheme, added
SeedColorScheme.fromSeeds(...)
that can be used to create a seededColorScheme
using multiple seed colors andFlexTones
configuration. -
In FlexSeedScheme, added
FlexTonalPalette
a re-implementation of Material Color UtilitiesTonalPalette
, with addition of tonal palette tones 5 and 98. The tone 98 also exists in the Web Material Theme Builder app, but not in Flutter or Material Color Utilities package. Tone 5 is custom addition forFlexTones
andFlexColorScheme
. -
Added
appBarCenterTitle
property toFlexSubThemesData
configuration. It works the same way ascenterTitle
inAppBar
and its theme. The property is not available in the Themes Playground app, only via the API. We recommend keeping it null to use platform
adaptive default behavior, but offer it as convenience property for those that like to use same centering style regardless of used platform. -
Added two new properties to
FlexSubThemes.elevatedButtonTheme
.- Boolean
useMaterial3
, defaults to false. onBaseSchemeColor
, defaults to nullSchemeColor?
.
When
useMaterial3
isfalse
, theelevatedButtonTheme.baseSchemeColor
is used as background color as before, and the new propertyelevatedButtonTheme.onBaseSchemeColor
is used as foreground color. However, whenuseMaterial3
istrue
, their foreground and background color roles are reversed, andbaseSchemeColor
becomes its foreground color and theonBaseSchemeColor
its background color. - Boolean
-
Added
elevatedButtonSecondarySchemeColor
property of typeSchemeColor?
toFlexSubThemesData
. Use it to control secondary color of theElevatedButton
in its sub-themes. FCS applies this color toFlexSubThemes.elevatedButtonTheme.onBaseSchemeColor
. IfuseMaterial3
is false, it is the foreground color. IfuseMaterial3
is true, it is the background color. Material 3 and 2 have a completely different default elevated button styles. The Material 2 elevated button is color wise, like the M3 filled button, but with elevation. -
Added two new properties to
FlexSubThemes.outlinedButtonTheme
.- Boolean
useMaterial3
, defaults to false. outlineSchemeColor
, defaults to nullSchemeColor?
.
WhenuseMaterial3
isfalse
, theoutlineSchemeColor
defaults tobaseSchemeColor
.
WhenuseMaterial3
istrue
, theoutlineSchemeColor
defaults toSchemeColor.outline
.
- Boolean
REMOVED EARLIER DEPRECATED MEMBERS
As a chore and clean up all previously deprecated members have been removed from version 6.0.0. It no longer has any self deprecated members. This removes a lot legacy backwards compatibility with deprecated members from versions 2, 3 and 4, and even one from version 5.1.0. Removed all earlier self deprecated members as follows:
- FlexSubThemesData:
inputDecorationRadius
,bottomNavigationBarSchemeColor
,navigationBarIsStyled
,navigationBarTextSchemeColor
,navigationBarMutedUnselectedText
,navigationBarIconSchemeColor
,navigationBarHighlightSchemeColor
. - FlexColorScheme:
primaryVariant
,secondaryVariant
,useSubThemes
. Removed staticFlexColorScheme.m3TextTheme
deprecated in 5.1.0 and staticFlexColorScheme.themedSystemNavigationBar
in version 2 its deprecated parameternullContextBackground
. - FlexThemeData:
primaryVariant
,secondaryVariant
,useSubThemes
. - FlexSchemeColor:
primaryVariant
,secondaryVariant
. - SchemeColor:
primaryVariant
,secondaryVariant
. - FlexConstants:
kDarkenSecondaryVariant
,kDarkenSecondaryVariantFromSecondary
,kDarkenPrimaryVariant
. - FlexSubThemes.bottomNavigationBar:
baseSchemeColor
. - FlexSubThemes.navigationBarTheme:
textSchemeColor
,unselectedTextSchemeColor
,mutedUnselectedText
,iconSchemeColor
,highlightSchemeColor
.
STYLE CHANGE - BREAKING
FlexSubThemesData.fabUseShape
opinionated component theme style default was changed fromtrue
tofalse
, this breaks previous default style. The opinionated style change was done to use a style that by default matches M3 style whenThemeData.useMaterial3
istrue
. The new default style is also a way to work around issue #107946, where it is shown that you cannot create a theme that replicates the default roundings in M3 of the FAB.
Style migration: If you had keptFlexSubThemesData.fabUseShape
unspecified and relied on default value in a previous version, you must set it totrue
to get the same result as before. Breaking style changes like this, in the opinionated opt in component sub-themes are unfortunate. However, required as FlexColorScheme continues to evolve with Flutter SDK to support Material 3 theming, while offering its own opinionated tweaks on some M3 default styles as well.
STYLE CHANGE - MINOR
-
The M3 color utilities package material_color_utilities from the Material team, that Flutter SDK depends on and FCS also uses, introduced a minor breaking change going from version 0.1.4 to 0.1.5. Some colors in the tonal palettes no longer give exactly the same color values as before. This changes the results for some colors when you create a
ColorScheme.fromSeed
or FCS does it internally with its extended versionSeedColorScheme.fromSeeds
. The new algorithm changes for example all the default M3 error colors slightly. The changes in the color values are minor, and not visually noticeable to the eye. Values are however slightly different, and this release uses the new value for FCS M3 error colors. Tests were also updated to use the new values. The change did break FCS color value tests, and should be per its own policy be considered a major breaking change. However, since the Material 3 design and material_color_utilities calls this change minor, then so does FCS. -
The opt-in opinionated tinted text themes were made less aggressive on the tint, and received a bit of opacity for styles that in 2014/2018/2021 styles have opacity. The custom styles uses significantly less opacity since they already also get alpha blended tint color applied. Combining it with same level of opacity would make them too low contrast.
-
Style fix, the ...
Version 6.0.0-dev.1
6.0.0-dev.1
Aug 28, 2022
This dev release is for Flutter beta 3.3.0-0.5.pre, it will be released when next Flutter stable version after 3.0 comes out, presumably version 3.3.
If you experiment with this dev release and want to use the Theme Playground, then please use the version 6 beta build, here. The doc site does not yet contain any information about version 6, it will be added after its stable release.
Due to a number of known and below documented Flutter SDK issues when using useMaterial3
set to true
, we cannot yet recommend using the option in production. Use it only if you are willing to accept the still incomplete Material 3 implementation in Flutter and the issues. If you keep useMaterial3
set to false
, and use FCS opinionated component themes, you can create a theme that is visually fairly similar to M3, but still using M2 ThemeData
mode to avoid many issues.
BREAKING
-
This FlexColorScheme version no longer directly depends on package Material Color Utilities package, which is also used by Flutter SDK. Instead, it uses package
FlexSeedScheme that depends on it. As a part of this change classesFlexTones
,FlexTonalPalette
andFlexCorePalette
where moved into the package FlexSeedScheme. FlexColorScheme still exports these classes. If you were using them directly before, you can still do so without adding the FlexSeedScheme package. -
In FlexSeedScheme,
FlexTones
contains a minor breaking change to make the API cleaner. TheFlexTones.light
andFlexTones.dark
no longer produce the config for the Material 3 tone and chroma setup. They no longer lock the chroma values to the default values for M3, but use null in their configs for their chroma values. Resulting in that chroma from key colors will be used, as long as they are over set minimum values. These named constructors then provide a cleaner starting API for defining additional configurations, by not forcingnull
to be passed to use chroma value in key colors. To get the Material 3 configuration, use the factoryFlexTones.material
instead ofFlexTones.light
andFlexTones.light
. It as before produces the correct Material 3 configuration, by definingsecondaryChroma: 16
andtertiaryChroma: 24
usingFlexTones.light
andFlexTones.dark
to return the correct Material 3 matchingFlexTones
configuration as before. This change was introduced to prepare for extractingFlexTones
andFlexSeedScheme
to their own package that will provide afromFlexSeeds
extension onColorScheme
. It is unlikely to impact any normal usage of FlexColorScheme, but it is still a breaking change. -
In FlexSeedScheme
FlexCorePalette.fromSeeds
propertiessecondaryChroma
andtertiaryChroma
now default to null instead of previous M3 palette default generating values 16 and 24 respectively. Set them to values 16 and 24 to create same tonal palettes as Material Color UtilitiesCorePalette
and previous versions ofFlexCorePalette
. -
To allow for greater flexibility and addition of tonal palette tones 5 (custom for FCS) and 98 (Google Material 3 Web theme builder app includes tone 98 to, but not Flutter SDK),
FlexCorePalette
no longer extendsCorePalette
, it is a modified re-implementation. -
In FlexSeedScheme the
FlexTonalPalette
methodasList
and constructorfromList
, now include the values of the error color in produced asList, and as required values in fromList.
NEW
-
In FlexSeedScheme, added customization possibility of
error
tonal palette to the defaultFlexTonalPalette
constructor. -
In FlexSeedScheme, added two new
FlexTones
:FlexTones.ultraContrast
with even more contrast thathighContrast
.FlexTones.jolly
for a seededColorScheme
with more poppy and jolly seed colors.
-
In FlexSeedScheme, added
SeedColorScheme.fromSeeds(...)
that can be used to create a seededColorScheme
using multiple seed colors andFlexTones
configuration. -
In FlexSeedScheme, added
FlexTonalPalette
a re-implementation of Material Color UtilitiesTonalPalette
, with addition of tonal palette tones 5 and 98. The tone 98 also exists in the Web Material Theme Builder app, but not in Flutter or Material Color Utilities package. Tone 5 is custom addition forFlexTones
andFlexColorScheme
. -
Added
appBarCenterTitle
property toFlexSubThemesData
configuration. It works the same way ascenterTitle
inAppBar
and its theme. The property is not available in the Themes Playground app, only via the API. We recommend keeping it null to use platform
adaptive default behavior, but offer it as convenience property for those that like to use same centering style regardless of used platform. -
Added two new properties to
FlexSubThemes.elevatedButtonTheme
.- Boolean
useMaterial3
, defaults to false. onBaseSchemeColor
, defaults to nullSchemeColor?
.
When
useMaterial3
isfalse
, theelevatedButtonTheme.baseSchemeColor
is used as background color as before, and the new propertyelevatedButtonTheme.onBaseSchemeColor
is used as foreground color. However, whenuseMaterial3
istrue
, their foreground and background color roles are reversed, andbaseSchemeColor
becomes its foreground color and theonBaseSchemeColor
its background color. - Boolean
-
Added
elevatedButtonSecondarySchemeColor
property of typeSchemeColor?
toFlexSubThemesData
. Use it to control secondary color of theElevatedButton
in its sub-themes. FCS applies this color toFlexSubThemes.elevatedButtonTheme.onBaseSchemeColor
. IfuseMaterial3
is false, it is the foreground color. IfuseMaterial3
is true, it is the background color. Material 3 and 2 have a completely different default elevated button styles. The Material 2 elevated button is color wise, like the M3 filled button, but with elevation. -
Added two new properties to
FlexSubThemes.outlinedButtonTheme
.- Boolean
useMaterial3
, defaults to false. outlineSchemeColor
, defaults to nullSchemeColor?
.
WhenuseMaterial3
isfalse
, theoutlineSchemeColor
defaults tobaseSchemeColor
.
WhenuseMaterial3
istrue
, theoutlineSchemeColor
defaults toSchemeColor.outline
.
- Boolean
REMOVED EARLIER DEPRECATED MEMBERS
As a chore and clean up all previously deprecated members have been removed from version 6.0.0. It no longer has any self deprecated members. This removes a lot legacy backwards compatibility with deprecated members from versions 2, 3 and 4, and even one from version 5.1.0. Removed all earlier self deprecated members as follows:
- FlexSubThemesData:
inputDecorationRadius
,bottomNavigationBarSchemeColor
,navigationBarIsStyled
,navigationBarTextSchemeColor
,navigationBarMutedUnselectedText
,navigationBarIconSchemeColor
,navigationBarHighlightSchemeColor
. - FlexColorScheme:
primaryVariant
,secondaryVariant
,useSubThemes
. Removed staticFlexColorScheme.m3TextTheme
deprecated in 5.1.0 and staticFlexColorScheme.themedSystemNavigationBar
in version 2 its deprecated parameternullContextBackground
. - FlexThemeData:
primaryVariant
,secondaryVariant
,useSubThemes
. - FlexSchemeColor:
primaryVariant
,secondaryVariant
. - SchemeColor:
primaryVariant
,secondaryVariant
. - FlexConstants:
kDarkenSecondaryVariant
,kDarkenSecondaryVariantFromSecondary
,kDarkenPrimaryVariant
. - FlexSubThemes.bottomNavigationBar:
baseSchemeColor
. - FlexSubThemes.navigationBarTheme:
textSchemeColor
,unselectedTextSchemeColor
,mutedUnselectedText
,iconSchemeColor
,highlightSchemeColor
.
STYLE CHANGE - BREAKING
FlexSubThemesData.fabUseShape
opinionated component theme style default was changed fromtrue
tofalse
, this breaks previous default style. The opinionated style change was done to use a style that by default matches M3 style whenThemeData.useMaterial3
istrue
. The new default style is also a way to work around issue #107946, where it is shown that you cannot create a theme that replicates the default roundings in M3 of the FAB.
Style migration: If you had keptFlexSubThemesData.fabUseShape
unspecified and relied on default value in a previous version, you must set it totrue
to get the same result as before. Breaking style changes like this, in the opinionated opt in component sub-themes are unfortunate. However, required as FlexColorScheme continues to evolve with Flutter SDK to support Material 3 theming, while offering its own opinionated tweaks on some M3 default styles as well.
STYLE CHANGE - MINOR
- The M3 color utilities package material_color_utilities from the Material team, that Flutter SDK depends on and FCS also uses, introduced a minor breaking change going from version 0.1.4 to 0.1.5. Some colors in the tonal palettes no longer give exactly the same color values as before. This changes the results for some colors when you create a
ColorScheme.fromSeed
or FCS does it internally with its extended versionSeedColorScheme.fromSeeds
. The new algorithm changes for example all the default M3 error colors slightly. The changes in the color values are minor, and not visually noticeable to the eye. Values are however slightly different, and this release uses the new value for FCS M3 error colors. Tests were also updated to use the new values. The change did break FCS color value tests, and should be per its own policy be considered a major breaking change. However, since the Material 3 design and material_color_utilities calls this change minor, then so does ...
Version 5.1.0
v5.1.0 - July 8, 2022
- Updated to support Flutter 3.0.0, Dart 2.17 and latest Flutter package dependencies in example apps. Requires at least Flutter 3.0.0 and Dart 2.17.0.
NEW
-
Added full support for in Flutter 3.0.0 new
ColorScheme.surfaceTint
color. It is set toColorScheme.primary
color by default, as Flutter and Material 3 does. If a customsurfaceTint
color is provided, it is also used as the blend color, instead ofprimary
color, for
FlexColorScheme's surface blend feature. -
Added API for using Flutter 3.0.0 theme extensions directly via FlexColorScheme API. It was added as a convenience feature in order to avoid having to add theme extensions with a
copyWith
on FlexColorScheme produced ThemeData. With theFlexColorScheme.extensions
andFlexThemeData.extensions
properties you can add custom theme extensions directly.
DEPRECATED
-
Deprecated:
FlexColorScheme.m3TextTheme
. The custom M3 text theme is no longer needed after Flutter 3.0.0 release that includes the new M3 Typography in addition to its earlier releasedTextTheme
. You can opt in on using the new M3 style TextTheme as before by settingFlexColorScheme.subThemesData.useTextTheme
to true or by settingFlexColorScheme.useMaterial3
to true. Using either does however come with known issue #103864, where dynamically switching Typography, e.g. from 2014 or 2018, to M3 2021 Typography, triggers the mentioned assert in issue
#103864. This issue has always existed in Flutter SDK ThemeData when dynamically changing between different Typography. Before FlexColorScheme avoided triggering this issue by only using Typography 2018, also when
opting in on M3 TextTheme, that before used 2018 based Typography to make a custom M3 likeTextTheme
. Avoiding this issue is no longer possible when opting in on M3, that now correctly uses its own and different Typography from M2. This exposes this issue if you dynamically change ThemeData from one to another Typography. To avoid this Flutter SDK issue, use the same Typography for all your themes in your app and don't dynamically switch theme between ThemeData objects that uses different Typography in your application. The use cases for doing this are few, but it is still a Flutter SDK limitation to be aware about. -
Deprecated:
FlexSubThemes.buttonTheme
that creates an opinionatedButtonThemeData
. The ButtonThemeData is marked as obsolete in Flutter SDK, but not yet deprecated in Flutter version 3.0.0. FlexColorscheme now marks it as deprecated. It will be removed in a future FlexColorScheme release when Flutter SDK deprecatesButtonThemeData
.
M3 STYLE FIXES AND CHANGES
-
FAB M3 defaults change: Floating Action Button background color, will when opting in on
ThemeData.useMaterail3
, use colortheme.colorScheme.primaryContainer
, otherwisetheme.colorScheme.secondary
is used. -
Input Decorator default change: The
TextField
and itsInputDecorator
border radius default value was changed from 20dp to 16 dp when using opinionated component themes. If opting in on Material 3, the default value for M3 design is used, which is only 4 dp. See specification https://m3.material.io/components/text-fields/specs. Flutter 3.0.x does not yet implement the new M3 TextField style, but via this change when opting in on M3, FlexColorScheme offers an early approximation of it. -
NavigationBar M3 defaults change: Default colors of
NavigationBar
when opting in onuseMaterial3
and not using opinionated component themes will now match M3 default colors. The background color will follow M3 style also by default when component themes are enabled anduseMaterial3
is true. This style is difficult to replicate with a single color otherwise. The difference is subtle for FCS surface tinted background colors. You can still set it tobackground
color to replicate past FCS default color when sub-themes were enabled. For other properties, if opinionated component themes are not used, FCS will use default M3 theme styles onNavigationBar
whenuseMaterial3
is true. If opting in on opinionated component themes, FCS uses its own custom opinionated default style. Which can be modified to be the same as default M3 style too, just as before. The change also includes a default font size change for FCS opinionated styled navigation bar, from 11dp to 12dp. This change was done to harmonize it with its M3 style. -
NavigationRail M3 defaults change: Default colors of
NavigationRail
when opting in onuseMaterial3
and not using opinionated component themes will now match M3 default colors. If opinionated component themes are not used, FCS will use default M3 theme styles onNavigationRail
whenuseMaterial3
is true. If opting in on opinionated component themes, FCS uses its own custom opinionated default style. Which can be modified to be the same as default M3 style too, just as before. The change also includes a default font size change for FCS opinionated styled rail, from 14dp to 12dp. This change was done to harmonize it with its M3 style. -
Toggleable M3 style change: Default color of toggles (Switch, CheckBox and Radio) are now using
primary
color as default themed color when opting in on opinionated component themes or settingThemeData.useMaterail3
to true. The Switch, CheckBox and Radio themes then use a style that match the M3 color design intent. In it, switches and toggles are mostly primary color based. In M3 color design, the secondary color is a poor choice for switches and toggles, and it is therefore not used as their default color. It does not look nice with M3 based ColorSchemes, created e.g. using M3 color seeding. If you use a custom M3 color design, where secondary color is still prominent, you can of course still use it. -
Fixed lint: "Avoid using private types in public APIs". See tweet discussion about why and when you might run into this lint being triggered by older Stateful Widgets. The lint warning was addressed in the package and examples.
EXAMPLE UPDATES
-
Added a Theme Extensions example to the default example app, i.e. the "Hot Reload Playground".
-
Themes Playground: Updated the default style info labels for Switch, CheckBox and Radio.
-
Themes Playground: To the top row theme selector, where the FlexColorScheme and component themes switches are, added the "Use Material 3" toggle. Previously this toggle was only available on the introduction panel. The availability in the header makes it easy to toggle it ON and OFF at any time, to see what impact it has on widgets.
-
Themes Playground: Updated the default style info labels for the NavigationBar. The logic to display default color labels in different config modes (M2/M3/FCS/FCS+M2/FCS+M3) is quite involved, please report any issues.
-
Themes Playground: Updated the default style info labels for the NavigationRail. The logic to display default color labels in different config modes (M2/M3/FCS/FCS+M2/FCS+M3) is quite involved, please report any issues.
-
Themes Playground: Due to issue #107190, the Playground previous default to use Material 3 was changed to false.
-
Added support in Themes Playground to customize the
surfaceTint
color. It controls both the elevation color used for elevatedMaterial
surfaces in M3. Plus for FlexColorScheme it is also used as the surface blend color. By default, thesurfaceTint
color equalsColorScheme.primary
color. Generally there are not many good design reasons to change the color, but it is now possible to do so. A good graphical designer can use it to create subtle difference from the standard surface elevation color branding effects. Used poorly, it mostly creates not so appealing visual and coloring results.
KNOWN FLUTTER SDK ISSUES
The issues below in the Flutter SDK itself, are known to impact FlexColorScheme and Flutter theming in general.
-
Switching Typography dynamically in Flutter SDK ThemeData is broken, see issue #103864 for more information. If it is done and the error ignored, an app doing so eventually become unstable.
-
The Themes Playground app contains a workaround to avoid issue #103864. The workaround is done by always using 2021 Typography, but simulating 2018 Typography. This is done by using a custom TextTheme that looks like 2018 Typography is used when using M2 theme mode. The Playground App actually always stays in 2021 Typography, but looks
like it switches it. Which it does by applying a customTextTheme
in 2021 Typography, that looks like 2018 Typography is used. All other examples also avoid the issue by only using the M3 2021 Typography and not even mimicking a switch between M2 and M3 Typography. The above workaround is needed because the Playground app has toggles that switches Typography frequently, without the workaround it will eventually crash. With this workaround it never switches Typography, it just looks like it does, but app stays in 2021 Typography all the time. The by Themes Playground generated ThemeData config will use the actual real effective Typography. This is also fine, since an app using the theme will likely never switch used Typography. However, if it does, it will face the same issue the Playground app did. The issue is a Flutter SDK issue that FlexColorScheme cannot fix. Most likely 99% of apps will never run into this issue. -
In Flutter SDK 3.0.x, when opting in on
useMaterial3:true
, theMaterial
widget and other SDK widgets built on it, gets no elevation when only theelevation
property is defined. It is required to also ...