|
@@ -5,6 +5,9 @@ import '../widgets/DataTableMySqlDemo/Especialista.dart';
|
5
|
5
|
import '../widgets/DataTableMySqlDemo/Services.dart';
|
6
|
6
|
import 'dart:async';
|
7
|
7
|
import '../widgets/functions.dart';
|
|
8
|
+import 'package:flutter/material.dart';
|
|
9
|
+import 'package:url_launcher/url_launcher.dart';
|
|
10
|
+
|
8
|
11
|
|
9
|
12
|
class VerOficina extends StatefulWidget{
|
10
|
13
|
VerOficina() : super();
|
|
@@ -238,7 +241,30 @@ class _VerOficinaState extends State<VerOficina>{
|
238
|
241
|
children: <Widget>[
|
239
|
242
|
TextButton(
|
240
|
243
|
child: const Text('Buscar en el mapa'),
|
241
|
|
- onPressed: () { /* ... */ },
|
|
244
|
+ onPressed: () {
|
|
245
|
+ setState(() async {
|
|
246
|
+ String destinationLatitude = "18.39007092764153";
|
|
247
|
+ String destinationLongitude = "-65.976216841223";
|
|
248
|
+ String originlatitude = "18.418738017376207";
|
|
249
|
+ String originlongitude = "-66.02565531285634";
|
|
250
|
+
|
|
251
|
+ //const url = 'https://www.google.com/maps/@42.585444,13.007813,6z';
|
|
252
|
+ const url = "https://www.google.com/maps/dir/?api=1¶meters&origin=18.418738017376207,-66.02565531285634&destination=18.39007092764153,-65.976216841223";
|
|
253
|
+ if (await canLaunch(url)) {
|
|
254
|
+ await launch(url);
|
|
255
|
+ } else {
|
|
256
|
+ throw 'Could not launch $url';
|
|
257
|
+ }
|
|
258
|
+
|
|
259
|
+ //String uri = "http://maps.google.com/maps?daddr=" + destinationLatitude + "," + destinationLongitude + " (" + "Doctor" + ")";
|
|
260
|
+ //Intent intent;
|
|
261
|
+ //intent.setAction(Action.ACTION_VIEW);
|
|
262
|
+ //Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(uri));
|
|
263
|
+ //intent.setPackage("com.google.android.apps.maps");
|
|
264
|
+ //startActivity(intent);
|
|
265
|
+ //UIApplication.shared.openURL(URL(string:"https://www.google.com/maps/@42.585444,13.007813,6z")!);
|
|
266
|
+ });
|
|
267
|
+ },
|
242
|
268
|
),
|
243
|
269
|
const SizedBox(width: 8),
|
244
|
270
|
],
|