Skip to content

Additional color mappings for FAB in Material 3 #130702

Description

@gawi151

Is there an existing issue for this?

Use case

Material 3 FAB button spec states additional color mappings. https://m3.material.io/components/floating-action-button/specs#4a69fc37-5201-4ebe-9ce4-3b6273691dfb

Screenshot 2023-07-17 at 14 49 59

Proposal

It would be really nice if we had access to those additional mappings from the API. Currently, AFAIK, only primary FAB is mapped here https://github.com/flutter/flutter/blob/bfd92a86197a289fdccaad85c9179ea73f049734/dev/tools/gen_defaults/data/fab_primary.json

Activity

  1. changed the title [-]Additional color mappings for FAB button in Material 3[/-] [+]Additional color mappings for FAB in Material 3[/+] on Jul 17, 2023
  2. added
    in triagePresently being triaged by the triage team
    c: new featureNothing broken; request for a new capability
    frameworkflutter/packages/flutter repository. See also f: labels.
    p: material_uimaterial_ui package in flutter/packages
    c: proposalA detailed proposal for a change to Flutter
    team-designOwned by Design Languages team
    and removed
    in triagePresently being triaged by the triage team
    on Jul 17, 2023
  3. rydmike commented on Jul 17, 2023

    @rydmike
    Contributor

    While it is certainly in the M3 spec, I am not sure having variant FloatingActionButton constructors just for different color mappings is strictly necessary.

    Flutter already supports alternative color mapping on FAB Widget property level and global theme level, so the M3 design options can easily be made.

    That said I have nothing against having FloatingActionButton.surface(), FloatingActionButton.secondary() and FloatingActionButton.tertiary() available as named constructor options.

    They would then need to be either fixed color mapping wise to those colors (not affected by FAB Theme color properties and not have widget color properties) since their variant name already fully describes its colors or not be destroyed when using FAB theming, like variants are today.

    Currently, the already existing FloatingActionButton size variants are destroyed if you FAB theme their shape border radius or icons size. Since FAB theme only supports one variant, see #107946.

    Alternatively, this could also be a documentation topic, "How to make FABs using M3 guide variant color mappings" or something like that.

  4. HansMuller commented on Jul 19, 2023

    @HansMuller
    Contributor

    @rydmike - agree that this is probably best served by an example. Any interest in providing one?

  5. MaxYablochkin commented on Jul 27, 2023

    @MaxYablochkin

    I don't see the point in additional constructors FloatingActionButton.surface() FloatingActionButton.secondary() FloatingActionButton.tertiary() when you can change the background & foreground in style

  6. added
    P2Important issues not at the top of the work list
    triaged-designTriaged by Design Languages team
    on Jul 27, 2023
  7. 4 remaining items

  8. moved this from 🗺 Planned to 🚧 In Progress in Material 3on Aug 28, 2023
  9. moved this from To do to In progress in Nevercodeon Aug 28, 2023
  10. moved this from 🚧 In Progress to ✅ Done in Material 3on Aug 28, 2023
  11. moved this from ✅ Done to 🚧 In Progress in Material 3on Aug 28, 2023
  12. moved this from In progress to PR submitted in Nevercodeon Aug 28, 2023
  13. moved this from 🚧 In Progress to ✅ Done in Material 3on Aug 29, 2023
  14. moved this from PR submitted to Done (PR merged) in Nevercodeon Aug 29, 2023
  15. added
    r: fixedIssue is closed as already fixed in a newer version
    on Aug 29, 2023
  16. github-actions commented on Sep 12, 2023

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

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

Metadata

Metadata

Assignees

Labels

P2Important issues not at the top of the work listd: examplesSample code and demosframeworkflutter/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 teamtriaged-designTriaged 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