Skip to content

Deprecate BoxDecoration.shape #108051

Open
Open

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.

Activity

  1. changed the title [-]Deprecate BoxShape[/-] [+]Deprecate `BoxDecoration.shape`[/+] on Jul 20, 2022
  2. added
    in triagePresently being triaged by the triage team
    frameworkflutter/packages/flutter repository. See also f: labels.
    c: proposalA detailed proposal for a change to Flutter
    and removed
    in triagePresently being triaged by the triage team
    on Jul 21, 2022
  3. added
    P1High-priority issues at the top of the work list
    on Jul 26, 2022
  4. added
    P2Important issues not at the top of the work list
    and removed
    P1High-priority issues at the top of the work list
    on Oct 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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