Skip to content

Commit 2af77ad

Browse files
[material_ui] Fix FilledButton Material 3 default style docs (flutter#12620)
Fixes flutter#191556 This is the port of flutter#191721 following the Material/Cupertino decoupling. ## Description The Material 3 defaults documented in `FilledButton.defaultStyleOf` did not match the values used by `_FilledButtonDefaultsM3`. The documentation described the tonal variant colors (`secondaryContainer` / `onSecondaryContainer`) and corresponding overlay colors, while the implementation uses `primary` / `onPrimary`. This updates the Material 3 defaults documentation to match the existing implementation. ## Tests - Ran `dart format packages/material_ui/lib/src/filled_button.dart`. - No tests added as this is a documentation-only change. Original Flutter PR: flutter#191721 ## 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.
1 parent d41e30a commit 2af77ad

2 files changed

Lines changed: 15 additions & 4 deletions

File tree

‎packages/material_ui/lib/src/filled_button.dart‎

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -400,13 +400,21 @@ class FilledButton extends ButtonStyleButton {
400400
/// * `textStyle` - Theme.textTheme.labelLarge
401401
/// * `backgroundColor`
402402
/// * disabled - Theme.colorScheme.onSurface(0.12)
403-
/// * others - Theme.colorScheme.secondaryContainer
403+
/// * others
404+
/// - Theme.colorScheme.primary in `FilledButton`
405+
/// - Theme.colorScheme.secondaryContainer in `FilledButton.tonal`
404406
/// * `foregroundColor`
405407
/// * disabled - Theme.colorScheme.onSurface(0.38)
406-
/// * others - Theme.colorScheme.onSecondaryContainer
408+
/// * others
409+
/// - Theme.colorScheme.onPrimary in `FilledButton`
410+
/// - Theme.colorScheme.onSecondaryContainer in `FilledButton.tonal`
407411
/// * `overlayColor`
408-
/// * hovered - Theme.colorScheme.onSecondaryContainer(0.08)
409-
/// * focused or pressed - Theme.colorScheme.onSecondaryContainer(0.1)
412+
/// * hovered
413+
/// - Theme.colorScheme.onPrimary(0.08) in `FilledButton`
414+
/// - Theme.colorScheme.onSecondaryContainer(0.08) in `FilledButton.tonal`
415+
/// * focused or pressed
416+
/// - Theme.colorScheme.onPrimary(0.1) in `FilledButton`
417+
/// - Theme.colorScheme.onSecondaryContainer(0.1) in `FilledButton.tonal`
410418
/// * `shadowColor` - Theme.colorScheme.shadow
411419
/// * `surfaceTintColor` - Colors.transparent
412420
/// * `elevation`
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
changelog: |
2+
- Corrects the Material 3 default style documentation for FilledButton to match its implementation.
3+
version: patch

0 commit comments

Comments
 (0)