Repository navigation
Fixes locale being ignored in geocoding constructor (#324) - #325
Merged
Merged
Conversation
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues remain for the change forwarding the constructor locale to geocoding calls.
No open issues 🎉
What changed in this PR
Fixes #324 by forwarding the constructor’s locale to the internal Geocoding factory, allowing geocoding calls to use the configured locale by default.
Changes:
- Preserves the constructor locale while allowing per-call overrides.
- Adds regression tests for constructor locale handling across all three geocoding methods and a method-level override.
- Bumps the package to
5.0.1and documents the fix.
| File | Description |
|---|---|
geocoding/test/geocoding_test.dart |
Adds locale regression tests and locale tracking in the platform mock. |
geocoding/pubspec.yaml |
Updates the package version to 5.0.1. |
geocoding/lib/geocoding.dart |
Forwards the constructor locale to the internal factory. |
geocoding/CHANGELOG.md |
Records the locale fix for release 5.0.1. |
Review effort: Balanced
|
|
||
| setUp(() { | ||
| GeocodingPlatformFactory.instance = MockGeocodingPlatformFactory(); | ||
| platform = MockGeocodingPlatform(); |
| GeocodingPlatformFactory.instance = MockGeocodingPlatformFactory(); | ||
| platform = MockGeocodingPlatform(); | ||
| GeocodingPlatformFactory.instance = | ||
| MockGeocodingPlatformFactory(platform); |
| } | ||
|
|
||
| @override | ||
| Future<List<Placemark>> placemarkFromAddress( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

The
localepassed to theGeocodingconstructor was silently ignored (see #324). The public constructor forwarded toGeocoding._fromPlatformCreationParamswithout thelocaleargument, so the internal_localewas alwaysnull. As a result,locationFromAddress,placemarkFromAddressandplacemarkFromCoordinatesfell back to the device locale unless alocalewas passed to each call individually.Before:
Pre-launch Checklist
pubspec.yamlwith an appropriate new version according to the pub versioning philosophy, or this PR does not need version changes.CHANGELOG.mdwith a new## x.y.zsection that matches the version inpubspec.yaml///).main.dart format .and committed any changes.flutter analyzeand fixed any errors.