besprechung

This commit is contained in:
Nico
2025-06-06 19:46:29 +02:00
parent 7d85090d4e
commit ccf1643711
13 changed files with 256 additions and 210 deletions

View File

@@ -167,7 +167,7 @@ class _ExcursionMainState extends State<ExcursionMain> {
rmap["BLand"]!["controller"]!.text = prefs.getString('bLand') ?? "";
});
rmap["Datum"]!["controller"]!.text = DateTime.now().toString();
rmap["Datum"]!["controller"]!.text = DateTime.now().toString().split(" ").first;
rmap["Sent"]!["controller"]!.text = "0";
}
@@ -205,7 +205,7 @@ class _ExcursionMainState extends State<ExcursionMain> {
Datum(
initDatum: DateTime.now(),
onDateChanged: (date) {
rmap["Datum"]!["controller"]!.text = date.toString();
rmap["Datum"]!["controller"]!.text = date.toString().split(" ").first;
},
name: AppLocalizations.of(context)!.date,
),
@@ -357,7 +357,7 @@ class _ExcursionMainState extends State<ExcursionMain> {
// Check for always permission before starting tracking
LocationPermission permission = await Geolocator.checkPermission();
if (permission != LocationPermission.always) {
if (mounted) {
if (context.mounted) {
bool? shouldContinue = await showDialog<bool>(
context: context,
builder: (context) => AlertDialog(
@@ -371,7 +371,7 @@ class _ExcursionMainState extends State<ExcursionMain> {
TextButton(
onPressed: () async {
await Geolocator.openAppSettings();
Navigator.of(context).pop(true);
if (context.mounted) Navigator.of(context).pop(true);
},
child: Text(AppLocalizations.of(context)!.openSettings),
),
@@ -387,7 +387,7 @@ class _ExcursionMainState extends State<ExcursionMain> {
// Try checking the permission multiple times
for (int i = 0; i < 5; i++) {
await Future.delayed(const Duration(seconds: 1));
if (!mounted) return;
if (!context.mounted) return;
permission = await Geolocator.checkPermission();
if (permission == LocationPermission.always) {
@@ -396,7 +396,7 @@ class _ExcursionMainState extends State<ExcursionMain> {
// If this is the last attempt and we still don't have permission
if (i == 4 && permission != LocationPermission.always) {
if (mounted) {
if (context.mounted) {
ScaffoldMessenger.of(context).showSnackBar(
SnackBar(
content: Text(AppLocalizations.of(context)!.permissionNotGranted),
@@ -410,7 +410,8 @@ class _ExcursionMainState extends State<ExcursionMain> {
}
}
await Navigator.push(context, MaterialPageRoute(
if (context.mounted) {
await Navigator.push(context, MaterialPageRoute(
builder: (context) {
return Tracking(
weg: rmap["Weg"]!["controller"]!,
@@ -418,6 +419,7 @@ class _ExcursionMainState extends State<ExcursionMain> {
);
},
));
}
setState(() {});
},
child: Text(AppLocalizations.of(context)!.trackingAnAusschalten),

View File

@@ -26,15 +26,15 @@ class _HinweiseState extends State<Hinweise> {
void initState() {
sonstigesController.addListener(updateController);
liegestelleChecked = widget.hinweise.text.contains("liegestelle") ? true : false;
kadaverChecked = widget.hinweise.text.contains("kadaver") ? true : false;
sichtungChecked = widget.hinweise.text.contains("sichtung") ? true : false;
heulenChecked = widget.hinweise.text.contains("heulen") ? true : false;
liegestelleChecked = widget.hinweise.text.contains("Liegestelle") ? true : false;
kadaverChecked = widget.hinweise.text.contains("Wildtierkadaver") ? true : false;
sichtungChecked = widget.hinweise.text.contains("Sichtung") ? true : false;
heulenChecked = widget.hinweise.text.contains("Heulen") ? true : false;
bool firstRun = true;
for (String val in widget.hinweise.text.split(",")) {
if (val != "liegestelle" && val != "kadaver" && val != "sichtung" && val != "heulen" && val != "") {
if (val != "Liegestelle" && val != "Wildtierkadaver" && val != "Sichtung" && val != "Heulen" && val != "") {
sonstigesChecked = true;
if (!firstRun) sonstigesController.text += ",";
sonstigesController.text += val;
@@ -53,10 +53,10 @@ class _HinweiseState extends State<Hinweise> {
void updateController() {
Map<String, bool> props = {
"liegestelle": liegestelleChecked,
"kadaver": kadaverChecked,
"sichtung": sichtungChecked,
"heulen": heulenChecked,
"Liegestelle": liegestelleChecked,
"Wildtierkadaver": kadaverChecked,
"Sichtung": sichtungChecked,
"Heulen": heulenChecked,
"sonstiges": sonstigesChecked
};
bool firstRun = true;

View File

@@ -215,7 +215,7 @@ class _TrackingState extends State<Tracking> {
currentPosition!.longitude,
),
radius: currentPosition!.accuracy,
color: Colors.blue.withOpacity(0.2),
color: Colors.blue.withAlpha(2),
borderColor: Colors.blue,
borderStrokeWidth: 2,
),