Skip to content

Instantly share code, notes, and snippets.

@clairtonluz
Created January 24, 2019 14:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save clairtonluz/8ce0d321fbff0039eb631102d927f9e5 to your computer and use it in GitHub Desktop.
Save clairtonluz/8ce0d321fbff0039eb631102d927f9e5 to your computer and use it in GitHub Desktop.
import 'package:url_launcher/url_launcher.dart';
class MapUtils {
static openMap(double latitude, double longitude) async {
String googleUrl = 'https://www.google.com/maps/search/?api=1&query=$latitude,$longitude';
if (await canLaunch(googleUrl)) {
await launch(googleUrl);
} else {
throw 'Não foi possível abrir o mapa.';
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment