flutter_geocoder icon indicating copy to clipboard operation
flutter_geocoder copied to clipboard

It is NOT supporting to Null Safety

Open kamleshwebtech opened this issue 3 years ago • 15 comments

I have setup it in my project but getting error:

The library 'package:geocoder/geocoder.dart' is legacy, and should not be imported into a null safe library.
Try migrating the imported library.

Please update it's library and make it compatible with Null Safety. Thanks.

kamleshwebtech avatar May 21 '21 10:05 kamleshwebtech

yeah make it null safe asap

AliYar-Khan avatar May 21 '21 16:05 AliYar-Khan

I guess you can go with #64 @AliYar-Khan @kamleshwebtech

dependencies:
  flutter:
    sdk: flutter
  flutter_geocoder:
    git:
      url: https://github.com/JCKodel/flutter_geocoder.git
      ref: "b0361f4"

Here is code

yahu1031 avatar Jun 01 '21 04:06 yahu1031

I am getting this error when I try your method

pub get failed (server unavailable) -- attempting retry 4 in 8 seconds...
Git error. Command: `git rev-list --max-count=1 b0361f4`                
stdout:                                                                 
stderr: fatal: ambiguous argument 'b0361f4': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:                   
'git <command> [<revision>...] -- [<file>...]'                          
exit code: 128    

AlexMainaMunyua avatar Jul 26 '21 09:07 AlexMainaMunyua

@AlexMainaMunyua try this 7059f6f

dependencies:
  flutter:
    sdk: flutter
  flutter_geocoder:
    git:
      url: https://github.com/JCKodel/flutter_geocoder.git
      ref: "7059f6f"

BTW you don't need this any more, cause the package is now sounding null-safety

yahu1031 avatar Jul 26 '21 09:07 yahu1031

Do we have a null-safe variant of this that also supports iOS?

Markaleth avatar Jul 29 '21 14:07 Markaleth

@Markaleth yes we do. Better read the docs once. 😄

yahu1031 avatar Jul 29 '21 14:07 yahu1031

@yahu1031 would you please help with a link, Im struggling with finding null safe geocoder versions that support iOS. thanks!

mZadorskii avatar Jul 29 '21 21:07 mZadorskii

@mZadorskii the latest version is sounding null safety. Not sure what are you struggling with 😕

yahu1031 avatar Jul 29 '21 21:07 yahu1031

@kamleshwebtech or @aloisdeniel better close this issue.

yahu1031 avatar Jul 29 '21 21:07 yahu1031

@yahu1031 My bad, I just looked yaml and saw 2.12 sdk. pub dev is not showing Null-safe sticker next to library for some reason image

mZadorskii avatar Jul 29 '21 21:07 mZadorskii

No need to worry about it buddy @mZadorskii just continue with it.

yahu1031 avatar Jul 29 '21 21:07 yahu1031

It looks like what is checked into master has been updated for null safety, but that it has not been published to pub.dev. The latest version on pub.dev is still 0.2.1 which is NOT null sound safe. Are there plans to publish 0.3.0?

coreysprague avatar Jul 29 '21 21:07 coreysprague

All is good now. Previously I was getting some issues.

You can close this issue.

AlexMainaMunyua avatar Jul 30 '21 06:07 AlexMainaMunyua

~~The linked PR that fixes the null safety seems to have an issue with converting coordinates to an address in iOS, anyone else having the same issue or knows what the issue is? https://github.com/JCKodel/flutter_geocoder/pull/1#issuecomment-887420192~~

Just want to add I was using the git-version with the null-safety fix

 flutter_geocoder: 
    git:
      url: https://github.com/JCKodel/flutter_geocoder.git
      ref: "7059f6f"

The pub.dev is still 0.2.1 as @coreysprague mentioned, so that is not possible to use, but I realised that using the following solves the issue.

 flutter_geocoder: 
    git:
      url: https://github.com/aloisdeniel/flutter_geocoder.git
      ref: "2ee33a9"

So basically, until the version is upgraded in pub.dev we could use the latter.

proformance avatar Aug 02 '21 09:08 proformance

flutter_geocoder: git: url: https://github.com/aloisdeniel/flutter_geocoder.git ref: "2ee33a9"

The plugin geocoder uses a deprecated version of the Android embedding.

MennaCC avatar Oct 03 '23 22:10 MennaCC