Repository navigation
[material_ui] Fix M3 doc errors in the ElevatedButton and FilledButton - #13685
QuncCccccc wants to merge 9 commits into
Conversation
| /// 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. | ||
| /// |
There was a problem hiding this comment.
These are incorrectly copy pasty from Elevated button, so I removed it.
There was a problem hiding this comment.
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.
| /// The [backgroundColor] and [disabledBackgroundColor] colors are | ||
| /// used to create a [WidgetStateProperty] [ButtonStyle.backgroundColor]. |
There was a problem hiding this comment.
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].
This PR fixes the parts of the
ElevatedButtonandFilledButtondocs that don't match the code. It doesn't change any behavior.FilledButton's docs listedElevatedButton's elevations,ElevatedButton.styleFromgave the wrong disabled elevation, and several docs saidElevatedButtonelevates when pressed, which isn't true in Material 3.ElevatedButton.icon.iconSizeandiconColor, and corrects the outdated Material 2 defaults of both buttons.ElevatedButton.styleFromstill 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
[shared_preferences]///).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-assistbot 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
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