Skip to content

Don't overwrite the icon theme in CupertinoButton #149172

@ricardoboss

Description

@ricardoboss

Use case

I have a widget that shows a row of buttons and I want to apply an IconTheme to them for setting their size.

Currently, I have to set the size for each icon within each button individually, because the CupertinoButton widget overwrites any IconTheme provided above it in the tree.

Proposal

I'd like to propose that the build method in _CupertinoButtonState uses IconTheme.of(context).copyWith(color: foregroundColor) to set the theme instead of just IconTheme(color: foregroundColor).

This way, it sets the correct color but also incorporates any parent styles.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Important issues not at the top of the work lista: fidelityMatching the OEM platforms betterc: new featureNothing broken; request for a new capabilityc: proposalA detailed proposal for a change to Flutterf: cupertinoflutter/packages/flutter/cupertino repositoryframeworkflutter/packages/flutter repository. See also f: labels.r: fixedIssue is closed as already fixed in a newer versionteam-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