-
-
Notifications
You must be signed in to change notification settings - Fork 85
Expand file tree
/
Copy pathgeocoding.dart
More file actions
57 lines (51 loc) · 1.97 KB
/
geocoding.dart
File metadata and controls
57 lines (51 loc) · 1.97 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
import 'dart:async';
import 'package:geocoding_platform_interface/geocoding_platform_interface.dart';
export 'package:geocoding_platform_interface/geocoding_platform_interface.dart';
/// Returns a list of [Location] instances found for the supplied address.
///
/// In most situations the returned list should only contain one entry.
/// However in some situations where the supplied address could not be
/// resolved into a single [Location], multiple [Location] instances may be
/// returned.
Future<List<Location>> locationFromAddress(
String address, {
Region? targetRegion,
}) =>
GeocodingPlatform.instance!.locationFromAddress(
address,
targetRegion: targetRegion,
);
/// Returns a list of [Placemark] instances found for the supplied
/// coordinates.
///
/// In most situations the returned list should only contain one entry.
/// However in some situations where the supplied coordinates could not be
/// resolved into a single [Placemark], multiple [Placemark] instances may be
/// returned.
Future<List<Placemark>> placemarkFromCoordinates(
double latitude,
double longitude,
) =>
GeocodingPlatform.instance!.placemarkFromCoordinates(
latitude,
longitude,
);
/// Overrides default locale
///
/// You can specify a locale in which the results are returned.
/// When not used the current active locale of the device will be used.
/// The `localeIdentifier` should be formatted using the syntax:
/// [languageCode]_[countryCode] (eg. en_US or nl_NL).
Future<void> setLocaleIdentifier(
String localeIdentifier,
) =>
GeocodingPlatform.instance!.setLocaleIdentifier(
localeIdentifier,
);
/// Returns true if there is a geocoder implementation present that may return results.
/// If true, there is still no guarantee that any individual geocoding attempt will succeed.
///
///
/// This method is only implemented on Android, calling this on iOS always
/// returns [true].
Future<bool> isPresent() => GeocodingPlatform.instance!.isPresent();