added livecard map shit

This commit is contained in:
Kima 2024-02-11 21:20:44 +01:00
parent a8a94f5f88
commit 120215d3b8
2 changed files with 23 additions and 3 deletions

View File

@ -1,3 +1,5 @@
import 'dart:io';
import 'package:animations/animations.dart'; import 'package:animations/animations.dart';
import 'package:filcnaplo/api/providers/user_provider.dart'; import 'package:filcnaplo/api/providers/user_provider.dart';
import 'package:filcnaplo/helpers/subject.dart'; import 'package:filcnaplo/helpers/subject.dart';
@ -105,8 +107,27 @@ class LiveCardStateA extends State<LiveCard> {
.format(DateTime.now()) .format(DateTime.now())
.capital(), .capital(),
icon: FeatherIcons.sun, icon: FeatherIcons.sun,
onTap: () => MapsLauncher.launchQuery( onTap: () async {
'${_userProvider.student?.school.city ?? ''} ${_userProvider.student?.school.name ?? ''}'), 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 description: liveCard.nextLesson != null
? Text.rich( ? Text.rich(
TextSpan( TextSpan(

View File

@ -62,7 +62,6 @@ dependencies:
git: git:
url: https://github.com/kimaah/image_crop.git url: https://github.com/kimaah/image_crop.git
uuid: ^4.2.2 uuid: ^4.2.2
maps_launcher: ^2.2.0
dev_dependencies: dev_dependencies:
flutter_lints: ^3.0.1 flutter_lints: ^3.0.1