File tree Expand file tree Collapse file tree 3 files changed +21
-1
lines changed Expand file tree Collapse file tree 3 files changed +21
-1
lines changed Original file line number Diff line number Diff line change 1
1
import 'package:collection/collection.dart' ;
2
2
import 'package:flutter/foundation.dart' ;
3
3
import 'package:flutter/material.dart' ;
4
+ import 'package:map_launcher/map_launcher.dart' ;
4
5
5
6
import 'MaterialIconsSelected.dart' ;
6
7
import 'main.dart' ;
@@ -171,10 +172,21 @@ class StudySpacePage extends StatelessWidget {
171
172
height:
172
173
Theme .of (context).textTheme.bodyLarge! .fontSize! / 2 ),
173
174
OutlinedButton .icon (
174
- onPressed: () {
175
+ onPressed: () async {
175
176
if (kDebugMode) {
176
177
print ("Tapped on the address of ${studySpace .title }." );
177
178
}
179
+ final availableMaps = await MapLauncher .installedMaps;
180
+ if (kDebugMode) {
181
+ print (availableMaps);
182
+ }
183
+
184
+ await availableMaps.first.showDirections (
185
+ destinationTitle: studySpace.title,
186
+ destination: Coords (studySpace.buildingPosition.latitude,
187
+ studySpace.buildingPosition.longitude),
188
+ directionsMode: DirectionsMode .walking,
189
+ );
178
190
},
179
191
icon: Icon (MaterialIconsSelected .place,
180
192
size: Theme .of (context).textTheme.bodyLarge! .fontSize! ),
Original file line number Diff line number Diff line change @@ -417,6 +417,13 @@ packages:
417
417
url: "https://pub.dartlang.org"
418
418
source: hosted
419
419
version: "1.0.2"
420
+ map_launcher:
421
+ dependency: "direct main"
422
+ description:
423
+ name: map_launcher
424
+ url: "https://pub.dartlang.org"
425
+ source: hosted
426
+ version: "2.2.1+2"
420
427
matcher:
421
428
dependency: transitive
422
429
description:
Original file line number Diff line number Diff line change @@ -19,6 +19,7 @@ dependencies:
19
19
json_serializable : ^6.1.5
20
20
flutter_native_splash : ^2.1.3+1
21
21
geolocator : ^8.2.0
22
+ map_launcher : ^2.2.1+2
22
23
23
24
dev_dependencies :
24
25
flutter_test :
You can’t perform that action at this time.
0 commit comments