From 120215d3b861a5bcb462c3ae0c6797d7a46e1ed9 Mon Sep 17 00:00:00 2001 From: Kima Date: Sun, 11 Feb 2024 21:20:44 +0100 Subject: [PATCH] added livecard map shit --- .../lib/pages/home/live_card/live_card.dart | 25 +++++++++++++++++-- filcnaplo_mobile_ui/pubspec.yaml | 1 - 2 files changed, 23 insertions(+), 3 deletions(-) diff --git a/filcnaplo_mobile_ui/lib/pages/home/live_card/live_card.dart b/filcnaplo_mobile_ui/lib/pages/home/live_card/live_card.dart index a0fd60d..38762a7 100755 --- a/filcnaplo_mobile_ui/lib/pages/home/live_card/live_card.dart +++ b/filcnaplo_mobile_ui/lib/pages/home/live_card/live_card.dart @@ -1,3 +1,5 @@ +import 'dart:io'; + import 'package:animations/animations.dart'; import 'package:filcnaplo/api/providers/user_provider.dart'; import 'package:filcnaplo/helpers/subject.dart'; @@ -105,8 +107,27 @@ class LiveCardStateA extends State { .format(DateTime.now()) .capital(), icon: FeatherIcons.sun, - onTap: () => MapsLauncher.launchQuery( - '${_userProvider.student?.school.city ?? ''} ${_userProvider.student?.school.name ?? ''}'), + onTap: () async { + await MapsLauncher.launchQuery( + '${_userProvider.student?.school.city ?? ''} ${_userProvider.student?.school.name ?? ''}'); + // if (Platform.isIOS && + // (await MapLauncher.isMapAvailable(MapType.apple) ?? false)) { + // MapLauncher.showMarker( + // coords: Coords(0, 0), + // title: + // '${_userProvider.student?.school.city ?? ''} ${_userProvider.student?.school.name ?? ''}', + // mapType: MapType.apple, + // ); + // } else if (Platform.isAndroid && + // (await MapLauncher.isMapAvailable(MapType.google) ?? false)) { + // MapLauncher.showMarker( + // coords: Coords(0, 0), + // title: + // '${_userProvider.student?.school.city ?? ''} ${_userProvider.student?.school.name ?? ''}', + // mapType: MapType.google, + // ); + // } + }, description: liveCard.nextLesson != null ? Text.rich( TextSpan( diff --git a/filcnaplo_mobile_ui/pubspec.yaml b/filcnaplo_mobile_ui/pubspec.yaml index afe8489..1f46635 100644 --- a/filcnaplo_mobile_ui/pubspec.yaml +++ b/filcnaplo_mobile_ui/pubspec.yaml @@ -62,7 +62,6 @@ dependencies: git: url: https://github.com/kimaah/image_crop.git uuid: ^4.2.2 - maps_launcher: ^2.2.0 dev_dependencies: flutter_lints: ^3.0.1