Browse Source

Union Sprint 3 Carlos

Oniel Mendez 4 years ago
parent
commit
0876c368c6

+ 27
- 1
fast_med_flutter/lib/routes/ver_oficina.dart View File

5
 import '../widgets/DataTableMySqlDemo/Services.dart';
5
 import '../widgets/DataTableMySqlDemo/Services.dart';
6
 import 'dart:async';
6
 import 'dart:async';
7
 import '../widgets/functions.dart';
7
 import '../widgets/functions.dart';
8
+import 'package:flutter/material.dart';
9
+import 'package:url_launcher/url_launcher.dart';
10
+
8
 
11
 
9
 class VerOficina extends StatefulWidget{
12
 class VerOficina extends StatefulWidget{
10
   VerOficina() : super();
13
   VerOficina() : super();
238
                     children: <Widget>[
241
                     children: <Widget>[
239
                       TextButton(
242
                       TextButton(
240
                         child: const Text('Buscar en el mapa'),
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&parameters&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
                       const SizedBox(width: 8),
269
                       const SizedBox(width: 8),
244
                     ],
270
                     ],

+ 43
- 1
fast_med_flutter/pubspec.lock View File

399
       url: "https://pub.dartlang.org"
399
       url: "https://pub.dartlang.org"
400
     source: hosted
400
     source: hosted
401
     version: "1.3.0-nullsafety.3"
401
     version: "1.3.0-nullsafety.3"
402
+  url_launcher:
403
+    dependency: "direct main"
404
+    description:
405
+      name: url_launcher
406
+      url: "https://pub.dartlang.org"
407
+    source: hosted
408
+    version: "5.7.10"
409
+  url_launcher_linux:
410
+    dependency: transitive
411
+    description:
412
+      name: url_launcher_linux
413
+      url: "https://pub.dartlang.org"
414
+    source: hosted
415
+    version: "0.0.1+4"
416
+  url_launcher_macos:
417
+    dependency: transitive
418
+    description:
419
+      name: url_launcher_macos
420
+      url: "https://pub.dartlang.org"
421
+    source: hosted
422
+    version: "0.0.1+9"
423
+  url_launcher_platform_interface:
424
+    dependency: transitive
425
+    description:
426
+      name: url_launcher_platform_interface
427
+      url: "https://pub.dartlang.org"
428
+    source: hosted
429
+    version: "1.0.9"
430
+  url_launcher_web:
431
+    dependency: transitive
432
+    description:
433
+      name: url_launcher_web
434
+      url: "https://pub.dartlang.org"
435
+    source: hosted
436
+    version: "0.1.5+1"
437
+  url_launcher_windows:
438
+    dependency: transitive
439
+    description:
440
+      name: url_launcher_windows
441
+      url: "https://pub.dartlang.org"
442
+    source: hosted
443
+    version: "0.0.1+3"
402
   vector_math:
444
   vector_math:
403
     dependency: transitive
445
     dependency: transitive
404
     description:
446
     description:
422
     version: "0.1.2"
464
     version: "0.1.2"
423
 sdks:
465
 sdks:
424
   dart: ">=2.10.0-110 <2.11.0"
466
   dart: ">=2.10.0-110 <2.11.0"
425
-  flutter: ">=1.17.0 <2.0.0"
467
+  flutter: ">=1.22.0 <2.0.0"

+ 1
- 0
fast_med_flutter/pubspec.yaml View File

23
 dependencies:
23
 dependencies:
24
   flutter:
24
   flutter:
25
     sdk: flutter
25
     sdk: flutter
26
+  url_launcher: ^5.4.0
26
 
27
 
27
   firebase_helpers: ^0.1.8
28
   firebase_helpers: ^0.1.8
28
   cloud_firestore: ^0.13.5
29
   cloud_firestore: ^0.13.5