Skip to content

Deprecate BoxDecoration.shape #108051

@bernaferrari

Description

@bernaferrari

Discussion here: #103833

According to @Hixie:

[BoxShape.oval] There is a comment saying new shapes shouldn't go here.

I should probably have included more information in the comment saying why:
Each new enum value is a lot of new code in a bunch of places, including in code we don't control (e.g. app code, that's why the Google tests are failing), so we'd need to write a migration guide and migrate a bunch of code.

  • Each new enum value requires new code in a bunch of places.
  • That new code likely won't get tree-shaken out, since I don't think the compiler can know which values are never used. So this has a permanent binary size cost even for people who don't use it.
  • In principle, we've moved to ShapeBorders rather than BoxShape for new shapes, and the existence of BoxShape is just a legacy feature at this point. Adding more shapes encourages people to use BoxShape in the future.

So I think it is worth trying to remove it. We can't deprecate BoxShape completely because InkWell uses it. But we can remove from BoxDecoration.

Metadata

Metadata

Assignees

Labels

P2Important issues not at the top of the work listc: proposalA detailed proposal for a change to Flutterframeworkflutter/packages/flutter repository. See also f: labels.team-frameworkOwned by Framework teamtriaged-frameworkTriaged by Framework team

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions