Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/content/release/breaking-changes/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ release, and listed in alphabetical order:

* [`ImageFilter.blur` default tile mode automatic selection][]
* [Localized messages are generated into source, not a synthetic package][]
* [Material 3 Tokens Update in Flutter][]
* [`.flutter-plugins-dependencies` replaces `.flutter-plugins`][] <!-- Branch cut starts here, below will be in next stable -->
* [`Color` wide gamut support][]
* [Remove invalid parameters for `InputDecoration.collapsed`][]
Expand All @@ -47,6 +48,7 @@ release, and listed in alphabetical order:

[`ImageFilter.blur` default tile mode automatic selection]: /release/breaking-changes/image-filter-blur-tilemode
[Localized messages are generated into source, not a synthetic package]: /release/breaking-changes/flutter-generate-i10n-source
[Material 3 Tokens Update in Flutter]: /release/breaking-changes/material-design-3-token-update
[`.flutter-plugins-dependencies` replaces `.flutter-plugins`]: /release/breaking-changes/flutter-plugins-configuration
[`Color` wide gamut support]: /release/breaking-changes/wide-gamut-framework
[Remove invalid parameters for `InputDecoration.collapsed`]: /release/breaking-changes/input-decoration-collapsed
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
---
title: Material 3 Tokens Update in Flutter
description: >-
The latest Material Design 3 tokens(v6.1) have been applied to the Flutter
Material library.
---

## Summary

The Material Design tokens updated the mapping of 4 color roles (only in Light
mode) to be more visually appealing while retaining accessible contrast. There
are not any breakages identified in Flutter testing of this change, which
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
mode) to be more visually appealing while retaining accessible contrast. There
are not any breakages identified in Flutter testing of this change, which
mode) to be more visually appealing while retaining accessible contrast.
Testing identified this change as non-breaking in Flutter, but some customers
may notice this small change.

Maybe we should also have non-breaking link to the breaking changes policy?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, replace "may" with might in line 13.

applied to the following color properties:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
applied to the following color properties:
The update affected the following color properties:


* On-primary-container (Primary10 to Primary30)
* On-secondary-container (Secondary10 to Secondary30)
* On-tertiary-container (Tertiary10 to Tertiary30)
* On-error-container (Error10 to Error30)

Widgets that have been using these roles with their default value might look
different.

Additionally, the Material 3 tokens also updated the border color of Chips from
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Additionally, the Material 3 tokens also updated the border color of Chips from
Additionally, the Material 3 tokens updated the border color of Chips from

Additionally + also can be redundant, I do this all the time myself 😅

`ColorScheme.outline` to `ColorScheme.outlineVariant` to improve visual
hierarchy between chips and buttons. Chips (`Chip`, `ActionChip`, `ChoiceChip`,
`FilterChip`, and `InputChip`) that have been using the chip border tokens may
look different.

## Migration guide

The differences in the mappings of the color roles are small. Using
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
The differences in the mappings of the color roles are small. Using
The differences in the mappings of the color roles are small. Use

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks so much for all the suggestions!

`ColorScheme.copyWith` to revert to the original default colors:

Code before migration:

```dart
final ColorScheme colors = ThemeData().colorScheme;
```

Code after migration:

```dart
final ColorScheme colors = ThemeData().colorScheme.copyWith(
onPrimaryContainer: const Color(0xFF21005D),
onSecondaryContainer: const Color(0xFF1D192B),
onTertiaryContainer: const Color(0xFF31111D),
onErrorContainer: const Color(0xFF410E0B),
);
```

After applying the token update, the default border color of M3 chips looks
lighter. Take `ActionChip` as an example:

Code before migration:

```dart
final Widget chip = ActionChip(
label: const Text('action chip'),
onPressed: () {},
);
```

Code after migration:

```dart
final Widget chip = ChipTheme(
data: ChipThemeData(
side: BorderSide(
color: Theme.of(context).colorScheme.outline
),
),
child: ActionChip(
label: const Text('action chip'),
onPressed: () {}
)
);
```

## Timeline

Landed in version: 3.26.0-0.0.pre<br>
In stable release: not yet

## References
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might be good to include some API references like in other migration guides. ColorScheme, Theme, and Chip classes look relevant to include here.


Relevant PRs:

* [Update tokens to v5.0.0][]
* [Update tokens to v6.1.0][]

[Update tokens to v5.0.0]: {{site.repo.flutter}}/pull/[153385]
[Update tokens to v6.1.0]: {{site.repo.flutter}}/pull/[153722]
Loading