Skip to content

[material_ui] Fix M3 doc errors in the ElevatedButton and FilledButton - #13685

Open
QuncCccccc wants to merge 9 commits into
flutter:mainfrom
QuncCccccc:filled_button_m3_elevation_docs
Open

QuncCccccc wants to merge 9 commits into
flutter:mainfrom
QuncCccccc:filled_button_m3_elevation_docs

Conversation

@QuncCccccc

@QuncCccccc QuncCccccc commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

This PR fixes the parts of the ElevatedButton and FilledButton docs that don't match the code. It doesn't change any behavior.

  • Elevation: FilledButton's docs listed ElevatedButton's elevations, ElevatedButton.styleFrom gave the wrong disabled elevation, and several docs said ElevatedButton elevates when pressed, which isn't true in Material 3.
  • Padding: fixes the font size thresholds (42, not 36) and the padding of ElevatedButton.icon.
  • Default style lists: adds the missing iconSize and iconColor, and corrects the outdated Material 2 defaults of both buttons.
  • Fixes a few smaller mistakes in the theme docs and the grammar.

ElevatedButton.styleFrom still uses Material 2 elevation offsets for hovered, focused, and pressed buttons. This PR only documents them, and I filed flutter/flutter#196845 for later fix.

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 17, 2026
Comment on lines -219 to -223
/// The button's elevations are defined relative to the [elevation]
/// parameter. The disabled elevation is the same as the parameter
/// value, [elevation] + 2 is used when the button is hovered
/// or focused, and elevation + 6 is used when the button is pressed.
///

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These are incorrectly copy pasty from Elevated button, so I removed it.

@QuncCccccc
QuncCccccc marked this pull request as ready for review November 18, 2026 02:29
@QuncCccccc
QuncCccccc requested a review from elliette November 18, 2026 02:30

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates the documentation for several button widgets, including ElevatedButton, FilledButton, and ButtonStyleButton, to correct descriptions of visual behaviors like elevation and shadows, update padding and default values, and fix minor typos. The feedback points out a missing preposition in the FilledButton documentation to improve grammatical correctness.

Comment on lines +209 to +210
/// The [backgroundColor] and [disabledBackgroundColor] colors are
/// used to create a [WidgetStateProperty] [ButtonStyle.backgroundColor].

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The sentence is missing a preposition (like "for" or "of") between [WidgetStateProperty] and [ButtonStyle.backgroundColor]. Adding "for" improves readability and grammatical correctness.

  /// The [backgroundColor] and [disabledBackgroundColor] colors are
  /// used to create a [WidgetStateProperty] for [ButtonStyle.backgroundColor].

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