Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate to Dart 3.0 #1517

Merged
merged 15 commits into from
May 15, 2023
Merged

Migrate to Dart 3.0 #1517

merged 15 commits into from
May 15, 2023

Conversation

josxha
Copy link
Contributor

@josxha josxha commented May 11, 2023

#1512 (5fb3b3b) bumped the minimum Flutter SDK to 3.10, but did not change the minimum Dart SDK. This PR changes the Dart SDK to 3.0 minimum, enabling the new features and performance benefits.

In addition, this PR:

  • Removes the Tuple dependency in favour of Records
  • Uses new pattern matching switches in some locations
  • Seals the TileDisplay class to benefit from new pattern matching switches, instead of switching on runtimeType
  • Deprecates TileUpdateTransformers.alwaysLoadAndPrune, as it should be unnecessary compared to ignoreTapEvents
  • Improves some documentation
  • Includes some other more minor improvements/changes

This PR also fixes the failing Android builds by upgrading Gradle.

josxha added 5 commits May 11, 2023 21:52
- This was already an indirect requirement because of `flutter: ">=3.10.0"`.
- setting this dependency constraint enables the new dart 3 language features.
@JaffaKetchup
Copy link
Member

Hi @josxha, and thanks for the contribution.
Personally, I can't bump the version to Dart 3, as I'm using FVM, and that is currently having some issues. This might hinder my ability to work on this project.
I'll check on a few things tomorrow. If everything turns out to be OK, I see no reason why this shouldn't be OK to merge (unless we decide we want to keep a little more compatibility).

@josxha
Copy link
Contributor Author

josxha commented May 11, 2023

Thanks for your message, @JaffaKetchup! I wasn't aware of the FVM project, but do hope that they manage to resolve the issues soon.

@josxha josxha marked this pull request as ready for review May 11, 2023 20:55
@JaffaKetchup
Copy link
Member

For reference: leoafarias/fvm#474.
When I try to build this project, my tools complain about the Dart SDK version being too high. Can't upgrade due to the above issue.
Will try to see if there's anything I can do to bypass this.

@josxha
Copy link
Contributor Author

josxha commented May 12, 2023

@JaffaKetchup isn't this basically the same as downloading the flutter sdk multiple times in different directories?
For example /dev/flutter/3.10 and /dev/flutter/3.7. Then you can use them by calling /dev/flutter/3.10/bin/flutter.

You could even create an alias with alias flutter3.10='/dev/flutter/3.10/bin/flutter' and then use it with flutter3.10.
I guess it's more work to set it up but at least you don't have to wait for an stale issue to be closed.

@JaffaKetchup
Copy link
Member

@josxha It's pretty much that, but it also manages the global Flutter version. I've got my fingers crossed that it might be solved soon, the maintainer replied 10 hrs ago.
I've also got a really busy month coming up - but maybe if I get some time I'll remove FVM and just deal with one installation.

@JaffaKetchup
Copy link
Member

JaffaKetchup commented May 12, 2023

I've managed to reinstall Dart 3, Flutter & FVM by using FVM from source instead of from Chocolatey.
I'll have a look at this soon hopefully, otherwise it'll be about 2-3 weeks before I get the chance.

@JaffaKetchup JaffaKetchup changed the title Update minimum dart sdk to version 3 Migrate to Dart 3.0 May 12, 2023
Removed unused `multiplyBy` method in `CustomPoint`
Replaced some `TileCoordinates` parameters with positional super params
Replaced private constructor with `abstract` class for `TileUpdateTransformers`
Improved `TileUpdateTransformer(s)` documentation
Deprecated `TileUpdateTransformers.alwaysLoadAndPrune`, as it should be unnecessary compared to `ignoreTapEvents`
Copy link
Contributor

@TesteurManiak TesteurManiak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some minor changes to make before merging otherwise LGTM.

lib/src/geo/crs/crs.dart Outdated Show resolved Hide resolved
lib/src/layer/marker_layer.dart Outdated Show resolved Hide resolved
lib/src/layer/tile_layer/tile_bounds/tile_bounds.dart Outdated Show resolved Hide resolved
lib/src/layer/tile_layer/tile_bounds/tile_bounds.dart Outdated Show resolved Hide resolved
lib/src/layer/tile_layer/tile_display.dart Outdated Show resolved Hide resolved
@TesteurManiak TesteurManiak self-assigned this May 14, 2023
@JaffaKetchup JaffaKetchup merged commit 9a13031 into fleaflet:master May 15, 2023
@JaffaKetchup
Copy link
Member

Thanks @josxha 🎉.

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.

3 participants