luc sitzung
This commit is contained in:
12
Todo.txt
12
Todo.txt
@@ -1,33 +1,31 @@
|
|||||||
todo:
|
todo:
|
||||||
<<<<<<< HEAD
|
|
||||||
TEST SEND FILE TO SERVER FUNCTION
|
|
||||||
maybe auch vorschläge aus templates in dropdown menüs anzeigen
|
maybe auch vorschläge aus templates in dropdown menüs anzeigen
|
||||||
im englischen abändern
|
im englischen abändern
|
||||||
zurückfeld in datenansicht
|
zurückfeld in datenansicht
|
||||||
überschriften für view cams
|
überschriften für view cams
|
||||||
dropdown menü fixen (ai fragen)
|
dropdown menü fixen (ai fragen)
|
||||||
=======
|
|
||||||
>>>>>>> d6ae86598dd9d031af9fe29680dc050c5bb2946f
|
|
||||||
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
|
||||||
textdateien auch an server senden
|
textdateien auch an server senden
|
||||||
<<<<<<< HEAD
|
|
||||||
error check wenn dateiauswahl abgebrochen wurde einfügen
|
error check wenn dateiauswahl abgebrochen wurde einfügen
|
||||||
save option einfügen nur zum speichern
|
save option einfügen nur zum speichern
|
||||||
=======
|
|
||||||
ausvon und ausbis fixen (falsches datum übergeben (20000-01-01))
|
ausvon und ausbis fixen (falsches datum übergeben (20000-01-01))
|
||||||
zurückfeld in datenansicht
|
zurückfeld in datenansicht
|
||||||
maybe auch vorschläge aus templates in dropdown menüs anzeigen
|
maybe auch vorschläge aus templates in dropdown menüs anzeigen
|
||||||
im englischen abändern
|
im englischen abändern
|
||||||
>>>>>>> d6ae86598dd9d031af9fe29680dc050c5bb2946f
|
einzelnen eintrag löschen
|
||||||
|
alle datumsfelder in 1 klasse und überarbeiten dass entfernen funktioniert und knöpfe bissl breiter
|
||||||
|
|
||||||
|
|
||||||
keine ahnung obs funktioniert:
|
keine ahnung obs funktioniert:
|
||||||
dropdown menü fixen (ai fragen)
|
dropdown menü fixen (ai fragen)
|
||||||
|
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:
|
||||||
|
standartwert in textfeld
|
||||||
überschriften für view cams
|
überschriften für view cams
|
||||||
schritte latlang umbenennen
|
schritte latlang umbenennen
|
||||||
gespeicherten ordner anzeigen
|
gespeicherten ordner anzeigen
|
||||||
|
|||||||
BIN
assets/images/reconix_small.png
Normal file
BIN
assets/images/reconix_small.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 39 KiB |
@@ -302,20 +302,24 @@ class _AddCamMainState extends State<AddCamMain> {
|
|||||||
try {
|
try {
|
||||||
response = await dio.post(prefs.getString('apiAddress') ?? "",
|
response = await dio.post(prefs.getString('apiAddress') ?? "",
|
||||||
data: jsonEncode(place));
|
data: jsonEncode(place));
|
||||||
|
print(jsonEncode(place));
|
||||||
} on DioException catch (e) {
|
} on DioException catch (e) {
|
||||||
if (e.response?.statusCode == 500) {
|
if (e.response?.statusCode == 500) {
|
||||||
/* print('-------------------------');
|
print('-------------------------');
|
||||||
print('code 500'); */
|
print('code 500');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (response.statusCode == 201) {
|
if (response.statusCode == 201) {
|
||||||
// print(response.statusCode);
|
print("------------------");
|
||||||
|
print(response.statusCode);
|
||||||
var placeDB = DBHelper();
|
var placeDB = DBHelper();
|
||||||
|
|
||||||
await placeDB.updateSent();
|
await placeDB.updateSent();
|
||||||
} else {
|
} 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();
|
Map<String, dynamic> place = getPlace();
|
||||||
|
|
||||||
await placeDB.addPlace(place);
|
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
|
// The widget tree which gets the shown widget from the ./cam_widgets.dart file
|
||||||
@@ -412,7 +420,7 @@ class _AddCamMainState extends State<AddCamMain> {
|
|||||||
children: [
|
children: [
|
||||||
Align(
|
Align(
|
||||||
alignment: Alignment.bottomLeft,
|
alignment: Alignment.bottomLeft,
|
||||||
child: RequiredVarTextField(
|
child: VarTextField(
|
||||||
required: true,
|
required: true,
|
||||||
dbName: "Standort",
|
dbName: "Standort",
|
||||||
textController: standortC,
|
textController: standortC,
|
||||||
@@ -452,16 +460,24 @@ class _AddCamMainState extends State<AddCamMain> {
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
RequiredVarTextField(textController: betreuungC, localization: AppLocalizations.of(context)!.betreuung, dbName: "KontSum", required: false),
|
VarTextField(
|
||||||
Betreuung(betreuungC: betreuungC),
|
textController: betreuungC,
|
||||||
|
localization: AppLocalizations.of(context)!.betreuung,
|
||||||
|
dbName: "KontSum",
|
||||||
|
required: false),
|
||||||
const SizedBox(
|
const SizedBox(
|
||||||
height: 20,
|
height: 20,
|
||||||
),
|
),
|
||||||
CamId(id: id),
|
VarTextField(
|
||||||
Align(
|
textController: id,
|
||||||
alignment: Alignment.bottomLeft,
|
localization: AppLocalizations.of(context)!.camLink,
|
||||||
child: FFTyp(ffTypC: ffTypC),
|
dbName: "CID",
|
||||||
),
|
required: true),
|
||||||
|
VarTextField(
|
||||||
|
textController: ffTypC,
|
||||||
|
localization: AppLocalizations.of(context)!.fftyp,
|
||||||
|
dbName: "FFTyp",
|
||||||
|
required: true),
|
||||||
const SizedBox(
|
const SizedBox(
|
||||||
height: 15,
|
height: 15,
|
||||||
),
|
),
|
||||||
@@ -502,14 +518,11 @@ class _AddCamMainState extends State<AddCamMain> {
|
|||||||
const SizedBox(
|
const SizedBox(
|
||||||
height: 15,
|
height: 15,
|
||||||
),
|
),
|
||||||
Align(
|
VarTextField(textController: kSchloNrC, localization: AppLocalizations.of(context)!.kschlonr, dbName: "KSchloNr", required: false),
|
||||||
alignment: Alignment.bottomLeft,
|
|
||||||
child: KSchloNr(kSchloNrC: kSchloNrC),
|
|
||||||
),
|
|
||||||
const SizedBox(
|
const SizedBox(
|
||||||
height: 5,
|
height: 5,
|
||||||
),
|
),
|
||||||
Rudel(rudelC: rudelC),
|
VarTextField(textController: rudelC, localization: AppLocalizations.of(context)!.rudel, dbName: "Rudel", required: true),
|
||||||
const SizedBox(
|
const SizedBox(
|
||||||
height: 15,
|
height: 15,
|
||||||
),
|
),
|
||||||
@@ -562,22 +575,10 @@ class _AddCamMainState extends State<AddCamMain> {
|
|||||||
},
|
},
|
||||||
child: Text(AppLocalizations.of(context)!.openMap)),
|
child: Text(AppLocalizations.of(context)!.openMap)),
|
||||||
),
|
),
|
||||||
Align(
|
VarTextField(textController: bLandC, localization: AppLocalizations.of(context)!.bland, dbName: "BLand", required: true, default_value: "bLand",),
|
||||||
alignment: Alignment.bottomLeft,
|
VarTextField(textController: lkrC, localization: AppLocalizations.of(context)!.lkr, dbName: "Lkr", required: true),
|
||||||
child: BLand(bLandC: bLandC),
|
VarTextField(textController: beiOrtC, localization: AppLocalizations.of(context)!.beiort, dbName: "BeiOrt", required: true),
|
||||||
),
|
VarTextField(textController: ortInfoC, localization: AppLocalizations.of(context)!.ortinfo, dbName: "OrtInfo", required: false),
|
||||||
Align(
|
|
||||||
alignment: Alignment.bottomLeft,
|
|
||||||
child: Lkr(lkrC: lkrC),
|
|
||||||
),
|
|
||||||
Align(
|
|
||||||
alignment: Alignment.bottomLeft,
|
|
||||||
child: BeiOrt(beiOrtC: beiOrtC),
|
|
||||||
),
|
|
||||||
Align(
|
|
||||||
alignment: Alignment.bottomLeft,
|
|
||||||
child: OrtInfo(ortInfoC: ortInfoC),
|
|
||||||
),
|
|
||||||
const SizedBox(
|
const SizedBox(
|
||||||
height: 15,
|
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(
|
const SizedBox(
|
||||||
height: 20,
|
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(
|
const SizedBox(
|
||||||
height: 20,
|
height: 20,
|
||||||
),
|
),
|
||||||
AbbauDat(abbauDat: abbauDat),
|
Row(
|
||||||
|
children: [
|
||||||
|
AbbauDat(abbauDat: abbauDat),
|
||||||
|
ElevatedButton(
|
||||||
|
onPressed: () {
|
||||||
|
setState(() {
|
||||||
|
abbauDat = null;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
child: const Text("X"))
|
||||||
|
],
|
||||||
|
),
|
||||||
const SizedBox(
|
const SizedBox(
|
||||||
height: 20,
|
height: 20,
|
||||||
),
|
),
|
||||||
Align(
|
VarTextField(textController: auftragC, localization: AppLocalizations.of(context)!.auftrag, dbName: "Auftrag", required: false),
|
||||||
alignment: Alignment.bottomLeft,
|
VarTextField(textController: kontAbspC, localization: AppLocalizations.of(context)!.kontabsp, dbName: "KontAbsp", required: false),
|
||||||
child: Auftrag(auftragC: auftragC),
|
VarTextField(textController: sonstBemC, localization: AppLocalizations.of(context)!.sonstbemerkungen, dbName: "SonstBem", required: false),
|
||||||
),
|
|
||||||
Align(
|
|
||||||
alignment: Alignment.bottomLeft,
|
|
||||||
child: KontAbsp(kontAbspC: kontAbspC),
|
|
||||||
),
|
|
||||||
Align(
|
|
||||||
alignment: Alignment.bottomLeft,
|
|
||||||
child: SonstBem(sonstBemC: sonstBemC),
|
|
||||||
),
|
|
||||||
],
|
],
|
||||||
)),
|
)),
|
||||||
// Fourth step
|
// Fourth step
|
||||||
@@ -671,36 +674,16 @@ class _AddCamMainState extends State<AddCamMain> {
|
|||||||
const SizedBox(
|
const SizedBox(
|
||||||
height: 15,
|
height: 15,
|
||||||
),
|
),
|
||||||
Align(
|
VarTextField(textController: adresse1C, localization: AppLocalizations.of(context)!.adresse1, dbName: "Adresse1", required: true),
|
||||||
alignment: Alignment.bottomLeft,
|
VarTextField(textController: adresse2C, localization: AppLocalizations.of(context)!.adresse2, dbName: "Adresse2", required: false),
|
||||||
child: Adresse1(adresse1C: adresse1C)),
|
VarTextField(textController: adresse3C, localization: AppLocalizations.of(context)!.adresse3, dbName: "Adresse2", required: false),
|
||||||
Align(
|
|
||||||
alignment: Alignment.bottomLeft,
|
|
||||||
child: Adresse2(adresse2C: adresse2C),
|
|
||||||
),
|
|
||||||
Align(
|
|
||||||
alignment: Alignment.bottomLeft,
|
|
||||||
child: Adresse3(adresse3C: adresse3C),
|
|
||||||
),
|
|
||||||
const SizedBox(
|
const SizedBox(
|
||||||
height: 15,
|
height: 15,
|
||||||
),
|
),
|
||||||
Align(
|
VarTextField(textController: fKontakt1C, localization: AppLocalizations.of(context)!.fkontakt1, dbName: "FKontakt1", required: false),
|
||||||
alignment: Alignment.bottomLeft,
|
VarTextField(textController: fKontakt2C, localization: AppLocalizations.of(context)!.fkontakt2, dbName: "FKontakt2", required: false),
|
||||||
child: FKontakt1(fKontakt1C: fKontakt1C),
|
VarTextField(textController: fKontakt3C, localization: AppLocalizations.of(context)!.fkontakt3, dbName: "FKontakt3", required: false),
|
||||||
),
|
VarTextField(textController: intKommC, localization: AppLocalizations.of(context)!.intkomm, dbName: "IntKomm", required: false),
|
||||||
Align(
|
|
||||||
alignment: Alignment.bottomLeft,
|
|
||||||
child: FKontakt2(fKontakt2C: fKontakt2C),
|
|
||||||
),
|
|
||||||
Align(
|
|
||||||
alignment: Alignment.bottomLeft,
|
|
||||||
child: FKontakt3(fKontakt3C: fKontakt3C),
|
|
||||||
),
|
|
||||||
Align(
|
|
||||||
alignment: Alignment.bottomLeft,
|
|
||||||
child: IntKomm(intKommC: intKommC),
|
|
||||||
),
|
|
||||||
],
|
],
|
||||||
))
|
))
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ import 'package:geolocator/geolocator.dart';
|
|||||||
import 'package:intl/intl.dart';
|
import 'package:intl/intl.dart';
|
||||||
import 'package:latlong2/latlong.dart';
|
import 'package:latlong2/latlong.dart';
|
||||||
import 'package:shared_preferences/shared_preferences.dart';
|
import 'package:shared_preferences/shared_preferences.dart';
|
||||||
|
import 'package:geocoding/geocoding.dart';
|
||||||
|
|
||||||
// * Collection of All widgets displayed in the add_cam section
|
// * Collection of All widgets displayed in the add_cam section
|
||||||
|
|
||||||
@@ -16,31 +17,48 @@ import 'package:shared_preferences/shared_preferences.dart';
|
|||||||
// * Step 1 place, camera, terretory
|
// * Step 1 place, camera, terretory
|
||||||
//
|
//
|
||||||
|
|
||||||
class RequiredVarTextField extends StatefulWidget {
|
class VarTextField extends StatefulWidget {
|
||||||
final TextEditingController textController;
|
final TextEditingController textController;
|
||||||
final String localization;
|
final String localization;
|
||||||
final String dbName;
|
final String dbName;
|
||||||
|
final String? default_value;
|
||||||
final bool required;
|
final bool required;
|
||||||
|
|
||||||
const RequiredVarTextField(
|
const VarTextField(
|
||||||
{super.key,
|
{super.key,
|
||||||
required this.textController,
|
required this.textController,
|
||||||
required this.localization,
|
required this.localization,
|
||||||
required this.dbName, required this.required});
|
required this.dbName,
|
||||||
|
required this.required,
|
||||||
|
this.default_value});
|
||||||
|
|
||||||
@override
|
@override
|
||||||
State<RequiredVarTextField> createState() => _RequiredVarTextFieldState();
|
State<VarTextField> createState() => _VarTextFieldState();
|
||||||
}
|
}
|
||||||
|
|
||||||
class _RequiredVarTextFieldState extends State<RequiredVarTextField> {
|
class _VarTextFieldState extends State<VarTextField> {
|
||||||
late Future<List<Map<String, dynamic>>> dbVar;
|
late Future<List<Map<String, dynamic>>> dbVar;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void initState() {
|
void initState() {
|
||||||
super.initState();
|
super.initState();
|
||||||
|
|
||||||
|
if (widget.textController.text == "" && widget.default_value != null)
|
||||||
|
_loadPref();
|
||||||
|
|
||||||
dbVar = DBHelper().getPlace();
|
dbVar = DBHelper().getPlace();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void _loadPref() {
|
||||||
|
Future.delayed(Duration.zero, () async {
|
||||||
|
SharedPreferences prefs = await SharedPreferences.getInstance();
|
||||||
|
String bLand = prefs.getString(widget.default_value!) ?? "";
|
||||||
|
setState(() {
|
||||||
|
widget.textController.text = bLand;
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Row(
|
return Row(
|
||||||
@@ -51,23 +69,29 @@ class _RequiredVarTextFieldState extends State<RequiredVarTextField> {
|
|||||||
controller: widget.textController,
|
controller: widget.textController,
|
||||||
keyboardType: TextInputType.multiline,
|
keyboardType: TextInputType.multiline,
|
||||||
maxLines: null,
|
maxLines: null,
|
||||||
|
onChanged: (value) {
|
||||||
|
setState(() {
|
||||||
|
widget.textController.text = value;
|
||||||
|
});
|
||||||
|
},
|
||||||
decoration: InputDecoration(
|
decoration: InputDecoration(
|
||||||
hintText: widget.localization,
|
hintText: widget.localization,
|
||||||
enabledBorder: widget.required
|
enabledBorder: widget.required
|
||||||
? (widget.textController.text.isEmpty
|
? (widget.textController.text.isEmpty
|
||||||
? const UnderlineInputBorder(
|
? const UnderlineInputBorder(
|
||||||
borderSide: BorderSide(color: Colors.red))
|
borderSide: BorderSide(color: Colors.red))
|
||||||
: const UnderlineInputBorder(
|
: const UnderlineInputBorder(
|
||||||
borderSide: BorderSide(color: Colors.green)))
|
borderSide: BorderSide(color: Colors.green)))
|
||||||
: const UnderlineInputBorder(borderSide: BorderSide(color: Colors.grey)),
|
: const UnderlineInputBorder(
|
||||||
focusedBorder: widget.required
|
borderSide: BorderSide(color: Colors.grey)),
|
||||||
? (widget.textController.text.isEmpty
|
focusedBorder: widget.required
|
||||||
? const UnderlineInputBorder(
|
? (widget.textController.text.isEmpty
|
||||||
borderSide: BorderSide(color: Colors.red))
|
? const UnderlineInputBorder(
|
||||||
: const UnderlineInputBorder(
|
borderSide: BorderSide(color: Colors.red))
|
||||||
borderSide: BorderSide(color: Colors.green)))
|
: const UnderlineInputBorder(
|
||||||
: const UnderlineInputBorder(borderSide: BorderSide(color: Colors.grey))
|
borderSide: BorderSide(color: Colors.green)))
|
||||||
),
|
: const UnderlineInputBorder(
|
||||||
|
borderSide: BorderSide(color: Colors.grey))),
|
||||||
)),
|
)),
|
||||||
Expanded(
|
Expanded(
|
||||||
flex: 1,
|
flex: 1,
|
||||||
@@ -123,10 +147,10 @@ class Standort extends StatefulWidget {
|
|||||||
{super.key, required this.standortC, required this.localization});
|
{super.key, required this.standortC, required this.localization});
|
||||||
|
|
||||||
@override
|
@override
|
||||||
State<RequiredVarTextField> createState() => _RequiredVarTextFieldState();
|
State<VarTextField> createState() => _StandortState();
|
||||||
}
|
}
|
||||||
|
|
||||||
class _StandortState extends State<RequiredVarTextField> {
|
class _StandortState extends State<VarTextField> {
|
||||||
late Future<List<Map<String, dynamic>>> Standort;
|
late Future<List<Map<String, dynamic>>> Standort;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
@@ -426,6 +450,9 @@ class KarteState extends State<Karte> {
|
|||||||
Position? updatedPosition;
|
Position? updatedPosition;
|
||||||
bool saveVisible = false;
|
bool saveVisible = false;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void initState() {
|
void initState() {
|
||||||
super.initState();
|
super.initState();
|
||||||
@@ -452,8 +479,13 @@ class KarteState extends State<Karte> {
|
|||||||
children: [
|
children: [
|
||||||
Text(AppLocalizations.of(context)!.saveMap),
|
Text(AppLocalizations.of(context)!.saveMap),
|
||||||
TextButton(
|
TextButton(
|
||||||
onPressed: () {
|
onPressed: () async {
|
||||||
|
|
||||||
|
List<Placemark> placemarks = await placemarkFromCoordinates(selectedPosition!.latitude, selectedPosition!.longitude);
|
||||||
|
print(placemarks);
|
||||||
|
|
||||||
if (selectedPosition != null) {
|
if (selectedPosition != null) {
|
||||||
|
|
||||||
setState(() {
|
setState(() {
|
||||||
updatedPosition = Position(
|
updatedPosition = Position(
|
||||||
longitude: selectedPosition!.longitude,
|
longitude: selectedPosition!.longitude,
|
||||||
@@ -1935,16 +1967,12 @@ class _AbbauDatState extends State<AbbauDat> {
|
|||||||
Future<DateTime?> pickDate() async {
|
Future<DateTime?> pickDate() async {
|
||||||
final date = await showDatePicker(
|
final date = await showDatePicker(
|
||||||
context: context,
|
context: context,
|
||||||
initialDate: abbauDat!,
|
initialDate: DateTime.now(),
|
||||||
firstDate: DateTime(2000),
|
firstDate: DateTime(2000),
|
||||||
lastDate: DateTime(5000));
|
lastDate: DateTime(5000));
|
||||||
if (date == null) return null;
|
if (date == null) return null;
|
||||||
setState(() => abbauDat = date);
|
setState(() => abbauDat = date);
|
||||||
|
|
||||||
var place = {'AbbauDat': DateFormat('yyyy-MM-dd').format(abbauDat!)};
|
|
||||||
|
|
||||||
await DBHelper().addPlace(place);
|
|
||||||
|
|
||||||
return abbauDat;
|
return abbauDat;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ class HomePage extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
body: Column(
|
body: Column(
|
||||||
children: [
|
children: [
|
||||||
Image.asset('assets/images/reconix.png'),
|
Image.asset('assets/images/reconix_small.png'),
|
||||||
Center(
|
Center(
|
||||||
child: Column(
|
child: Column(
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
|
|||||||
@@ -19,6 +19,8 @@ void main() async {
|
|||||||
WidgetsFlutterBinding.ensureInitialized();
|
WidgetsFlutterBinding.ensureInitialized();
|
||||||
SharedPreferences prefs = await SharedPreferences.getInstance();
|
SharedPreferences prefs = await SharedPreferences.getInstance();
|
||||||
bool isFirstLaunch = prefs.getBool('isFirstLaunch') ?? true;
|
bool isFirstLaunch = prefs.getBool('isFirstLaunch') ?? true;
|
||||||
|
await prefs.setString('kTage1', "28");
|
||||||
|
await prefs.setString('kTage2', "48");
|
||||||
runApp(MyApp(isFirstLaunch: isFirstLaunch));
|
runApp(MyApp(isFirstLaunch: isFirstLaunch));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -26,6 +28,8 @@ class MyApp extends StatelessWidget {
|
|||||||
final bool isFirstLaunch;
|
final bool isFirstLaunch;
|
||||||
const MyApp({super.key, required this.isFirstLaunch});
|
const MyApp({super.key, required this.isFirstLaunch});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return MaterialApp(
|
return MaterialApp(
|
||||||
|
|||||||
@@ -9,13 +9,12 @@ import 'package:path/path.dart';
|
|||||||
class DBHelper {
|
class DBHelper {
|
||||||
static Database? _placeDB;
|
static Database? _placeDB;
|
||||||
|
|
||||||
|
|
||||||
// checks if the databses are existing and creates them with the initPlaceDatabase function if not
|
// checks if the databses are existing and creates them with the initPlaceDatabase function if not
|
||||||
Future<Database> get placeDB async {
|
Future<Database> get placeDB async {
|
||||||
if (_placeDB != null) {
|
if (_placeDB != null) {
|
||||||
return _placeDB!;
|
return _placeDB!;
|
||||||
}
|
}
|
||||||
_placeDB = await initPlaceDatabase();
|
_placeDB = await initPlaceDatabase();
|
||||||
return _placeDB!;
|
return _placeDB!;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -31,12 +30,11 @@ class DBHelper {
|
|||||||
// The function that helps
|
// The function that helps
|
||||||
_onCreatePlace(Database placeDB, int version) async {
|
_onCreatePlace(Database placeDB, int version) async {
|
||||||
await placeDB.execute(
|
await placeDB.execute(
|
||||||
'CREATE TABLE place (CID TEXT PRIMARY KEY UNIQUE NOT NULL, Standort TEXT, Rudel TEXT, Datum DATE, Adresse1 TEXT, Adresse2 TEXT, Adresse3 TEXT, BLand TEXT, Lkr TEXT, BeiOrt TEXT, OrtInfo TEXT, Status TEXT, STTyp TEXT, FFTyp TEXT, FotoFilm TEXT, MEZ TEXT, Platzung TEXT, KSchloNr TEXT, Bearsafe TEXT, KontDat DATE, Betreuung TEXT, AbbauDat DATE, Auftrag TEXT, KontAbsp TEXT, SonstBem TEXT, FKontakt1 TEXT, FKontakt2 TEXT, FKontakt3 TEXT, KTage1 INTEGER, KTage2 INTEGER, ProtoAm DATE, IntKomm TEXT, DECLNG DECIMALS(4,8), DECLAT DECIMALS(4,8), Sent INTEGER DEFAULT 0)');
|
'CREATE TABLE place (CID TEXT PRIMARY KEY UNIQUE NOT NULL, Standort TEXT, Rudel TEXT, Datum DATE, Adresse1 TEXT, Adresse2 TEXT, Adresse3 TEXT, BLand TEXT, Lkr TEXT, BeiOrt TEXT, OrtInfo TEXT, Status TEXT, STTyp TEXT, FFTyp TEXT, FotoFilm TEXT, MEZ TEXT, Platzung TEXT, KSchloNr TEXT, Bearsafe TEXT, KontDat DATE, Betreuung TEXT, AbbauDat DATE, Auftrag TEXT, KontAbsp TEXT, SonstBem TEXT, FKontakt1 TEXT, FKontakt2 TEXT, FKontakt3 TEXT, KTage1 INTEGER, KTage2 INTEGER, ProtoAm DATE, IntKomm TEXT, DECLNG DECIMALS(4,8), DECLAT DECIMALS(4,8), Sent INTEGER DEFAULT 0)');
|
||||||
await placeDB.execute(
|
await placeDB.execute(
|
||||||
'CREATE TABLE templates (CID TEXT PRIMARY KEY UNIQUE NOT NULL, Standort TEXT, Rudel TEXT, Datum DATE, Adresse1 TEXT, Adresse2 TEXT, Adresse3 TEXT, BLand TEXT, Lkr TEXT, BeiOrt TEXT, OrtInfo TEXT, Status TEXT, STTyp TEXT, FFTyp TEXT, FotoFilm TEXT, MEZ TEXT, Platzung TEXT, KSchloNr TEXT, Bearsafe TEXT, KontDat DATE, Betreuung TEXT, AbbauDat DATE, Auftrag TEXT, KontAbsp TEXT, SonstBem TEXT, FKontakt1 TEXT, FKontakt2 TEXT, FKontakt3 TEXT, KTage1 INTEGER, KTage2 INTEGER, ProtoAm DATE, IntKomm TEXT, DECLNG DECIMALS(4,8), DECLAT DECIMALS(4,8))');
|
'CREATE TABLE templates (CID TEXT PRIMARY KEY UNIQUE NOT NULL, Standort TEXT, Rudel TEXT, Datum DATE, Adresse1 TEXT, Adresse2 TEXT, Adresse3 TEXT, BLand TEXT, Lkr TEXT, BeiOrt TEXT, OrtInfo TEXT, Status TEXT, STTyp TEXT, FFTyp TEXT, FotoFilm TEXT, MEZ TEXT, Platzung TEXT, KSchloNr TEXT, Bearsafe TEXT, KontDat DATE, Betreuung TEXT, AbbauDat DATE, Auftrag TEXT, KontAbsp TEXT, SonstBem TEXT, FKontakt1 TEXT, FKontakt2 TEXT, FKontakt3 TEXT, KTage1 INTEGER, KTage2 INTEGER, ProtoAm DATE, IntKomm TEXT, DECLNG DECIMALS(4,8), DECLAT DECIMALS(4,8))');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Function to add a finished entrie
|
// Function to add a finished entrie
|
||||||
Future<void> addPlace(Map<String, dynamic> place) async {
|
Future<void> addPlace(Map<String, dynamic> place) async {
|
||||||
var placeDBClient = await placeDB;
|
var placeDBClient = await placeDB;
|
||||||
@@ -50,6 +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");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -59,7 +58,7 @@ class DBHelper {
|
|||||||
place,
|
place,
|
||||||
|
|
||||||
// replaces the entrie with the new onw if a unique value exists and conflicts
|
// replaces the entrie with the new onw if a unique value exists and conflicts
|
||||||
conflictAlgorithm: ConflictAlgorithm.replace,
|
// conflictAlgorithm: ConflictAlgorithm.replace,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -67,7 +66,8 @@ class DBHelper {
|
|||||||
Future<void> updateSent() async {
|
Future<void> updateSent() async {
|
||||||
var placeDBClient = await placeDB;
|
var placeDBClient = await placeDB;
|
||||||
|
|
||||||
placeDBClient.update('place', true as Map<String, Object?>, where: 'CID = ?', whereArgs: ['CID']);
|
placeDBClient.update('place', true as Map<String, Object?>,
|
||||||
|
where: 'CID = ?', whereArgs: ['CID']);
|
||||||
}
|
}
|
||||||
|
|
||||||
// same thing as before but with templatews
|
// same thing as before but with templatews
|
||||||
@@ -86,7 +86,7 @@ class DBHelper {
|
|||||||
await placeDBClient.insert(
|
await placeDBClient.insert(
|
||||||
'templates',
|
'templates',
|
||||||
templates,
|
templates,
|
||||||
conflictAlgorithm: ConflictAlgorithm.replace,
|
// conflictAlgorithm: ConflictAlgorithm.replace,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -102,7 +102,6 @@ class DBHelper {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// get the finished entries from db
|
// get the finished entries from db
|
||||||
Future<List<Map<String, dynamic>>> getPlace() async {
|
Future<List<Map<String, dynamic>>> getPlace() async {
|
||||||
var placeDBClient = await placeDB;
|
var placeDBClient = await placeDB;
|
||||||
@@ -126,4 +125,24 @@ class DBHelper {
|
|||||||
var placeDBClient = await placeDB;
|
var placeDBClient = await placeDB;
|
||||||
await placeDBClient.delete('templates');
|
await placeDBClient.delete('templates');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// delete specific template
|
||||||
|
Future<void> deleteTemplate(String cid) async {
|
||||||
|
var placeDBClient = await placeDB;
|
||||||
|
await placeDBClient.delete(
|
||||||
|
'templates',
|
||||||
|
where: 'CID = ?',
|
||||||
|
whereArgs: [cid],
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
// delete specific place
|
||||||
|
Future<void> deletePlace(String cid) async {
|
||||||
|
var placeDBClient = await placeDB;
|
||||||
|
await placeDBClient.delete(
|
||||||
|
'place',
|
||||||
|
where: 'CID = ?',
|
||||||
|
whereArgs: [cid],
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -22,7 +22,6 @@ class _SettingsState extends State<Settings> {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
import 'package:fforte/addCam/add_cam_main.dart';
|
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/cupertino.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:flutter/widgets.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';
|
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
|
||||||
@@ -132,11 +134,14 @@ class _ViewCamsState extends State<ViewCams> {
|
|||||||
Row(
|
Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
children: [
|
children: [
|
||||||
Text(AppLocalizations.of(context)!.placedata),
|
Expanded(
|
||||||
const SizedBox(
|
flex: 2,
|
||||||
width: 250,
|
child: Text(
|
||||||
),
|
AppLocalizations.of(context)!.placedata)),
|
||||||
Text(AppLocalizations.of(context)!.sent),
|
Expanded(
|
||||||
|
flex: 2,
|
||||||
|
child:
|
||||||
|
Text(AppLocalizations.of(context)!.sent)),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
const SizedBox(
|
const SizedBox(
|
||||||
|
|||||||
32
pubspec.lock
32
pubspec.lock
@@ -197,6 +197,38 @@ packages:
|
|||||||
description: flutter
|
description: flutter
|
||||||
source: sdk
|
source: sdk
|
||||||
version: "0.0.0"
|
version: "0.0.0"
|
||||||
|
geocoding:
|
||||||
|
dependency: "direct main"
|
||||||
|
description:
|
||||||
|
name: geocoding
|
||||||
|
sha256: d580c801cba9386b4fac5047c4c785a4e19554f46be42f4f5e5b7deacd088a66
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "3.0.0"
|
||||||
|
geocoding_android:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: geocoding_android
|
||||||
|
sha256: "4e1539a136c6ab4c44963cfc631970ee499f706a03654fc1d446b2100caf7221"
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "3.3.0"
|
||||||
|
geocoding_ios:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: geocoding_ios
|
||||||
|
sha256: "94ddba60387501bd1c11e18dca7c5a9e8c645d6e3da9c38b9762434941870c24"
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "3.0.1"
|
||||||
|
geocoding_platform_interface:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: geocoding_platform_interface
|
||||||
|
sha256: "8c2c8226e5c276594c2e18bfe88b19110ed770aeb7c1ab50ede570be8b92229b"
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "3.2.0"
|
||||||
geolocator:
|
geolocator:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
|
|||||||
@@ -48,6 +48,7 @@ dependencies:
|
|||||||
file_picker: ^6.2.0
|
file_picker: ^6.2.0
|
||||||
http: ^1.2.1
|
http: ^1.2.1
|
||||||
dio: ^5.4.1
|
dio: ^5.4.1
|
||||||
|
geocoding: ^3.0.0
|
||||||
|
|
||||||
dev_dependencies:
|
dev_dependencies:
|
||||||
flutter_lints: ^3.0.1
|
flutter_lints: ^3.0.1
|
||||||
|
|||||||
Reference in New Issue
Block a user