Skip to content

Documentation error concerning new ColorScheme roles for Material 3 #148359

@rydmike

Description

@rydmike

Steps to reproduce

Compare this documentation page for Flutter 3.22.0 stable release:

https://docs.flutter.dev/release/breaking-changes/new-color-scheme-roles

To the code included in the 3.22 stable release:

final SchemeTonalSpot scheme;
switch (brightness) {
case Brightness.light:
scheme = SchemeTonalSpot(sourceColorHct: Hct.fromInt(seedColor.value), isDark: false, contrastLevel: 0.0);
case Brightness.dark:
scheme = SchemeTonalSpot(sourceColorHct: Hct.fromInt(seedColor.value), isDark: true, contrastLevel: 0.0);
}

Expected results

Expect the mentioned schemeVariant to be available in Flutter 3.22.0 as documented.

Actual results

The advertised schemeVariant is not available in the Flutter 3.22.0 release and should be removed from the 3.22 documentation.

It can however be found in master channel here

And here:

static DynamicScheme _buildDynamicScheme(Brightness brightness, Color seedColor, DynamicSchemeVariant schemeVariant) {
final bool isDark = brightness == Brightness.dark;
final Hct sourceColor = Hct.fromInt(seedColor.value);
return switch (schemeVariant) {
DynamicSchemeVariant.tonalSpot => SchemeTonalSpot(sourceColorHct: sourceColor, isDark: isDark, contrastLevel: 0.0),
DynamicSchemeVariant.fidelity => SchemeFidelity(sourceColorHct: sourceColor, isDark: isDark, contrastLevel: 0.0),
DynamicSchemeVariant.content => SchemeContent(sourceColorHct: sourceColor, isDark: isDark, contrastLevel: 0.0),
DynamicSchemeVariant.monochrome => SchemeMonochrome(sourceColorHct: sourceColor, isDark: isDark, contrastLevel: 0.0),
DynamicSchemeVariant.neutral => SchemeNeutral(sourceColorHct: sourceColor, isDark: isDark, contrastLevel: 0.0),
DynamicSchemeVariant.vibrant => SchemeVibrant(sourceColorHct: sourceColor, isDark: isDark, contrastLevel: 0.0),
DynamicSchemeVariant.expressive => SchemeExpressive(sourceColorHct: sourceColor, isDark: isDark, contrastLevel: 0.0),
DynamicSchemeVariant.rainbow => SchemeRainbow(sourceColorHct: sourceColor, isDark: isDark, contrastLevel: 0.0),
DynamicSchemeVariant.fruitSalad => SchemeFruitSalad(sourceColorHct: sourceColor, isDark: isDark, contrastLevel: 0.0),
};

Where the feature exists, but the property name is dynamicSchemeVariant, like the enum DynamicSchemeVariant it is based on.

The documentation https://docs.flutter.dev/release/breaking-changes/new-color-scheme-roles also fails to mention the 12 new ColorScheme colors that did land:

  • primaryFixed
  • primaryFixedDim
  • onPrimaryFixed
  • onPrimaryFixedVariant
  • secondaryFixed
  • secondaryFixedDim
  • onSecondaryFixed
  • onSecondaryFixedVariant
  • tertiaryFixed
  • tertiaryFixedDim
  • onTertiaryFixed
  • onTertiaryFixedVariant

This would have been a nice place to mention them too and maybe link to further documentation about their usage, if nothing else to the Material-3 guide that explains them.

Code sample

Code references provided via GitHub and doc links.

Screenshots or Video

What the docs says:

Screenshot 2024-05-15 at 13 03 05

Logs

No response

Flutter Doctor output

Doctor output
flutter doctor -v
[✓] Flutter (Channel stable, 3.22.0, on macOS 14.3 23D56 darwin-arm64, locale en-US)
    • Flutter version 3.22.0 on channel stable at /Users/rydmike/fvm/versions/stable
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 5dcb86f68f (6 days ago), 2024-05-09 07:39:20 -0500
    • Engine revision f6344b75dc
    • Dart version 3.4.0
    • DevTools version 2.34.3

[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
    • Android SDK at /Users/rydmike/Library/Android/sdk
    • Platform android-34, build-tools 34.0.0
    • Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 17.0.9+0-17.0.9b1087.7-11185874)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 15.4)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Build 15F31d
    • CocoaPods version 1.13.0

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2023.2)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 17.0.9+0-17.0.9b1087.7-11185874)

[✓] IntelliJ IDEA Community Edition (version 2024.1.1)
    • IntelliJ at /Applications/IntelliJ IDEA CE.app
    • Flutter plugin version 79.0.3
    • Dart plugin version 241.15989.9

[✓] VS Code (version 1.87.2)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.84.0

[✓] Network resources
    • All expected network resources are available.

Metadata

Metadata

Assignees

Labels

P2Important issues not at the top of the work listd: api docsIssues with https://api.flutter.dev/f: material designflutter/packages/flutter/material repository.frameworkflutter/packages/flutter repository. See also f: labels.team-designOwned by Design Languages teamtriaged-designTriaged by Design Languages team

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions