Skip to content

[Breaking] Replace usages of dart:math geometry types with custom types#316

Open
parlough wants to merge 7 commits intogoogle:masterfrom
parlough:feat/custom-geometry-types
Open

[Breaking] Replace usages of dart:math geometry types with custom types#316
parlough wants to merge 7 commits intogoogle:masterfrom
parlough:feat/custom-geometry-types

Conversation

@parlough
Copy link
Copy Markdown
Contributor

@parlough parlough commented Feb 14, 2025

This is a breaking change and shouldn't be included until the next major release.

These types were built for dart:html, contain unrelated functionality, and require this library to always add an int generic. To aid the deprecation of these types in dart:math, migrate this package to custom types. These types, particularly the addition of a new Size type can more semantically match their purpose in the package, and be a bit simpler to use, no longer having a type parameter.

Contributes to dart-lang/sdk#54852

@devoncarew
Copy link
Copy Markdown
Contributor

I don't know that I have enough context on the 'why' to evaluate this PR. Perhaps we should resolve dart-lang/sdk#54852 first? cc @kevmoo for thoughts

@parlough
Copy link
Copy Markdown
Contributor Author

parlough commented Feb 25, 2025

I don't know that I have enough context on the 'why' to evaluate this PR. Perhaps we should resolve dart-lang/sdk#54852 first?

That issue is the why for this. This package seems to be the only dependency of Flutter that uses these types, being a blocking stop in deprecating the types.

Also, Rectangle was used for representing Size causing not matching the semantic meaning and requiring redundant information each time.

Happy to continue the discussion in that issue first though :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants