tiled.dart icon indicating copy to clipboard operation
tiled.dart copied to clipboard

feat!: Dart SDK compatibility

Open benni-tec opened this issue 2 years ago • 2 comments

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 Rect from flame with Rectangle from dart:math
  • Replaced flutter_test with test package

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 analyze fails due to XmlData.value however 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 docs and 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_tiled contains a conversion extension
  • Rect: Instead using dart:math's Rectangle --> Use flame's toRect() method to convert

Related Issues

  • #69

benni-tec avatar Jan 16 '24 19:01 benni-tec

Would this help here? https://flutter.dev/go/move-flutter-agnostic-types

If yes, help me understand how. If not, what's missing?

kevmoo avatar Jun 18 '24 18:06 kevmoo

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!

spydon avatar Jun 19 '24 07:06 spydon