Skip to content

Material 3 FloatingActionButton background/foreground docs are inconsistent #147368

Closed

Description

@ishaanbahal

Steps to reproduce

The docs here state

If this property is null, then the
[FloatingActionButtonThemeData.backgroundColor] of
[ThemeData.floatingActionButtonTheme] is used. If that property is also
null, then the [Theme]'s [ColorScheme.secondary] color is used.

That is the case with M2 themes but with M3 Theme, it uses primaryContainer as can be seen in the code referenced.

It is just confusing figuring out why secondary is not what it should look like. Seems like a minor documentation fix, though even the website right now states the same, not sure where its code comes from.

Links referenced above:

Expected results

The expected color either should be secondary in M3 theme or docs should reflect it is primaryContainer

Actual results

In case of M3 theme, the color if not provided for property background turns out to be primaryContainer, not secondary as the documentation states.

Code sample

Not sure if this is required. The report itself should suffice

Screenshots or Video

No response

Logs

No response

Flutter Doctor output

Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.19.6, on macOS 14.4.1 23E224 darwin-arm64, locale en-IN)
[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
[✓] Xcode - develop for iOS and macOS (Xcode 15.3)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2023.1)
[✓] VS Code (version 1.88.1)
[✓] Connected device (4 available)
    ! Error: Browsing on the local area network for Ishaan’s iPad. Ensure the device is unlocked and attached with a cable or
      associated with the same local area network as this Mac.
      The device must be opted into Developer Mode to connect wirelessly. (code -27)
[✓] Network resources

• No issues found!

Activity

  1. added
    in triagePresently being triaged by the triage team
    frameworkflutter/packages/flutter repository. See also f: labels.
    p: material_uimaterial_ui package in flutter/packages
    d: api docsIssues with https://api.flutter.dev/
    team-designOwned by Design Languages team
    and removed
    in triagePresently being triaged by the triage team
    on Apr 25, 2024
  2. self-assigned this
    on Apr 25, 2024
  3. moved this from To do to In progress in Nevercodeon Apr 25, 2024
  4. changed the title [-]M3 FloatingActionButton default background color is primaryContainer, not secondary[/-] [+]Material 3 `FloatingActionButton` background/foreground docs are inconsistent[/+] on Apr 25, 2024
  5. moved this from In progress to No status in Nevercodeon Apr 25, 2024
  6. moved this to PR submitted in Nevercodeon Apr 25, 2024
  7. moved this from PR submitted to Done (PR merged) in Nevercodeon Apr 26, 2024
  8. github-actions commented on May 10, 2024

    @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.

  9. locked as resolved and limited conversation to collaborators on May 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

d: api docsIssues with https://api.flutter.dev/frameworkflutter/packages/flutter repository. See also f: labels.p: material_uimaterial_ui package in flutter/packagesr: fixedIssue is closed as already fixed in a newer versionteam-designOwned by Design Languages team

Type

No type

Projects

  • Status
    Done (PR merged)

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions