use Datum instead of KontDat
This commit is contained in:
@@ -21,6 +21,7 @@ import 'package:fforte/screens/sharedWidgets/var_text_field.dart';
|
||||
import 'package:fforte/l10n/app_localizations.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:geolocator/geolocator.dart';
|
||||
import 'package:shared_preferences/shared_preferences.dart';
|
||||
|
||||
class ExcursionMain extends StatefulWidget {
|
||||
final bool isTemplate;
|
||||
@@ -58,10 +59,9 @@ class _ExcursionMainState extends State<ExcursionMain> {
|
||||
Map<String, Map<String, dynamic>> rmap = {
|
||||
"ID": {"controller": TextEditingController(), "required": false},
|
||||
// Step 1
|
||||
"LogDat": {"controller": TextEditingController(), "required": false},
|
||||
"Datum": {"controller": TextEditingController(), "required": false},
|
||||
"Rudel": {"controller": TextEditingController(), "required": false},
|
||||
"Teilnehmer": {"controller": TextEditingController(), "required": false},
|
||||
"Jahr": {"controller": TextEditingController(), "required": false},
|
||||
"Dauer": {"controller": TextEditingController(), "required": false},
|
||||
"MHund": {"controller": TextEditingController(), "required": false},
|
||||
"MLeine": {"controller": TextEditingController(), "required": false},
|
||||
@@ -150,6 +150,11 @@ class _ExcursionMainState extends State<ExcursionMain> {
|
||||
rmap[key]!["controller"]!.text =
|
||||
widget.existingData?[key].toString() ?? "";
|
||||
}
|
||||
} else {
|
||||
// Set BLand if there is no existing data
|
||||
SharedPreferences.getInstance().then((prefs) {
|
||||
rmap["BLand"]!["controller"]!.text = prefs.getString('bLand') ?? "";
|
||||
});
|
||||
}
|
||||
|
||||
isTemplate = widget.isTemplate;
|
||||
@@ -186,7 +191,7 @@ class _ExcursionMainState extends State<ExcursionMain> {
|
||||
Datum(
|
||||
initDatum: DateTime.now(),
|
||||
onDateChanged: (date) {
|
||||
rmap["LogDat"]!["controller"]!.text = date.toString();
|
||||
rmap["Datum"]!["controller"]!.text = date.toString();
|
||||
},
|
||||
name: AppLocalizations.of(context)!.date,
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user