flutter_geocoder icon indicating copy to clipboard operation
flutter_geocoder copied to clipboard

Null safety support

Open fabirt opened this issue 4 years ago • 16 comments

Please consider migrating to null-safety.

fabirt avatar Mar 06 '21 13:03 fabirt

yes please

filly82 avatar Mar 07 '21 11:03 filly82

Any news, guys?

higorlapacw avatar Mar 08 '21 16:03 higorlapacw

Same here!

JaffaKetchup avatar Mar 08 '21 19:03 JaffaKetchup

I've forked and migrated the project for null safety (had to remove example folder because it was too old).

  geocoder:
    git:
      url: https://github.com/JCKodel/flutter_geocoder.git

JCKodel avatar Mar 09 '21 21:03 JCKodel

@JCKodel I don't think this project is being maintained, so the owner won't accept any PRs. Maybe you should contact him with e-mail or consider uploading you version in pub.dev What do you think?

higorlapacw avatar Mar 10 '21 10:03 higorlapacw

@JCKodel I don't think this project is being maintained, so the owner won't accept any PRs. Maybe you should contact him with e-mail or consider uploading you version in pub.dev What do you think?

Done. https://pub.dev/packages/flutter_geocoder

JCKodel avatar Mar 10 '21 14:03 JCKodel

Thanks @JCKodel for the package. If someone needs the package for iOS I modified the original version and added some of the changes made from JCK.

This in your pubspec.yaml

geocoder: git: url: git://github.com/n0tc0ding/flutter_geocoder.git

this in your dart code

import 'package:geocoder/geocoder.dart';

n0tc0ding avatar Mar 15 '21 04:03 n0tc0ding

Thanks @JCKodel for the package. If someone needs the package for iOS I modified the original version and added some of the changes made from JCK.

This in your pubspec.yaml

geocoder: git: url: git://github.com/n0tc0ding/flutter_geocoder.git

this in your dart code

import 'package:geocoder/geocoder.dart';

@n0tc0ding

Since I've published the package named flutter_geocoder, can you please make a PR for this repository, so I can update the published package (I don't know if it is possible to transfer the ownership of packages, didn't found anything on pub.dev).

JCKodel avatar Mar 15 '21 04:03 JCKodel

@JCKodel Let me read how to that and I will try to do the PR.

PD: I have never done a PR lol

n0tc0ding avatar Mar 15 '21 04:03 n0tc0ding

@JCKodel Let me read how to that and I will try to do the PR.

PD: I have never done a PR lol

The problem is that you forked the original repo, not this one. If you fork this repo and then apply your changes, then, it will be easy to create a PR.

JCKodel avatar Mar 15 '21 05:03 JCKodel

@JCKodel I can't really see which one will be going further :-) but if the other one, please, remove the 'nullsafety' from the version so that it will be a stable package rather than a prerelease one. You could also consider bumping up the version to make it a breaking change.

deakjahn avatar Mar 19 '21 17:03 deakjahn

Use geocoding package, migration is simple enough.

Holofox avatar Mar 26 '21 08:03 Holofox

Hello @JCKodel, thank you for migrate it to null safety and it works on Android :) I want to ask a question, when will it be implemented on iOS Device ?

Kind regards

gushendra86 avatar Apr 08 '21 08:04 gushendra86

Hello @JCKodel, thank you for migrate it to null safety and it works on Android :) I want to ask a question, when will it be implemented on iOS Device ?

Kind regards

Null safety is Dart only. If this plugin had iOS support, it will keep working. Nothing changes in Java/Objective-C code.

JCKodel avatar Apr 08 '21 13:04 JCKodel

Hello @JCKodel, thank you for migrate it to null safety and it works on Android :) I want to ask a question, when will it be implemented on iOS Device ? Kind regards

Null safety is Dart only. If this plugin had iOS support, it will keep working. Nothing changes in Java/Objective-C code.

Hello, thanks for your reply. But i get this error when running it on iOS : [VERBOSE-2:ui_dart_state.cc(186)] Unhandled Exception: MissingPluginException(No implementation found for method findAddressesFromCoordinates on channel github.com/aloisdeniel/geocoder) #0 MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:156:7) #1 LocalGeocoding.findAddressesFromCoordinates (package:flutter_geocoder/services/local.dart:13:26) #2 _GoogleMaps15PageState._getAddress (package:maps_flutter/maps/google_maps_flutter/google_maps15.dart:45:21)

This is the screenshot newww

Screenshot 2021-04-08 222644

When i use from original source (geocoder: ^0.2.1), iOS is not error and can return address.

Thank you and kind regards

gushendra86 avatar Apr 08 '21 15:04 gushendra86

@JCKodel, i found the different is in this path : flutter_geocoder/ios/Runner/GeneratedPluginRegistrant.m

Must be edited looks like in this path : https://github.com/n0tc0ding/flutter_geocoder/blob/master/ios/Runner/GeneratedPluginRegistrant.m

This file is different too : https://github.com/n0tc0ding/flutter_geocoder/blob/master/pubspec.yaml

n0tc0ding : flutter: plugin: androidPackage: com.aloisdeniel.geocoder pluginClass: GeocoderPlugin

JCKodel : flutter: plugin: platforms: android: package: com.aloisdeniel.geocoder pluginClass: GeocoderPlugin

Thanks and regards

gushendra86 avatar Apr 08 '21 15:04 gushendra86