Skip to content

Conversation

@darrenaustin
Copy link
Contributor

As part of the migration to Material 3, this PR adds a new useMaterial3 flag to ThemeData that will allow applications to opt-in to Material 3 changes that are coming to many of the components across the library.

Currently there are no components that this affects, but as we migrate each component to M3, they will use this flag to determine which defaults they should use, and this flags doc will be updated.

Pre-launch Checklist

  • I read the [Contributor Guide] and followed the process outlined there for submitting PRs.
  • I read the [Tree Hygiene] wiki page, which explains my responsibilities.
  • I read and followed the [Flutter Style Guide], including [Features we expect every widget to implement].
  • I signed the [CLA].
  • I listed at least one issue that this PR fixes in the description above.
  • I updated/added relevant documentation (doc comments with ///).
  • I added new tests to check the change I am making, or this PR is [test-exempt].
  • All existing and new tests are passing.

@flutter-dashboard flutter-dashboard bot added f: material design flutter/packages/flutter/material repository. framework flutter/packages/flutter repository. See also f: labels. labels Nov 10, 2021
@google-cla google-cla bot added the cla: yes label Nov 10, 2021
@MarcusWichelmann
Copy link

Wouldn't an enum be better suited once Material 4 might become a thing in the future? Otherwise we would have two flags useMaterial3 and useMaterial4 then and it will be unclear what the combination of both being true does.

@darrenaustin
Copy link
Contributor Author

Wouldn't an enum be better suited once Material 4 might become a thing in the future? Otherwise we would have two flags useMaterial3 and useMaterial4 then and it will be unclear what the combination of both being true does.

An enum would be better if we planned on keeping this around. However, the currently proposed plan is that useMaterial3 is a temporary flag that will be removed after everything is migrated to M3. This will hopefully take place well before an M4 so there shouldn't be any overlap.

Copy link
Contributor

@HansMuller HansMuller left a comment

Choose a reason for hiding this comment

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

LGTM

@fluttergithubbot fluttergithubbot merged commit 7d09817 into flutter:master Nov 19, 2021
@darrenaustin darrenaustin deleted the themedata_m3 branch November 19, 2021 19:21
@guidezpl guidezpl changed the title Added useMaterial3 flag to ThemeData. Introduce useMaterial3 flag for ThemeData to allow for opt-in Mar 30, 2022
@guidezpl guidezpl changed the title Introduce useMaterial3 flag for ThemeData to allow for opt-in Introduce useMaterial3 flag for ThemeData to allow for opt-in Mar 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

f: material design flutter/packages/flutter/material repository. framework flutter/packages/flutter repository. See also f: labels.

Projects

No open projects
Status: Done

Development

Successfully merging this pull request may close these issues.

5 participants