Skip to content

Use native CLGeocoder in geocoding_darwin example#302

Open
rickdijk wants to merge 4 commits into
Baseflow:mainfrom
rickdijk:refactor-darwin-example-clgeocoder
Open

Use native CLGeocoder in geocoding_darwin example#302
rickdijk wants to merge 4 commits into
Baseflow:mainfrom
rickdijk:refactor-darwin-example-clgeocoder

Conversation

@rickdijk

Copy link
Copy Markdown

Summary

  • Refactors the geocoding_darwin example to use the native CLGeocoder API via clgeocoder.dart instead of GeocodingDarwinFactory / the shared Geocoding interface.
  • Aligns with how the geocoding_android example demonstrates its native Geocoder API.

Test plan

  • cd geocoding_darwin/example && flutter run
  • Run example on iOS or macOS and verify reverse/forward geocoding and locale selection

Demonstrates the external native API via clgeocoder.dart instead of the
shared Geocoding platform interface, matching the geocoding_android example pattern.
@rickdijk rickdijk requested a review from mvanbeusekom June 25, 2026 19:06

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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 / Geocoding with direct cl.CLGeocoder calls.
  • Adds async handlers for forward/reverse geocoding with basic error handling (PlatformException, FormatException).
  • Updates display helpers to format CLPlacemark and CLLocation results (including coordinate/timestamp retrieval).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@mvanbeusekom mvanbeusekom left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

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:

  1. Should only apply to one specific package (which is the case for this PR, as it only affects the geocoding_darwin package).
  2. Should update the version in the pubspec.yaml and a matching entry in the CHANGELOG.md file.

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

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

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).

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