Skip to main content

google_location_extract 1.0.1 copy "google_location_extract: ^1.0.1" to clipboard
google_location_extract: ^1.0.1 copied to clipboard

Extract rich location details from full and shortened Google Maps URLs.

example/google_location_extract_example.dart

// ignore_for_file: avoid_print

import 'package:google_location_extract/google_location_extract.dart';

Future<void> main() async {
  const parser = GoogleMapsParser();
  final directLocation = parser.parse(
    'https://www.google.com/maps/place/Accra+Mall/'
    '@5.6224,-0.1731,17z',
  );
  print(directLocation.toJson());

  final extractor = GoogleMapsLocationExtractor();
  try {
    final sharedLocation = await extractor.extract(
      'Meet me here: https://maps.app.goo.gl/example',
    );
    print(sharedLocation.toJson());
  } on LocationExtractFormatException catch (error) {
    print('Invalid Google Maps link: ${error.message}');
  } on LocationExtractNetworkException catch (error) {
    print('Could not resolve the link: ${error.message}');
  } finally {
    extractor.close();
  }
}
0
likes
160
points
37
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

Extract rich location details from full and shortened Google Maps URLs.

Repository (GitHub)
View/report issues

License

MIT (license)

Dependencies

flutter, http

More

Packages that depend on google_location_extract