Skip to content

Material 3 FloatingActionButton background/foreground docs are inconsistent #147368

@ishaanbahal

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!

Metadata

Metadata

Assignees

Labels

d: api docsIssues with https://api.flutter.dev/f: material designflutter/packages/flutter/material repository.frameworkflutter/packages/flutter repository. See also f: labels.r: 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