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 null safety #829

Closed
AyushBherwani1998 opened this issue Feb 27, 2021 · 78 comments
Closed

Migrate to null safety #829

AyushBherwani1998 opened this issue Feb 27, 2021 · 78 comments

Comments

@AyushBherwani1998
Copy link

AyushBherwani1998 commented Feb 27, 2021

One of our side project uses this library, would be happy to help to migrate to null safety @johnpryan

@AyushBherwani1998
Copy link
Author

There are few blockers

flutter_image is deprecated and no longer maintained under Flutter org.
latlong is archived and is no longer maintained.
positioned_tap_detector has been discontinued
proj4dart is not yet migrated to sound null safety.

@andreystavitsky
Copy link

For latlong here is active pull request
#750

@aytunch
Copy link
Contributor

aytunch commented Mar 5, 2021

in order for migrating to Flutter 2.0 we will need this library to be null safe. This is a one of a kind package which lets Flutter community to use their beloved widgets as markers. @johnpryan do you have any strategy for this? @AyushBherwani1998 thanks for listing the deprecated dependencies. It might be a good starting point before nnbd migration. I think flutter_image and latlong are not going to be hard to replace. I don't know what proj4dart is for and if there is a replacement for positioned_tap_detector.

@kevin-lot
Copy link

kevin-lot commented Mar 5, 2021

For "latlong".
What about "latlng" package ? (that is already null safety compatible)

nb: I didn't check the code https://github.com/xclud/flutter_latlng.

@JAICHANGPARK
Copy link


Error: Cannot run with sound null safety, because the following dependencies
don't support null safety:

 - package:flutter_map
 - package:latlong
 - package:logging
 - package:validate
 - package:proj4dart
 - package:tuple
 - package:positioned_tap_detector
 - package:flutter_image
 - package:quiver
 - package:mgrs_dart
 - package:wkt_parser
 - package:unicode
 - package:lists


@jpeiffer
Copy link
Contributor

It looks like latlong was abandoned but someone has forked that and added Null Safety:
https://pub.dev/packages/latlong2

@attex
Copy link

attex commented Mar 11, 2021

logging has been updated to null-safety
tuple has a prerelease for null-safety
quiver has been updated to null-safety
unicode has been updated to null-safety

@arsamme
Copy link
Contributor

arsamme commented Mar 13, 2021

I think this repo is archived and I'm gonna fork and publish NS version of flutter_map.

@aytunch
Copy link
Contributor

aytunch commented Mar 13, 2021

@arsamme thanks. But I do hope it is not the case for flutter_map. I see the owner @johnpryan active from time to time. I would love to hear his opinion about the future of this great package

@arsamme
Copy link
Contributor

arsamme commented Mar 13, 2021

@aytunch I hope too. But he didn't respond to any issue for a long time.

@proton1k
Copy link

@arsamme @aytunch there's a call for maintainers on the top of the issues list on this repo. I assume someone else has to join as an active maintainer so that the package get's timel yupdates. Is there another package available out there or downgrading to pre-null-safety version is one of the ways you manage the production-ready apps ?

@aytunch
Copy link
Contributor

aytunch commented Mar 13, 2021

@o1dnik I have missed the call for maintainers issue, thanks for pointing it out. I have been using this library from the very early days. And lately @maRci002 and @lpongetti have done very useful and successful contributions among other developers. As now understanding that @johnpryan is busy with other stuff, I would like to know from you two friends if you have an agenda on this libraries null safety upgrade, maintenance and new features? Thanks.

Lastly, I would like to remind to the developers and marketers of several Map provider companies which are supported by this package that if this package is not maintained anymore, we would most likely change to another provider which offer similar functionality using their official packages. So it would be great to get some help from your side too:)

@arsamme
Copy link
Contributor

arsamme commented Mar 13, 2021

@aytunch I've submitted call for maintainers form and no answers yet (after about two weeks)

@maRci002
Copy link
Contributor

I am going to migrate proj4dart to nullsafety including mgrs_dart / wkt_parser packages.

@aytunch
Copy link
Contributor

aytunch commented Mar 14, 2021

Great to hear from you @maRci002

I am just gathering the info scattered throughout this issue so we know where we are in terms of Null Safety status of Flutter_map's dependencies. Thanks everyone who shared info here (I haven't checked the packages, just collected the info in the issue so if there are new updates, please copy paste the table and reply accordingly):

  • ✅ package:logging

  • ✅ package:quiver

  • ✅ package:unicode

  • ✅ package:lists

  • ✅ package:positioned_tap_detector (thanks to @arsamme)

  • ♻️ package:tuple (prerelease null safety)

  • ⚠️ package:proj4dart (on maRci002's radar)

  • ⚠️ package:mgrs_dart (on maRci002's radar)

  • ⚠️ package:wkt_parser (on maRci002's radar)

  • ❓package:latlong (https://pub.dev/packages/latlong2 someone has forked that and added Null Safety) There is an alternative package called latlng which has null safety also.

  • ❓package:validate (looks like this is not a dependency: Migrate to null safety MikeMitterer/dart-validate#6 (comment))

  • ❌ package:flutter_image (deprecated and no longer maintained under Flutter org)

@arsamme
Copy link
Contributor

arsamme commented Mar 15, 2021

Great to hear from you @maRci002

I am just gathering the info scattered throughout this issue so we know where we are in terms of Null Safety status of Flutter_map's dependencies. Thanks everyone who shared info here (I haven't checked the packages, just collected the info in the issue so if there are new updates, please copy paste the table and reply accordingly):

  • ✅ package:logging
  • ✅ package:quiver
  • ✅ package:unicode
  • ♻️ package:tuple (prerelease null safety)
  • ⚠️ package:proj4dart (on maRci002's radar)
  • ⚠️ package:mgrs_dart (on maRci002's radar)
  • ⚠️ package:wkt_parser (on maRci002's radar)
  • ❓package:latlong (https://pub.dev/packages/latlong2 someone has forked that and added Null Safety) There is an alternative package called latlng which has null safety also.
  • ❌ package:lists
  • ❌ package:validate
  • ❌ package:positioned_tap_detector (discontinued)
  • ❌ package:flutter_image (deprecated and no longer maintained under Flutter org)

lists is migrated

@JaffaKetchup
Copy link
Member

JaffaKetchup commented Mar 15, 2021

Hi all,
Another thing that may need to be migrated are the multiple plugins (not sure if this is out of scope, however). Also, before publishing a new version as @arsamme suggested (good idea), it may also be a good idea to merge some pull requests (again this might be out of scope), such as #564, #827, #810, #582, #826, #818 & #577. This would immediately boost the new package and make it even better than before.

Thanks for all your hard efforts, I really appreciate it, even though I am still in full time education, I program/code as much as possible in my spare time :).

Edit PS. I just feel that if you're going to this much effort, we might as well do it as good as possible the first time :).

@arsamme
Copy link
Contributor

arsamme commented Mar 15, 2021

@JaffaKetchup Unfortunately author of package is nit responding and I think there is no way for merging PRs. In my opinion best solution for now is forking this repo and publishing migrated package, then adding other features.

@JaffaKetchup
Copy link
Member

@arsamme Yeah, sorry should have clarified. I meant after creating the new GitHub repo but before publishing on pub.dev.

@arsamme
Copy link
Contributor

arsamme commented Mar 15, 2021

@JaffaKetchup Great. So I'll notify you here on updates.

@erickhaendel
Copy link

Great, awaiting for updates.

@johnpryan
Copy link
Collaborator

I have added some additional maintainers to help with maintenance.

@arsamme
Copy link
Contributor

arsamme commented Mar 16, 2021

@johnpryan nice. Is there any eta on when we will get nnbd version?

@johnpryan
Copy link
Collaborator

@arsamme no, we need to wait for other packages to upgrade first.

@kengu
Copy link
Contributor

kengu commented Mar 16, 2021

@johnpryan / @maRci002 - what do you think of replacing lat_long with maps_toolkit, ref #750? The change looks simple enough, so does the new dependency. The question is do we need a dependency for modelling LatLng when there is no commonly used library for LatLng in dart/flutter community that is actively maintained afaics?

@bramvbilsen
Copy link

@aytunch I've just finished moving @escamoteur's branch to issues/829-nullsafety. See PR #870 which merges sound null-safety when flutter_image is migrated.

If you can not wait for this to land on master, use the following dependency override

dependency_overrides:
  flutter_map:
    git:
      url: https://github.com/fleaflet/flutter_map
      ref: issues/829-nullsafety

Using the dependency override, I get the following build error:


FAILURE: Build failed with an exception.

* Where:
Script 'C:\Users\bramv\DevTools\flutter\packages\flutter_tools\gradle\flutter.gradle' line: 991

* What went wrong:
Execution failed for task ':app:compileFlutterBuildDebug'.
> Process 'command 'C:\Users\bramv\DevTools\flutter\bin\flutter.bat'' finished with non-zero exit value 1

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

Do you have the same result?

@josxha
Copy link
Contributor

josxha commented Apr 23, 2021

@bramvbilsen I think flutter_map isn't the problem here. There is a problem with gradle. Open the /android directory with e.g. Android Studio and try to build gradle there.

@barbalex
Copy link

If you can not wait for this to land on master, use the following dependency override

This unfortunately does not work yet, as flutter_image is not null safe yet:

Error: Cannot run with sound null safety, because the following dependencies
don't support null safety:

- package:flutter_image

For solutions, see https://dart.dev/go/unsound-null-safety
3

FAILURE: Build failed with an exception.

* Where:
Script 'C:\Users\alexa\flutter\packages\flutter_tools\gradle\flutter.gradle' line: 1035

* What went wrong:
Execution failed for task ':app:compileFlutterBuildDebug'.
> Process 'command 'C:\Users\alexa\flutter\bin\flutter.bat'' finished with non-zero exit value 1

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 11s
Exception: Gradle task assembleDebug failed with exit code 1
Exited (sigterm)

I guess it will start working after flutter_image got updated 🙏

@josxha
Copy link
Contributor

josxha commented May 11, 2021

@barbalex Have a look into the provided link in the error message.
Even though flutter_map has no complete sound null safety support yet because of the flutter_image dependency, you can run your app with unsound null safety: flutter run --no-sound-null-safety
See: https://dart.dev/null-safety/unsound-null-safety#testing-or-running-mixed-version-programs

Option 2 (if you don't want to run you're app with unsound null safety):
There is an open pull request that removes the flutter_image decendency. You can use it with:

dependency_overrides:
  flutter_map:
    git:
      url: git://github.com/josxha/flutter_map.git
      ref: issues/829-nullsafety

@aytunch
Copy link
Contributor

aytunch commented May 14, 2021

flutter_image null safety just got merged fyi everyone. Is there any other dependencies left for flutter_map to be sound null safe?

@josxha
Copy link
Contributor

josxha commented May 14, 2021

@aytunch Unfortunately not quite, flutter_image has been merged and moved to a new repository, but the version has not been released on pub.dev yet.
The new repository is: https://github.com/flutter/packages/tree/master/packages/flutter_image

However, I would like to point out my PR replacing flutter_image with http. This would make all packages with support for sound null safety. See: #894

@aytunch
Copy link
Contributor

aytunch commented May 14, 2021

@josxha Thank you for #894 In the long run I think relying on http will be much safer and robust. Do you have any idea when your http PR be merged? And after it is merged, do we have any obstacles for flutter_map to become sound null safe?

@mootw
Copy link
Collaborator

mootw commented May 15, 2021

@aytunch http is going to be a more robust solution. I made some noise in a new issue about releasing a new version but sometimes @johnpryan and the new maintainers are a bit slow on the catch-up to PRs. My guess is that null-safety and the http merge will be in the next week. I just checked the master branch and all other dependencies are null safe so there are no more blockers (assuming we remove flutter_image)

@kengu
Copy link
Contributor

kengu commented May 15, 2021

See my comment on #894. I think we should wait for flutter_image 4.0.1, which is now part of flutter packages. The branch 829-nullsafety is now pointing to the new location in flutter packages.

When flutter_image 4.0.1 is published to pub.dev, I will merge it to master as soon at a contributor approves it (we can not merge our own PRs), and ask @johnpryan to release 0.13.0.

@JaffaKetchup
Copy link
Member

This is great news, and I'm glad to see some progress 👍 .

Should the new release be 1.0.0 (or 2.0.0) however? This is because this is a potentially breaking change with huge code refactoring, and it kind of seems time for a major release.

@mootw
Copy link
Collaborator

mootw commented May 15, 2021

Caching should not be handled by the image provider like that. Check my post in #984 for info.

@JaffaKetchup it would likely be version 1.0.0. Any increase of the first number is indicating a significant breaking change.

@rorystephenson
Copy link
Contributor

FWIW I opened an issue to ask for flutter_image to be published: flutter/flutter#82900

@barbalex
Copy link

And flutter_image v4.0.1 was published: flutter/flutter#82900 (comment)

@kengu
Copy link
Contributor

kengu commented May 19, 2021

I'll update the branch tonight @barbalex

@johnpryan We are ready to merge shortly. Can you do the review soon?

ThexXTURBOXx added a commit to ThexXTURBOXx/flutter_map that referenced this issue May 19, 2021
@kengu
Copy link
Contributor

kengu commented May 19, 2021

flutter_image is now upgraded to latest version 4.0.1 in PR #870

ThexXTURBOXx added a commit to ThexXTURBOXx/flutter_map that referenced this issue May 19, 2021
ThexXTURBOXx added a commit to ThexXTURBOXx/flutter_map that referenced this issue May 19, 2021
ThexXTURBOXx added a commit to ThexXTURBOXx/flutter_map that referenced this issue May 19, 2021
@JaffaKetchup
Copy link
Member

Hi, are we ready for this? Hoping to get this done today or tomorrow so I can update my plugin 👍.

ThexXTURBOXx added a commit to ThexXTURBOXx/flutter_map that referenced this issue May 20, 2021
@kengu kengu mentioned this issue May 21, 2021
@kamleshwebtech
Copy link

Still looking forward for Null Safety solution :)

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

No branches or pull requests