Skip to content

CupertinoButton is missing minWidth and minHeight. #161294

@StanleyCocos

Description

@StanleyCocos

Use case

Most of the time, our buttons may need to be rectangular rather than perfectly square. Currently, CupertinoButton only has a minSize property. For users, it is unclear whether this refers to width or height. Moreover, it is impossible to set a minimum size with unequal width and height. The only option is to adjust the size of its child to achieve the desired dimensions.

Specifically:

child: ConstrainedBox(
constraints: BoxConstraints(
minWidth:
widget.minSize ??
kCupertinoButtonMinSize[widget.sizeStyle] ??
kMinInteractiveDimensionCupertino,
minHeight:
widget.minSize ??
kCupertinoButtonMinSize[widget.sizeStyle] ??
kMinInteractiveDimensionCupertino,
),

I think this place should use minWidth and minHeight.

Proposal

Add minWidth and minHeight to replace minSize.

Metadata

Metadata

Assignees

Labels

P2Important issues not at the top of the work listc: 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