useFlutterDefaults property

bool useFlutterDefaults
final

Set to true to use Flutter SDK default component theme designs.

Default to false.

Prefer false to use FlexColorScheme (FCS) defaults.

When set to true, many color properties that in FlexSubThemesData are nullable and default to 'null, but that as undefined default to using theming choices that differ from Flutter SDK default component theme designs, will when this property is set to true default to using Flutter SDK defaults, instead of its own opinionated defaults.

When you use this flag you loose many of the harmonizing defaults FlexColorScheme.subThemesData bring, but it may serve as an optional starting point for your own custom component themes with fewer copyWith overrides needed for its opinionated choices.

The individual FlexSubThemesData properties and FlexSubThemes document their adherence to this setting, they are also listed here:

Impact on BottomNavigationBarThemeData sub-theming:

                   FCS defaults   Flutter defaults
useFlutterDefaults false          true
- background       background     background
- selected icon    primary        light: theme primary, dark: secondary
- Selected label   primary        light: theme primary, dark: secondary
- unselected icon  onSurface      light: black54, dark: white70
- unSelected label onSurface      light: black54, dark: white70

FCS further applies both an alpha blend and slight opacity to unselected icon and unselected label, but only if bottomNavigationBarMutedUnselectedIcon and bottomNavigationBarMutedUnselectedLabel are true respectively, this also applies to undefined color inputs.

When muted unselected options are true, the actual difference to Flutter default for unselected items is subtle, FCS has a bit more contrast.

Impact on NavigationBarThemeData sub-theming:

                   FCS defaults   M2 defaults       useMaterial3:true
useFlutterDefaults false          true              true
results in:

- background       surfaceVariant surface with      surface with
                                  onSurface overlay primary overlay
                   elev 3         elev 0            elev 3
- height           80             80                80
- indicator        primary op24%  secondary op24%   secondaryContainer
- selected icon    primary        onSurface         onSecondaryContainer
- unselected icon  onSurface      onSurface         onSurfaceVariant
- Selected label   primary        onSurface         onSurface
- unSelected label onSurface      onSurface         onSurfaceVariant
- TextTheme        labelMedium    overline          labelMedium

FCS further applies both an alpha blend and slight opacity to unselected icon and unselected label, but only if navigationBarMutedUnselectedIcon and navigationBarMutedUnselectedLabel are true respectively, this also applies to undefined color inputs.

Impact on NavigationRailThemeData sub-theming:

                   FCS defaults    Flutter defaults
useFlutterDefaults false           true
- background       background      surface
- indicator        primary op24%   secondary op24%
- selected icon    primary         primary
- Selected label   primary         primary
- unselected icon  onSurface       onSurface op64%
- unSelected label onSurface       onSurface op64%
- TextTheme        FCS.labelMedium default.bodyText1

FCS further applies both an alpha blend and slight opacity to unselected icon and unselected label, but only if navigationRailMutedUnselectedIcon and are navigationRailMutedUnselectedLabel true respectively, this also applies to undefined color inputs.

If you want a style that is consistent by default across BottomNavigationBar, NavigationBar and NavigationRail, prefer keeping this setting false.

If undefined, defaults to false.

Implementation

final bool useFlutterDefaults;