From 10b3a647e78a284f424e7da55ab8a939834e0c68 Mon Sep 17 00:00:00 2001 From: Sven Carstensen Date: Fri, 29 May 2026 08:45:50 +0200 Subject: [PATCH] Job-Identifikation auf externalId umstellen und Tour-State persistieren MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Job-Löschung und -Anzeige nutzen externalId statt interner id - RefreshBadgesMessage korrekt instanziieren - Tour-State beim Abschluss in Job.tours zurückschreiben und persistieren - Version auf 352 erhöht Co-Authored-By: Claude Opus 4.8 (1M context) --- lib/content_views/task_list_page.dart | 7 +++++++ lib/content_views/tour_list_page.dart | 2 +- lib/main.dart | 8 +++++--- pubspec.yaml | 2 +- 4 files changed, 14 insertions(+), 5 deletions(-) diff --git a/lib/content_views/task_list_page.dart b/lib/content_views/task_list_page.dart index 0ef1fd2..cb5124a 100644 --- a/lib/content_views/task_list_page.dart +++ b/lib/content_views/task_list_page.dart @@ -564,6 +564,13 @@ class _TaskListPageState extends State with ProducerMixin { widget.tour.state = Constants.stateFinishedNotConfirmed; + final updatedTours = widget.job.tours; + final tourIdx = updatedTours.indexWhere((t) => t.id == widget.tour.id); + if (tourIdx >= 0) { + updatedTours[tourIdx] = widget.tour; + widget.job.tours = updatedTours; + } + final jobBox = MyApp.objectBoxStore.box(); jobBox.put(widget.job); diff --git a/lib/content_views/tour_list_page.dart b/lib/content_views/tour_list_page.dart index 12f8041..3653377 100644 --- a/lib/content_views/tour_list_page.dart +++ b/lib/content_views/tour_list_page.dart @@ -65,7 +65,7 @@ class _TourListPageState extends State with ProducerMixin { child: Row( children: [ Text( - widget.job.id.toString(), + widget.job.externalId.toString(), textAlign: TextAlign.left, ), ], diff --git a/lib/main.dart b/lib/main.dart index 8926d23..29fa9d8 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -418,10 +418,12 @@ class _MainState extends State
with SingleTickerProviderStateMixin, Produc var removeJobMessage = message.payload as RemoveJobMessage; final box = MyApp.objectBoxStore.box(); - var job = box.get(removeJobMessage.id); + final query = box.query(Job_.externalId.equals(removeJobMessage.id)).build(); + final job = query.findFirst(); + query.close(); if (job != null) { - box.remove(removeJobMessage.id); + box.remove(job.id); sendMessage( routingKey: Constants.messageTopicJobDeleted, @@ -430,7 +432,7 @@ class _MainState extends State
with SingleTickerProviderStateMixin, Produc sendMessage( routingKey: Constants.messageTopicUpdateBadges, - payload: RefreshBadgesMessage, + payload: RefreshBadgesMessage(), ); } }, diff --git a/pubspec.yaml b/pubspec.yaml index 85667ad..d83622f 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -16,7 +16,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html # In Windows, build-name is used as the major, minor, and patch parts # of the product and file versions while build-number is used as the build suffix. -version: 349.0.0+349 +version: 352.0.0+352 environment: sdk: '>=3.9.0 <4.0.0'