flutter / flutter

Flutter makes it easy and fast to build beautiful apps for mobile and beyond
https://flutter.dev
BSD 3-Clause "New" or "Revised" License
162.27k stars 26.66k forks source link

implement the prominent style for labelLarge and labelMedium in the TextTheme - Material Design 3 #147775

Open alessandrovolpi-puntozero opened 2 weeks ago

alessandrovolpi-puntozero commented 2 weeks ago

Use case

As described in the documentation, in Material Design 3 there are three Label styles:

For the Large and the Medium, Material Design provides two different type of weightness: normal and prominent.

But in the text_theme.dart there are only labelLarge and labelMedium, without the prominent style.

Proposal

Implement the prominent style in the TextTheme for the labelLarge and labelMedium.

danagbemava-nc commented 2 weeks ago

Hi @alessandrovolpi-puntozero, it seems like on the material site, the weight for prominent is 700, does using fontWeight: FontWeight.w700 not suite your use-case?

alessandrovolpi-puntozero commented 2 weeks ago

Yes, but I think it’s better to have this style directly in the TextTheme instead of manual coding every times.

For example, when I customize the textTheme I write:

textTheme = TextTheme(
  labelLarge: const TextStyle(fontSize: 16.0, fontWeight: FontWeight.w400),
  labelSmall: const TextStyle(fontSize: 12.0, fontWeight: FontWeight.w400)
);

My proposal is something like this:

textTheme = TextTheme(
  labelLarge: const TextStyle(fontSize: 16.0, fontWeight: FontWeight.w400),
  labelLargeProminent: const TextStyle(fontSize: 16.0, fontWeight: FontWeight.w700),
  labelSmall: const TextStyle(fontSize: 12.0, fontWeight: FontWeight.w400)
);

In this way when I want to use this style I can use textTheme.labelLargeProminent