Skip to content

mistake in api docs #191556

Closed
flutter/packages
#12620

Description

@mohamed-tamerrr

defaultStyleOf doc comment on FilledButton shows backgroundColor: secondaryContainer, but the actual _FilledButtonDefaultsM3 implementation uses colorScheme.primary the doc comment appears to describe the tonal variant instead

Link the exact file: packages/flutter/lib/src/material/filled_button.dart

  @override
  WidgetStateProperty<Color?>? get backgroundColor =>
    WidgetStateProperty.resolveWith((Set<WidgetState> states) {
      if (states.contains(WidgetState.disabled)) {
        return _colors.onSurface.withOpacity(0.12);
      }
      return _colors.primary;     <====
    });

the docs :
https://api.flutter.dev/flutter/material/FilledButton/defaultStyleOf.html

Material 3 defaults

backgroundColor
disabled - Theme.colorScheme.onSurface(0.12)
others - Theme.colorScheme.secondaryContainer <====

just a mistake in docs

Activity

  1. suryaKommana2662 commented on Aug 24, 2026

    @suryaKommana2662
    Contributor

    @mohamed-tamerrr Thanks for the report. This appears to be a discrepancy between the FilledButton.defaultStyleOf API documentation and the current Material 3 implementation. Routing this to team-design for further investigatioin.

  2. added
    p: material_uimaterial_ui package in flutter/packages
    d: api docsIssues with https://api.flutter.dev/
    packageflutter/packages repository. See also p: labels.
    team-designOwned by Design Languages team
    and removed
    in triagePresently being triaged by the triage team
    on Aug 24, 2026
  3. piedcipher commented on Aug 24, 2026

    @piedcipher
    Member

    Same issue for foregroundColor as well

    Image

    WidgetStateProperty<Color?>? get foregroundColor =>

  4. added
    P2Important issues not at the top of the work list
    triaged-designTriaged by Design Languages team
    on Aug 25, 2026
  5. added a commit that references this issue on Sep 8, 2026
    2af77ad
  6. added 2 commits that reference this issue on Sep 9, 2026
    bc58b87
    243ff20
  7. github-actions commented on Sep 22, 2026

    @github-actions

    This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

  8. locked as resolved and limited conversation to collaborators on Sep 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

P2Important issues not at the top of the work listd: api docsIssues with https://api.flutter.dev/p: material_uimaterial_ui package in flutter/packagespackageflutter/packages repository. See also p: labels.team-designOwned by Design Languages teamtriaged-designTriaged by Design Languages team

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions