Skip to content

[material_ui] Add Material 3 Expressive FilledButton and Filled tonal button (FilledButton.tonal) - #13702

Draft
QuncCccccc wants to merge 3 commits into
flutter:mainfrom
QuncCccccc:filled_button_m3e
Draft

QuncCccccc wants to merge 3 commits into
flutter:mainfrom
QuncCccccc:filled_button_m3e

Conversation

@QuncCccccc

Copy link
Copy Markdown
Contributor

Adds Material 3 Expressive support to FilledButton, including FilledButton.tonal. As with ElevatedButton (#13084), apps opt in with FilledButtonThemeData(variant: StyleVariant.material3Expressive). Without it, FilledButton keeps the Material 3 style.

With Material 3 Expressive, filled and filled tonal buttons support:

  • Sizes (ButtonStyle.sizeVariant): extra small through extra large. Each size has its own height, padding, icon size, label text style, and gap between the icon and the label.
  • Shapes (ButtonStyle.shapeVariant): round and square, including the pressed shape and the shape change when a toggle button is selected.
  • Toggle buttons: a button with a non-null isSelected is selectable, and uses the selected colors and selected semantics when isSelected is true.

The defaults are generated from the Material Design tokens by ButtonTemplateM3E, which #13684 updates to support all the common buttons.

New APIs:

  • FilledButtonThemeData.variant and FilledButtonTheme.variantOf. A theme that doesn't specify variant inherits it from the enclosing themes, the same way as ElevatedButtonThemeData.variant.
  • isSelected for all four FilledButton constructors.
  • sizeVariant and shapeVariant parameters for FilledButton.styleFrom.
FilledButton FilledButton.tonal
Material 3 Expressive FilledButton sizes, shapes, toggle buttons, and disabled buttons Material 3 Expressive FilledButton.tonal sizes, shapes, toggle buttons, and disabled buttons

This PR depends on #13684. The generated defaults in this PR come from the template changes in that PR, so until #13684 lands, running gen_defaults on this branch fails at ButtonTemplateM3E('Filled Button'), because the template on main only supports ElevatedButton. The code and tests in this PR don't depend on #13684. I'll rebase this PR once #13684 lands.

Part of flutter/flutter#184937

Pre-Review Checklist

If you need help, consider asking for advice on the #hackers-new channel on Discord.

Note: The Flutter team is currently trialing the use of Gemini Code Assist for GitHub. Comments from the gemini-code-assist bot should not be taken as authoritative feedback from the Flutter team. If you find its comments useful you can update your code accordingly, but if you are unsure or disagree with the feedback, please feel free to wait for a Flutter team member's review for guidance on which automated comments should be addressed.

Footnotes

  1. Regular contributors who have demonstrated familiarity with the repository guidelines only need to comment if the PR is not auto-exempted by repo tooling. ↩ ↩2

@github-actions github-actions Bot added p: material_ui triage-design Should be looked at in design triage labels Nov 18, 2026
@QuncCccccc QuncCccccc changed the title [material_ui] Add Material 3 Expressive FilledButton [material_ui] Add Material 3 Expressive FilledButton and Filled tonal button (FilledButton.tonal) Nov 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

p: material_ui triage-design Should be looked at in design triage

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant