diff --git a/Todo.txt b/Todo.txt index 6b2ae69..fcf3733 100644 --- a/Todo.txt +++ b/Todo.txt @@ -1,14 +1,10 @@ todo: -TESTEN!! maybe auch vorschläge aus templates in dropdown menüs anzeigen eintrag in db wenn http response (in sent column) nachricht wenn einstellungen erfolgreich geändert -view cams übersetzen abbaudat leer -datum step redesign (maybe linien dazwischen und sized box zwischen text und button weg) beim nächsten schritt als template im englischen abändern -systematic ??? standort automatisch in Karte karte drehen aus Auftrag absätze machen und textfeld größer wenn langer text @@ -16,11 +12,12 @@ beim letzten weiter alle leeren felder anzeigen (array zurückgeben) gespeicherten ordner anzeigen zurückfeld in datenansicht überschriften für view cams -Überall wo Kameras steht standorte hinschreiben null eintrag in dropdown menüs weg speichern funktion zum Abbrechen fehler beim speichern anzeigen -ktage raus +place variable ein mal deklarieren in add_cam_main +nach koordinaten lkr auswählen (esri-leaflet-geocoder) +nach screenshots sortieren not to do: diff --git a/assets/images/reconix.png b/assets/images/reconix.png new file mode 100644 index 0000000..df8426c Binary files /dev/null and b/assets/images/reconix.png differ diff --git a/lib/addCam/add_cam_main.dart b/lib/addCam/add_cam_main.dart index 8e45517..4aab8b1 100644 --- a/lib/addCam/add_cam_main.dart +++ b/lib/addCam/add_cam_main.dart @@ -11,6 +11,7 @@ import 'package:intl/intl.dart'; import 'package:latlong2/latlong.dart'; import 'package:animations/animations.dart'; import 'package:http/http.dart' as http; +import 'package:dio/dio.dart'; class AddCamMain extends StatefulWidget { final bool isTemplate; @@ -264,12 +265,38 @@ class _AddCamMainState extends State { 'KontSum': kontSumC.text, }; - final response = await http.post(Uri.parse("http://192.168.178.30/www.dbb-wolf.de/data/_nicoapi.php"), +/* final response = await http.post( + Uri.parse('http://192.168.1.106/www.dbb-wolf.de/data/_app24.php'), headers: { 'Content-Type': 'application/json; charset=UTF-8', }, - body: jsonEncode(place)); - print(response); + body: '{"test": "test"}' + ); */ + + print(jsonEncode(place)); + + final dio = Dio(); + dio.options.responseType = ResponseType.plain; + Response response = + Response(requestOptions: RequestOptions(path: ''), statusCode: 400); + + try { + response = await dio.post( + 'http://192.168.1.106/www.dbb-wolf.de/data/_app24.php', + data: jsonEncode(place)); + } on DioException catch (e) { + if (e.response?.statusCode == 500) { + print('-------------------------'); + print('code 500'); + return; + } + } + if (response.statusCode == 201) { + print(response.statusCode); + // TODO Hackal setzen + } else { + print(response.statusCode); + } } Future saveFile() async { @@ -459,12 +486,16 @@ class _AddCamMainState extends State { title: Text(AppLocalizations.of(context)!.firstStep), content: Column( children: [ + Align( + alignment: Alignment.bottomLeft, + child: AltStOrt(altStOrtC: altStOrtC), + ), CamId(id: id), - Rudel(rudelC: rudelC), Align( alignment: Alignment.bottomLeft, child: FFTyp(ffTypC: ffTypC), ), + Rudel(rudelC: rudelC), const SizedBox( height: 15, ), @@ -725,10 +756,6 @@ class _AddCamMainState extends State { }); }, ), - Align( - alignment: Alignment.bottomLeft, - child: AltStOrt(altStOrtC: altStOrtC), - ), ], )), Step( @@ -783,7 +810,7 @@ class _AddCamMainState extends State { // Here the site is built inclusive the steps from above return Scaffold( - appBar: AppBar(title: Text(AppLocalizations.of(context)!.addCam)), + appBar: AppBar(title: Text(AppLocalizations.of(context)!.addplace)), body: PageTransitionSwitcher( duration: const Duration(milliseconds: 800), transitionBuilder: (Widget child, Animation animation, diff --git a/lib/home.dart b/lib/home.dart index 172d2ac..28a70d0 100644 --- a/lib/home.dart +++ b/lib/home.dart @@ -23,27 +23,35 @@ class HomePage extends StatelessWidget { PopupMenuItem( value: '/settings', child: Text(AppLocalizations.of(context)!.settings), - ) + ), + PopupMenuItem( + value: '/introScreen', + child: Text(AppLocalizations.of(context)!.showloginscreen)) ]) ], ), - body: Center( - child: Column( - mainAxisAlignment: MainAxisAlignment.center, + body: Column( children: [ - ElevatedButton( - onPressed: () { - Navigator.push( - context, - MaterialPageRoute( - builder: (context) => const AddCamMain())); - }, - child: Text(AppLocalizations.of(context)!.addCam)), - ElevatedButton(onPressed: () => Navigator.pushNamed(context, '/viewCams'), - child: const Text('view Cams')), - + Image.asset('assets/images/reconix.png'), + Center( + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + ElevatedButton( + onPressed: () { + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => const AddCamMain())); + }, + child: Text(AppLocalizations.of(context)!.addplace)), + ElevatedButton(onPressed: () => Navigator.pushNamed(context, '/viewCams'), + child: Text(AppLocalizations.of(context)!.viewplaces)), + + ], + )), ], - )), + ), ); } } diff --git a/lib/intro_screen.dart b/lib/intro_screen.dart index 7398f47..74a8aa0 100644 --- a/lib/intro_screen.dart +++ b/lib/intro_screen.dart @@ -1,4 +1,5 @@ import 'package:flutter/material.dart'; +import 'package:flutter/widgets.dart'; import 'package:shared_preferences/shared_preferences.dart'; import 'package:flutter_gen/gen_l10n/app_localizations.dart'; @@ -42,13 +43,86 @@ class _IntroScreenState extends State { const SizedBox( height: 15, ), - TextField( - decoration: InputDecoration( - hintText: AppLocalizations.of(context)!.bland), - controller: bLandC, - onChanged: (value) => setState(() { - bLandC.text = value; - }), + Column( + children: [ + DropdownButton( + hint: Text(bLandC.text), + items: const [ + DropdownMenuItem( + value: 'Baden-Württemberg', + child: Text('Baden-Württemberg'), + ), + DropdownMenuItem( + value: 'Bayern', + child: Text('Bayern'), + ), + DropdownMenuItem( + value: 'Berlin', + child: Text('Berlin'), + ), + DropdownMenuItem( + value: 'Brandenburg', + child: Text('Brandenburg'), + ), + DropdownMenuItem( + value: 'Bremen', + child: Text('Bremen'), + ), + DropdownMenuItem( + value: 'Hamburg', + child: Text('Hamburg'), + ), + DropdownMenuItem( + value: 'Hessen', + child: Text('Hessen'), + ), + DropdownMenuItem( + value: 'Mecklenburg-Vorpommern', + child: Text('Mecklenburg-Vorpommern'), + ), + DropdownMenuItem( + value: 'Niedersachsen', + child: Text('Niedersachsen'), + ), + DropdownMenuItem( + value: 'Nordrhein-Westfalen', + child: Text('Nordrhein-Westfalen'), + ), + DropdownMenuItem( + value: 'Rheinland-Pfalz', + child: Text('Rheinland-Pfalz'), + ), + DropdownMenuItem( + value: 'Saarland', + child: Text('Saarland'), + ), + DropdownMenuItem( + value: 'Sachsen', + child: Text('Sachsen'), + ), + DropdownMenuItem( + value: 'Sachsen-Anhalt', + child: Text('Sachsen-Anhalt'), + ), + DropdownMenuItem( + value: 'Schleswig-Holstein', + child: Text('Schleswig-Holstein'), + ), + DropdownMenuItem( + value: 'Thüringen', + child: Text('Thüringen'), + ), + ], + onChanged: (value) { + setState(() { + bLandC.text = value!; + }); + }, + ), + TextField( + controller: bLandC, + ), + ], ), const SizedBox( height: 15, diff --git a/lib/l10n/app_de.arb b/lib/l10n/app_de.arb index 37b7747..352f61b 100644 --- a/lib/l10n/app_de.arb +++ b/lib/l10n/app_de.arb @@ -1,17 +1,17 @@ { "homePageTitle": "FFOrte", - "addCam": "Kamera hinzufügen", + "addplace": "Standort hinzufügen", "completed": "Vollständig", "uncompleted": "Unvollständig", "deleteEverything": "Alles löschen?", - "deleteEverythingContent": "Alle Kameras werden lokal gelöscht!", + "deleteEverythingContent": "Alle Standorte werden lokal gelöscht!", "camLink": "ID der Kamera", - "firstStep": "KAMERA, TERRITORIUM", - "secondStep": "DATUM, KONTAKT", + "firstStep": "STANDORT, KAMERA, TERRITORIUM", + "secondStep": "DATUM, KONTAKT, ORT", "date": "DATUM", "kontakt": "KONTAKT", "status": "Status", - "viewCamsAppbar": "Kameras ansehen", + "viewplacesappbar": "Standorte ansehen", "locations": "STANDORT", "rudel": "Territorium", "namevorname": "Name", @@ -24,8 +24,8 @@ "aktiv": "Aktiv", "inaktiv": "Inaktiv", "opportunistisch": "opportunistisch", - "systematic": "systematisch", - "fftyp": "Fotofallentyp", + "systematisch": "systematisch", + "fftyp": "Modell der Kamera", "foto": "Foto", "film": "Film", "sommerzeit": "Sommerzeit", @@ -50,7 +50,7 @@ "fkontakt2": "FKontakt 2", "fkontakt3": "FKontakt 3", "hofgarten": "Hof/Garten", - "altstort": "Alter Standort", + "altstort": "Standort", "wiesefeld": "Wiese/Feld/offenfläche", "ausvon": "Aus von", "nichts": "---", @@ -58,9 +58,9 @@ "ktage1": "KTage 1", "ktage2": "KTage 2", "eugrid": "EUGrid", - "pickDate": "Datum Aufstelung", + "pickDate": "Datum Aufstellung", "pickTime": "Zeit auswählen", - "delAll": "Alle Kameras löschen", + "delAll": "Alle Standorte löschen", "fieldEmpty": "Folgendes Feld ist leer:", "cancel": "Abbrechen", "template": "Als Vorlage speichern", @@ -72,12 +72,14 @@ "markerSet": "Marker gesetzt auf", "kontsum": "Kontrollsumme", "bearsafe": "Bearsafe", - "sttyp": "Status", + "sttyp": "Wahl des Standortes", "ort": "Ort", "continueB": "Weiter", "settings": "Einstellungen", "changenamestate": "Name und Bundesland ändern", "saveasfile": "Als Datei speichern", "sendtoserver": "Zum Server senden", - "savemethod": "Speichermethode auswählen" + "savemethod": "Speichermethode auswählen", + "viewplaces": "Standorte anzeigen", + "showloginscreen": "Login-Bildschirm Anzeigen" } \ No newline at end of file diff --git a/lib/l10n/app_en.arb b/lib/l10n/app_en.arb index 49fda1a..aa09220 100644 --- a/lib/l10n/app_en.arb +++ b/lib/l10n/app_en.arb @@ -3,23 +3,23 @@ "@homePageTitle": { "description": "The title of the homepage" }, - "addCam": "add Cam", - "@addCam": { - "description": "Button to add a camera" + "addplace": "add Place", + "@addplace": { + "description": "Button to add a place" }, "completed": "Completed", "@completed": { - "description": "View cams tab titel" + "description": "View place tab titel" }, "uncompleted": "Uncompleted", "@uncompleted": { - "description": "View cams tab titel" + "description": "View place tab titel" }, "deleteEverything": "Delete everything?", "@deleteEverything": { "description": "Delete everything Alert Dialog title" }, - "deleteEverythingContent": "Every camera will deleted locally!", + "deleteEverythingContent": "Every place will deleted locally!", "@deleteEverythingContent": { "description": "Delete everything Alert Dialog content" }, @@ -27,7 +27,7 @@ "@camLink": { "description": "Camera link textfield" }, - "firstStep": "Camera, pack", + "firstStep": "PLACE, CAMERA, TERRITORY", "@firstStep": { "description": "title first step" }, @@ -51,9 +51,9 @@ "@secondStep": { "description": "title second step" }, - "viewCamsAppbar": "View cams", - "@viewCamsAppbar": { - "description": "view cams appbar" + "viewplacesappbar": "View Places", + "@viewplacesappbar": { + "description": "view places appbar" }, "locations": "Location", "@locations": { @@ -113,11 +113,11 @@ }, "systematisch": "systematic", - "@systematic": { + "@systematisch": { "description": "systematic radiobutton" }, - "fftyp": "Photo trap type", + "fftyp": "Camera model", "@fftyp": { "description": "FFTyp textfield" }, @@ -237,7 +237,7 @@ "description": "fkontakt3 textfield" }, - "altstort": "AltStOrt", + "altstort": "Place", "@altstort": { "description": "altstort textfield" }, @@ -299,9 +299,9 @@ "@pickTime": { "description": "Pick time button" }, - "delAll": "Delete all cams", + "delAll": "Delete all places", "@delAll": { - "description": "Delete all Cams" + "description": "Delete all Places" }, "fieldEmpty": "Following Field is empty:", "@fieldEmpty": { @@ -345,7 +345,7 @@ "description": "Bearsafe header" }, - "sttyp": "STTyp", + "sttyp": "Selection of location", "@sttyp": { "description": "sttyp header" }, @@ -357,7 +357,7 @@ "ort": "Place", "@ort": { - "description": "View specific cam appbar text" + "description": "View specific place appbar text" }, "continueB": "continue", @@ -377,7 +377,17 @@ "savemethod": "Choose safe method", "@savemethod": { - "description": "Title of save mthod popup" + "description": "Title of save method popup" + }, + + "viewplaces": "View Places", + "@viewplaces": { + "description": "View places button" + }, + + "showloginscreen": "Show login Screen", + "@showloginscreen": { + "description": "show login screen popup menu item" } } \ No newline at end of file diff --git a/lib/viewCam/view_cams.dart b/lib/viewCam/view_cams.dart index 423a7b8..ddf1353 100644 --- a/lib/viewCam/view_cams.dart +++ b/lib/viewCam/view_cams.dart @@ -106,7 +106,7 @@ class _ViewCamsState extends State { text: AppLocalizations.of(context)!.uncompleted, ) ]), - title: Text(AppLocalizations.of(context)!.viewCamsAppbar)), + title: Text(AppLocalizations.of(context)!.viewplacesappbar)), body: TabBarView( children: [ FutureBuilder>>( diff --git a/pubspec.lock b/pubspec.lock index fa3832a..cd152bb 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -57,6 +57,14 @@ packages: url: "https://pub.dev" source: hosted version: "3.0.3" + dio: + dependency: "direct main" + description: + name: dio + sha256: "49af28382aefc53562459104f64d16b9dfd1e8ef68c862d5af436cc8356ce5a8" + url: "https://pub.dev" + source: hosted + version: "5.4.1" fake_async: dependency: transitive description: diff --git a/pubspec.yaml b/pubspec.yaml index 352dcf8..21661c5 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -47,6 +47,7 @@ dependencies: flutter_file_dialog: ^3.0.2 file_picker: ^6.2.0 http: ^1.2.1 + dio: ^5.4.1 dev_dependencies: flutter_lints: ^3.0.1 @@ -63,8 +64,8 @@ flutter: # the material Icons class. uses-material-design: true # To add assets to your application, add an assets section, like this: - # assets: - # - images/a_dot_burr.jpeg + assets: + - assets/images/ # - images/a_dot_ham.jpeg # An image asset can refer to one or more resolution-specific "variants", see # https://flutter.dev/assets-and-images/#resolution-aware diff --git a/time.txt b/time.txt index 98e45f1..a27f95b 100644 --- a/time.txt +++ b/time.txt @@ -39,4 +39,7 @@ 2 mär 1h 30 min 7 mär 1h -- abgerechnet - \ No newline at end of file +- abgerechnet - + +16 mär 4h +20 mär 6h 15 min \ No newline at end of file diff --git a/untranslated.txt b/untranslated.txt index 20d52ff..9e26dfe 100644 --- a/untranslated.txt +++ b/untranslated.txt @@ -1,5 +1 @@ -{ - "de": [ - "systematisch" - ] -} +{} \ No newline at end of file