feat!: Dart SDK compatibility
Description
This PR makes this package compatible with the Dart SDK. In order to achieve this I changed 3 things:
- Replace
dart:ui's Color with a simple ColorData class - Replaced
RectfromflamewithRectanglefromdart:math - Replaced
flutter_testwithtestpackage
The ColorData class is used excatly once for which I prepared a flame_tiled PR (however I need to wait until this is merged right) including conversion extensions.
No Rectangle attribute is ever read in flame_tiled, evenso flame already contains conversion extensions!
Checklist
- [x] The title of my PR starts with a [Conventional Commit] prefix (
fix:,feat:,docs:etc). - [x] I have read the [Contributor Guide] and followed the process outlined for submitting PRs.
-->
melos run analyzefails due toXmlData.valuehowever I think this requires another issue/PR - [x] I have updated/added tests for ALL new/updated/fixed functionality.
- [x] I have updated/added relevant documentation in
docsand added dartdoc comments with///. - [x] I have updated/added relevant examples in
examples. --> I don't think there are any exmaples necessary for this
Breaking Change
- [x] Yes, this is a breaking change.
- [ ] No, this is not a breaking change.
I think this should result in a minor version bump to 0.11.0 to indicate these breaking changes!
In order to achieve dart comaptibilty only two things changed:
- Color: Custom data class -->
flame_tiledcontains a conversion extension - Rect: Instead using
dart:math's Rectangle --> Useflame'stoRect()method to convert
Related Issues
- #69
Would this help here? https://flutter.dev/go/move-flutter-agnostic-types
If yes, help me understand how. If not, what's missing?
Would this help here? https://flutter.dev/go/move-flutter-agnostic-types
If yes, help me understand how. If not, what's missing?
Yes! That would be exactly what we need here, it migrates all the types that we need out of flutter.
Thanks!