-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Open
Labels
P3Issues that are less important to the Flutter projectIssues that are less important to the Flutter projectc: new featureNothing broken; request for a new capabilityNothing broken; request for a new capabilityc: proposalA detailed proposal for a change to FlutterA detailed proposal for a change to Flutterf: material designflutter/packages/flutter/material repository.flutter/packages/flutter/material repository.frameworkflutter/packages/flutter repository. See also f: labels.flutter/packages/flutter repository. See also f: labels.team-designOwned by Design Languages teamOwned by Design Languages teamtriaged-designTriaged by Design Languages teamTriaged by Design Languages team
Description
Setting useMaterial3 applies certain defaults when constructed from the factory constructor, but since many themes are constructed from a default and customized with copyWith, they won't have correct typography or ripple effects. The code snippet below illustrates the missing defaults:
Copying my initial comment from a PR:
I would expect
copyWithwithuseMaterial3true to apply these updates, if I haven't provided my owntypographyandsplashFactory, of course. If I understand correctly, we're currently requiring every created theme out there (that doesn't use the factory constructor) to add the following?
...
typography: Typography.material2021(platform: platform),
splashFactory: platform == TargetPlatform.android && !kIsWeb ? InkSparkle.splashFactory ? InkRipple.splashFactory,
)
It's not documented anywhere and is pretty brittle.
Originally posted by @guidezpl in #104815 (comment)
Metadata
Metadata
Assignees
Labels
P3Issues that are less important to the Flutter projectIssues that are less important to the Flutter projectc: new featureNothing broken; request for a new capabilityNothing broken; request for a new capabilityc: proposalA detailed proposal for a change to FlutterA detailed proposal for a change to Flutterf: material designflutter/packages/flutter/material repository.flutter/packages/flutter/material repository.frameworkflutter/packages/flutter repository. See also f: labels.flutter/packages/flutter repository. See also f: labels.team-designOwned by Design Languages teamOwned by Design Languages teamtriaged-designTriaged by Design Languages teamTriaged by Design Languages team