[Bug]: `Geocoding(locale: ...)` has no effect – locale is not forwarded to `_fromPlatformCreationParams`
Maintainers usually reply within 1 day
@AmrWalidi is already working on this.
Since Oct 31, 2026.
Assessment
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Newbie friendliness
- 92/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Domain
- backend-api-design, mobile
Research direction
Start at the public Geocoding constructor and its _fromPlatformCreationParams factory, which the issue identifies as the point where locale is dropped. Check how the factory passes locale to the platform implementation, then forward the constructor argument and verify that an explicit locale reaches it. Done when the reported German locale is used instead of the device locale.
Written by the indexing model from the issue text.
Description
Please check the following before submitting a new issue.
- I have searched the existing issues.
- I have carefully read the documentation and verified I have added the required platform specific configuration.
Please select affected platform(s)
- Android
- iOS
Steps to reproduce
- Set the device language to something other than German (e.g. English).
- Create a
Geocodinginstance with an explicit locale:Geocoding(locale: const Locale('de', 'DE')). - Call
placemarkFromCoordinatesfor a location in Germany (e.g.52.5163, 13.3777, Brandenburger Tor, Berlin). - Inspect the returned
Placemark, e.g.placemark.country.
Expected results
The placemarks are returned in the locale passed to the constructor (de_DE), e.g. country == 'Deutschland'.
Actual results
The locale passed to the constructor is ignored. The placemarks come back in the device locale, e.g. country == 'Germany'.
The cause is in the public Geocoding constructor: it accepts locale, but does not forward it to the private factory Geocoding._fromPlatformCreationParams, so the value never reaches the platform implementation.
Proposed fix – forward the parameter:
Geocoding({Locale? locale})
: this._fromPlatformCreationParams(
pi.GeocodingCreationParams(),
locale: locale,
);
Code sample
Code sample
import 'package:flutter/material.dart';
import 'package:geocoding/geocoding.dart';
void main() => runApp(const MyApp());
class MyApp extends StatelessWidget {
const MyApp({super.key});
@override
Widget build(BuildContext context) {
return const MaterialApp(
home: Scaffold(
body: Center(
child: ElevatedButton(
onPressed: _reverseGeocode,
child: Text('Reverse geocode'),
),
),
),
);
}
}
Future<void> _reverseGeocode() async {
final geocoding = Geocoding(locale: const Locale('de', 'DE'));
final placemarks = await geocoding.placemarkFromCoordinates(52.5163, 13.3777);
// Device language set to English:
// Expected: "Deutschland"
// Actual: "Germany"
debugPrint(placemarks.first.country);
}
Screenshots or video
Version
5.0.0
Flutter Doctor output
Doctor output
(Irrelevant)
- Dominant language
- Dart
- Stars
- 154
- Forks
- 94
- Avg merge
- 1h 21m
- Merged PRs (30d)
- 3
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from Baseflow/flutter-geocoding
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
Baseflow/flutter-geocoding#337 · 1 reaction ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
Baseflow/flutter-geocoding#332 ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 1-3 hours Newbie friendliness 84/100
Baseflow/flutter-geocoding#311 · 2 comments ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
Baseflow/flutter-geocoding#309 ·
Maintainers usually reply within 1 day
-
Difficulty 4/5 3-5 days Newbie friendliness 49/100
Baseflow/flutter-geocoding#327 ·
Maintainers usually reply within 1 day
All issues in Baseflow/flutter-geocoding
Similar issues
-
feature
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
VeryGoodOpenSource/vgv-ai-flutter-plugin#219 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Anxcye/anx-reader#1024 ·
-
[cloud_functions]: Apple platforms ignore custom domains passed as regionPossibly taken @ragavendranbala-TSL claimed this today. OpenNeeds Attention platform: ios platform: macos plugin: functions type: bug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
firebase/flutterfire#19015 · 2 comments ·
Maintainers usually reply within 4 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
RevenueCat/purchases-flutter#2048 ·
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
hajisensai/Fushi#4543 · 3 comments ·
Maintainers usually reply within 1 day