Repository navigation
Additional color mappings for FAB in Material 3 #130702
Description
Activity
- changed the title
[-]Additional color mappings for FAB button in Material 3[/-][+]Additional color mappings for FAB in Material 3[/+]on Jul 17, 2023 - addedin triagePresently being triaged by the triage teamPresently being triaged by the triage teamc: new featureNothing broken; request for a new capabilityNothing broken; request for a new capabilityframeworkflutter/packages/flutter repository. See also f: labels.flutter/packages/flutter repository. See also f: labels.p: material_uimaterial_ui package in flutter/packagesmaterial_ui package in flutter/packagesc: proposalA detailed proposal for a change to FlutterA detailed proposal for a change to Flutterteam-designOwned by Design Languages teamOwned by Design Languages teamand removedin triagePresently being triaged by the triage teamPresently being triaged by the triage team
on Jul 17, 2023 While it is certainly in the M3 spec, I am not sure having variant
FloatingActionButtonconstructors 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()andFloatingActionButton.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
FloatingActionButtonsize 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.
@rydmike - agree that this is probably best served by an example. Any interest in providing one?
I don't see the point in additional constructors FloatingActionButton.surface() FloatingActionButton.secondary() FloatingActionButton.tertiary() when you can change the background & foreground in style
Reacted by Max Yablochkin and Rydmike- addedP2Important issues not at the top of the work listImportant issues not at the top of the work listtriaged-designTriaged by Design Languages teamTriaged by Design Languages team
on Jul 27, 2023 4 remaining items
- moved this from PR submitted to Done (PR merged) in Nevercode
on Aug 29, 2023 - added a commit that references this issue
on Aug 29, 2023 - addedr: fixedIssue is closed as already fixed in a newer versionIssue is closed as already fixed in a newer version
on Aug 29, 2023 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 -vand a minimal reproduction of the issue.- locked as resolved and limited conversation to collaborators
on Sep 12, 2023
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsDone (PR merged)
- StatusShow more project fields✅ Done
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
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