Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

☂️ Make useMaterial3: true by default #127064

Closed
25 tasks done
Tracked by #91605
HansMuller opened this issue May 17, 2023 · 10 comments
Closed
25 tasks done
Tracked by #91605

☂️ Make useMaterial3: true by default #127064

HansMuller opened this issue May 17, 2023 · 10 comments
Assignees
Labels
c: proposal A detailed proposal for a change to Flutter f: material design flutter/packages/flutter/material repository. framework flutter/packages/flutter repository. See also f: labels. r: fixed Issue is closed as already fixed in a newer version team-design Owned by Design Languages team triaged-design Triaged by Design Languages team

Comments

@HansMuller
Copy link
Contributor

HansMuller commented May 17, 2023

Making Material 3 the default is the last big step in our long (long) transition from Material 2 to Material 3. Currently apps must opt-in to Material 3 with the useMaterial3 flag that appears in all of the ThemeData factory constructors.

  return MaterialApp(
    theme: ThemeData(useMaterial3: true),
    // ...
  );

Once this issue has been resolved, useMaterial3: true will be the default. It will still be possible to configure applications for Material 2 by specifying useMaterial3: false.

Once this change has landed in a stable release, the useMaterial3 flag will be deprecated and eventually removed per Flutter's deprecation policy.

#129724 Exists to ensure that the the Flutter repo doesn't regress. There's a similar CL for Google internal tests: cl/543770414.

Step 1 - All tests pass when useMaterial3 is true by default

Tests that do not pass when useMaterial is temporarily set to true by default in theme_data.dart (roughly line #442) will either be split into a pair of tests, one that specifies M3 and one that specifies M2, or a single provisional test that specifies M2. For the latter, the test should be added to Step 3 below.

Step 2 - ThemeData useMaterial3 is true by default

Step 3 - Add M2 and M3-specific tests

-- The remaining work for Step 3 has been moved to #139076 --

Tests that were modified with useMaterial3: false will likely need an M3 version. Examples that were modified with useMaterial3: false should be updated (along with their tests) to M3.

A list of all the test files that are likely to need to be updated can be found in the M2-M3 Updates TODO spreadsheet.

@danagbemava-nc danagbemava-nc added in triage Presently being triaged by the triage team framework flutter/packages/flutter repository. See also f: labels. f: material design flutter/packages/flutter/material repository. c: proposal A detailed proposal for a change to Flutter and removed in triage Presently being triaged by the triage team labels May 18, 2023
@HansMuller HansMuller changed the title Make useMaterial3: true by default ☂️ Make useMaterial3: true by default Jun 12, 2023
auto-submit bot pushed a commit to flutter/cocoon that referenced this issue Jun 13, 2023
Prepare for the change to the default value of `ThemeData.useMaterial3` coming in flutter/flutter#127064. Currently the dashboard's tests depend on the UI being configured for Material2. While we're undergoing this transition, changed the dashboard's MaterialApp and its tests to specify `useMaterial3: false`.
auto-submit bot pushed a commit that referenced this issue Jun 13, 2023
Updates most of the unit tests in the packages/flutter/test/material folder so that they'll pass if ThemeData.useMaterial3 defaults to true.

All of the tests have wired useMaterial3 to false and will need to be updated with a M3 version.

related to #127064
auto-submit bot pushed a commit that referenced this issue Jun 26, 2023
Updated the chip tests per the changes from #128584 so that Chip tests that depend on Material2 will continue to pass when Material3 becomes the default. 

Part of: #127064
auto-submit bot pushed a commit to flutter/packages that referenced this issue Jun 27, 2023
The appearance of the golden image created by the  rfw `'Material widgets'` test depends on the Material2 theme, which is currently the default theme. Updated the test to ensure that the test continues to succeed when the default theme is changed to Material3.

See flutter/flutter#127064
fluttermirroringbot pushed a commit that referenced this issue Jun 28, 2023
Updated tests in dev, examples/api, and tests/widgets to ensure that
they continue to pass when the default for `ThemeData.useMaterial3` is
changed to true.

This is the final set of changes required for
#127064.
auto-submit bot pushed a commit that referenced this issue Jun 30, 2023
Updated and reorganized unit tests for `SwitchListTile` to have M2 and M3 versions.

More info in #127064
Mairramer pushed a commit to Mairramer/flutter that referenced this issue Oct 10, 2023
Updated unit tests for `Drawer` to have M2 and M3 versions.

More info in flutter#127064
Mairramer pushed a commit to Mairramer/flutter that referenced this issue Oct 10, 2023
Separates the tests for the Material dialog into Material3 and Material2 versions.

More info in flutter#127064
Mairramer pushed a commit to Mairramer/flutter that referenced this issue Oct 10, 2023
…flutter#136071)

This PR updates unit tests from bottom sheet tests for M3 migration.

More info in flutter#127064

It also contains in bottom_sheet.dart where a default value took precedence over a theme attribute.
Mairramer pushed a commit to Mairramer/flutter that referenced this issue Oct 10, 2023
)

Updated unit tests for `CircleAvatar` & `DataTable` to have M2 and M3 versions.

More info in flutter#127064
auto-submit bot pushed a commit that referenced this issue Oct 10, 2023
Seperates tests for the localizations package into Material2 and Material3 versions and removes dependency on theme.

More info in #127064
auto-submit bot pushed a commit that referenced this issue Oct 25, 2023
Updated unit tests for `CircleOutlinedButton` to have M2 and M3 versions.

More info in #127064

This also gets rid of unnecessary `fromSwatch` usage (part of #132584 documentation and test cleanup)
TahaTesser added a commit to TahaTesser/flutter that referenced this issue Oct 25, 2023
Updated unit tests for `CircleOutlinedButton` to have M2 and M3 versions.

More info in flutter#127064

This also gets rid of unnecessary `fromSwatch` usage (part of flutter#132584 documentation and test cleanup)
auto-submit bot pushed a commit that referenced this issue Oct 27, 2023
)

This relands #136809 (it was reverted in #137242)
---

Updated unit tests for `CircleOutlinedButton` to have M2 and M3 versions.

More info in #127064

This also gets rid of unnecessary `fromSwatch` usage (part of #132584 documentation and test cleanup)
@FMorschel
Copy link

Has this been done? I see that all 25 issues are complete

@HansMuller
Copy link
Contributor Author

@FMorschel - good question. It essentially has been done however we're still updating some tests per "Step 3" in the description.

@FMorschel
Copy link

I see! Thank you for answering!

@parlough
Copy link
Member

parlough commented Nov 4, 2023

@HansMuller Thanks for your work on this!

Would you or someone on your team be able to create a doc to add to https://docs.flutter.dev/release/breaking-changes for this change: flutter/website#9788

fluttermirroringbot pushed a commit that referenced this issue Nov 6, 2023
This PR updates `BottomNavigationBar` unit tests for M3 migration.

More info in #127064

It was somewhat complex because existing tests relied on a lot of magic numbers.
auto-submit bot added a commit that referenced this issue Nov 6, 2023
Reverts #136624
Initiated by: HansMuller
This change reverts the following previous change:
Original Description:
This PR updates `BottomNavigationBar` unit tests for M3 migration.

More info in #127064

It was somewhat complex because existing tests relied on a lot of magic numbers.
@rydmike
Copy link
Contributor

rydmike commented Nov 24, 2023

@HansMuller, as this landed in 3.16, why is it still open?

@HansMuller
Copy link
Contributor Author

I will close it as soon as we've created a separate issue for the tests that remain to be written per M2-M3 Updates TODO spreadsheet. Should be very soon.

@HansMuller
Copy link
Contributor Author

The remaining test updating work has been moved to #139076

@danagbemava-nc danagbemava-nc added the r: fixed Issue is closed as already fixed in a newer version label Nov 28, 2023
Copy link

This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 12, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
c: proposal A detailed proposal for a change to Flutter f: material design flutter/packages/flutter/material repository. framework flutter/packages/flutter repository. See also f: labels. r: fixed Issue is closed as already fixed in a newer version team-design Owned by Design Languages team triaged-design Triaged by Design Languages team
Projects
No open projects
Status: Done
Development

No branches or pull requests

6 participants