finished tracking. But not tested enough yet

time
This commit is contained in:
Nico
2025-05-19 22:11:52 +02:00
parent fccc810b8c
commit b97f703a47
18 changed files with 263 additions and 62 deletions

View File

@@ -6,6 +6,8 @@ import 'package:fforte/screens/sharedMethods/save_template.dart';
import 'package:fforte/screens/sharedMethods/save_main_entry.dart';
import 'package:flutter/material.dart';
import 'package:fforte/l10n/app_localizations.dart';
import 'package:geolocator/geolocator.dart';
import 'package:latlong2/latlong.dart';
class AddEntriesDialogHelper {
// Function to show the dialog where the user has to choose if he want to safe his values as a template
@@ -258,4 +260,67 @@ class AddEntriesDialogHelper {
},
);
}
static void locationSettingsDialog(BuildContext context) async {
return showDialog(
context: context,
barrierDismissible: true,
builder: (BuildContext context) {
return AlertDialog(
content: Text(AppLocalizations.of(context)!.needsAlwaysLocation),
actions: [
TextButton(
onPressed: () {
Geolocator.openAppSettings();
Navigator.pop(context);
},
child: Text("Ok"),
),
TextButton(
onPressed: () {},
child: Text(AppLocalizations.of(context)!.cancel),
),
],
);
},
);
}
static Future<bool> deleteCompleteRouteDialog(BuildContext context) async {
bool confirmed = false;
await showDialog(
context: context,
barrierDismissible: true,
builder: (BuildContext context) {
return AlertDialog(
title: Text(AppLocalizations.of(context)!.deleteEverything),
content: SingleChildScrollView(
child: ListBody(
children: <Widget>[
Text(AppLocalizations.of(context)!.deleteWholeRouteBody),
],
),
),
actions: [
TextButton(
onPressed: () {
confirmed = true;
Navigator.of(context).pop();
},
child: Text("Ok"),
),
TextButton(
onPressed: () => {
Navigator.of(context).pop()
},
child: Text(AppLocalizations.of(context)!.cancel),
),
],
);
},
);
return confirmed;
}
}