Use native CLGeocoder in geocoding_darwin example#302
Conversation
Demonstrates the external native API via clgeocoder.dart instead of the shared Geocoding platform interface, matching the geocoding_android example pattern.
There was a problem hiding this comment.
Pull request overview
Refactors the geocoding_darwin example app to demonstrate the native Darwin geocoding surface (CLGeocoder) directly via clgeocoder.dart, mirroring the platform-native style shown in the Android example.
Changes:
- Replaces usage of
GeocodingDarwinFactory/Geocodingwith directcl.CLGeocodercalls. - Adds async handlers for forward/reverse geocoding with basic error handling (
PlatformException,FormatException). - Updates display helpers to format
CLPlacemarkandCLLocationresults (including coordinate/timestamp retrieval).
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
mvanbeusekom
left a comment
There was a problem hiding this comment.
The new implementation of the example/lib/main.dart is exactly how I envisioned it.
The only thing I didn't mention (and is also not mentioned in the CONTRIBUTING.md guide) is that each PR:
- Should only apply to one specific package (which is the case for this PR, as it only affects the
geocoding_darwinpackage). - Should update the version in the
pubspec.yamland a matching entry in theCHANGELOG.mdfile.
You did create an entry in the CHANGELOG.md (which uses the correct style), but it should contain a new version number and this new version number should also be updated in the pubspec.yaml file.
| @@ -1,3 +1,8 @@ | |||
| ## Unreleased | |||
There was a problem hiding this comment.
You can directly create a new version number and use it here (can be a patch fix, so I suggest using version 1.0.1).
Summary
CLGeocoderAPI viaclgeocoder.dartinstead ofGeocodingDarwinFactory/ the sharedGeocodinginterface.GeocoderAPI.Test plan
cd geocoding_darwin/example && flutter run