tabbing on finished entrie in view cams now leads to add cam window with normal save options
This commit is contained in:
3
Todo.txt
3
Todo.txt
@@ -1,5 +1,4 @@
|
|||||||
todo:
|
todo:
|
||||||
möglichkeit einfügen um nicht gesendete einträge zu senden
|
|
||||||
im englischen abändern
|
im englischen abändern
|
||||||
redesign datenansicht
|
redesign datenansicht
|
||||||
ausvon und ausbis fixen (falsches datum übergeben (20000-01-01))
|
ausvon und ausbis fixen (falsches datum übergeben (20000-01-01))
|
||||||
@@ -12,13 +11,13 @@ sandorte ansehen in karte (extra tab)
|
|||||||
Platzierung garnix als standart aber pflichtfeld
|
Platzierung garnix als standart aber pflichtfeld
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
keine ahnung obs funktioniert:
|
keine ahnung obs funktioniert:
|
||||||
TEST SEND FILE TO SERVER FUNCTION
|
TEST SEND FILE TO SERVER FUNCTION
|
||||||
eintrg in db wenn http response (in sent column)
|
eintrg in db wenn http response (in sent column)
|
||||||
|
|
||||||
|
|
||||||
not to do:
|
not to do:
|
||||||
|
möglichkeit einfügen um nicht gesendete einträge zu senden
|
||||||
save option einfügen nur zum speichern
|
save option einfügen nur zum speichern
|
||||||
maybe auch vorschläge aus templates in dropdown menüs anzeigen
|
maybe auch vorschläge aus templates in dropdown menüs anzeigen
|
||||||
fehler beim speichern anzeigen
|
fehler beim speichern anzeigen
|
||||||
|
|||||||
@@ -15,9 +15,10 @@ import 'package:shared_preferences/shared_preferences.dart';
|
|||||||
|
|
||||||
class AddCamMain extends StatefulWidget {
|
class AddCamMain extends StatefulWidget {
|
||||||
final bool isTemplate;
|
final bool isTemplate;
|
||||||
final Map<String, dynamic>? templateData;
|
final bool isFinished;
|
||||||
|
final Map<String, dynamic>? existingData;
|
||||||
|
|
||||||
const AddCamMain({super.key, this.isTemplate = false, this.templateData});
|
const AddCamMain({super.key, this.isTemplate = false, this.existingData, this.isFinished = false});
|
||||||
|
|
||||||
@override
|
@override
|
||||||
State<AddCamMain> createState() => _AddCamMainState();
|
State<AddCamMain> createState() => _AddCamMainState();
|
||||||
@@ -26,7 +27,7 @@ class AddCamMain extends StatefulWidget {
|
|||||||
class _AddCamMainState extends State<AddCamMain> {
|
class _AddCamMainState extends State<AddCamMain> {
|
||||||
// var declaration
|
// var declaration
|
||||||
int currentStep = 0;
|
int currentStep = 0;
|
||||||
bool isTemplate = false;
|
// bool isTemplate = false;
|
||||||
|
|
||||||
TextEditingController id = TextEditingController();
|
TextEditingController id = TextEditingController();
|
||||||
TextEditingController rudelC = TextEditingController();
|
TextEditingController rudelC = TextEditingController();
|
||||||
@@ -171,39 +172,39 @@ class _AddCamMainState extends State<AddCamMain> {
|
|||||||
});
|
});
|
||||||
|
|
||||||
// If a template is edited this fills in the existing values
|
// If a template is edited this fills in the existing values
|
||||||
if (widget.isTemplate && widget.templateData != null) {
|
if (widget.isTemplate || widget.isFinished && widget.existingData != null) {
|
||||||
id.text = widget.templateData!['CID'];
|
id.text = widget.existingData!['CID'];
|
||||||
rudelC.text = widget.templateData!['Rudel'];
|
rudelC.text = widget.existingData!['Rudel'];
|
||||||
adresse1C.text = widget.templateData!['Adresse1'];
|
adresse1C.text = widget.existingData!['Adresse1'];
|
||||||
adresse2C.text = widget.templateData!['Adresse2'];
|
adresse2C.text = widget.existingData!['Adresse2'];
|
||||||
adresse3C.text = widget.templateData!['Adresse3'];
|
adresse3C.text = widget.existingData!['Adresse3'];
|
||||||
bLandC.text = widget.templateData!['BLand'];
|
bLandC.text = widget.existingData!['BLand'];
|
||||||
lkrC.text = widget.templateData!['Lkr'];
|
lkrC.text = widget.existingData!['Lkr'];
|
||||||
beiOrtC.text = widget.templateData!['BeiOrt'];
|
beiOrtC.text = widget.existingData!['BeiOrt'];
|
||||||
ortInfoC.text = widget.templateData!['OrtInfo'];
|
ortInfoC.text = widget.existingData!['OrtInfo'];
|
||||||
selectedStatus = widget.templateData!['Status'];
|
selectedStatus = widget.existingData!['Status'];
|
||||||
selectedSTTyp = widget.templateData!['STTyp'];
|
selectedSTTyp = widget.existingData!['STTyp'];
|
||||||
ffTypC.text = widget.templateData!['FFTyp'];
|
ffTypC.text = widget.existingData!['FFTyp'];
|
||||||
selectedFotoFilm = widget.templateData!['FotoFilm'];
|
selectedFotoFilm = widget.existingData!['FotoFilm'];
|
||||||
selectedMEZ = widget.templateData!['MEZ'];
|
selectedMEZ = widget.existingData!['MEZ'];
|
||||||
selectedPlatzung = widget.templateData!['Platzung'];
|
selectedPlatzung = widget.existingData!['Platzung'];
|
||||||
kSchloNrC.text = widget.templateData!['KSchloNr'];
|
kSchloNrC.text = widget.existingData!['KSchloNr'];
|
||||||
selectedBearsafe = widget.templateData!['Bearsafe'];
|
selectedBearsafe = widget.existingData!['Bearsafe'];
|
||||||
datumS = widget.templateData!['Datum'];
|
datumS = widget.existingData!['Datum'];
|
||||||
kontDatS = widget.templateData!['KontDat'];
|
kontDatS = widget.existingData!['KontDat'];
|
||||||
abbauDatS = widget.templateData!['AbbauDat'];
|
abbauDatS = widget.existingData!['AbbauDat'];
|
||||||
auftragC.text = widget.templateData!['Auftrag'];
|
auftragC.text = widget.existingData!['Auftrag'];
|
||||||
kontAbspC.text = widget.templateData!['KontAbsp'];
|
kontAbspC.text = widget.existingData!['KontAbsp'];
|
||||||
sonstBemC.text = widget.templateData!['SonstBem'];
|
sonstBemC.text = widget.existingData!['SonstBem'];
|
||||||
fKontakt1C.text = widget.templateData!['FKontakt1'];
|
fKontakt1C.text = widget.existingData!['FKontakt1'];
|
||||||
fKontakt2C.text = widget.templateData!['FKontakt2'];
|
fKontakt2C.text = widget.existingData!['FKontakt2'];
|
||||||
fKontakt3C.text = widget.templateData!['FKontakt3'];
|
fKontakt3C.text = widget.existingData!['FKontakt3'];
|
||||||
standortC.text = widget.templateData!['Standort'];
|
standortC.text = widget.existingData!['Standort'];
|
||||||
kTage1C.text = widget.templateData!['KTage1'].toString();
|
kTage1C.text = widget.existingData!['KTage1'].toString();
|
||||||
kTage2C.text = widget.templateData!['KTage2'].toString();
|
kTage2C.text = widget.existingData!['KTage2'].toString();
|
||||||
protoAmS = widget.templateData!['ProtoAm'];
|
protoAmS = widget.existingData!['ProtoAm'];
|
||||||
intKommC.text = widget.templateData!['IntKomm'];
|
intKommC.text = widget.existingData!['IntKomm'];
|
||||||
betreuungC.text = widget.templateData!['Betreuung'];
|
betreuungC.text = widget.existingData!['Betreuung'];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -240,7 +241,6 @@ class _AddCamMainState extends State<AddCamMain> {
|
|||||||
return showDialog(
|
return showDialog(
|
||||||
context: context,
|
context: context,
|
||||||
builder: (BuildContext context) {
|
builder: (BuildContext context) {
|
||||||
var dialogContext = context;
|
|
||||||
return AlertDialog(
|
return AlertDialog(
|
||||||
title: Text(AppLocalizations.of(context)!.savemethod),
|
title: Text(AppLocalizations.of(context)!.savemethod),
|
||||||
actions: [
|
actions: [
|
||||||
@@ -283,7 +283,7 @@ class _AddCamMainState extends State<AddCamMain> {
|
|||||||
}, child: Text(AppLocalizations.of(context)!.justsave)),
|
}, child: Text(AppLocalizations.of(context)!.justsave)),
|
||||||
TextButton(
|
TextButton(
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
Navigator.pop(dialogContext);
|
Navigator.pop(context);
|
||||||
},
|
},
|
||||||
child: Text(AppLocalizations.of(context)!.cancel)),
|
child: Text(AppLocalizations.of(context)!.cancel)),
|
||||||
],
|
],
|
||||||
@@ -291,6 +291,7 @@ class _AddCamMainState extends State<AddCamMain> {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void _httpRequest() async {
|
void _httpRequest() async {
|
||||||
Map<String, dynamic> place = getPlace();
|
Map<String, dynamic> place = getPlace();
|
||||||
|
|
||||||
@@ -393,7 +394,7 @@ class _AddCamMainState extends State<AddCamMain> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (emptyFields.isEmpty) empty = true;
|
if (emptyFields.isNotEmpty) empty = true;
|
||||||
|
|
||||||
return emptyFields;
|
return emptyFields;
|
||||||
}
|
}
|
||||||
@@ -826,7 +827,6 @@ class _AddCamMainState extends State<AddCamMain> {
|
|||||||
empty = false;
|
empty = false;
|
||||||
if (empty == true) {
|
if (empty == true) {
|
||||||
showTemplateDialog(emptyFields);
|
showTemplateDialog(emptyFields);
|
||||||
();
|
|
||||||
return;
|
return;
|
||||||
} else if (empty == false) {
|
} else if (empty == false) {
|
||||||
await showSaveOptionsDialog();
|
await showSaveOptionsDialog();
|
||||||
|
|||||||
@@ -91,5 +91,6 @@
|
|||||||
"sent": "Gesendet",
|
"sent": "Gesendet",
|
||||||
"savefilefailed": "Fehler. Bitte nochmal versuchen",
|
"savefilefailed": "Fehler. Bitte nochmal versuchen",
|
||||||
"justplace": "Standort",
|
"justplace": "Standort",
|
||||||
"justsave": "Nur speichern"
|
"justsave": "Nur speichern",
|
||||||
|
"finishedentrie": "Bereits fertiger Eintrag"
|
||||||
}
|
}
|
||||||
@@ -442,6 +442,11 @@
|
|||||||
"justsave": "Just save",
|
"justsave": "Just save",
|
||||||
"@justsave": {
|
"@justsave": {
|
||||||
"description": "Just save in the database save options dialog"
|
"description": "Just save in the database save options dialog"
|
||||||
|
},
|
||||||
|
|
||||||
|
"finishedentrie": "Already finished entrie",
|
||||||
|
"@finishedentrie": {
|
||||||
|
"description": "already finished entrie options dialog header"
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -48,7 +48,7 @@ class DBHelper {
|
|||||||
|
|
||||||
// checks if the camid var from before is empty to avoid double entries
|
// checks if the camid var from before is empty to avoid double entries
|
||||||
if (existingCID.isNotEmpty) {
|
if (existingCID.isNotEmpty) {
|
||||||
//throw Exception("Eintrag existiert schon");
|
updatePlace(place);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -62,6 +62,17 @@ class DBHelper {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Future<void> updatePlace(Map<String, dynamic> place) async {
|
||||||
|
var placeDBClient = await placeDB;
|
||||||
|
|
||||||
|
await placeDBClient.update(
|
||||||
|
'place',
|
||||||
|
place,
|
||||||
|
where: "CID = ?",
|
||||||
|
whereArgs: [place['CID']]
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
// function to update the sent value
|
// function to update the sent value
|
||||||
Future<void> updateSent() async {
|
Future<void> updateSent() async {
|
||||||
var placeDBClient = await placeDB;
|
var placeDBClient = await placeDB;
|
||||||
|
|||||||
@@ -2,7 +2,6 @@ import 'package:fforte/addCam/add_cam_main.dart';
|
|||||||
import 'package:fforte/other/db_helper.dart';
|
import 'package:fforte/other/db_helper.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_gen/gen_l10n/app_localizations.dart';
|
import 'package:flutter_gen/gen_l10n/app_localizations.dart';
|
||||||
import 'package:flutter_popup_card/flutter_popup_card.dart';
|
|
||||||
// * Site that shows all entries in the databases
|
// * Site that shows all entries in the databases
|
||||||
|
|
||||||
class ViewCams extends StatefulWidget {
|
class ViewCams extends StatefulWidget {
|
||||||
@@ -160,7 +159,18 @@ class _ViewCamsState extends State<ViewCams> {
|
|||||||
onChanged: null,
|
onChanged: null,
|
||||||
),
|
),
|
||||||
onTap: () async {
|
onTap: () async {
|
||||||
showPopupCard(
|
|
||||||
|
Navigator.push(
|
||||||
|
context,
|
||||||
|
MaterialPageRoute(builder: (context) =>
|
||||||
|
AddCamMain(
|
||||||
|
isFinished: true,
|
||||||
|
existingData: place,
|
||||||
|
)
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
/* showPopupCard(
|
||||||
context: context,
|
context: context,
|
||||||
builder: (context) {
|
builder: (context) {
|
||||||
return PopupCard(
|
return PopupCard(
|
||||||
@@ -257,7 +267,7 @@ class _ViewCamsState extends State<ViewCams> {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
});
|
}); */
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
@@ -299,7 +309,8 @@ class _ViewCamsState extends State<ViewCams> {
|
|||||||
builder: (context) =>
|
builder: (context) =>
|
||||||
AddCamMain(
|
AddCamMain(
|
||||||
isTemplate: true,
|
isTemplate: true,
|
||||||
templateData: templates,
|
isFinished: false,
|
||||||
|
existingData: templates,
|
||||||
)));
|
)));
|
||||||
},
|
},
|
||||||
title: Text('Place ${index + 1}'),
|
title: Text('Place ${index + 1}'),
|
||||||
|
|||||||
Reference in New Issue
Block a user