From bb3dc9e856c1b2147963498fe3eda6f60df9401f Mon Sep 17 00:00:00 2001 From: Sven Carstensen Date: Sat, 14 Feb 2026 08:52:06 +0100 Subject: [PATCH] Erweiterungen --- .vscode/launch.json | 11 +- android/app/build.gradle | 4 +- android/gradle.properties | 2 +- android/settings.gradle | 4 +- lib/content_views/accepted_jobs_page.dart | 71 +- lib/content_views/assigned_jobs_page.dart | 62 +- lib/content_views/finished_jobs_page.dart | 63 +- lib/content_views/set_desired_zip_page.dart | 6 + lib/content_views/tour_details_page.dart | 17 + lib/content_views/tour_list_page.dart | 14 +- lib/main.dart | 34 +- lib/model/job.dart | 26 + lib/model/job_tour.dart | 8 + lib/model/tour_file.dart | 39 + lib/objectbox-model.json | 123 +- lib/objectbox.g.dart | 2030 ++++++++--------- lib/popups/accept_jobs_popup.dart | 1 + lib/popups/files_popup.dart | 262 +++ lib/popups/map_popup.dart | 25 +- .../tasks_popups/commision_number_popup.dart | 7 +- .../pickup_delivery_status_popup.dart | 8 + .../tasks_popups/receipt_giver_popup.dart | 6 +- .../tasks_popups/station_notice_popup.dart | 10 +- lib/popups/tasks_popups/zip_popup.dart | 19 +- lib/tools/mqtt_core.dart | 13 +- lib/tools/util.dart | 23 + pubspec.lock | 74 +- pubspec.yaml | 1 + 28 files changed, 1672 insertions(+), 1291 deletions(-) create mode 100644 lib/model/tour_file.dart create mode 100644 lib/popups/files_popup.dart diff --git a/.vscode/launch.json b/.vscode/launch.json index c7c7ad0..bb8773b 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -18,10 +18,19 @@ "program": "lib/main.dart" }, { - "name": "Stadtbote - Aktuelles Gerät", + "name": "Stadtbote - Pixel 7", "request": "launch", "type": "dart", "flutterMode": "debug", + "deviceId": "2B101FDH2003HB", + "program": "lib/main.dart" + }, + { + "name": "Stadtbote - Pixel 7 (Release)", + "request": "launch", + "type": "dart", + "flutterMode": "release", + "deviceId": "2B101FDH2003HB", "program": "lib/main.dart" } ] diff --git a/android/app/build.gradle b/android/app/build.gradle index 951e577..0bf982f 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -29,7 +29,7 @@ if (keystorePropertiesFile.exists()) { } android { - compileSdkVersion 34 + compileSdk 36 ndkVersion flutter.ndkVersion namespace "de.assecutor.stadtbote" @@ -50,7 +50,7 @@ android { applicationId "de.assecutor.stadtbote" minSdkVersion flutter.minSdkVersion targetSdkVersion flutter.targetSdkVersion - compileSdk = 35 + versionCode flutterVersionCode.toInteger() versionName flutterVersionName minSdkVersion 28 diff --git a/android/gradle.properties b/android/gradle.properties index 94adc3a..102964e 100644 --- a/android/gradle.properties +++ b/android/gradle.properties @@ -1,3 +1,3 @@ -org.gradle.jvmargs=-Xmx1536M +org.gradle.jvmargs=-Xmx4096M -XX:MaxMetaspaceSize=512m android.useAndroidX=true android.enableJetifier=true diff --git a/android/settings.gradle b/android/settings.gradle index 667cff2..41ce158 100644 --- a/android/settings.gradle +++ b/android/settings.gradle @@ -18,8 +18,8 @@ pluginManagement { plugins { id "dev.flutter.flutter-plugin-loader" version "1.0.0" - id "com.android.application" version "8.1.0" apply false - id "org.jetbrains.kotlin.android" version "1.8.10" apply false + id "com.android.application" version "8.9.1" apply false + id "org.jetbrains.kotlin.android" version "2.1.0" apply false } include ":app" \ No newline at end of file diff --git a/lib/content_views/accepted_jobs_page.dart b/lib/content_views/accepted_jobs_page.dart index b80e115..51a8600 100644 --- a/lib/content_views/accepted_jobs_page.dart +++ b/lib/content_views/accepted_jobs_page.dart @@ -8,6 +8,7 @@ import 'package:stadtbote/messages/pop_content_view_message.dart'; import '../main.dart'; import '../model/job.dart'; import '../objectbox.g.dart'; +import '../popups/files_popup.dart'; import '../tools/constants.dart'; import '../tools/util.dart'; @@ -92,38 +93,48 @@ class _AcceptedJobsPageState extends State border: Border.all(color: Colors.grey, width: 0.5), borderRadius: const BorderRadius.all(Radius.circular(13))), padding: const EdgeInsets.all(15.0), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Text( - DateFormat('dd.MM.yyyy HH:mm') - .format(DateTime.fromMillisecondsSinceEpoch(job.ordertime * 1000, isUtc: true).toLocal()) - .toString(), - style: TextStyle( - backgroundColor: isJobTooFarInFuture(job) - ? Colors.red - : Colors.transparent), - textAlign: TextAlign.left, - ), - Text( - job.crFilter != null ? job.crFilter.toString() : "", - textAlign: TextAlign.left, - ), - Row( - children: [ - Image.asset( - "assets/${mapVehicleTypeToImageName(job.vhtId)}", - width: 60, - height: 60), - const SizedBox(width: 10), - Text(mapVehicleTypeToText(job.vhtId)), + child: Stack( + children: [ + Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Text( + DateFormat('dd.MM.yyyy HH:mm') + .format(DateTime.fromMillisecondsSinceEpoch(job.ordertime * 1000, isUtc: true).toLocal()) + .toString(), + style: TextStyle( + backgroundColor: isJobTooFarInFuture(job) + ? Colors.red + : Colors.transparent), + textAlign: TextAlign.left, + ), + Text( + job.crFilter != null ? job.crFilter.toString() : "", + textAlign: TextAlign.left, + ), + Row( + children: [ + Image.asset( + "assets/${mapVehicleTypeToImageName(job.vhtId)}", + width: 60, + height: 60), + const SizedBox(width: 10), + Text(mapVehicleTypeToText(job.vhtId)), + ], + ), + Text( + bottomText, + textAlign: TextAlign.left, + ), ], ), - Text( - bottomText, - textAlign: TextAlign.left, - ), + if (job.hasFiles) + Positioned( + top: 0, + right: 0, + child: FilesBadge(files: job.files), + ), ], ), )), diff --git a/lib/content_views/assigned_jobs_page.dart b/lib/content_views/assigned_jobs_page.dart index 0bbbdcd..29e7bb0 100644 --- a/lib/content_views/assigned_jobs_page.dart +++ b/lib/content_views/assigned_jobs_page.dart @@ -17,6 +17,7 @@ import 'package:stadtbote/tools/messages/remove_state_0_job_from_map.dart'; import '../main.dart'; import '../model/job.dart'; +import '../popups/files_popup.dart'; import '../tools/constants.dart'; import '../tools/util.dart'; @@ -38,6 +39,7 @@ class _AssignedJobsPageState extends State with ProducerMixin, late bool _initCompleted = false; List _jobs = []; + final List _expandableControllers = []; @override void initState() { @@ -59,6 +61,11 @@ class _AssignedJobsPageState extends State with ProducerMixin, // Unsubscribe from all message topics unsubscribe(queueId: Constants.messageTopicJobReceived); + // Dispose all expandable controllers + for (var controller in _expandableControllers) { + controller.dispose(); + } + super.dispose(); } @@ -92,9 +99,16 @@ class _AssignedJobsPageState extends State with ProducerMixin, List _createWidgets() { List widgets = []; + // Clear previous controllers before creating new ones + for (var controller in _expandableControllers) { + controller.dispose(); + } + _expandableControllers.clear(); + for (var job in _jobs) { var expandableController = ExpandableController(); expandableController.expanded = true; + _expandableControllers.add(expandableController); widgets.add(ExpandableNotifier( child: ListTile( @@ -126,27 +140,29 @@ class _AssignedJobsPageState extends State with ProducerMixin, ), child: Padding( padding: const EdgeInsets.all(12.0), - child: Column( + child: Stack( children: [ - Text( - DateFormat('dd.MM.yyyy HH:mm').format(DateTime.fromMillisecondsSinceEpoch(job.ordertime * 1000, isUtc: true).toLocal()).toString(), - textAlign: TextAlign.left, - style: TextStyle(backgroundColor: isJobTooFarInFuture(job) ? Colors.red : Colors.white), - ), - Row( - mainAxisAlignment: MainAxisAlignment.center, + Column( children: [ - Image.asset("assets/${mapVehicleTypeToImageName(job.vhtId)}", width: 60, height: 60), - const SizedBox(width: 10), Text( - mapVehicleTypeToText(job.vhtId) + DateFormat('dd.MM.yyyy HH:mm').format(DateTime.fromMillisecondsSinceEpoch(job.ordertime * 1000, isUtc: true).toLocal()).toString(), + textAlign: TextAlign.left, + style: TextStyle(backgroundColor: isJobTooFarInFuture(job) ? Colors.red : Colors.white), ), - ], - ), - Text('Auftragsnummer: ${job.externalId}'), - Text(job.tours[0].comp), - Text(job.tours[0].street), - Text(job.tours[0].city), + Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Image.asset("assets/${mapVehicleTypeToImageName(job.vhtId)}", width: 60, height: 60), + const SizedBox(width: 10), + Text( + mapVehicleTypeToText(job.vhtId) + ), + ], + ), + Text('Auftragsnummer: ${job.externalId}'), + Text(job.tours[0].comp), + Text(job.tours[0].street), + Text(job.tours[0].city), const SizedBox(height: 20), ScrollOnExpand( scrollOnExpand: true, @@ -217,11 +233,19 @@ class _AssignedJobsPageState extends State with ProducerMixin, ]) ], ), - ), + if (job.hasFiles) + Positioned( + top: 0, + right: 0, + child: FilesBadge(files: job.files), + ), + ], ), ), ), - )); + ), + ), + )); } return widgets; diff --git a/lib/content_views/finished_jobs_page.dart b/lib/content_views/finished_jobs_page.dart index 9e03d18..cc2bcc4 100644 --- a/lib/content_views/finished_jobs_page.dart +++ b/lib/content_views/finished_jobs_page.dart @@ -8,6 +8,7 @@ import 'package:stadtbote/messages/pop_content_view_message.dart'; import '../main.dart'; import '../model/job.dart'; +import '../popups/files_popup.dart'; import '../tools/constants.dart'; import '../tools/util.dart'; @@ -85,34 +86,44 @@ class _FinishedJobsPageState extends State border: Border.all(color: Colors.grey, width: 0.5), borderRadius: const BorderRadius.all(Radius.circular(13))), padding: const EdgeInsets.all(15.0), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Text( - DateFormat('dd.MM.yyyy HH:mm') - .format(DateTime.fromMillisecondsSinceEpoch(job.ordertime * 1000, isUtc: true).toLocal()) - .toString(), - textAlign: TextAlign.left, - ), - Text( - job.crFilter != null ? job.crFilter.toString() : "", - textAlign: TextAlign.left, - ), - Row( - children: [ - Image.asset( - "assets/${mapVehicleTypeToImageName(job.vhtId)}", - width: 60, - height: 60), - const SizedBox(width: 10), - Text(mapVehicleTypeToText(job.vhtId)), + child: Stack( + children: [ + Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Text( + DateFormat('dd.MM.yyyy HH:mm') + .format(DateTime.fromMillisecondsSinceEpoch(job.ordertime * 1000, isUtc: true).toLocal()) + .toString(), + textAlign: TextAlign.left, + ), + Text( + job.crFilter != null ? job.crFilter.toString() : "", + textAlign: TextAlign.left, + ), + Row( + children: [ + Image.asset( + "assets/${mapVehicleTypeToImageName(job.vhtId)}", + width: 60, + height: 60), + const SizedBox(width: 10), + Text(mapVehicleTypeToText(job.vhtId)), + ], + ), + Text( + bottomText, + textAlign: TextAlign.left, + ), ], ), - Text( - bottomText, - textAlign: TextAlign.left, - ), + if (job.hasFiles) + Positioned( + top: 0, + right: 0, + child: FilesBadge(files: job.files), + ), ], ), )), diff --git a/lib/content_views/set_desired_zip_page.dart b/lib/content_views/set_desired_zip_page.dart index 040d1da..c697a4f 100644 --- a/lib/content_views/set_desired_zip_page.dart +++ b/lib/content_views/set_desired_zip_page.dart @@ -102,6 +102,12 @@ class _SetDesiredZipPageState extends State acknowledgeRequired: true), ); } + + @override + void dispose() { + textEditController.dispose(); + super.dispose(); + } } class _HeaderWidget extends StatefulWidget { diff --git a/lib/content_views/tour_details_page.dart b/lib/content_views/tour_details_page.dart index dc62175..2a880c1 100644 --- a/lib/content_views/tour_details_page.dart +++ b/lib/content_views/tour_details_page.dart @@ -6,6 +6,7 @@ import 'package:stadtbote/messages/pop_content_view_message.dart'; import 'package:stadtbote/model/job_tour.dart'; import '../model/job.dart'; +import '../popups/files_popup.dart'; import '../popups/map_popup.dart'; import '../tools/constants.dart'; import '../tools/util.dart'; @@ -103,6 +104,22 @@ class _TourDetailsPageState extends State with ProducerMixin { "Komm-#: ${widget.tour.com}", textAlign: TextAlign.left, ), + if (widget.tour.files != null && widget.tour.files!.isNotEmpty) ...[ + const SizedBox(height: 10), + Row( + children: [ + FilesBadge(files: widget.tour.files), + const SizedBox(width: 8), + const Text( + 'Dateien verfügbar', + style: TextStyle( + fontSize: 12, + color: Colors.grey, + ), + ), + ], + ), + ], const SizedBox(height: 10), getDefaultButton( 'Karte', diff --git a/lib/content_views/tour_list_page.dart b/lib/content_views/tour_list_page.dart index 553898f..5192d70 100644 --- a/lib/content_views/tour_list_page.dart +++ b/lib/content_views/tour_list_page.dart @@ -7,6 +7,7 @@ import 'package:stadtbote/model/job_tour.dart'; import 'package:stadtbote/popups/map_popup.dart'; import '../model/job.dart'; +import '../popups/files_popup.dart'; import '../tools/constants.dart'; import '../tools/util.dart'; @@ -152,9 +153,16 @@ class _TourListPageState extends State with ProducerMixin { crossAxisAlignment: CrossAxisAlignment.stretch, mainAxisAlignment: MainAxisAlignment.center, children: [ - Text( - "${"Station ${tour.sort}"} ${mapTourMode(tour.mode)}", - textAlign: TextAlign.left, + Row( + children: [ + Expanded( + child: Text( + "${"Station ${tour.sort}"} ${mapTourMode(tour.mode)}", + textAlign: TextAlign.left, + ), + ), + FilesBadge(files: tour.files), + ], ), Text( tour.comp, diff --git a/lib/main.dart b/lib/main.dart index 2f3b217..54a7851 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -188,7 +188,7 @@ class Main extends StatefulWidget { State
createState() => _MainState(); } -class _MainState extends State
with SingleTickerProviderStateMixin, ProducerMixin, ConsumerMixin { +class _MainState extends State
with SingleTickerProviderStateMixin, ProducerMixin, ConsumerMixin, WidgetsBindingObserver { DateTime? _lastBackPressed; late ContentViewWidget _currentContent; late WidgetStack contentStack = WidgetStack(); @@ -210,7 +210,11 @@ class _MainState extends State
with SingleTickerProviderStateMixin, Produc @override void dispose() { + // Unregister from app lifecycle events + WidgetsBinding.instance.removeObserver(this); + _animationController?.dispose(); + _checkForNewState0JobsJobsTimer?.cancel(); // Unsubscribe from all message topics unsubscribe(queueId: Constants.messageTopicPushContentView); @@ -228,6 +232,9 @@ class _MainState extends State
with SingleTickerProviderStateMixin, Produc @override void initState() { super.initState(); + + // Register for app lifecycle events + WidgetsBinding.instance.addObserver(this); _animationController = AnimationController(vsync: this, duration: const Duration(milliseconds: 1000)); _animationController!.repeat(reverse: true); @@ -253,6 +260,31 @@ class _MainState extends State
with SingleTickerProviderStateMixin, Produc }); } + @override + void didChangeAppLifecycleState(AppLifecycleState state) { + super.didChangeAppLifecycleState(state); + + switch (state) { + case AppLifecycleState.paused: + case AppLifecycleState.inactive: + case AppLifecycleState.hidden: + // App geht in den Hintergrund - Animation und Timer pausieren + _animationController?.stop(); + _checkForNewState0JobsJobsTimer?.cancel(); + Util.logInfo('App in Hintergrund - Rendering pausiert'); + break; + case AppLifecycleState.resumed: + // App kommt zurück in den Vordergrund - Animation und Timer fortsetzen + _animationController?.repeat(reverse: true); + _startCheckForNewState0JobsJobsTimer(); + Util.logInfo('App im Vordergrund - Rendering fortgesetzt'); + break; + case AppLifecycleState.detached: + // App wird beendet + break; + } + } + @override Widget build(BuildContext context) { if (!_initCompleted) { diff --git a/lib/model/job.dart b/lib/model/job.dart index a18e7db..7764d15 100644 --- a/lib/model/job.dart +++ b/lib/model/job.dart @@ -1,6 +1,7 @@ import 'dart:convert'; import 'package:objectbox/objectbox.dart'; import 'package:stadtbote/model/job_tour.dart'; +import 'package:stadtbote/model/tour_file.dart'; @Entity() class Job { @@ -34,6 +35,25 @@ class Job { toursJson = jsonEncode(value.map((e) => e.toJson()).toList()); } + // Store files as JSON string for ObjectBox + String filesJson = ''; + + @Transient() + List get files { + if (filesJson.isEmpty) { + return []; + } + final List decoded = jsonDecode(filesJson); + return decoded.map((e) => TourFile.fromJson(e as Map)).toList(); + } + + set files(List value) { + filesJson = jsonEncode(value.map((e) => e.toJson()).toList()); + } + + // Helper method to check if job has files + bool get hasFiles => files.isNotEmpty; + Job(); factory Job.fromJson(Map json) { @@ -52,6 +72,11 @@ class Job { job.tours = (json['tours'] as List) .map((e) => JobTour.fromJson(e as Map)) .toList(); + if (json['files'] != null) { + job.files = (json['files'] as List) + .map((e) => TourFile.fromJson(e as Map)) + .toList(); + } return job; } @@ -68,6 +93,7 @@ class Job { 'rem': rem, 'delayOrderTime': delayOrderTime, 'tours': tours.map((e) => e.toJson()).toList(), + 'files': files.map((e) => e.toJson()).toList(), }; } } diff --git a/lib/model/job_tour.dart b/lib/model/job_tour.dart index 2de5d45..ec26c57 100644 --- a/lib/model/job_tour.dart +++ b/lib/model/job_tour.dart @@ -1,3 +1,4 @@ +import 'package:stadtbote/model/tour_file.dart'; import 'package:stadtbote/model/tour_position.dart'; import 'package:stadtbote/model/tour_task.dart'; @@ -15,6 +16,7 @@ class JobTour { TourPosition? pos; late String rem; List? tasks; + List? files; JobTour(); @@ -39,6 +41,11 @@ class JobTour { .map((e) => TourTask.fromJson(e as Map)) .toList() : null; + tour.files = json['files'] != null + ? (json['files'] as List) + .map((e) => TourFile.fromJson(e as Map)) + .toList() + : null; return tour; } @@ -57,6 +64,7 @@ class JobTour { 'pos': pos?.toJson(), 'rem': rem, 'tasks': tasks?.map((e) => e.toJson()).toList(), + 'files': files?.map((e) => e.toJson()).toList(), }; } } diff --git a/lib/model/tour_file.dart b/lib/model/tour_file.dart new file mode 100644 index 0000000..719797c --- /dev/null +++ b/lib/model/tour_file.dart @@ -0,0 +1,39 @@ +class TourFile { + late int index; + late String name; + String? remark; + late String url; + + TourFile(); + + factory TourFile.fromJson(Map json) { + final file = TourFile(); + file.index = json['index'] as int; + file.name = json['name'] as String; + file.remark = json['remark'] as String?; + file.url = json['url'] as String; + return file; + } + + Map toJson() { + return { + 'index': index, + 'name': name, + 'remark': remark, + 'url': url, + }; + } + + bool get isPdf { + return name.toLowerCase().endsWith('.pdf'); + } + + bool get isImage { + final ext = name.toLowerCase(); + return ext.endsWith('.jpg') || + ext.endsWith('.jpeg') || + ext.endsWith('.png') || + ext.endsWith('.gif') || + ext.endsWith('.webp'); + } +} diff --git a/lib/objectbox-model.json b/lib/objectbox-model.json index 2ef9361..0aec326 100644 --- a/lib/objectbox-model.json +++ b/lib/objectbox-model.json @@ -34,7 +34,7 @@ }, { "id": "3:808686831791135454", - "lastPropertyId": "12:5320049580625017283", + "lastPropertyId": "13:1803006975816940878", "name": "Job", "properties": [ { @@ -99,6 +99,11 @@ "type": 6, "flags": 40, "indexId": "1:2108836818156887439" + }, + { + "id": "13:1803006975816940878", + "name": "filesJson", + "type": 9 } ], "relations": [] @@ -302,52 +307,6 @@ ], "relations": [] }, - { - "id": "11:8606238749478059367", - "lastPropertyId": "7:4056540326670791484", - "name": "ChatMessage", - "properties": [ - { - "id": "1:3236243497308902958", - "name": "id", - "type": 6, - "flags": 1 - }, - { - "id": "2:1689142031630531044", - "name": "time", - "type": 6 - }, - { - "id": "3:9168654785572108691", - "name": "from", - "type": 9 - }, - { - "id": "4:3167039386322657979", - "name": "subj", - "type": 9 - }, - { - "id": "5:371212500165499194", - "name": "text", - "type": 9 - }, - { - "id": "6:7798301556204918939", - "name": "read", - "type": 1 - }, - { - "id": "7:4056540326670791484", - "name": "externalId", - "type": 6, - "flags": 40, - "indexId": "2:428171949166894655" - } - ], - "relations": [] - }, { "id": "12:4865606913057136676", "lastPropertyId": "5:4858121848992922038", @@ -381,17 +340,65 @@ } ], "relations": [] + }, + { + "id": "14:3621615714595976689", + "lastPropertyId": "7:5084802055406173119", + "name": "ChatMessage", + "properties": [ + { + "id": "1:8160599835026826926", + "name": "id", + "type": 6, + "flags": 1 + }, + { + "id": "2:5736027494386837185", + "name": "externalId", + "type": 6, + "flags": 40, + "indexId": "4:8487631368009819350" + }, + { + "id": "3:4672344908186587803", + "name": "time", + "type": 6 + }, + { + "id": "4:2026513613729432961", + "name": "from", + "type": 9 + }, + { + "id": "5:6544369704442218939", + "name": "subj", + "type": 9 + }, + { + "id": "6:8234519373253706290", + "name": "text", + "type": 9 + }, + { + "id": "7:5084802055406173119", + "name": "read", + "type": 1 + } + ], + "relations": [] } ], - "lastEntityId": "12:4865606913057136676", - "lastIndexId": "2:428171949166894655", + "lastEntityId": "14:3621615714595976689", + "lastIndexId": "4:8487631368009819350", "lastRelationId": "0:0", "lastSequenceId": "0:0", "modelVersion": 5, "modelVersionParserMinimum": 5, "retiredEntityUids": [ 3121960281516643928, - 3330049220205502332 + 3330049220205502332, + 8606238749478059367, + 9126058286032860192 ], "retiredIndexUids": [], "retiredPropertyUids": [ @@ -405,7 +412,21 @@ 3530187464938423960, 2939471599149775609, 4870701960967093484, - 9072329172508444422 + 9072329172508444422, + 3236243497308902958, + 1689142031630531044, + 9168654785572108691, + 3167039386322657979, + 371212500165499194, + 7798301556204918939, + 4056540326670791484, + 2028590175083469347, + 7733678916130816919, + 5111729991837061065, + 2981635918450905844, + 4551221086536914442, + 1176594062059570557, + 4272081635478028034 ], "retiredRelationUids": [], "version": 1 diff --git a/lib/objectbox.g.dart b/lib/objectbox.g.dart index 4345807..2ac6781 100644 --- a/lib/objectbox.g.dart +++ b/lib/objectbox.g.dart @@ -29,449 +29,387 @@ export 'package:objectbox/objectbox.dart'; // so that callers only have to impor final _entities = [ obx_int.ModelEntity( - id: const obx_int.IdUid(2, 1900005481935470756), - name: 'EnqueuedMessage', - lastPropertyId: const obx_int.IdUid(4, 4315208696498141362), - flags: 0, - properties: [ - obx_int.ModelProperty( - id: const obx_int.IdUid(1, 3300983318147351068), - name: 'id', - type: 6, - flags: 1, - ), - obx_int.ModelProperty( - id: const obx_int.IdUid(2, 9210049710668674502), - name: 'messageId', - type: 9, - flags: 0, - ), - obx_int.ModelProperty( - id: const obx_int.IdUid(3, 7408744652169267115), - name: 'topic', - type: 9, - flags: 0, - ), - obx_int.ModelProperty( - id: const obx_int.IdUid(4, 4315208696498141362), - name: 'payload', - type: 9, - flags: 0, - ), - ], - relations: [], - backlinks: [], - ), + id: const obx_int.IdUid(2, 1900005481935470756), + name: 'EnqueuedMessage', + lastPropertyId: const obx_int.IdUid(4, 4315208696498141362), + flags: 0, + properties: [ + obx_int.ModelProperty( + id: const obx_int.IdUid(1, 3300983318147351068), + name: 'id', + type: 6, + flags: 1), + obx_int.ModelProperty( + id: const obx_int.IdUid(2, 9210049710668674502), + name: 'messageId', + type: 9, + flags: 0), + obx_int.ModelProperty( + id: const obx_int.IdUid(3, 7408744652169267115), + name: 'topic', + type: 9, + flags: 0), + obx_int.ModelProperty( + id: const obx_int.IdUid(4, 4315208696498141362), + name: 'payload', + type: 9, + flags: 0) + ], + relations: [], + backlinks: []), obx_int.ModelEntity( - id: const obx_int.IdUid(3, 808686831791135454), - name: 'Job', - lastPropertyId: const obx_int.IdUid(12, 5320049580625017283), - flags: 0, - properties: [ - obx_int.ModelProperty( - id: const obx_int.IdUid(1, 5216786081620356305), - name: 'id', - type: 6, - flags: 1, - ), - obx_int.ModelProperty( - id: const obx_int.IdUid(2, 8894906213962654908), - name: 'ver', - type: 9, - flags: 0, - ), - obx_int.ModelProperty( - id: const obx_int.IdUid(3, 3303839163899107532), - name: 'state', - type: 6, - flags: 0, - ), - obx_int.ModelProperty( - id: const obx_int.IdUid(4, 3119487970513925946), - name: 'crFilter', - type: 9, - flags: 0, - ), - obx_int.ModelProperty( - id: const obx_int.IdUid(5, 4732141596159047170), - name: 'ordertime', - type: 6, - flags: 0, - ), - obx_int.ModelProperty( - id: const obx_int.IdUid(6, 1449947228203387059), - name: 'offsWarn', - type: 6, - flags: 0, - ), - obx_int.ModelProperty( - id: const obx_int.IdUid(7, 3209886298748159414), - name: 'global', - type: 1, - flags: 0, - ), - obx_int.ModelProperty( - id: const obx_int.IdUid(8, 6098449484765014411), - name: 'vhtId', - type: 6, - flags: 0, - ), - obx_int.ModelProperty( - id: const obx_int.IdUid(9, 1076725124291766663), - name: 'rem', - type: 9, - flags: 0, - ), - obx_int.ModelProperty( - id: const obx_int.IdUid(10, 3500399465824083528), - name: 'delayOrderTime', - type: 6, - flags: 0, - ), - obx_int.ModelProperty( - id: const obx_int.IdUid(11, 3214338916427673014), - name: 'toursJson', - type: 9, - flags: 0, - ), - obx_int.ModelProperty( - id: const obx_int.IdUid(12, 5320049580625017283), - name: 'externalId', - type: 6, - flags: 40, - indexId: const obx_int.IdUid(1, 2108836818156887439), - ), - ], - relations: [], - backlinks: [], - ), + id: const obx_int.IdUid(3, 808686831791135454), + name: 'Job', + lastPropertyId: const obx_int.IdUid(13, 1803006975816940878), + flags: 0, + properties: [ + obx_int.ModelProperty( + id: const obx_int.IdUid(1, 5216786081620356305), + name: 'id', + type: 6, + flags: 1), + obx_int.ModelProperty( + id: const obx_int.IdUid(2, 8894906213962654908), + name: 'ver', + type: 9, + flags: 0), + obx_int.ModelProperty( + id: const obx_int.IdUid(3, 3303839163899107532), + name: 'state', + type: 6, + flags: 0), + obx_int.ModelProperty( + id: const obx_int.IdUid(4, 3119487970513925946), + name: 'crFilter', + type: 9, + flags: 0), + obx_int.ModelProperty( + id: const obx_int.IdUid(5, 4732141596159047170), + name: 'ordertime', + type: 6, + flags: 0), + obx_int.ModelProperty( + id: const obx_int.IdUid(6, 1449947228203387059), + name: 'offsWarn', + type: 6, + flags: 0), + obx_int.ModelProperty( + id: const obx_int.IdUid(7, 3209886298748159414), + name: 'global', + type: 1, + flags: 0), + obx_int.ModelProperty( + id: const obx_int.IdUid(8, 6098449484765014411), + name: 'vhtId', + type: 6, + flags: 0), + obx_int.ModelProperty( + id: const obx_int.IdUid(9, 1076725124291766663), + name: 'rem', + type: 9, + flags: 0), + obx_int.ModelProperty( + id: const obx_int.IdUid(10, 3500399465824083528), + name: 'delayOrderTime', + type: 6, + flags: 0), + obx_int.ModelProperty( + id: const obx_int.IdUid(11, 3214338916427673014), + name: 'toursJson', + type: 9, + flags: 0), + obx_int.ModelProperty( + id: const obx_int.IdUid(12, 5320049580625017283), + name: 'externalId', + type: 6, + flags: 40, + indexId: const obx_int.IdUid(1, 2108836818156887439)), + obx_int.ModelProperty( + id: const obx_int.IdUid(13, 1803006975816940878), + name: 'filesJson', + type: 9, + flags: 0) + ], + relations: [], + backlinks: []), obx_int.ModelEntity( - id: const obx_int.IdUid(4, 8465470793923038042), - name: 'LocationStatus', - lastPropertyId: const obx_int.IdUid(4, 946656881802398278), - flags: 0, - properties: [ - obx_int.ModelProperty( - id: const obx_int.IdUid(1, 7878463571761872972), - name: 'id', - type: 6, - flags: 1, - ), - obx_int.ModelProperty( - id: const obx_int.IdUid(2, 5068730443811682471), - name: 'zip', - type: 9, - flags: 0, - ), - obx_int.ModelProperty( - id: const obx_int.IdUid(3, 2759928435998483383), - name: 'area', - type: 9, - flags: 0, - ), - obx_int.ModelProperty( - id: const obx_int.IdUid(4, 946656881802398278), - name: 'zipReal', - type: 9, - flags: 0, - ), - ], - relations: [], - backlinks: [], - ), + id: const obx_int.IdUid(4, 8465470793923038042), + name: 'LocationStatus', + lastPropertyId: const obx_int.IdUid(4, 946656881802398278), + flags: 0, + properties: [ + obx_int.ModelProperty( + id: const obx_int.IdUid(1, 7878463571761872972), + name: 'id', + type: 6, + flags: 1), + obx_int.ModelProperty( + id: const obx_int.IdUid(2, 5068730443811682471), + name: 'zip', + type: 9, + flags: 0), + obx_int.ModelProperty( + id: const obx_int.IdUid(3, 2759928435998483383), + name: 'area', + type: 9, + flags: 0), + obx_int.ModelProperty( + id: const obx_int.IdUid(4, 946656881802398278), + name: 'zipReal', + type: 9, + flags: 0) + ], + relations: [], + backlinks: []), obx_int.ModelEntity( - id: const obx_int.IdUid(5, 2550695273986067070), - name: 'LogEntry', - lastPropertyId: const obx_int.IdUid(4, 25366889950650452), - flags: 0, - properties: [ - obx_int.ModelProperty( - id: const obx_int.IdUid(1, 7926124814316455592), - name: 'id', - type: 6, - flags: 1, - ), - obx_int.ModelProperty( - id: const obx_int.IdUid(2, 7429096942006040633), - name: 'time', - type: 10, - flags: 0, - ), - obx_int.ModelProperty( - id: const obx_int.IdUid(3, 142738454977074579), - name: 'severity', - type: 6, - flags: 0, - ), - obx_int.ModelProperty( - id: const obx_int.IdUid(4, 25366889950650452), - name: 'text', - type: 9, - flags: 0, - ), - ], - relations: [], - backlinks: [], - ), + id: const obx_int.IdUid(5, 2550695273986067070), + name: 'LogEntry', + lastPropertyId: const obx_int.IdUid(4, 25366889950650452), + flags: 0, + properties: [ + obx_int.ModelProperty( + id: const obx_int.IdUid(1, 7926124814316455592), + name: 'id', + type: 6, + flags: 1), + obx_int.ModelProperty( + id: const obx_int.IdUid(2, 7429096942006040633), + name: 'time', + type: 10, + flags: 0), + obx_int.ModelProperty( + id: const obx_int.IdUid(3, 142738454977074579), + name: 'severity', + type: 6, + flags: 0), + obx_int.ModelProperty( + id: const obx_int.IdUid(4, 25366889950650452), + name: 'text', + type: 9, + flags: 0) + ], + relations: [], + backlinks: []), obx_int.ModelEntity( - id: const obx_int.IdUid(6, 8578494735294491413), - name: 'Picture', - lastPropertyId: const obx_int.IdUid(4, 8471947406218406695), - flags: 0, - properties: [ - obx_int.ModelProperty( - id: const obx_int.IdUid(1, 8233658715755176189), - name: 'id', - type: 6, - flags: 1, - ), - obx_int.ModelProperty( - id: const obx_int.IdUid(2, 3598678677730019293), - name: 'tourId', - type: 6, - flags: 0, - ), - obx_int.ModelProperty( - id: const obx_int.IdUid(3, 8439819560525061668), - name: 'number', - type: 6, - flags: 0, - ), - obx_int.ModelProperty( - id: const obx_int.IdUid(4, 8471947406218406695), - name: 'data', - type: 9, - flags: 0, - ), - ], - relations: [], - backlinks: [], - ), + id: const obx_int.IdUid(6, 8578494735294491413), + name: 'Picture', + lastPropertyId: const obx_int.IdUid(4, 8471947406218406695), + flags: 0, + properties: [ + obx_int.ModelProperty( + id: const obx_int.IdUid(1, 8233658715755176189), + name: 'id', + type: 6, + flags: 1), + obx_int.ModelProperty( + id: const obx_int.IdUid(2, 3598678677730019293), + name: 'tourId', + type: 6, + flags: 0), + obx_int.ModelProperty( + id: const obx_int.IdUid(3, 8439819560525061668), + name: 'number', + type: 6, + flags: 0), + obx_int.ModelProperty( + id: const obx_int.IdUid(4, 8471947406218406695), + name: 'data', + type: 9, + flags: 0) + ], + relations: [], + backlinks: []), obx_int.ModelEntity( - id: const obx_int.IdUid(7, 2548574384262878250), - name: 'Ranking', - lastPropertyId: const obx_int.IdUid(2, 1452725296922082150), - flags: 0, - properties: [ - obx_int.ModelProperty( - id: const obx_int.IdUid(1, 7118038767191691106), - name: 'id', - type: 6, - flags: 1, - ), - obx_int.ModelProperty( - id: const obx_int.IdUid(2, 1452725296922082150), - name: 'ranksJson', - type: 9, - flags: 0, - ), - ], - relations: [], - backlinks: [], - ), + id: const obx_int.IdUid(7, 2548574384262878250), + name: 'Ranking', + lastPropertyId: const obx_int.IdUid(2, 1452725296922082150), + flags: 0, + properties: [ + obx_int.ModelProperty( + id: const obx_int.IdUid(1, 7118038767191691106), + name: 'id', + type: 6, + flags: 1), + obx_int.ModelProperty( + id: const obx_int.IdUid(2, 1452725296922082150), + name: 'ranksJson', + type: 9, + flags: 0) + ], + relations: [], + backlinks: []), obx_int.ModelEntity( - id: const obx_int.IdUid(8, 2017786340054665973), - name: 'SessionStatus', - lastPropertyId: const obx_int.IdUid(11, 3261302622742923576), - flags: 0, - properties: [ - obx_int.ModelProperty( - id: const obx_int.IdUid(1, 3031533826735683075), - name: 'id', - type: 6, - flags: 1, - ), - obx_int.ModelProperty( - id: const obx_int.IdUid(2, 7909042823552092798), - name: 'custId', - type: 6, - flags: 0, - ), - obx_int.ModelProperty( - id: const obx_int.IdUid(3, 7042631773737541316), - name: 'hqId', - type: 6, - flags: 0, - ), - obx_int.ModelProperty( - id: const obx_int.IdUid(4, 2110246729553520570), - name: 'usrId', - type: 6, - flags: 0, - ), - obx_int.ModelProperty( - id: const obx_int.IdUid(5, 1816167905802287907), - name: 'crId', - type: 6, - flags: 0, - ), - obx_int.ModelProperty( - id: const obx_int.IdUid(6, 6893748738418511496), - name: 'sid', - type: 9, - flags: 0, - ), - obx_int.ModelProperty( - id: const obx_int.IdUid(7, 5132625371004843897), - name: 'vhtId', - type: 6, - flags: 0, - ), - obx_int.ModelProperty( - id: const obx_int.IdUid(8, 497003757522498160), - name: 'locZip', - type: 9, - flags: 0, - ), - obx_int.ModelProperty( - id: const obx_int.IdUid(9, 7881671035561328160), - name: 'serverVersion', - type: 9, - flags: 0, - ), - obx_int.ModelProperty( - id: const obx_int.IdUid(10, 8539036586265341170), - name: 'serverInstance', - type: 9, - flags: 0, - ), - obx_int.ModelProperty( - id: const obx_int.IdUid(11, 3261302622742923576), - name: 'bwvEnabled', - type: 1, - flags: 0, - ), - ], - relations: [], - backlinks: [], - ), + id: const obx_int.IdUid(8, 2017786340054665973), + name: 'SessionStatus', + lastPropertyId: const obx_int.IdUid(11, 3261302622742923576), + flags: 0, + properties: [ + obx_int.ModelProperty( + id: const obx_int.IdUid(1, 3031533826735683075), + name: 'id', + type: 6, + flags: 1), + obx_int.ModelProperty( + id: const obx_int.IdUid(2, 7909042823552092798), + name: 'custId', + type: 6, + flags: 0), + obx_int.ModelProperty( + id: const obx_int.IdUid(3, 7042631773737541316), + name: 'hqId', + type: 6, + flags: 0), + obx_int.ModelProperty( + id: const obx_int.IdUid(4, 2110246729553520570), + name: 'usrId', + type: 6, + flags: 0), + obx_int.ModelProperty( + id: const obx_int.IdUid(5, 1816167905802287907), + name: 'crId', + type: 6, + flags: 0), + obx_int.ModelProperty( + id: const obx_int.IdUid(6, 6893748738418511496), + name: 'sid', + type: 9, + flags: 0), + obx_int.ModelProperty( + id: const obx_int.IdUid(7, 5132625371004843897), + name: 'vhtId', + type: 6, + flags: 0), + obx_int.ModelProperty( + id: const obx_int.IdUid(8, 497003757522498160), + name: 'locZip', + type: 9, + flags: 0), + obx_int.ModelProperty( + id: const obx_int.IdUid(9, 7881671035561328160), + name: 'serverVersion', + type: 9, + flags: 0), + obx_int.ModelProperty( + id: const obx_int.IdUid(10, 8539036586265341170), + name: 'serverInstance', + type: 9, + flags: 0), + obx_int.ModelProperty( + id: const obx_int.IdUid(11, 3261302622742923576), + name: 'bwvEnabled', + type: 1, + flags: 0) + ], + relations: [], + backlinks: []), obx_int.ModelEntity( - id: const obx_int.IdUid(9, 3249643184099511839), - name: 'Status', - lastPropertyId: const obx_int.IdUid(4, 4970112377686786436), - flags: 0, - properties: [ - obx_int.ModelProperty( - id: const obx_int.IdUid(1, 7475926067533914770), - name: 'id', - type: 6, - flags: 1, - ), - obx_int.ModelProperty( - id: const obx_int.IdUid(2, 3333419739867469217), - name: 'posZip', - type: 9, - flags: 0, - ), - obx_int.ModelProperty( - id: const obx_int.IdUid(3, 7999157864794363157), - name: 'posArea', - type: 9, - flags: 0, - ), - obx_int.ModelProperty( - id: const obx_int.IdUid(4, 4970112377686786436), - name: 'posZipReal', - type: 9, - flags: 0, - ), - ], - relations: [], - backlinks: [], - ), + id: const obx_int.IdUid(9, 3249643184099511839), + name: 'Status', + lastPropertyId: const obx_int.IdUid(4, 4970112377686786436), + flags: 0, + properties: [ + obx_int.ModelProperty( + id: const obx_int.IdUid(1, 7475926067533914770), + name: 'id', + type: 6, + flags: 1), + obx_int.ModelProperty( + id: const obx_int.IdUid(2, 3333419739867469217), + name: 'posZip', + type: 9, + flags: 0), + obx_int.ModelProperty( + id: const obx_int.IdUid(3, 7999157864794363157), + name: 'posArea', + type: 9, + flags: 0), + obx_int.ModelProperty( + id: const obx_int.IdUid(4, 4970112377686786436), + name: 'posZipReal', + type: 9, + flags: 0) + ], + relations: [], + backlinks: []), obx_int.ModelEntity( - id: const obx_int.IdUid(11, 8606238749478059367), - name: 'ChatMessage', - lastPropertyId: const obx_int.IdUid(7, 4056540326670791484), - flags: 0, - properties: [ - obx_int.ModelProperty( - id: const obx_int.IdUid(1, 3236243497308902958), - name: 'id', - type: 6, - flags: 1, - ), - obx_int.ModelProperty( - id: const obx_int.IdUid(2, 1689142031630531044), - name: 'time', - type: 6, - flags: 0, - ), - obx_int.ModelProperty( - id: const obx_int.IdUid(3, 9168654785572108691), - name: 'from', - type: 9, - flags: 0, - ), - obx_int.ModelProperty( - id: const obx_int.IdUid(4, 3167039386322657979), - name: 'subj', - type: 9, - flags: 0, - ), - obx_int.ModelProperty( - id: const obx_int.IdUid(5, 371212500165499194), - name: 'text', - type: 9, - flags: 0, - ), - obx_int.ModelProperty( - id: const obx_int.IdUid(6, 7798301556204918939), - name: 'read', - type: 1, - flags: 0, - ), - obx_int.ModelProperty( - id: const obx_int.IdUid(7, 4056540326670791484), - name: 'externalId', - type: 6, - flags: 40, - indexId: const obx_int.IdUid(2, 428171949166894655), - ), - ], - relations: [], - backlinks: [], - ), + id: const obx_int.IdUid(12, 4865606913057136676), + name: 'TaskInfo', + lastPropertyId: const obx_int.IdUid(5, 4858121848992922038), + flags: 0, + properties: [ + obx_int.ModelProperty( + id: const obx_int.IdUid(1, 8874807593467526189), + name: 'id', + type: 6, + flags: 1), + obx_int.ModelProperty( + id: const obx_int.IdUid(2, 1555074981837956508), + name: 'sId', + type: 6, + flags: 0), + obx_int.ModelProperty( + id: const obx_int.IdUid(3, 4882275733695652364), + name: 'additionalText', + type: 9, + flags: 0), + obx_int.ModelProperty( + id: const obx_int.IdUid(4, 8255231557511579852), + name: 'answer', + type: 9, + flags: 0), + obx_int.ModelProperty( + id: const obx_int.IdUid(5, 4858121848992922038), + name: 'completed', + type: 1, + flags: 0) + ], + relations: [], + backlinks: []), obx_int.ModelEntity( - id: const obx_int.IdUid(12, 4865606913057136676), - name: 'TaskInfo', - lastPropertyId: const obx_int.IdUid(5, 4858121848992922038), - flags: 0, - properties: [ - obx_int.ModelProperty( - id: const obx_int.IdUid(1, 8874807593467526189), - name: 'id', - type: 6, - flags: 1, - ), - obx_int.ModelProperty( - id: const obx_int.IdUid(2, 1555074981837956508), - name: 'sId', - type: 6, - flags: 0, - ), - obx_int.ModelProperty( - id: const obx_int.IdUid(3, 4882275733695652364), - name: 'additionalText', - type: 9, - flags: 0, - ), - obx_int.ModelProperty( - id: const obx_int.IdUid(4, 8255231557511579852), - name: 'answer', - type: 9, - flags: 0, - ), - obx_int.ModelProperty( - id: const obx_int.IdUid(5, 4858121848992922038), - name: 'completed', - type: 1, - flags: 0, - ), - ], - relations: [], - backlinks: [], - ), + id: const obx_int.IdUid(14, 3621615714595976689), + name: 'ChatMessage', + lastPropertyId: const obx_int.IdUid(7, 5084802055406173119), + flags: 0, + properties: [ + obx_int.ModelProperty( + id: const obx_int.IdUid(1, 8160599835026826926), + name: 'id', + type: 6, + flags: 1), + obx_int.ModelProperty( + id: const obx_int.IdUid(2, 5736027494386837185), + name: 'externalId', + type: 6, + flags: 40, + indexId: const obx_int.IdUid(4, 8487631368009819350)), + obx_int.ModelProperty( + id: const obx_int.IdUid(3, 4672344908186587803), + name: 'time', + type: 6, + flags: 0), + obx_int.ModelProperty( + id: const obx_int.IdUid(4, 2026513613729432961), + name: 'from', + type: 9, + flags: 0), + obx_int.ModelProperty( + id: const obx_int.IdUid(5, 6544369704442218939), + name: 'subj', + type: 9, + flags: 0), + obx_int.ModelProperty( + id: const obx_int.IdUid(6, 8234519373253706290), + name: 'text', + type: 9, + flags: 0), + obx_int.ModelProperty( + id: const obx_int.IdUid(7, 5084802055406173119), + name: 'read', + type: 1, + flags: 0) + ], + relations: [], + backlinks: []) ]; /// Shortcut for [obx.Store.new] that passes [getObjectBoxModel] and for Flutter @@ -485,526 +423,474 @@ final _entities = [ /// For Flutter apps, also calls `loadObjectBoxLibraryAndroidCompat()` from /// the ObjectBox Flutter library to fix loading the native ObjectBox library /// on Android 6 and older. -Future openStore({ - String? directory, - int? maxDBSizeInKB, - int? maxDataSizeInKB, - int? fileMode, - int? maxReaders, - bool queriesCaseSensitiveDefault = true, - String? macosApplicationGroup, -}) async { +Future openStore( + {String? directory, + int? maxDBSizeInKB, + int? maxDataSizeInKB, + int? fileMode, + int? maxReaders, + bool queriesCaseSensitiveDefault = true, + String? macosApplicationGroup}) async { await loadObjectBoxLibraryAndroidCompat(); - return obx.Store( - getObjectBoxModel(), - directory: directory ?? (await defaultStoreDirectory()).path, - maxDBSizeInKB: maxDBSizeInKB, - maxDataSizeInKB: maxDataSizeInKB, - fileMode: fileMode, - maxReaders: maxReaders, - queriesCaseSensitiveDefault: queriesCaseSensitiveDefault, - macosApplicationGroup: macosApplicationGroup, - ); + return obx.Store(getObjectBoxModel(), + directory: directory ?? (await defaultStoreDirectory()).path, + maxDBSizeInKB: maxDBSizeInKB, + maxDataSizeInKB: maxDataSizeInKB, + fileMode: fileMode, + maxReaders: maxReaders, + queriesCaseSensitiveDefault: queriesCaseSensitiveDefault, + macosApplicationGroup: macosApplicationGroup); } /// Returns the ObjectBox model definition for this project for use with /// [obx.Store.new]. obx_int.ModelDefinition getObjectBoxModel() { final model = obx_int.ModelInfo( - entities: _entities, - lastEntityId: const obx_int.IdUid(12, 4865606913057136676), - lastIndexId: const obx_int.IdUid(2, 428171949166894655), - lastRelationId: const obx_int.IdUid(0, 0), - lastSequenceId: const obx_int.IdUid(0, 0), - retiredEntityUids: const [3121960281516643928, 3330049220205502332], - retiredIndexUids: const [], - retiredPropertyUids: const [ - 2911299806708299572, - 5499360845675591736, - 6629677753597654195, - 2459198878504939029, - 1821648847924307341, - 2516901162497323279, - 7500431799407089850, - 3530187464938423960, - 2939471599149775609, - 4870701960967093484, - 9072329172508444422, - ], - retiredRelationUids: const [], - modelVersion: 5, - modelVersionParserMinimum: 5, - version: 1, - ); + entities: _entities, + lastEntityId: const obx_int.IdUid(14, 3621615714595976689), + lastIndexId: const obx_int.IdUid(4, 8487631368009819350), + lastRelationId: const obx_int.IdUid(0, 0), + lastSequenceId: const obx_int.IdUid(0, 0), + retiredEntityUids: const [ + 3121960281516643928, + 3330049220205502332, + 8606238749478059367, + 9126058286032860192 + ], + retiredIndexUids: const [], + retiredPropertyUids: const [ + 2911299806708299572, + 5499360845675591736, + 6629677753597654195, + 2459198878504939029, + 1821648847924307341, + 2516901162497323279, + 7500431799407089850, + 3530187464938423960, + 2939471599149775609, + 4870701960967093484, + 9072329172508444422, + 3236243497308902958, + 1689142031630531044, + 9168654785572108691, + 3167039386322657979, + 371212500165499194, + 7798301556204918939, + 4056540326670791484, + 2028590175083469347, + 7733678916130816919, + 5111729991837061065, + 2981635918450905844, + 4551221086536914442, + 1176594062059570557, + 4272081635478028034 + ], + retiredRelationUids: const [], + modelVersion: 5, + modelVersionParserMinimum: 5, + version: 1); final bindings = { EnqueuedMessage: obx_int.EntityDefinition( - model: _entities[0], - toOneRelations: (EnqueuedMessage object) => [], - toManyRelations: (EnqueuedMessage object) => {}, - getId: (EnqueuedMessage object) => object.id, - setId: (EnqueuedMessage object, int id) { - object.id = id; - }, - objectToFB: (EnqueuedMessage object, fb.Builder fbb) { - final messageIdOffset = fbb.writeString(object.messageId); - final topicOffset = fbb.writeString(object.topic); - final payloadOffset = fbb.writeString(object.payload); - fbb.startTable(5); - fbb.addInt64(0, object.id); - fbb.addOffset(1, messageIdOffset); - fbb.addOffset(2, topicOffset); - fbb.addOffset(3, payloadOffset); - fbb.finish(fbb.endTable()); - return object.id; - }, - objectFromFB: (obx.Store store, ByteData fbData) { - final buffer = fb.BufferContext(fbData); - final rootOffset = buffer.derefObject(0); + model: _entities[0], + toOneRelations: (EnqueuedMessage object) => [], + toManyRelations: (EnqueuedMessage object) => {}, + getId: (EnqueuedMessage object) => object.id, + setId: (EnqueuedMessage object, int id) { + object.id = id; + }, + objectToFB: (EnqueuedMessage object, fb.Builder fbb) { + final messageIdOffset = fbb.writeString(object.messageId); + final topicOffset = fbb.writeString(object.topic); + final payloadOffset = fbb.writeString(object.payload); + fbb.startTable(5); + fbb.addInt64(0, object.id); + fbb.addOffset(1, messageIdOffset); + fbb.addOffset(2, topicOffset); + fbb.addOffset(3, payloadOffset); + fbb.finish(fbb.endTable()); + return object.id; + }, + objectFromFB: (obx.Store store, ByteData fbData) { + final buffer = fb.BufferContext(fbData); + final rootOffset = buffer.derefObject(0); - final object = EnqueuedMessage() - ..id = const fb.Int64Reader().vTableGet(buffer, rootOffset, 4, 0) - ..messageId = const fb.StringReader( - asciiOptimization: true, - ).vTableGet(buffer, rootOffset, 6, '') - ..topic = const fb.StringReader( - asciiOptimization: true, - ).vTableGet(buffer, rootOffset, 8, '') - ..payload = const fb.StringReader( - asciiOptimization: true, - ).vTableGet(buffer, rootOffset, 10, ''); + final object = EnqueuedMessage() + ..id = const fb.Int64Reader().vTableGet(buffer, rootOffset, 4, 0) + ..messageId = const fb.StringReader(asciiOptimization: true) + .vTableGet(buffer, rootOffset, 6, '') + ..topic = const fb.StringReader(asciiOptimization: true) + .vTableGet(buffer, rootOffset, 8, '') + ..payload = const fb.StringReader(asciiOptimization: true) + .vTableGet(buffer, rootOffset, 10, ''); - return object; - }, - ), + return object; + }), Job: obx_int.EntityDefinition( - model: _entities[1], - toOneRelations: (Job object) => [], - toManyRelations: (Job object) => {}, - getId: (Job object) => object.id, - setId: (Job object, int id) { - object.id = id; - }, - objectToFB: (Job object, fb.Builder fbb) { - final verOffset = fbb.writeString(object.ver); - final crFilterOffset = object.crFilter == null - ? null - : fbb.writeString(object.crFilter!); - final remOffset = fbb.writeString(object.rem); - final toursJsonOffset = fbb.writeString(object.toursJson); - fbb.startTable(13); - fbb.addInt64(0, object.id); - fbb.addOffset(1, verOffset); - fbb.addInt64(2, object.state); - fbb.addOffset(3, crFilterOffset); - fbb.addInt64(4, object.ordertime); - fbb.addInt64(5, object.offsWarn); - fbb.addBool(6, object.global); - fbb.addInt64(7, object.vhtId); - fbb.addOffset(8, remOffset); - fbb.addInt64(9, object.delayOrderTime); - fbb.addOffset(10, toursJsonOffset); - fbb.addInt64(11, object.externalId); - fbb.finish(fbb.endTable()); - return object.id; - }, - objectFromFB: (obx.Store store, ByteData fbData) { - final buffer = fb.BufferContext(fbData); - final rootOffset = buffer.derefObject(0); + model: _entities[1], + toOneRelations: (Job object) => [], + toManyRelations: (Job object) => {}, + getId: (Job object) => object.id, + setId: (Job object, int id) { + object.id = id; + }, + objectToFB: (Job object, fb.Builder fbb) { + final verOffset = fbb.writeString(object.ver); + final crFilterOffset = object.crFilter == null + ? null + : fbb.writeString(object.crFilter!); + final remOffset = fbb.writeString(object.rem); + final toursJsonOffset = fbb.writeString(object.toursJson); + final filesJsonOffset = fbb.writeString(object.filesJson); + fbb.startTable(14); + fbb.addInt64(0, object.id); + fbb.addOffset(1, verOffset); + fbb.addInt64(2, object.state); + fbb.addOffset(3, crFilterOffset); + fbb.addInt64(4, object.ordertime); + fbb.addInt64(5, object.offsWarn); + fbb.addBool(6, object.global); + fbb.addInt64(7, object.vhtId); + fbb.addOffset(8, remOffset); + fbb.addInt64(9, object.delayOrderTime); + fbb.addOffset(10, toursJsonOffset); + fbb.addInt64(11, object.externalId); + fbb.addOffset(12, filesJsonOffset); + fbb.finish(fbb.endTable()); + return object.id; + }, + objectFromFB: (obx.Store store, ByteData fbData) { + final buffer = fb.BufferContext(fbData); + final rootOffset = buffer.derefObject(0); - final object = Job() - ..id = const fb.Int64Reader().vTableGet(buffer, rootOffset, 4, 0) - ..ver = const fb.StringReader( - asciiOptimization: true, - ).vTableGet(buffer, rootOffset, 6, '') - ..state = const fb.Int64Reader().vTableGet(buffer, rootOffset, 8, 0) - ..crFilter = const fb.StringReader( - asciiOptimization: true, - ).vTableGetNullable(buffer, rootOffset, 10) - ..ordertime = const fb.Int64Reader().vTableGet( - buffer, - rootOffset, - 12, - 0, - ) - ..offsWarn = const fb.Int64Reader().vTableGet( - buffer, - rootOffset, - 14, - 0, - ) - ..global = const fb.BoolReader().vTableGet( - buffer, - rootOffset, - 16, - false, - ) - ..vhtId = const fb.Int64Reader().vTableGet(buffer, rootOffset, 18, 0) - ..rem = const fb.StringReader( - asciiOptimization: true, - ).vTableGet(buffer, rootOffset, 20, '') - ..delayOrderTime = const fb.Int64Reader().vTableGet( - buffer, - rootOffset, - 22, - 0, - ) - ..toursJson = const fb.StringReader( - asciiOptimization: true, - ).vTableGet(buffer, rootOffset, 24, '') - ..externalId = const fb.Int64Reader().vTableGet( - buffer, - rootOffset, - 26, - 0, - ); + final object = Job() + ..id = const fb.Int64Reader().vTableGet(buffer, rootOffset, 4, 0) + ..ver = const fb.StringReader(asciiOptimization: true) + .vTableGet(buffer, rootOffset, 6, '') + ..state = const fb.Int64Reader().vTableGet(buffer, rootOffset, 8, 0) + ..crFilter = const fb.StringReader(asciiOptimization: true) + .vTableGetNullable(buffer, rootOffset, 10) + ..ordertime = + const fb.Int64Reader().vTableGet(buffer, rootOffset, 12, 0) + ..offsWarn = + const fb.Int64Reader().vTableGet(buffer, rootOffset, 14, 0) + ..global = + const fb.BoolReader().vTableGet(buffer, rootOffset, 16, false) + ..vhtId = + const fb.Int64Reader().vTableGet(buffer, rootOffset, 18, 0) + ..rem = const fb.StringReader(asciiOptimization: true) + .vTableGet(buffer, rootOffset, 20, '') + ..delayOrderTime = + const fb.Int64Reader().vTableGet(buffer, rootOffset, 22, 0) + ..toursJson = const fb.StringReader(asciiOptimization: true) + .vTableGet(buffer, rootOffset, 24, '') + ..externalId = + const fb.Int64Reader().vTableGet(buffer, rootOffset, 26, 0) + ..filesJson = const fb.StringReader(asciiOptimization: true) + .vTableGet(buffer, rootOffset, 28, ''); - return object; - }, - ), + return object; + }), LocationStatus: obx_int.EntityDefinition( - model: _entities[2], - toOneRelations: (LocationStatus object) => [], - toManyRelations: (LocationStatus object) => {}, - getId: (LocationStatus object) => object.id, - setId: (LocationStatus object, int id) { - object.id = id; - }, - objectToFB: (LocationStatus object, fb.Builder fbb) { - final zipOffset = fbb.writeString(object.zip); - final areaOffset = fbb.writeString(object.area); - final zipRealOffset = fbb.writeString(object.zipReal); - fbb.startTable(5); - fbb.addInt64(0, object.id); - fbb.addOffset(1, zipOffset); - fbb.addOffset(2, areaOffset); - fbb.addOffset(3, zipRealOffset); - fbb.finish(fbb.endTable()); - return object.id; - }, - objectFromFB: (obx.Store store, ByteData fbData) { - final buffer = fb.BufferContext(fbData); - final rootOffset = buffer.derefObject(0); + model: _entities[2], + toOneRelations: (LocationStatus object) => [], + toManyRelations: (LocationStatus object) => {}, + getId: (LocationStatus object) => object.id, + setId: (LocationStatus object, int id) { + object.id = id; + }, + objectToFB: (LocationStatus object, fb.Builder fbb) { + final zipOffset = fbb.writeString(object.zip); + final areaOffset = fbb.writeString(object.area); + final zipRealOffset = fbb.writeString(object.zipReal); + fbb.startTable(5); + fbb.addInt64(0, object.id); + fbb.addOffset(1, zipOffset); + fbb.addOffset(2, areaOffset); + fbb.addOffset(3, zipRealOffset); + fbb.finish(fbb.endTable()); + return object.id; + }, + objectFromFB: (obx.Store store, ByteData fbData) { + final buffer = fb.BufferContext(fbData); + final rootOffset = buffer.derefObject(0); - final object = LocationStatus() - ..id = const fb.Int64Reader().vTableGet(buffer, rootOffset, 4, 0) - ..zip = const fb.StringReader( - asciiOptimization: true, - ).vTableGet(buffer, rootOffset, 6, '') - ..area = const fb.StringReader( - asciiOptimization: true, - ).vTableGet(buffer, rootOffset, 8, '') - ..zipReal = const fb.StringReader( - asciiOptimization: true, - ).vTableGet(buffer, rootOffset, 10, ''); + final object = LocationStatus() + ..id = const fb.Int64Reader().vTableGet(buffer, rootOffset, 4, 0) + ..zip = const fb.StringReader(asciiOptimization: true) + .vTableGet(buffer, rootOffset, 6, '') + ..area = const fb.StringReader(asciiOptimization: true) + .vTableGet(buffer, rootOffset, 8, '') + ..zipReal = const fb.StringReader(asciiOptimization: true) + .vTableGet(buffer, rootOffset, 10, ''); - return object; - }, - ), + return object; + }), LogEntry: obx_int.EntityDefinition( - model: _entities[3], - toOneRelations: (LogEntry object) => [], - toManyRelations: (LogEntry object) => {}, - getId: (LogEntry object) => object.id, - setId: (LogEntry object, int id) { - object.id = id; - }, - objectToFB: (LogEntry object, fb.Builder fbb) { - final textOffset = fbb.writeString(object.text); - fbb.startTable(5); - fbb.addInt64(0, object.id); - fbb.addInt64(1, object.time.millisecondsSinceEpoch); - fbb.addInt64(2, object.severity); - fbb.addOffset(3, textOffset); - fbb.finish(fbb.endTable()); - return object.id; - }, - objectFromFB: (obx.Store store, ByteData fbData) { - final buffer = fb.BufferContext(fbData); - final rootOffset = buffer.derefObject(0); + model: _entities[3], + toOneRelations: (LogEntry object) => [], + toManyRelations: (LogEntry object) => {}, + getId: (LogEntry object) => object.id, + setId: (LogEntry object, int id) { + object.id = id; + }, + objectToFB: (LogEntry object, fb.Builder fbb) { + final textOffset = fbb.writeString(object.text); + fbb.startTable(5); + fbb.addInt64(0, object.id); + fbb.addInt64(1, object.time.millisecondsSinceEpoch); + fbb.addInt64(2, object.severity); + fbb.addOffset(3, textOffset); + fbb.finish(fbb.endTable()); + return object.id; + }, + objectFromFB: (obx.Store store, ByteData fbData) { + final buffer = fb.BufferContext(fbData); + final rootOffset = buffer.derefObject(0); - final object = LogEntry() - ..id = const fb.Int64Reader().vTableGet(buffer, rootOffset, 4, 0) - ..time = DateTime.fromMillisecondsSinceEpoch( - const fb.Int64Reader().vTableGet(buffer, rootOffset, 6, 0), - ) - ..severity = const fb.Int64Reader().vTableGet( - buffer, - rootOffset, - 8, - 0, - ) - ..text = const fb.StringReader( - asciiOptimization: true, - ).vTableGet(buffer, rootOffset, 10, ''); + final object = LogEntry() + ..id = const fb.Int64Reader().vTableGet(buffer, rootOffset, 4, 0) + ..time = DateTime.fromMillisecondsSinceEpoch( + const fb.Int64Reader().vTableGet(buffer, rootOffset, 6, 0)) + ..severity = + const fb.Int64Reader().vTableGet(buffer, rootOffset, 8, 0) + ..text = const fb.StringReader(asciiOptimization: true) + .vTableGet(buffer, rootOffset, 10, ''); - return object; - }, - ), + return object; + }), Picture: obx_int.EntityDefinition( - model: _entities[4], - toOneRelations: (Picture object) => [], - toManyRelations: (Picture object) => {}, - getId: (Picture object) => object.id, - setId: (Picture object, int id) { - object.id = id; - }, - objectToFB: (Picture object, fb.Builder fbb) { - final dataOffset = fbb.writeString(object.data); - fbb.startTable(5); - fbb.addInt64(0, object.id); - fbb.addInt64(1, object.tourId); - fbb.addInt64(2, object.number); - fbb.addOffset(3, dataOffset); - fbb.finish(fbb.endTable()); - return object.id; - }, - objectFromFB: (obx.Store store, ByteData fbData) { - final buffer = fb.BufferContext(fbData); - final rootOffset = buffer.derefObject(0); + model: _entities[4], + toOneRelations: (Picture object) => [], + toManyRelations: (Picture object) => {}, + getId: (Picture object) => object.id, + setId: (Picture object, int id) { + object.id = id; + }, + objectToFB: (Picture object, fb.Builder fbb) { + final dataOffset = fbb.writeString(object.data); + fbb.startTable(5); + fbb.addInt64(0, object.id); + fbb.addInt64(1, object.tourId); + fbb.addInt64(2, object.number); + fbb.addOffset(3, dataOffset); + fbb.finish(fbb.endTable()); + return object.id; + }, + objectFromFB: (obx.Store store, ByteData fbData) { + final buffer = fb.BufferContext(fbData); + final rootOffset = buffer.derefObject(0); - final object = Picture() - ..id = const fb.Int64Reader().vTableGet(buffer, rootOffset, 4, 0) - ..tourId = const fb.Int64Reader().vTableGet(buffer, rootOffset, 6, 0) - ..number = const fb.Int64Reader().vTableGet(buffer, rootOffset, 8, 0) - ..data = const fb.StringReader( - asciiOptimization: true, - ).vTableGet(buffer, rootOffset, 10, ''); + final object = Picture() + ..id = const fb.Int64Reader().vTableGet(buffer, rootOffset, 4, 0) + ..tourId = + const fb.Int64Reader().vTableGet(buffer, rootOffset, 6, 0) + ..number = + const fb.Int64Reader().vTableGet(buffer, rootOffset, 8, 0) + ..data = const fb.StringReader(asciiOptimization: true) + .vTableGet(buffer, rootOffset, 10, ''); - return object; - }, - ), + return object; + }), Ranking: obx_int.EntityDefinition( - model: _entities[5], - toOneRelations: (Ranking object) => [], - toManyRelations: (Ranking object) => {}, - getId: (Ranking object) => object.id, - setId: (Ranking object, int id) { - object.id = id; - }, - objectToFB: (Ranking object, fb.Builder fbb) { - final ranksJsonOffset = fbb.writeString(object.ranksJson); - fbb.startTable(3); - fbb.addInt64(0, object.id); - fbb.addOffset(1, ranksJsonOffset); - fbb.finish(fbb.endTable()); - return object.id; - }, - objectFromFB: (obx.Store store, ByteData fbData) { - final buffer = fb.BufferContext(fbData); - final rootOffset = buffer.derefObject(0); + model: _entities[5], + toOneRelations: (Ranking object) => [], + toManyRelations: (Ranking object) => {}, + getId: (Ranking object) => object.id, + setId: (Ranking object, int id) { + object.id = id; + }, + objectToFB: (Ranking object, fb.Builder fbb) { + final ranksJsonOffset = fbb.writeString(object.ranksJson); + fbb.startTable(3); + fbb.addInt64(0, object.id); + fbb.addOffset(1, ranksJsonOffset); + fbb.finish(fbb.endTable()); + return object.id; + }, + objectFromFB: (obx.Store store, ByteData fbData) { + final buffer = fb.BufferContext(fbData); + final rootOffset = buffer.derefObject(0); - final object = Ranking() - ..id = const fb.Int64Reader().vTableGet(buffer, rootOffset, 4, 0) - ..ranksJson = const fb.StringReader( - asciiOptimization: true, - ).vTableGet(buffer, rootOffset, 6, ''); + final object = Ranking() + ..id = const fb.Int64Reader().vTableGet(buffer, rootOffset, 4, 0) + ..ranksJson = const fb.StringReader(asciiOptimization: true) + .vTableGet(buffer, rootOffset, 6, ''); - return object; - }, - ), + return object; + }), SessionStatus: obx_int.EntityDefinition( - model: _entities[6], - toOneRelations: (SessionStatus object) => [], - toManyRelations: (SessionStatus object) => {}, - getId: (SessionStatus object) => object.id, - setId: (SessionStatus object, int id) { - object.id = id; - }, - objectToFB: (SessionStatus object, fb.Builder fbb) { - final sidOffset = fbb.writeString(object.sid); - final locZipOffset = fbb.writeString(object.locZip); - final serverVersionOffset = fbb.writeString(object.serverVersion); - final serverInstanceOffset = fbb.writeString(object.serverInstance); - fbb.startTable(12); - fbb.addInt64(0, object.id); - fbb.addInt64(1, object.custId); - fbb.addInt64(2, object.hqId); - fbb.addInt64(3, object.usrId); - fbb.addInt64(4, object.crId); - fbb.addOffset(5, sidOffset); - fbb.addInt64(6, object.vhtId); - fbb.addOffset(7, locZipOffset); - fbb.addOffset(8, serverVersionOffset); - fbb.addOffset(9, serverInstanceOffset); - fbb.addBool(10, object.bwvEnabled); - fbb.finish(fbb.endTable()); - return object.id; - }, - objectFromFB: (obx.Store store, ByteData fbData) { - final buffer = fb.BufferContext(fbData); - final rootOffset = buffer.derefObject(0); + model: _entities[6], + toOneRelations: (SessionStatus object) => [], + toManyRelations: (SessionStatus object) => {}, + getId: (SessionStatus object) => object.id, + setId: (SessionStatus object, int id) { + object.id = id; + }, + objectToFB: (SessionStatus object, fb.Builder fbb) { + final sidOffset = fbb.writeString(object.sid); + final locZipOffset = fbb.writeString(object.locZip); + final serverVersionOffset = fbb.writeString(object.serverVersion); + final serverInstanceOffset = fbb.writeString(object.serverInstance); + fbb.startTable(12); + fbb.addInt64(0, object.id); + fbb.addInt64(1, object.custId); + fbb.addInt64(2, object.hqId); + fbb.addInt64(3, object.usrId); + fbb.addInt64(4, object.crId); + fbb.addOffset(5, sidOffset); + fbb.addInt64(6, object.vhtId); + fbb.addOffset(7, locZipOffset); + fbb.addOffset(8, serverVersionOffset); + fbb.addOffset(9, serverInstanceOffset); + fbb.addBool(10, object.bwvEnabled); + fbb.finish(fbb.endTable()); + return object.id; + }, + objectFromFB: (obx.Store store, ByteData fbData) { + final buffer = fb.BufferContext(fbData); + final rootOffset = buffer.derefObject(0); - final object = SessionStatus() - ..id = const fb.Int64Reader().vTableGet(buffer, rootOffset, 4, 0) - ..custId = const fb.Int64Reader().vTableGet(buffer, rootOffset, 6, 0) - ..hqId = const fb.Int64Reader().vTableGet(buffer, rootOffset, 8, 0) - ..usrId = const fb.Int64Reader().vTableGet(buffer, rootOffset, 10, 0) - ..crId = const fb.Int64Reader().vTableGet(buffer, rootOffset, 12, 0) - ..sid = const fb.StringReader( - asciiOptimization: true, - ).vTableGet(buffer, rootOffset, 14, '') - ..vhtId = const fb.Int64Reader().vTableGet(buffer, rootOffset, 16, 0) - ..locZip = const fb.StringReader( - asciiOptimization: true, - ).vTableGet(buffer, rootOffset, 18, '') - ..serverVersion = const fb.StringReader( - asciiOptimization: true, - ).vTableGet(buffer, rootOffset, 20, '') - ..serverInstance = const fb.StringReader( - asciiOptimization: true, - ).vTableGet(buffer, rootOffset, 22, '') - ..bwvEnabled = const fb.BoolReader().vTableGet( - buffer, - rootOffset, - 24, - false, - ); + final object = SessionStatus() + ..id = const fb.Int64Reader().vTableGet(buffer, rootOffset, 4, 0) + ..custId = + const fb.Int64Reader().vTableGet(buffer, rootOffset, 6, 0) + ..hqId = const fb.Int64Reader().vTableGet(buffer, rootOffset, 8, 0) + ..usrId = + const fb.Int64Reader().vTableGet(buffer, rootOffset, 10, 0) + ..crId = const fb.Int64Reader().vTableGet(buffer, rootOffset, 12, 0) + ..sid = const fb.StringReader(asciiOptimization: true) + .vTableGet(buffer, rootOffset, 14, '') + ..vhtId = + const fb.Int64Reader().vTableGet(buffer, rootOffset, 16, 0) + ..locZip = const fb.StringReader(asciiOptimization: true) + .vTableGet(buffer, rootOffset, 18, '') + ..serverVersion = const fb.StringReader(asciiOptimization: true) + .vTableGet(buffer, rootOffset, 20, '') + ..serverInstance = const fb.StringReader(asciiOptimization: true) + .vTableGet(buffer, rootOffset, 22, '') + ..bwvEnabled = + const fb.BoolReader().vTableGet(buffer, rootOffset, 24, false); - return object; - }, - ), + return object; + }), Status: obx_int.EntityDefinition( - model: _entities[7], - toOneRelations: (Status object) => [], - toManyRelations: (Status object) => {}, - getId: (Status object) => object.id, - setId: (Status object, int id) { - object.id = id; - }, - objectToFB: (Status object, fb.Builder fbb) { - final posZipOffset = fbb.writeString(object.posZip); - final posAreaOffset = fbb.writeString(object.posArea); - final posZipRealOffset = fbb.writeString(object.posZipReal); - fbb.startTable(5); - fbb.addInt64(0, object.id); - fbb.addOffset(1, posZipOffset); - fbb.addOffset(2, posAreaOffset); - fbb.addOffset(3, posZipRealOffset); - fbb.finish(fbb.endTable()); - return object.id; - }, - objectFromFB: (obx.Store store, ByteData fbData) { - final buffer = fb.BufferContext(fbData); - final rootOffset = buffer.derefObject(0); + model: _entities[7], + toOneRelations: (Status object) => [], + toManyRelations: (Status object) => {}, + getId: (Status object) => object.id, + setId: (Status object, int id) { + object.id = id; + }, + objectToFB: (Status object, fb.Builder fbb) { + final posZipOffset = fbb.writeString(object.posZip); + final posAreaOffset = fbb.writeString(object.posArea); + final posZipRealOffset = fbb.writeString(object.posZipReal); + fbb.startTable(5); + fbb.addInt64(0, object.id); + fbb.addOffset(1, posZipOffset); + fbb.addOffset(2, posAreaOffset); + fbb.addOffset(3, posZipRealOffset); + fbb.finish(fbb.endTable()); + return object.id; + }, + objectFromFB: (obx.Store store, ByteData fbData) { + final buffer = fb.BufferContext(fbData); + final rootOffset = buffer.derefObject(0); - final object = Status() - ..id = const fb.Int64Reader().vTableGet(buffer, rootOffset, 4, 0) - ..posZip = const fb.StringReader( - asciiOptimization: true, - ).vTableGet(buffer, rootOffset, 6, '') - ..posArea = const fb.StringReader( - asciiOptimization: true, - ).vTableGet(buffer, rootOffset, 8, '') - ..posZipReal = const fb.StringReader( - asciiOptimization: true, - ).vTableGet(buffer, rootOffset, 10, ''); + final object = Status() + ..id = const fb.Int64Reader().vTableGet(buffer, rootOffset, 4, 0) + ..posZip = const fb.StringReader(asciiOptimization: true) + .vTableGet(buffer, rootOffset, 6, '') + ..posArea = const fb.StringReader(asciiOptimization: true) + .vTableGet(buffer, rootOffset, 8, '') + ..posZipReal = const fb.StringReader(asciiOptimization: true) + .vTableGet(buffer, rootOffset, 10, ''); - return object; - }, - ), - ChatMessage: obx_int.EntityDefinition( - model: _entities[8], - toOneRelations: (ChatMessage object) => [], - toManyRelations: (ChatMessage object) => {}, - getId: (ChatMessage object) => object.id, - setId: (ChatMessage object, int id) { - object.id = id; - }, - objectToFB: (ChatMessage object, fb.Builder fbb) { - final fromOffset = fbb.writeString(object.from); - final subjOffset = fbb.writeString(object.subj); - final textOffset = fbb.writeString(object.text); - fbb.startTable(8); - fbb.addInt64(0, object.id); - fbb.addInt64(1, object.time); - fbb.addOffset(2, fromOffset); - fbb.addOffset(3, subjOffset); - fbb.addOffset(4, textOffset); - fbb.addBool(5, object.read); - fbb.addInt64(6, object.externalId); - fbb.finish(fbb.endTable()); - return object.id; - }, - objectFromFB: (obx.Store store, ByteData fbData) { - final buffer = fb.BufferContext(fbData); - final rootOffset = buffer.derefObject(0); - - final object = ChatMessage() - ..id = const fb.Int64Reader().vTableGet(buffer, rootOffset, 4, 0) - ..time = const fb.Int64Reader().vTableGet(buffer, rootOffset, 6, 0) - ..from = const fb.StringReader( - asciiOptimization: true, - ).vTableGet(buffer, rootOffset, 8, '') - ..subj = const fb.StringReader( - asciiOptimization: true, - ).vTableGet(buffer, rootOffset, 10, '') - ..text = const fb.StringReader( - asciiOptimization: true, - ).vTableGet(buffer, rootOffset, 12, '') - ..read = const fb.BoolReader().vTableGet( - buffer, - rootOffset, - 14, - false, - ) - ..externalId = const fb.Int64Reader().vTableGet( - buffer, - rootOffset, - 16, - 0, - ); - - return object; - }, - ), + return object; + }), TaskInfo: obx_int.EntityDefinition( - model: _entities[9], - toOneRelations: (TaskInfo object) => [], - toManyRelations: (TaskInfo object) => {}, - getId: (TaskInfo object) => object.id, - setId: (TaskInfo object, int id) { - object.id = id; - }, - objectToFB: (TaskInfo object, fb.Builder fbb) { - final additionalTextOffset = object.additionalText == null - ? null - : fbb.writeString(object.additionalText!); - final answerOffset = object.answer == null - ? null - : fbb.writeString(object.answer!); - fbb.startTable(6); - fbb.addInt64(0, object.id); - fbb.addInt64(1, object.sId); - fbb.addOffset(2, additionalTextOffset); - fbb.addOffset(3, answerOffset); - fbb.addBool(4, object.completed); - fbb.finish(fbb.endTable()); - return object.id; - }, - objectFromFB: (obx.Store store, ByteData fbData) { - final buffer = fb.BufferContext(fbData); - final rootOffset = buffer.derefObject(0); + model: _entities[8], + toOneRelations: (TaskInfo object) => [], + toManyRelations: (TaskInfo object) => {}, + getId: (TaskInfo object) => object.id, + setId: (TaskInfo object, int id) { + object.id = id; + }, + objectToFB: (TaskInfo object, fb.Builder fbb) { + final additionalTextOffset = object.additionalText == null + ? null + : fbb.writeString(object.additionalText!); + final answerOffset = + object.answer == null ? null : fbb.writeString(object.answer!); + fbb.startTable(6); + fbb.addInt64(0, object.id); + fbb.addInt64(1, object.sId); + fbb.addOffset(2, additionalTextOffset); + fbb.addOffset(3, answerOffset); + fbb.addBool(4, object.completed); + fbb.finish(fbb.endTable()); + return object.id; + }, + objectFromFB: (obx.Store store, ByteData fbData) { + final buffer = fb.BufferContext(fbData); + final rootOffset = buffer.derefObject(0); - final object = TaskInfo() - ..id = const fb.Int64Reader().vTableGet(buffer, rootOffset, 4, 0) - ..sId = const fb.Int64Reader().vTableGet(buffer, rootOffset, 6, 0) - ..additionalText = const fb.StringReader( - asciiOptimization: true, - ).vTableGetNullable(buffer, rootOffset, 8) - ..answer = const fb.StringReader( - asciiOptimization: true, - ).vTableGetNullable(buffer, rootOffset, 10) - ..completed = const fb.BoolReader().vTableGet( - buffer, - rootOffset, - 12, - false, - ); + final object = TaskInfo() + ..id = const fb.Int64Reader().vTableGet(buffer, rootOffset, 4, 0) + ..sId = const fb.Int64Reader().vTableGet(buffer, rootOffset, 6, 0) + ..additionalText = const fb.StringReader(asciiOptimization: true) + .vTableGetNullable(buffer, rootOffset, 8) + ..answer = const fb.StringReader(asciiOptimization: true) + .vTableGetNullable(buffer, rootOffset, 10) + ..completed = + const fb.BoolReader().vTableGet(buffer, rootOffset, 12, false); - return object; - }, - ), + return object; + }), + ChatMessage: obx_int.EntityDefinition( + model: _entities[9], + toOneRelations: (ChatMessage object) => [], + toManyRelations: (ChatMessage object) => {}, + getId: (ChatMessage object) => object.id, + setId: (ChatMessage object, int id) { + object.id = id; + }, + objectToFB: (ChatMessage object, fb.Builder fbb) { + final fromOffset = fbb.writeString(object.from); + final subjOffset = fbb.writeString(object.subj); + final textOffset = fbb.writeString(object.text); + fbb.startTable(8); + fbb.addInt64(0, object.id); + fbb.addInt64(1, object.externalId); + fbb.addInt64(2, object.time); + fbb.addOffset(3, fromOffset); + fbb.addOffset(4, subjOffset); + fbb.addOffset(5, textOffset); + fbb.addBool(6, object.read); + fbb.finish(fbb.endTable()); + return object.id; + }, + objectFromFB: (obx.Store store, ByteData fbData) { + final buffer = fb.BufferContext(fbData); + final rootOffset = buffer.derefObject(0); + + final object = ChatMessage() + ..id = const fb.Int64Reader().vTableGet(buffer, rootOffset, 4, 0) + ..externalId = + const fb.Int64Reader().vTableGet(buffer, rootOffset, 6, 0) + ..time = const fb.Int64Reader().vTableGet(buffer, rootOffset, 8, 0) + ..from = const fb.StringReader(asciiOptimization: true) + .vTableGet(buffer, rootOffset, 10, '') + ..subj = const fb.StringReader(asciiOptimization: true) + .vTableGet(buffer, rootOffset, 12, '') + ..text = const fb.StringReader(asciiOptimization: true) + .vTableGet(buffer, rootOffset, 14, '') + ..read = + const fb.BoolReader().vTableGet(buffer, rootOffset, 16, false); + + return object; + }) }; return obx_int.ModelDefinition(model, bindings); @@ -1013,24 +899,20 @@ obx_int.ModelDefinition getObjectBoxModel() { /// [EnqueuedMessage] entity fields to define ObjectBox queries. class EnqueuedMessage_ { /// See [EnqueuedMessage.id]. - static final id = obx.QueryIntegerProperty( - _entities[0].properties[0], - ); + static final id = + obx.QueryIntegerProperty(_entities[0].properties[0]); /// See [EnqueuedMessage.messageId]. - static final messageId = obx.QueryStringProperty( - _entities[0].properties[1], - ); + static final messageId = + obx.QueryStringProperty(_entities[0].properties[1]); /// See [EnqueuedMessage.topic]. - static final topic = obx.QueryStringProperty( - _entities[0].properties[2], - ); + static final topic = + obx.QueryStringProperty(_entities[0].properties[2]); /// See [EnqueuedMessage.payload]. - static final payload = obx.QueryStringProperty( - _entities[0].properties[3], - ); + static final payload = + obx.QueryStringProperty(_entities[0].properties[3]); } /// [Job] entity fields to define ObjectBox queries. @@ -1042,279 +924,233 @@ class Job_ { static final ver = obx.QueryStringProperty(_entities[1].properties[1]); /// See [Job.state]. - static final state = obx.QueryIntegerProperty( - _entities[1].properties[2], - ); + static final state = + obx.QueryIntegerProperty(_entities[1].properties[2]); /// See [Job.crFilter]. - static final crFilter = obx.QueryStringProperty( - _entities[1].properties[3], - ); + static final crFilter = + obx.QueryStringProperty(_entities[1].properties[3]); /// See [Job.ordertime]. - static final ordertime = obx.QueryIntegerProperty( - _entities[1].properties[4], - ); + static final ordertime = + obx.QueryIntegerProperty(_entities[1].properties[4]); /// See [Job.offsWarn]. - static final offsWarn = obx.QueryIntegerProperty( - _entities[1].properties[5], - ); + static final offsWarn = + obx.QueryIntegerProperty(_entities[1].properties[5]); /// See [Job.global]. - static final global = obx.QueryBooleanProperty( - _entities[1].properties[6], - ); + static final global = + obx.QueryBooleanProperty(_entities[1].properties[6]); /// See [Job.vhtId]. - static final vhtId = obx.QueryIntegerProperty( - _entities[1].properties[7], - ); + static final vhtId = + obx.QueryIntegerProperty(_entities[1].properties[7]); /// See [Job.rem]. static final rem = obx.QueryStringProperty(_entities[1].properties[8]); /// See [Job.delayOrderTime]. - static final delayOrderTime = obx.QueryIntegerProperty( - _entities[1].properties[9], - ); + static final delayOrderTime = + obx.QueryIntegerProperty(_entities[1].properties[9]); /// See [Job.toursJson]. - static final toursJson = obx.QueryStringProperty( - _entities[1].properties[10], - ); + static final toursJson = + obx.QueryStringProperty(_entities[1].properties[10]); /// See [Job.externalId]. - static final externalId = obx.QueryIntegerProperty( - _entities[1].properties[11], - ); + static final externalId = + obx.QueryIntegerProperty(_entities[1].properties[11]); + + /// See [Job.filesJson]. + static final filesJson = + obx.QueryStringProperty(_entities[1].properties[12]); } /// [LocationStatus] entity fields to define ObjectBox queries. class LocationStatus_ { /// See [LocationStatus.id]. - static final id = obx.QueryIntegerProperty( - _entities[2].properties[0], - ); + static final id = + obx.QueryIntegerProperty(_entities[2].properties[0]); /// See [LocationStatus.zip]. - static final zip = obx.QueryStringProperty( - _entities[2].properties[1], - ); + static final zip = + obx.QueryStringProperty(_entities[2].properties[1]); /// See [LocationStatus.area]. - static final area = obx.QueryStringProperty( - _entities[2].properties[2], - ); + static final area = + obx.QueryStringProperty(_entities[2].properties[2]); /// See [LocationStatus.zipReal]. - static final zipReal = obx.QueryStringProperty( - _entities[2].properties[3], - ); + static final zipReal = + obx.QueryStringProperty(_entities[2].properties[3]); } /// [LogEntry] entity fields to define ObjectBox queries. class LogEntry_ { /// See [LogEntry.id]. - static final id = obx.QueryIntegerProperty( - _entities[3].properties[0], - ); + static final id = + obx.QueryIntegerProperty(_entities[3].properties[0]); /// See [LogEntry.time]. - static final time = obx.QueryDateProperty( - _entities[3].properties[1], - ); + static final time = + obx.QueryDateProperty(_entities[3].properties[1]); /// See [LogEntry.severity]. - static final severity = obx.QueryIntegerProperty( - _entities[3].properties[2], - ); + static final severity = + obx.QueryIntegerProperty(_entities[3].properties[2]); /// See [LogEntry.text]. - static final text = obx.QueryStringProperty( - _entities[3].properties[3], - ); + static final text = + obx.QueryStringProperty(_entities[3].properties[3]); } /// [Picture] entity fields to define ObjectBox queries. class Picture_ { /// See [Picture.id]. - static final id = obx.QueryIntegerProperty( - _entities[4].properties[0], - ); + static final id = + obx.QueryIntegerProperty(_entities[4].properties[0]); /// See [Picture.tourId]. - static final tourId = obx.QueryIntegerProperty( - _entities[4].properties[1], - ); + static final tourId = + obx.QueryIntegerProperty(_entities[4].properties[1]); /// See [Picture.number]. - static final number = obx.QueryIntegerProperty( - _entities[4].properties[2], - ); + static final number = + obx.QueryIntegerProperty(_entities[4].properties[2]); /// See [Picture.data]. - static final data = obx.QueryStringProperty( - _entities[4].properties[3], - ); + static final data = + obx.QueryStringProperty(_entities[4].properties[3]); } /// [Ranking] entity fields to define ObjectBox queries. class Ranking_ { /// See [Ranking.id]. - static final id = obx.QueryIntegerProperty( - _entities[5].properties[0], - ); + static final id = + obx.QueryIntegerProperty(_entities[5].properties[0]); /// See [Ranking.ranksJson]. - static final ranksJson = obx.QueryStringProperty( - _entities[5].properties[1], - ); + static final ranksJson = + obx.QueryStringProperty(_entities[5].properties[1]); } /// [SessionStatus] entity fields to define ObjectBox queries. class SessionStatus_ { /// See [SessionStatus.id]. - static final id = obx.QueryIntegerProperty( - _entities[6].properties[0], - ); + static final id = + obx.QueryIntegerProperty(_entities[6].properties[0]); /// See [SessionStatus.custId]. - static final custId = obx.QueryIntegerProperty( - _entities[6].properties[1], - ); + static final custId = + obx.QueryIntegerProperty(_entities[6].properties[1]); /// See [SessionStatus.hqId]. - static final hqId = obx.QueryIntegerProperty( - _entities[6].properties[2], - ); + static final hqId = + obx.QueryIntegerProperty(_entities[6].properties[2]); /// See [SessionStatus.usrId]. - static final usrId = obx.QueryIntegerProperty( - _entities[6].properties[3], - ); + static final usrId = + obx.QueryIntegerProperty(_entities[6].properties[3]); /// See [SessionStatus.crId]. - static final crId = obx.QueryIntegerProperty( - _entities[6].properties[4], - ); + static final crId = + obx.QueryIntegerProperty(_entities[6].properties[4]); /// See [SessionStatus.sid]. - static final sid = obx.QueryStringProperty( - _entities[6].properties[5], - ); + static final sid = + obx.QueryStringProperty(_entities[6].properties[5]); /// See [SessionStatus.vhtId]. - static final vhtId = obx.QueryIntegerProperty( - _entities[6].properties[6], - ); + static final vhtId = + obx.QueryIntegerProperty(_entities[6].properties[6]); /// See [SessionStatus.locZip]. - static final locZip = obx.QueryStringProperty( - _entities[6].properties[7], - ); + static final locZip = + obx.QueryStringProperty(_entities[6].properties[7]); /// See [SessionStatus.serverVersion]. - static final serverVersion = obx.QueryStringProperty( - _entities[6].properties[8], - ); + static final serverVersion = + obx.QueryStringProperty(_entities[6].properties[8]); /// See [SessionStatus.serverInstance]. - static final serverInstance = obx.QueryStringProperty( - _entities[6].properties[9], - ); + static final serverInstance = + obx.QueryStringProperty(_entities[6].properties[9]); /// See [SessionStatus.bwvEnabled]. - static final bwvEnabled = obx.QueryBooleanProperty( - _entities[6].properties[10], - ); + static final bwvEnabled = + obx.QueryBooleanProperty(_entities[6].properties[10]); } /// [Status] entity fields to define ObjectBox queries. class Status_ { /// See [Status.id]. - static final id = obx.QueryIntegerProperty( - _entities[7].properties[0], - ); + static final id = + obx.QueryIntegerProperty(_entities[7].properties[0]); /// See [Status.posZip]. - static final posZip = obx.QueryStringProperty( - _entities[7].properties[1], - ); + static final posZip = + obx.QueryStringProperty(_entities[7].properties[1]); /// See [Status.posArea]. - static final posArea = obx.QueryStringProperty( - _entities[7].properties[2], - ); + static final posArea = + obx.QueryStringProperty(_entities[7].properties[2]); /// See [Status.posZipReal]. - static final posZipReal = obx.QueryStringProperty( - _entities[7].properties[3], - ); -} - -/// [ChatMessage] entity fields to define ObjectBox queries. -class ChatMessage_ { - /// See [ChatMessage.id]. - static final id = obx.QueryIntegerProperty( - _entities[8].properties[0], - ); - - /// See [ChatMessage.time]. - static final time = obx.QueryIntegerProperty( - _entities[8].properties[1], - ); - - /// See [ChatMessage.from]. - static final from = obx.QueryStringProperty( - _entities[8].properties[2], - ); - - /// See [ChatMessage.subj]. - static final subj = obx.QueryStringProperty( - _entities[8].properties[3], - ); - - /// See [ChatMessage.text]. - static final text = obx.QueryStringProperty( - _entities[8].properties[4], - ); - - /// See [ChatMessage.read]. - static final read = obx.QueryBooleanProperty( - _entities[8].properties[5], - ); - - /// See [ChatMessage.externalId]. - static final externalId = obx.QueryIntegerProperty( - _entities[8].properties[6], - ); + static final posZipReal = + obx.QueryStringProperty(_entities[7].properties[3]); } /// [TaskInfo] entity fields to define ObjectBox queries. class TaskInfo_ { /// See [TaskInfo.id]. - static final id = obx.QueryIntegerProperty( - _entities[9].properties[0], - ); + static final id = + obx.QueryIntegerProperty(_entities[8].properties[0]); /// See [TaskInfo.sId]. - static final sId = obx.QueryIntegerProperty( - _entities[9].properties[1], - ); + static final sId = + obx.QueryIntegerProperty(_entities[8].properties[1]); /// See [TaskInfo.additionalText]. - static final additionalText = obx.QueryStringProperty( - _entities[9].properties[2], - ); + static final additionalText = + obx.QueryStringProperty(_entities[8].properties[2]); /// See [TaskInfo.answer]. - static final answer = obx.QueryStringProperty( - _entities[9].properties[3], - ); + static final answer = + obx.QueryStringProperty(_entities[8].properties[3]); /// See [TaskInfo.completed]. - static final completed = obx.QueryBooleanProperty( - _entities[9].properties[4], - ); + static final completed = + obx.QueryBooleanProperty(_entities[8].properties[4]); +} + +/// [ChatMessage] entity fields to define ObjectBox queries. +class ChatMessage_ { + /// See [ChatMessage.id]. + static final id = + obx.QueryIntegerProperty(_entities[9].properties[0]); + + /// See [ChatMessage.externalId]. + static final externalId = + obx.QueryIntegerProperty(_entities[9].properties[1]); + + /// See [ChatMessage.time]. + static final time = + obx.QueryIntegerProperty(_entities[9].properties[2]); + + /// See [ChatMessage.from]. + static final from = + obx.QueryStringProperty(_entities[9].properties[3]); + + /// See [ChatMessage.subj]. + static final subj = + obx.QueryStringProperty(_entities[9].properties[4]); + + /// See [ChatMessage.text]. + static final text = + obx.QueryStringProperty(_entities[9].properties[5]); + + /// See [ChatMessage.read]. + static final read = + obx.QueryBooleanProperty(_entities[9].properties[6]); } diff --git a/lib/popups/accept_jobs_popup.dart b/lib/popups/accept_jobs_popup.dart index d446ba8..859f6e8 100644 --- a/lib/popups/accept_jobs_popup.dart +++ b/lib/popups/accept_jobs_popup.dart @@ -133,6 +133,7 @@ Future showAcceptJobsPopup(SharedMapReference mapReference, Function() onF // Ensure we always clean up subscriptions even if the dialog is dismissed via barrier tap or back button dialogFuture.whenComplete(() { isActive = false; + _scrollController.dispose(); if (builderCreated) { try { extendedStatefulBuilder.unsubscribe(queueId: Constants.messageTopicJobReceived); diff --git a/lib/popups/files_popup.dart b/lib/popups/files_popup.dart new file mode 100644 index 0000000..27ef986 --- /dev/null +++ b/lib/popups/files_popup.dart @@ -0,0 +1,262 @@ +import 'package:flutter/material.dart'; +import 'package:stadtbote/content_views/pdf_viewer_page.dart'; +import 'package:stadtbote/model/tour_file.dart'; +import 'package:stadtbote/tools/constants.dart'; +import 'package:stadtbote/tools/util.dart' show showAlertDialog; +import 'package:stadtbote/tools/util.dart' as util; + +void showFilesPopup(BuildContext context, List files) { + showDialog( + context: context, + builder: (BuildContext context) { + return AlertDialog( + title: const Text('Dateien'), + content: SizedBox( + width: double.maxFinite, + height: 400, + child: ListView.builder( + shrinkWrap: true, + itemCount: files.length, + itemBuilder: (context, index) { + final file = files[index]; + return _FileListItem(file: file); + }, + ), + ), + actions: [ + TextButton( + onPressed: () => Navigator.of(context).pop(), + child: const Text('Schließen'), + ), + ], + ); + }, + ); +} + +class _FileListItem extends StatefulWidget { + final TourFile file; + + const _FileListItem({required this.file}); + + @override + State<_FileListItem> createState() => _FileListItemState(); +} + +class _FileListItemState extends State<_FileListItem> { + bool _isLoading = false; + + @override + Widget build(BuildContext context) { + IconData iconData; + if (widget.file.isPdf) { + iconData = Icons.picture_as_pdf; + } else if (widget.file.isImage) { + iconData = Icons.image; + } else { + iconData = Icons.insert_drive_file; + } + + return Card( + margin: const EdgeInsets.symmetric(vertical: 4), + child: ListTile( + leading: Icon(iconData, color: Constants.colorPrimary), + title: Text(widget.file.name), + subtitle: widget.file.remark != null && widget.file.remark!.isNotEmpty + ? Text(widget.file.remark!) + : null, + trailing: _isLoading + ? const SizedBox( + width: 24, + height: 24, + child: CircularProgressIndicator(strokeWidth: 2), + ) + : const Icon(Icons.open_in_new), + onTap: () => _openFile(context), + ), + ); + } + + Future _openFile(BuildContext context) async { + if (_isLoading) return; + + setState(() { + _isLoading = true; + }); + + try { + if (widget.file.isPdf) { + Navigator.of(context).pop(); // Close the files dialog + + // Navigate to PDF viewer + Navigator.of(context).push( + MaterialPageRoute( + builder: (context) => PdfViewerPage( + pdfUrl: widget.file.url, + title: widget.file.name, + ), + ), + ); + } else if (widget.file.isImage) { + Navigator.of(context).pop(); // Close the files dialog + + // Show image in a dialog + await showDialog( + context: context, + builder: (BuildContext context) { + return Dialog( + insetPadding: const EdgeInsets.all(16), + child: Column( + mainAxisSize: MainAxisSize.min, + children: [ + AppBar( + title: Text(widget.file.name), + leading: IconButton( + icon: const Icon(Icons.close), + onPressed: () => Navigator.of(context).pop(), + ), + automaticallyImplyLeading: false, + ), + Flexible( + child: Image.network( + widget.file.url, + fit: BoxFit.contain, + loadingBuilder: (context, child, loadingProgress) { + if (loadingProgress == null) return child; + return Center( + child: CircularProgressIndicator( + value: loadingProgress.expectedTotalBytes != null + ? loadingProgress.cumulativeBytesLoaded / + loadingProgress.expectedTotalBytes! + : null, + ), + ); + }, + errorBuilder: (context, error, stackTrace) { + return Center( + child: Column( + mainAxisSize: MainAxisSize.min, + children: [ + const Icon( + Icons.error_outline, + size: 64, + color: Colors.red, + ), + const SizedBox(height: 16), + Text( + 'Fehler beim Laden des Bildes:\n$error', + textAlign: TextAlign.center, + style: const TextStyle(color: Colors.red), + ), + ], + ), + ); + }, + ), + ), + ], + ), + ); + }, + ); + } else { + // For other file types, try to open with external app + showAlertDialog( + 'Information', + 'Dateityp wird nicht direkt unterstützt. Die Datei wird im Browser geöffnet.', + ); + } + } catch (e) { + util.Util.logException('Error opening file: $e'); + if (context.mounted) { + showAlertDialog( + 'Fehler', + 'Fehler beim Öffnen der Datei: $e', + ); + } + } finally { + if (mounted) { + setState(() { + _isLoading = false; + }); + } + } + } +} + +/// Widget to display a file icon button if files are available +class FilesIconButton extends StatelessWidget { + final List? files; + final double iconSize; + + const FilesIconButton({ + super.key, + required this.files, + this.iconSize = 24, + }); + + @override + Widget build(BuildContext context) { + if (files == null || files!.isEmpty) { + return const SizedBox.shrink(); + } + + return IconButton( + icon: const Icon(Icons.attach_file), + iconSize: iconSize, + color: Constants.colorPrimary, + tooltip: '${files!.length} Datei(en)', + onPressed: () => showFilesPopup(context, files!), + ); + } +} + +/// Badge widget showing file count with icon +class FilesBadge extends StatelessWidget { + final List? files; + final VoidCallback? onTap; + + const FilesBadge({ + super.key, + required this.files, + this.onTap, + }); + + @override + Widget build(BuildContext context) { + if (files == null || files!.isEmpty) { + return const SizedBox.shrink(); + } + + return GestureDetector( + onTap: onTap ?? () => showFilesPopup(context, files!), + child: Container( + padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 4), + decoration: BoxDecoration( + color: Constants.colorPrimary.withAlpha(30), + borderRadius: BorderRadius.circular(12), + border: Border.all(color: Constants.colorPrimary, width: 1), + ), + child: Row( + mainAxisSize: MainAxisSize.min, + children: [ + Icon( + Icons.attach_file, + size: 16, + color: Constants.colorPrimary, + ), + const SizedBox(width: 4), + Text( + '${files!.length}', + style: TextStyle( + color: Constants.colorPrimary, + fontWeight: FontWeight.bold, + fontSize: 12, + ), + ), + ], + ), + ), + ); + } +} diff --git a/lib/popups/map_popup.dart b/lib/popups/map_popup.dart index e1e72d9..7434378 100644 --- a/lib/popups/map_popup.dart +++ b/lib/popups/map_popup.dart @@ -11,6 +11,9 @@ import '../model/job_tour.dart'; List _colors = [Colors.red, Colors.green]; showMapPopup(BuildContext context, JobTour currentTour, List tourList) async { + MapController? mapController; + Map> streamControllers = {}; + await showDialog( context: context, builder: (BuildContext context) { @@ -19,24 +22,24 @@ showMapPopup(BuildContext context, JobTour currentTour, List tourList) shadowColor: Colors.transparent, backgroundColor: Colors.white, content: StatefulBuilder(builder: (BuildContext context, StateSetter setState) { - var mapController = MapController(); - Map> streamController = {}; + mapController = MapController(); + streamControllers = {}; List tourWidgets = []; for (JobTour tour in tourList) { var currentStreamController = StreamController(); - streamController[tour.sort] = currentStreamController; + streamControllers[tour.sort] = currentStreamController; tourWidgets.add( GestureDetector( onTap: () async { if (tour.pos != null) { - mapController.move(LatLng(tour.pos!.lat, tour.pos!.long), mapController.camera.zoom); + mapController!.move(LatLng(tour.pos!.lat, tour.pos!.long), mapController!.camera.zoom); - streamController[currentTour.sort]!.sink.add(false); + streamControllers[currentTour.sort]!.sink.add(false); currentTour = tour; - streamController[tour.sort]!.sink.add(true); + streamControllers[tour.sort]!.sink.add(true); } else { showAlertDialog('Information', 'Es liegt keine Position für diese Station vor'); } @@ -158,7 +161,7 @@ showMapPopup(BuildContext context, JobTour currentTour, List tourList) height: 25, onChanged: (b) { valueNotifier.value = b; - mapController.move(mapController.camera.center, b ? 14.0 : 16.0); + mapController!.move(mapController!.camera.center, b ? 14.0 : 16.0); }, styleBuilder: (i) => ToggleStyle(indicatorColor: i == true ? _colors[0] : _colors[1]), textBuilder: (value) => value ? const Center(child: Text('Fern')) : const Center(child: Text('Nah')), @@ -173,7 +176,7 @@ showMapPopup(BuildContext context, JobTour currentTour, List tourList) child: AbsorbPointer( absorbing: true, child: FlutterMap( - mapController: mapController, + mapController: mapController!, options: MapOptions( initialCenter: LatLng(currentTour.pos!.lat, currentTour.pos!.long), initialZoom: 14, @@ -196,4 +199,10 @@ showMapPopup(BuildContext context, JobTour currentTour, List tourList) )); })); }); + + // Dispose all controllers after dialog is closed + mapController?.dispose(); + for (var controller in streamControllers.values) { + controller.close(); + } } diff --git a/lib/popups/tasks_popups/commision_number_popup.dart b/lib/popups/tasks_popups/commision_number_popup.dart index 2f0b2f9..3d01b68 100644 --- a/lib/popups/tasks_popups/commision_number_popup.dart +++ b/lib/popups/tasks_popups/commision_number_popup.dart @@ -50,7 +50,12 @@ showComissionNumberPopup(BuildContext context, TaskInfo taskInfo, Function(Strin controller: textEditingController, autofocus: true), const SizedBox(height: 20), - getDefaultButton('Übernehmen', () => {Navigator.of(context).pop(), onFinished(textEditingController.text)}) + getDefaultButton('Übernehmen', () { + final result = textEditingController.text; + textEditingController.dispose(); + Navigator.of(context).pop(); + onFinished(result); + }) ], ), ), diff --git a/lib/popups/tasks_popups/pickup_delivery_status_popup.dart b/lib/popups/tasks_popups/pickup_delivery_status_popup.dart index e5ae1fe..3cea51c 100644 --- a/lib/popups/tasks_popups/pickup_delivery_status_popup.dart +++ b/lib/popups/tasks_popups/pickup_delivery_status_popup.dart @@ -24,6 +24,8 @@ showPickupDeliveryStatusPopup(BuildContext context, TaskInfo taskInfo, Function( if (!didPop) { final shouldPop = await taskDialogSecurityException(context); if (shouldPop && context.mounted) { + controller.dispose(); + remController.dispose(); Navigator.of(context).pop(); } } @@ -73,6 +75,9 @@ showPickupDeliveryStatusPopup(BuildContext context, TaskInfo taskInfo, Function( if (remController.text.isNotEmpty) { Navigator.of(context).pop(), + controller.dispose(), + remController.dispose(), + onFinished(selectedTourEntry, remController.text) } else { showAlertDialog("Fehler", "Bitte geben Sie eine Bemerkung ein") @@ -80,6 +85,9 @@ showPickupDeliveryStatusPopup(BuildContext context, TaskInfo taskInfo, Function( } else { Navigator.of(context).pop(), + controller.dispose(), + remController.dispose(), + onFinished(selectedTourEntry, null) } }) diff --git a/lib/popups/tasks_popups/receipt_giver_popup.dart b/lib/popups/tasks_popups/receipt_giver_popup.dart index 29c1e76..a8eeac6 100644 --- a/lib/popups/tasks_popups/receipt_giver_popup.dart +++ b/lib/popups/tasks_popups/receipt_giver_popup.dart @@ -77,7 +77,11 @@ showReceiptGiverPopup(BuildContext context, TaskInfo taskInfo, Function(String, if (textEditingController.text.isNotEmpty && selectedTourEntry != null) { Navigator.of(context).pop(); - onFinished(textEditingController.text, selectedTourEntry!); + final result = textEditingController.text; + textEditingController.dispose(); + controller.dispose(); + + onFinished(result, selectedTourEntry!); } else { showAlertDialog("Fehler", "Sie müssen einen Text eingeben und ein Geschlecht auswählen"); } diff --git a/lib/popups/tasks_popups/station_notice_popup.dart b/lib/popups/tasks_popups/station_notice_popup.dart index 8a40e8a..f350946 100644 --- a/lib/popups/tasks_popups/station_notice_popup.dart +++ b/lib/popups/tasks_popups/station_notice_popup.dart @@ -54,10 +54,12 @@ showStationNoticePopup(BuildContext context, TaskInfo taskInfo, Function(String) autofocus: true), ), const SizedBox(height: 20), - getDefaultButton('Übernehmen', buttonHeight: 50, () => { - Navigator.of(context).pop(), - - onFinished(textEditingController.text)}) + getDefaultButton('Übernehmen', buttonHeight: 50, () { + final result = textEditingController.text; + textEditingController.dispose(); + Navigator.of(context).pop(); + onFinished(result); + }) ], ), ), diff --git a/lib/popups/tasks_popups/zip_popup.dart b/lib/popups/tasks_popups/zip_popup.dart index 1b3eaaf..894a20d 100644 --- a/lib/popups/tasks_popups/zip_popup.dart +++ b/lib/popups/tasks_popups/zip_popup.dart @@ -67,15 +67,16 @@ showZipPopup(BuildContext context, String text, String buttonText, const SizedBox(height: 20), getDefaultButton( buttonText, - () => { - if (_checkInput(context, - textEditingController.text)) - { - Navigator.of(context).pop(), - onFinished( - textEditingController.text) - }, - }), + () { + if (_checkInput(context, + textEditingController.text)) { + final result = textEditingController.text; + textEditingController.dispose(); + focusNode.dispose(); + Navigator.of(context).pop(); + onFinished(result); + } + }), ], ), ), diff --git a/lib/tools/mqtt_core.dart b/lib/tools/mqtt_core.dart index 19134b5..a5f4599 100644 --- a/lib/tools/mqtt_core.dart +++ b/lib/tools/mqtt_core.dart @@ -16,6 +16,7 @@ import 'package:stadtbote/model/chat_message.dart'; import 'package:stadtbote/model/location_status.dart'; import 'package:stadtbote/model/rank.dart'; import 'package:stadtbote/model/status.dart'; +import 'package:stadtbote/model/tour_file.dart'; import 'package:stadtbote/objectbox.g.dart'; import 'package:stadtbote/network_messages/acknowledge_job.dart'; import 'package:stadtbote/network_messages/acknowledge_message.dart'; @@ -401,8 +402,16 @@ class MqttCore with ProducerMixin, ConsumerMixin { query.close(); if (existingJob != null) { - // Update existing job + // Update existing job - preserve the ID newJob.id = existingJob.id; + + // Ensure files are updated even if the job already exists + // This handles migration from old app versions without files support + if (payloadData['files'] != null) { + newJob.files = (payloadData['files'] as List) + .map((e) => TourFile.fromJson(e as Map)) + .toList(); + } } box.put(newJob); @@ -754,7 +763,7 @@ class MqttCore with ProducerMixin, ConsumerMixin { void _commandLogoutReceived(Map payload) { try { - String timestamp = payload['timestamp'] ?? 'Unknown timestamp'; + String timestamp = payload['timestamp']?.toString() ?? 'Unknown timestamp'; Util.logInfo('Command logout received with timestamp: $timestamp'); // Disconnect MQTT client gracefully diff --git a/lib/tools/util.dart b/lib/tools/util.dart index 39bb5ea..1c89aaa 100644 --- a/lib/tools/util.dart +++ b/lib/tools/util.dart @@ -9,6 +9,7 @@ import 'package:shared_preferences/shared_preferences.dart'; import 'package:stadtbote/main.dart'; import 'package:stadtbote/model/job.dart'; import 'package:stadtbote/model/log_entry.dart'; +import 'package:stadtbote/objectbox.g.dart'; import 'package:stadtbote/tools/constants.dart'; import 'package:url_launcher/url_launcher.dart'; import 'package:uuid/uuid.dart'; @@ -97,6 +98,28 @@ class Util { final box = MyApp.objectBoxStore.box(); box.put(logEntry); + + // Cleanup old logs (delete entries older than 3 days) + _cleanupOldLogs(); + } + + static void _cleanupOldLogs() async { + try { + final box = MyApp.objectBoxStore.box(); + + // Delete logs older than 3 days + final threeDaysAgo = DateTime.now().subtract(const Duration(days: 3)); + final oldLogsQuery = box.query(LogEntry_.time.lessThan(threeDaysAgo.millisecondsSinceEpoch)).build(); + final oldLogs = oldLogsQuery.find(); + oldLogsQuery.close(); + + if (oldLogs.isNotEmpty) { + box.removeMany(oldLogs.map((e) => e.id).toList()); + } + } catch (e) { + // Silent fail for cleanup - don't log to avoid infinite loop + debugPrint('Log cleanup failed: $e'); + } } static logInfo(String message) { diff --git a/pubspec.lock b/pubspec.lock index 2f3cc66..986ca73 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -5,18 +5,18 @@ packages: dependency: transitive description: name: _fe_analyzer_shared - sha256: c209688d9f5a5f26b2fb47a188131a6fb9e876ae9e47af3737c0b4f58a93470d + sha256: "0b2f2bd91ba804e53a61d757b986f89f1f9eaed5b11e4b2f5a2468d86d6c9fc7" url: "https://pub.dev" source: hosted - version: "91.0.0" + version: "67.0.0" analyzer: - dependency: transitive + dependency: "direct dev" description: name: analyzer - sha256: f51c8499b35f9b26820cfe914828a6a98a94efd5cc78b37bb7d03debae3a1d08 + sha256: "37577842a27e4338429a1cbc32679d508836510b056f1eedf0c8d20e39c1383d" url: "https://pub.dev" source: hosted - version: "8.4.1" + version: "6.4.1" animated_toggle_switch: dependency: "direct main" description: @@ -125,18 +125,18 @@ packages: dependency: transitive description: name: build - sha256: ce76b1d48875e3233fde17717c23d1f60a91cc631597e49a400c89b475395b1d + sha256: "80184af8b6cb3e5c1c4ec6d8544d27711700bc3e6d2efad04238c7b5290889f0" url: "https://pub.dev" source: hosted - version: "3.1.0" + version: "2.4.1" build_config: dependency: transitive description: name: build_config - sha256: "4f64382b97504dc2fcdf487d5aae33418e08b4703fc21249e4db6d804a4d0187" + sha256: "4ae2de3e1e67ea270081eaee972e1bd8f027d459f249e0f1186730784c2e7e33" url: "https://pub.dev" source: hosted - version: "1.2.0" + version: "1.1.2" build_daemon: dependency: transitive description: @@ -149,26 +149,26 @@ packages: dependency: transitive description: name: build_resolvers - sha256: d1d57f7807debd7349b4726a19fd32ec8bc177c71ad0febf91a20f84cd2d4b46 + sha256: "339086358431fa15d7eca8b6a36e5d783728cf025e559b834f4609a1fcfb7b0a" url: "https://pub.dev" source: hosted - version: "3.0.3" + version: "2.4.2" build_runner: dependency: "direct dev" description: name: build_runner - sha256: b24597fceb695969d47025c958f3837f9f0122e237c6a22cb082a5ac66c3ca30 + sha256: "028819cfb90051c6b5440c7e574d1896f8037e3c96cf17aaeb054c9311cfbf4d" url: "https://pub.dev" source: hosted - version: "2.7.1" + version: "2.4.13" build_runner_core: dependency: transitive description: name: build_runner_core - sha256: "066dda7f73d8eb48ba630a55acb50c4a84a2e6b453b1cb4567f581729e794f7b" + sha256: f8126682b87a7282a339b871298cc12009cb67109cfa1614d6436fb0289193e0 url: "https://pub.dev" source: hosted - version: "9.3.1" + version: "7.3.2" built_collection: dependency: transitive description: @@ -317,10 +317,10 @@ packages: dependency: transitive description: name: dart_style - sha256: a9c30492da18ff84efe2422ba2d319a89942d93e58eb0b73d32abe822ef54b7b + sha256: "99e066ce75c89d6b29903d788a7bb9369cf754f7b24bf70bf4b6d6d6b26853b9" url: "https://pub.dev" source: hosted - version: "3.1.3" + version: "2.3.6" device_info_plus: dependency: "direct main" description: @@ -776,6 +776,14 @@ packages: url: "https://pub.dev" source: hosted version: "1.0.5" + js: + dependency: transitive + description: + name: js + sha256: "53385261521cc4a0c4658fd0ad07a7d14591cf8fc33abbceae306ddb974888dc" + url: "https://pub.dev" + source: hosted + version: "0.7.2" json_annotation: dependency: "direct main" description: @@ -788,10 +796,10 @@ packages: dependency: "direct dev" description: name: json_serializable - sha256: c5b2ee75210a0f263c6c7b9eeea80553dbae96ea1bf57f02484e806a3ffdffa3 + sha256: ea1432d167339ea9b5bb153f0571d0039607a873d6e04e0117af043f14a1fd4b url: "https://pub.dev" source: hosted - version: "6.11.2" + version: "6.8.0" latlong2: dependency: "direct main" description: @@ -916,26 +924,26 @@ packages: dependency: "direct main" description: name: objectbox - sha256: "3cc186749178a3556e1020c9082d0897d0f9ecbdefcc27320e65c5bc650f0e57" + sha256: "3d1cb5f9aa564f95c76ba251299f6cb1591c3dd8ff05fd76fa0549d899d9fe31" url: "https://pub.dev" source: hosted - version: "4.3.1" + version: "4.1.0" objectbox_flutter_libs: dependency: "direct main" description: name: objectbox_flutter_libs - sha256: cd754766e04229a4f51250f121813d9a3c1a74fc21cd68e48b3c6085cbcd6c85 + sha256: "4f54ebbd7a3b72f1a5ef4fea76cb01cc36440a4cac1f63bfb6719afba400eedb" url: "https://pub.dev" source: hosted - version: "4.3.1" + version: "4.1.0" objectbox_generator: dependency: "direct dev" description: name: objectbox_generator - sha256: "71a3f6948e631be5c7160d512ad2a8cb7471cdbcf1731ec6baf2a794b82386d7" + sha256: "777924e14daf18603a023b346333acac1c4fce9fe4a715b85d98cfcc723d9a1a" url: "https://pub.dev" source: hosted - version: "4.3.1" + version: "4.1.0" package_config: dependency: transitive description: @@ -1140,10 +1148,10 @@ packages: dependency: transitive description: name: pointycastle - sha256: "92aa3841d083cc4b0f4709b5c74fd6409a3e6ba833ffc7dc6a8fee096366acf5" + sha256: "4be0097fcf3fd3e8449e53730c631200ebc7b88016acecab2b0da2f0149222fe" url: "https://pub.dev" source: hosted - version: "4.0.0" + version: "3.9.1" pool: dependency: transitive description: @@ -1284,10 +1292,10 @@ packages: dependency: transitive description: name: shelf_web_socket - sha256: "3632775c8e90d6c9712f883e633716432a27758216dfb61bd86a8321c0580925" + sha256: cc36c297b52866d203dbf9332263c94becc2fe0ceaa9681d07b6ef9807023b67 url: "https://pub.dev" source: hosted - version: "3.0.0" + version: "2.0.1" signature: dependency: "direct main" description: @@ -1305,18 +1313,18 @@ packages: dependency: transitive description: name: source_gen - sha256: "7b19d6ba131c6eb98bfcbf8d56c1a7002eba438af2e7ae6f8398b2b0f4f381e3" + sha256: "14658ba5f669685cd3d63701d01b31ea748310f7ab854e471962670abcf57832" url: "https://pub.dev" source: hosted - version: "3.1.0" + version: "1.5.0" source_helper: dependency: transitive description: name: source_helper - sha256: "6a3c6cc82073a8797f8c4dc4572146114a39652851c157db37e964d9c7038723" + sha256: "86d247119aedce8e63f4751bd9626fc9613255935558447569ad42f9f5b48b3c" url: "https://pub.dev" source: hosted - version: "1.3.8" + version: "1.3.5" source_span: dependency: transitive description: diff --git a/pubspec.yaml b/pubspec.yaml index ea5dfcb..2e00610 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -77,6 +77,7 @@ dev_dependencies: build_runner: ^2.4.13 objectbox_generator: ^4.0.3 json_serializable: ^6.6.2 + analyzer: ^6.0.0 # The "flutter_lints" package below contains a set of recommended lints to # encourage good coding practices. The lint set provided by the package is