This commit is contained in:
nico
2024-04-16 17:35:55 +02:00
parent cbeedd2b04
commit d6ae86598d
6 changed files with 47 additions and 17 deletions

View File

@@ -1,5 +1,4 @@
todo: todo:
dropdown menü fixen (ai fragen)
fehler beim speichern anzeigen fehler beim speichern anzeigen
nach koordinaten lkr auswählen (esri-leaflet-geocoder) nach koordinaten lkr auswählen (esri-leaflet-geocoder)
fix ktage und nebeneinander positioniere fix ktage und nebeneinander positioniere
@@ -10,6 +9,7 @@ maybe auch vorschläge aus templates in dropdown menüs anzeigen
im englischen abändern im englischen abändern
keine ahnung obs funktioniert: keine ahnung obs funktioniert:
dropdown menü fixen (ai fragen)
eintrg in db wenn http response (in sent column) eintrg in db wenn http response (in sent column)

View File

@@ -256,8 +256,8 @@ class _AddCamMainState extends State<AddCamMain> {
child: Text(AppLocalizations.of(context)!.template)), child: Text(AppLocalizations.of(context)!.template)),
TextButton( TextButton(
onPressed: () async { onPressed: () async {
saveFile();
_httpRequest(); _httpRequest();
saveData();
Navigator.pushNamedAndRemoveUntil( Navigator.pushNamedAndRemoveUntil(
// ignore: use_build_context_synchronously // ignore: use_build_context_synchronously
context, context,
@@ -268,7 +268,7 @@ class _AddCamMainState extends State<AddCamMain> {
TextButton( TextButton(
onPressed: () async { onPressed: () async {
saveData(); saveData();
await saveFile(); saveFile();
// ignore: use_build_context_synchronously // ignore: use_build_context_synchronously
Navigator.pushNamedAndRemoveUntil( Navigator.pushNamedAndRemoveUntil(
// ignore: use_build_context_synchronously // ignore: use_build_context_synchronously
@@ -510,7 +510,7 @@ class _AddCamMainState extends State<AddCamMain> {
], ],
)), )),
// Second step // Second step
Step( Step(
title: Text(AppLocalizations.of(context)!.secondstep), title: Text(AppLocalizations.of(context)!.secondstep),
content: Column( content: Column(

View File

@@ -45,8 +45,8 @@ class _CamIdState extends State<CamId> {
Expanded( Expanded(
flex: 2, flex: 2,
child: TextField( child: TextField(
keyboardType: TextInputType.multiline, keyboardType: TextInputType.multiline,
maxLines: null, maxLines: null,
decoration: InputDecoration( decoration: InputDecoration(
hintText: AppLocalizations.of(context)!.camLink, hintText: AppLocalizations.of(context)!.camLink,
enabledBorder: widget.id.text.isEmpty enabledBorder: widget.id.text.isEmpty
@@ -233,7 +233,9 @@ class Karte extends StatefulWidget {
} }
class KarteState extends State<Karte> { class KarteState extends State<Karte> {
List<Marker> markers = [const Marker(point: LatLng(0, 0), child: Icon(Icons.location_on))]; List<Marker> markers = [
const Marker(point: LatLng(0, 0), child: Icon(Icons.location_on))
];
LatLng? selectedPosition; LatLng? selectedPosition;
Position? updatedPosition; Position? updatedPosition;
bool saveVisible = false; bool saveVisible = false;
@@ -241,7 +243,15 @@ class KarteState extends State<Karte> {
@override @override
void initState() { void initState() {
super.initState(); super.initState();
markers = [Marker(point: LatLng(widget.currentPosition.latitude, widget.currentPosition.longitude), child: const Icon(Icons.location_on, color: Colors.red,))]; markers = [
Marker(
point: LatLng(widget.currentPosition.latitude,
widget.currentPosition.longitude),
child: const Icon(
Icons.location_on,
color: Colors.red,
))
];
} }
@override @override
@@ -283,9 +293,12 @@ class KarteState extends State<Karte> {
], ],
), ),
body: FlutterMap( body: FlutterMap(
mapController: MapController(), mapController: MapController(),
options: MapOptions( options: MapOptions(
interactionOptions: const InteractionOptions(flags: InteractiveFlag.pinchZoom | InteractiveFlag.drag | InteractiveFlag.pinchMove), interactionOptions: const InteractionOptions(
flags: InteractiveFlag.pinchZoom |
InteractiveFlag.drag |
InteractiveFlag.pinchMove),
initialCenter: LatLng(widget.currentPosition.latitude, initialCenter: LatLng(widget.currentPosition.latitude,
widget.currentPosition.longitude), widget.currentPosition.longitude),
initialZoom: 16.0, initialZoom: 16.0,
@@ -406,7 +419,7 @@ class Adresse1 extends StatefulWidget {
const Adresse1({super.key, required this.adresse1C}); const Adresse1({super.key, required this.adresse1C});
@override @override
State<Adresse1> createState() => _Adresse1State(); State<Adresse1> createState() => _Adresse1State();
} }
class _Adresse1State extends State<Adresse1> { class _Adresse1State extends State<Adresse1> {
@@ -551,7 +564,8 @@ class _Adresse2State extends State<Adresse2> {
if (snapshot.hasData) { if (snapshot.hasData) {
return DropdownButton<String>( return DropdownButton<String>(
items: snapshot.data! items: snapshot.data!
.map((item) => buildMenuItem(item['Adresse2'].toString())) .map((item) =>
buildMenuItem(item['Adresse2'].toString()))
.toList(), .toList(),
onChanged: (value) { onChanged: (value) {
setState( setState(
@@ -1721,7 +1735,8 @@ class _AbbauDatState extends State<AbbauDat> {
), ),
Builder(builder: (context) { Builder(builder: (context) {
if (abbauDat != null) { if (abbauDat != null) {
return Text('${abbauDat?.day}. ${abbauDat?.month}. ${abbauDat?.year}'); return Text(
'${abbauDat?.day}. ${abbauDat?.month}. ${abbauDat?.year}');
} else { } else {
return Text(AppLocalizations.of(context)!.nichts); return Text(AppLocalizations.of(context)!.nichts);
} }
@@ -2270,8 +2285,11 @@ class _StandortState extends State<Standort> {
builder: (BuildContext context, builder: (BuildContext context,
AsyncSnapshot<List<Map<String, dynamic>>> snapshot) { AsyncSnapshot<List<Map<String, dynamic>>> snapshot) {
if (snapshot.hasData) { if (snapshot.hasData) {
var filteredData = snapshot.data!
.where((item) => item['Standort'] != null)
.toList();
return DropdownButton<String>( return DropdownButton<String>(
items: snapshot.data! items: filteredData
.map((item) => .map((item) =>
buildMenuItem(item['Standort'].toString())) buildMenuItem(item['Standort'].toString()))
.toList(), .toList(),
@@ -2305,7 +2323,6 @@ class _StandortState extends State<Standort> {
); );
} }
// KTage1 // KTage1
class KTage1 extends StatefulWidget { class KTage1 extends StatefulWidget {

View File

@@ -84,5 +84,7 @@
"filelocation": "Ort der zuletzt gespeicherten Datei:", "filelocation": "Ort der zuletzt gespeicherten Datei:",
"open": "öffnen", "open": "öffnen",
"date": "Datum", "date": "Datum",
"location": "Standort" "location": "Standort",
"placedata": "Standortdaten",
"sent": "Gesendet"
} }

View File

@@ -407,6 +407,16 @@
"location": "Location", "location": "Location",
"@location": { "@location": {
"description": "Location text" "description": "Location text"
},
"placedata": "Placedata",
"@camdata": {
"description": "view data placedata header"
},
"sent": "Sent",
"@sent": {
"description": "view data sent header"
} }
} }

View File

@@ -45,4 +45,5 @@
20 mär 6h 15 min 20 mär 6h 15 min
21 mär 4h 15 min 21 mär 4h 15 min
23 mär 2h 15 min 23 mär 2h 15 min
24 mär 1h 24 mär 1h
17 apr 45 min