Skip to content

☂️ Make useMaterial3: true by default #127064

@HansMuller

Description

@HansMuller

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.

Metadata

Metadata

Assignees

Labels

c: proposalA detailed proposal for a change to Flutterf: material designflutter/packages/flutter/material repository.frameworkflutter/packages/flutter repository. See also f: labels.r: fixedIssue is closed as already fixed in a newer versionteam-designOwned by Design Languages teamtriaged-designTriaged by Design Languages team

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions