Erweiterungen

This commit is contained in:
Sven committed 2026-02-14 08:52:06 +01:00
1 parent ba1f7d5440
commit bb3dc9e856
28 files changed
+1672 -1291

No files matched your search

+41 -30
View File
@@ -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<AcceptedJobsPage>
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: <Widget>[
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: <Widget>[
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),
),
],
),
)),
+43 -19
View File
@@ -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<AssignedJobsPage> with ProducerMixin,
late bool _initCompleted = false;
List<Job> _jobs = [];
final List<ExpandableController> _expandableControllers = [];
@override
void initState() {
@@ -59,6 +61,11 @@ class _AssignedJobsPageState extends State<AssignedJobsPage> 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<AssignedJobsPage> with ProducerMixin,
List<Widget> _createWidgets() {
List<Widget> 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<AssignedJobsPage> 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<AssignedJobsPage> with ProducerMixin,
])
],
),
),
if (job.hasFiles)
Positioned(
top: 0,
right: 0,
child: FilesBadge(files: job.files),
),
],
),
),
),
));
),
),
));
}
return widgets;
+37 -26
View File
@@ -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<FinishedJobsPage>
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: <Widget>[
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: <Widget>[
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),
),
],
),
)),
@@ -102,6 +102,12 @@ class _SetDesiredZipPageState extends State<SetDesiredZipPage>
acknowledgeRequired: true),
);
}
@override
void dispose() {
textEditController.dispose();
super.dispose();
}
}
class _HeaderWidget extends StatefulWidget {
+17
View File
@@ -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<TourDetailsPage> 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',
+11 -3
View File
@@ -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<TourListPage> with ProducerMixin {
crossAxisAlignment: CrossAxisAlignment.stretch,
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
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,