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
Comments
useMaterial3: true
by defaultuseMaterial3: true
by default
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`.
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
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
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.
Updated and reorganized unit tests for `SwitchListTile` to have M2 and M3 versions. More info in #127064
Updated unit tests for `Drawer` to have M2 and M3 versions. More info in flutter#127064
Separates the tests for the Material dialog into Material3 and Material2 versions. More info in flutter#127064
…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.
) Updated unit tests for `CircleAvatar` & `DataTable` to have M2 and M3 versions. More info in flutter#127064
Seperates tests for the localizations package into Material2 and Material3 versions and removes dependency on theme. More info in #127064
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)
Has this been done? I see that all 25 issues are complete |
@FMorschel - good question. It essentially has been done however we're still updating some tests per "Step 3" in the description. |
I see! Thank you for answering! |
@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 |
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.
@HansMuller, as this landed in 3.16, why is it still open? |
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. |
The remaining test updating work has been moved to #139076 |
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 |
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.Once this issue has been resolved,
useMaterial3: true
will be the default. It will still be possible to configure applications for Material 2 by specifyinguseMaterial3: 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 defaultTests 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 defaultThemeData.useMaterial3
to true #129724ThemeData.useMaterial3
API doc, default istrue
#130764Step 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 withuseMaterial3: 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.
The text was updated successfully, but these errors were encountered: