Skip to content

Option to disable CupertinoSegmentedControl #52105

@erf

Description

@erf

Use case

I was not able to disable the CupertinoSegmentedControl in a case where i did not want the user to edit some data.

I could perhaps use the AbsorbPointer widget, but i still would like the style to change when it's disabled and not only disable input.

Proposal

I would like to either have an enabled option on CupertinoSegmentedControl, which when false it can't be pressed and it will be displayed as disabled, e.g. "grayed out".

Another option would perhaps to have it disabled when onValueChanged is null.

Metadata

Metadata

Assignees

No one assigned

    Labels

    c: 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

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions