Skip to content

Commit f03dfb7

Browse files
Bug/216 wrong version (#221)
* Revert "Feature/208 update documentation (#210)" This reverts commit da17019. * set version to 2.2.1+1
1 parent b2aa67b commit f03dfb7

File tree

6 files changed

+35
-46
lines changed

6 files changed

+35
-46
lines changed

geocoding/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 2.2.1+1
2+
3+
- Reverts changes from version `2.2.1`, `2.2.1` should not be used. Use either version `2.2.1+1` or `3.0.0`.
4+
15
## 2.2.1
26

37
- Updates documentation related to setting the locale.

geocoding/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ import 'package:geocoding/geocoding.dart';
5757
List<Placemark> placemarks = await placemarkFromCoordinates(52.2165157, 6.9437819);
5858
```
5959

60-
The setLocaleIdentifier with the `localeIdentifier` parameter can be used to enforce the results to be formatted (and translated) according to the specified locale. The `localeIdentifier` should be formatted using the syntax: [languageCode]_[countryCode]. Use the [ISO 639-1 or ISO 639-2](http://www.loc.gov/standards/iso639-2/php/English_list.php) standard for the language code and the 2 letter [ISO 3166-1](https://en.wikipedia.org/wiki/ISO_3166-1) standard for the country code. Some examples are:
60+
Both the `locationFromAddress` and `placemarkFromCoordinates` accept an optional `localeIdentifier` parameter. This parameter can be used to enforce the results to be formatted (and translated) according to the specified locale. The `localeIdentifier` should be formatted using the syntax: [languageCode]_[countryCode]. Use the [ISO 639-1 or ISO 639-2](http://www.loc.gov/standards/iso639-2/php/English_list.php) standard for the language code and the 2 letter [ISO 3166-1](https://en.wikipedia.org/wiki/ISO_3166-1) standard for the country code. Some examples are:
6161

6262
Locale identifier | Description
6363
----------------- | -----------

geocoding/example/lib/main.dart

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -136,31 +136,6 @@ class _GeocodeWidgetState extends State<GeocodeWidget> {
136136
});
137137
}),
138138
),
139-
const Padding(
140-
padding: EdgeInsets.only(top: 8),
141-
),
142-
Center(
143-
child: ElevatedButton(
144-
child: Text('Set locale en_US'),
145-
onPressed: () {
146-
setLocaleIdentifier("en_US").then((_) {
147-
setState(() {});
148-
});
149-
})),
150-
const Padding(
151-
padding: EdgeInsets.only(top: 8),
152-
),
153-
Center(
154-
child: ElevatedButton(
155-
child: Text('Set locale nl_NL'),
156-
onPressed: () {
157-
setLocaleIdentifier("nl_NL").then((_) {
158-
setState(() {});
159-
});
160-
})),
161-
const Padding(
162-
padding: EdgeInsets.only(top: 8),
163-
),
164139
Expanded(
165140
child: SingleChildScrollView(
166141
child: Container(

geocoding/lib/geocoding.dart

Lines changed: 22 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,15 @@ export 'package:geocoding_platform_interface/geocoding_platform_interface.dart';
1010
/// However in some situations where the supplied address could not be
1111
/// resolved into a single [Location], multiple [Location] instances may be
1212
/// returned.
13-
Future<List<Location>> locationFromAddress(String address) =>
13+
///
14+
/// Optionally you can specify a locale in which the results are returned.
15+
/// When not supplied the currently active locale of the device will be used.
16+
/// The `localeIdentifier` should be formatted using the syntax:
17+
/// [languageCode]_[countryCode] (eg. en_US or nl_NL).
18+
Future<List<Location>> locationFromAddress(
19+
String address, {
20+
String? localeIdentifier,
21+
}) =>
1422
GeocodingPlatform.instance!.locationFromAddress(
1523
address,
1624
);
@@ -22,24 +30,19 @@ Future<List<Location>> locationFromAddress(String address) =>
2230
/// However in some situations where the supplied coordinates could not be
2331
/// resolved into a single [Placemark], multiple [Placemark] instances may be
2432
/// returned.
25-
Future<List<Placemark>> placemarkFromCoordinates(
26-
double latitude, double longitude) =>
27-
GeocodingPlatform.instance!.placemarkFromCoordinates(
28-
latitude,
29-
longitude,
30-
);
31-
32-
/// Overrides default locale
3333
///
3434
/// Optionally you can specify a locale in which the results are returned.
3535
/// When not supplied the currently active locale of the device will be used.
3636
/// The `localeIdentifier` should be formatted using the syntax:
3737
/// [languageCode]_[countryCode] (eg. en_US or nl_NL).
38-
Future<void> setLocaleIdentifier(
39-
String localeIdentifier,
40-
) =>
41-
GeocodingPlatform.instance!.setLocaleIdentifier(
42-
localeIdentifier,
38+
Future<List<Placemark>> placemarkFromCoordinates(
39+
double latitude,
40+
double longitude, {
41+
String? localeIdentifier,
42+
}) =>
43+
GeocodingPlatform.instance!.placemarkFromCoordinates(
44+
latitude,
45+
longitude,
4346
);
4447

4548
/// Returns a list of [Location] instances found for the supplied address.
@@ -48,6 +51,11 @@ Future<void> setLocaleIdentifier(
4851
/// However in some situations where the supplied address could not be
4952
/// resolved into a single [Location], multiple [Location] instances may be
5053
/// returned.
54+
///
55+
/// Optionally you can specify a locale in which the results are returned.
56+
/// When not supplied the currently active locale of the device will be used.
57+
/// The `localeIdentifier` should be formatted using the syntax:
58+
/// [languageCode]_[countryCode] (eg. en_US or nl_NL).
5159
Future<bool> isPresent({
5260
String? localeIdentifier,
5361
}) =>

geocoding/pubspec.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: geocoding
22
description: A Flutter Geocoding plugin which provides easy geocoding and reverse-geocoding features.
3-
version: 2.2.1
3+
version: 2.2.1+1
44
repository: https://github.com/baseflow/flutter-geocoding/tree/main/geocoding
55
issue_tracker: https://github.com/Baseflow/flutter-geocoding/issues
66

@@ -14,7 +14,7 @@ dependencies:
1414

1515
geocoding_platform_interface: ^3.0.0
1616
geocoding_android: ^3.0.0
17-
geocoding_ios: ^3.0.0
17+
geocoding_ios: ^2.0.0
1818

1919
dev_dependencies:
2020
flutter_test:

geocoding/test/geocoding_test.dart

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,16 +48,18 @@ class MockGeocodingPlatform extends Mock
4848
GeocodingPlatform {
4949
@override
5050
Future<List<Location>> locationFromAddress(
51-
String address,
52-
) async {
51+
String address, {
52+
String? localeIdentifier,
53+
}) async {
5354
return [mockLocation];
5455
}
5556

5657
@override
5758
Future<List<Placemark>> placemarkFromCoordinates(
5859
double latitude,
59-
double longitude,
60-
) async {
60+
double longitude, {
61+
String? localeIdentifier,
62+
}) async {
6163
return [mockPlacemark];
6264
}
6365
}

0 commit comments

Comments
 (0)