luc sitzung

This commit is contained in:
nico
2024-04-24 21:45:13 +02:00
parent 3f61b740b8
commit 3be74688fd
12 changed files with 195 additions and 130 deletions

View File

@@ -302,20 +302,24 @@ class _AddCamMainState extends State<AddCamMain> {
try {
response = await dio.post(prefs.getString('apiAddress') ?? "",
data: jsonEncode(place));
print(jsonEncode(place));
} on DioException catch (e) {
if (e.response?.statusCode == 500) {
/* print('-------------------------');
print('code 500'); */
print('-------------------------');
print('code 500');
return;
}
}
if (response.statusCode == 201) {
// print(response.statusCode);
print("------------------");
print(response.statusCode);
var placeDB = DBHelper();
await placeDB.updateSent();
} else {
//print(response.statusCode);
print("----------------");
print("Anderer code");
print(response.statusCode);
}
}
@@ -397,6 +401,10 @@ class _AddCamMainState extends State<AddCamMain> {
Map<String, dynamic> place = getPlace();
await placeDB.addPlace(place);
if (widget.isTemplate) {
await placeDB.deleteTemplate(id.text);
}
}
// The widget tree which gets the shown widget from the ./cam_widgets.dart file
@@ -412,7 +420,7 @@ class _AddCamMainState extends State<AddCamMain> {
children: [
Align(
alignment: Alignment.bottomLeft,
child: RequiredVarTextField(
child: VarTextField(
required: true,
dbName: "Standort",
textController: standortC,
@@ -452,16 +460,24 @@ class _AddCamMainState extends State<AddCamMain> {
});
},
),
RequiredVarTextField(textController: betreuungC, localization: AppLocalizations.of(context)!.betreuung, dbName: "KontSum", required: false),
Betreuung(betreuungC: betreuungC),
VarTextField(
textController: betreuungC,
localization: AppLocalizations.of(context)!.betreuung,
dbName: "KontSum",
required: false),
const SizedBox(
height: 20,
),
CamId(id: id),
Align(
alignment: Alignment.bottomLeft,
child: FFTyp(ffTypC: ffTypC),
),
VarTextField(
textController: id,
localization: AppLocalizations.of(context)!.camLink,
dbName: "CID",
required: true),
VarTextField(
textController: ffTypC,
localization: AppLocalizations.of(context)!.fftyp,
dbName: "FFTyp",
required: true),
const SizedBox(
height: 15,
),
@@ -502,14 +518,11 @@ class _AddCamMainState extends State<AddCamMain> {
const SizedBox(
height: 15,
),
Align(
alignment: Alignment.bottomLeft,
child: KSchloNr(kSchloNrC: kSchloNrC),
),
VarTextField(textController: kSchloNrC, localization: AppLocalizations.of(context)!.kschlonr, dbName: "KSchloNr", required: false),
const SizedBox(
height: 5,
),
Rudel(rudelC: rudelC),
VarTextField(textController: rudelC, localization: AppLocalizations.of(context)!.rudel, dbName: "Rudel", required: true),
const SizedBox(
height: 15,
),
@@ -562,22 +575,10 @@ class _AddCamMainState extends State<AddCamMain> {
},
child: Text(AppLocalizations.of(context)!.openMap)),
),
Align(
alignment: Alignment.bottomLeft,
child: BLand(bLandC: bLandC),
),
Align(
alignment: Alignment.bottomLeft,
child: Lkr(lkrC: lkrC),
),
Align(
alignment: Alignment.bottomLeft,
child: BeiOrt(beiOrtC: beiOrtC),
),
Align(
alignment: Alignment.bottomLeft,
child: OrtInfo(ortInfoC: ortInfoC),
),
VarTextField(textController: bLandC, localization: AppLocalizations.of(context)!.bland, dbName: "BLand", required: true, default_value: "bLand",),
VarTextField(textController: lkrC, localization: AppLocalizations.of(context)!.lkr, dbName: "Lkr", required: true),
VarTextField(textController: beiOrtC, localization: AppLocalizations.of(context)!.beiort, dbName: "BeiOrt", required: true),
VarTextField(textController: ortInfoC, localization: AppLocalizations.of(context)!.ortinfo, dbName: "OrtInfo", required: false),
const SizedBox(
height: 15,
),
@@ -626,7 +627,7 @@ class _AddCamMainState extends State<AddCamMain> {
],
),
),
KTage1(kTage1C: kTage1C),
VarTextField(textController: kTage1C, localization: AppLocalizations.of(context)!.ktage1, dbName: "KTage1", required: true, default_value: "kTage1",),
const SizedBox(
height: 20,
),
@@ -641,26 +642,28 @@ class _AddCamMainState extends State<AddCamMain> {
)
],
)),
KTage2(kTage2C: kTage2C),
VarTextField(textController: kTage2C, localization: AppLocalizations.of(context)!.ktage2, dbName: "KTage1", required: true, default_value: "kTage2",),
const SizedBox(
height: 20,
),
AbbauDat(abbauDat: abbauDat),
Row(
children: [
AbbauDat(abbauDat: abbauDat),
ElevatedButton(
onPressed: () {
setState(() {
abbauDat = null;
});
},
child: const Text("X"))
],
),
const SizedBox(
height: 20,
),
Align(
alignment: Alignment.bottomLeft,
child: Auftrag(auftragC: auftragC),
),
Align(
alignment: Alignment.bottomLeft,
child: KontAbsp(kontAbspC: kontAbspC),
),
Align(
alignment: Alignment.bottomLeft,
child: SonstBem(sonstBemC: sonstBemC),
),
VarTextField(textController: auftragC, localization: AppLocalizations.of(context)!.auftrag, dbName: "Auftrag", required: false),
VarTextField(textController: kontAbspC, localization: AppLocalizations.of(context)!.kontabsp, dbName: "KontAbsp", required: false),
VarTextField(textController: sonstBemC, localization: AppLocalizations.of(context)!.sonstbemerkungen, dbName: "SonstBem", required: false),
],
)),
// Fourth step
@@ -671,36 +674,16 @@ class _AddCamMainState extends State<AddCamMain> {
const SizedBox(
height: 15,
),
Align(
alignment: Alignment.bottomLeft,
child: Adresse1(adresse1C: adresse1C)),
Align(
alignment: Alignment.bottomLeft,
child: Adresse2(adresse2C: adresse2C),
),
Align(
alignment: Alignment.bottomLeft,
child: Adresse3(adresse3C: adresse3C),
),
VarTextField(textController: adresse1C, localization: AppLocalizations.of(context)!.adresse1, dbName: "Adresse1", required: true),
VarTextField(textController: adresse2C, localization: AppLocalizations.of(context)!.adresse2, dbName: "Adresse2", required: false),
VarTextField(textController: adresse3C, localization: AppLocalizations.of(context)!.adresse3, dbName: "Adresse2", required: false),
const SizedBox(
height: 15,
),
Align(
alignment: Alignment.bottomLeft,
child: FKontakt1(fKontakt1C: fKontakt1C),
),
Align(
alignment: Alignment.bottomLeft,
child: FKontakt2(fKontakt2C: fKontakt2C),
),
Align(
alignment: Alignment.bottomLeft,
child: FKontakt3(fKontakt3C: fKontakt3C),
),
Align(
alignment: Alignment.bottomLeft,
child: IntKomm(intKommC: intKommC),
),
VarTextField(textController: fKontakt1C, localization: AppLocalizations.of(context)!.fkontakt1, dbName: "FKontakt1", required: false),
VarTextField(textController: fKontakt2C, localization: AppLocalizations.of(context)!.fkontakt2, dbName: "FKontakt2", required: false),
VarTextField(textController: fKontakt3C, localization: AppLocalizations.of(context)!.fkontakt3, dbName: "FKontakt3", required: false),
VarTextField(textController: intKommC, localization: AppLocalizations.of(context)!.intkomm, dbName: "IntKomm", required: false),
],
))
];