Skip to content

Deprecate Point, Rectangle, and MutableRectangle in dart:math #54852

Open
@parlough

Description

@parlough

Now that dart:html usage has been decreasing and is going to continue to. They were moved from dart:html as part of #9213, but that continued to be their primary use.

A Point on a screen does not really belong in a math library, nor does Rectangle. Beyond that, Point declares operators that don't make sense for a point, conflating it with a vector. The * operator on Point<int> can also result in a runtime error when provided with a double 😢.

Some related discussion about performance concerns: #53912


All this isn't to say the functionality they provide isn't useful, but the use cases can now be better supported by focused packages that are easier to evolve. A lot of the previous uses are likely covered by a simple record too.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-core-librarySDK core library issues (core, async, ...); use area-vm or area-web for platform specific libraries.deprecationlibrary-mathtype-code-healthInternal changes to our tools and workflows to make them cleaner, simpler, or more maintainable

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions