You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 41990f9
Browse filesBrowse the repository at this point in the historyBrowse files
[material_ui] Add Material 3 Expressive ElevatedButton (flutter#13084)
Adds Material 3 Expressive support to `ElevatedButton`. As with `IconButton` (flutter#12832), apps opt in with `ElevatedButtonThemeData(variant: StyleVariant.material3Expressive)`. Without it, `ElevatedButton` keeps the Material 3 style.
With Material 3 Expressive, `ElevatedButton` supports:
* 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 a new `ButtonTemplateM3E` in `gen_defaults`.
New APIs:
* `ElevatedButtonThemeData.variant` and `ElevatedButtonTheme.variantOf`. A theme that doesn't specify `variant` inherits it from the enclosing themes, the same way as `IconButtonThemeData.variant` (flutter#13263).
* `ButtonStyleButton.isSelected` and `ElevatedButton.isSelected`.
* `sizeVariant` and `shapeVariant` parameters for `ElevatedButton.styleFrom`.
<img src="https://gist.githubusercontent.com/QuncCccccc/aba2243afce554b515eec724e62e5650/raw/44b10f43dfb6f42d2c0800928d993cec53df15c2/elevated_button_m3e.png" width="320" alt="Material 3 Expressive ElevatedButton sizes, shapes, toggle buttons, and disabled buttons">
Fixesflutter#194202
Part of flutter#184937
## Pre-Review Checklist
**Note**: The Flutter team is currently trialing the use of [Gemini Code Assist for GitHub](https://developers.google.com/gemini-code-assist/docs/review-github-code). 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.
[^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.
0 commit comments