I am developing a Flutter app, in which I need to show navigation to the user for a place. So, how can I open a map application from my Flutter app like we do using external
You can just use the url_launcher plugin to open maps. It launches map if installed or falls back to open the map on a browser.
Example:
import 'package:flutter/material.dart';
import 'package:url_launcher/url_launcher.dart';
void main() {
runApp(new Scaffold(
body: new Center(
child: new RaisedButton(
onPressed: _launchURL,
child: new Text('Launch Maps'),
),
),
));
}
_launchMaps() async {
const url = "https://www.google.com/maps/search/?api=1&query=LATITUDE,LONGITUDE,17&query_place_id=PLACE_ID";
if (await canLaunch(url)) {
await launch(url);
} else {
throw 'Could not launch Maps';
}
}
Hope that helps!