Unterschriftenerfassung dauerhaft auf Deutsch anzeigen, lokale VHS-Buildkonfiguration und Regressionstests ergänzen sowie Version auf 357.0.0+357 anheben.
268 lines
8.4 KiB
Dart
268 lines
8.4 KiB
Dart
import 'package:dart_mq/dart_mq.dart';
|
|
import 'package:flutter/material.dart';
|
|
import 'package:stadtbote/content_views/task_list_page.dart';
|
|
import 'package:stadtbote/content_views/utils/content_view_widget.dart';
|
|
import 'package:stadtbote/messages/pop_content_view_message.dart';
|
|
import 'package:stadtbote/model/job_tour.dart';
|
|
import 'package:stadtbote/popups/job_map_popup.dart';
|
|
|
|
import '../model/job.dart';
|
|
import '../popups/files_popup.dart';
|
|
import '../tools/app_localizations.dart';
|
|
import '../tools/constants.dart';
|
|
import '../tools/util.dart';
|
|
|
|
class TourDetailsPage extends ContentViewWidget {
|
|
const TourDetailsPage(
|
|
{super.key,
|
|
required this.job,
|
|
required this.tour,
|
|
this.readOnly = false});
|
|
|
|
final Job job;
|
|
|
|
final JobTour tour;
|
|
|
|
final bool readOnly;
|
|
|
|
@override
|
|
State<TourDetailsPage> createState() => _TourDetailsPageState();
|
|
|
|
@override
|
|
Future<Widget> getHeaderWidget(BuildContext context) async {
|
|
await Future.delayed(const Duration(microseconds: 0));
|
|
|
|
return _HeaderWidget();
|
|
}
|
|
}
|
|
|
|
class _TourDetailsPageState extends State<TourDetailsPage> with ProducerMixin {
|
|
late bool _initCompleted = false;
|
|
|
|
@override
|
|
void initState() {
|
|
Future.delayed(const Duration(seconds: 0), () async {
|
|
_initCompleted = true;
|
|
|
|
setState(() {});
|
|
});
|
|
|
|
super.initState();
|
|
}
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
if (!_initCompleted) {
|
|
return Util.getWaitWidget(context);
|
|
}
|
|
|
|
var remark = "";
|
|
if (widget.tour.rem.isNotEmpty) {
|
|
remark += '${widget.tour.rem}\n';
|
|
} else {
|
|
remark = 'no_remark'.tr;
|
|
}
|
|
|
|
return Padding(
|
|
padding: const EdgeInsets.all(8.0),
|
|
child: Column(
|
|
children: [
|
|
Expanded(
|
|
child: Container(
|
|
padding: const EdgeInsets.all(10),
|
|
decoration: BoxDecoration(
|
|
border: Border.all(color: Colors.grey, width: 0.5),
|
|
color: Colors.transparent,
|
|
borderRadius: const BorderRadius.all(Radius.circular(13))),
|
|
child: Column(
|
|
crossAxisAlignment: CrossAxisAlignment.stretch,
|
|
children: [
|
|
Text(
|
|
"${'station'.tr} ${widget.tour.sort} ${mapTourMode(widget.tour.mode)}",
|
|
textAlign: TextAlign.left,
|
|
),
|
|
Text(
|
|
widget.tour.comp,
|
|
textAlign: TextAlign.left,
|
|
),
|
|
Text(
|
|
widget.tour.person,
|
|
textAlign: TextAlign.left,
|
|
),
|
|
Text(
|
|
widget.tour.street,
|
|
textAlign: TextAlign.left,
|
|
),
|
|
Text(
|
|
widget.tour.city,
|
|
textAlign: TextAlign.left,
|
|
),
|
|
Text(
|
|
"${'phone'.tr} ${widget.tour.phone}",
|
|
textAlign: TextAlign.left,
|
|
),
|
|
Text(
|
|
"${'commission_number'.tr}: ${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),
|
|
Text(
|
|
'files_available'.tr,
|
|
style: const TextStyle(
|
|
fontSize: 12,
|
|
color: Colors.grey,
|
|
),
|
|
),
|
|
],
|
|
),
|
|
],
|
|
const SizedBox(height: 10),
|
|
getDefaultButton(
|
|
'map'.tr,
|
|
() => showJobMapPopup(context, widget.job, currentTour: widget.tour)),
|
|
],
|
|
),
|
|
)),
|
|
const SizedBox(height: 10),
|
|
Expanded(
|
|
child: Container(
|
|
padding: const EdgeInsets.all(10),
|
|
decoration: BoxDecoration(
|
|
border: Border.all(color: Colors.grey, width: 1.5),
|
|
color: Colors.transparent,
|
|
borderRadius: const BorderRadius.all(Radius.circular(13))),
|
|
child: Column(
|
|
crossAxisAlignment: CrossAxisAlignment.stretch,
|
|
children: [
|
|
Expanded(
|
|
child: Scrollbar(
|
|
thumbVisibility: true,
|
|
child: SingleChildScrollView(child: Text(remark)))),
|
|
]),
|
|
),
|
|
),
|
|
const SizedBox(height: 10),
|
|
getDefaultButton(
|
|
'next'.tr,
|
|
() async => {
|
|
sendMessage(
|
|
routingKey: Constants.messageTopicPushContentView,
|
|
payload: TaskListPage(
|
|
job: widget.job,
|
|
tour: widget.tour,
|
|
readOnly: widget.readOnly),
|
|
)
|
|
}),
|
|
],
|
|
),
|
|
);
|
|
}
|
|
}
|
|
|
|
class _HeaderWidget extends StatefulWidget {
|
|
@override
|
|
State<_HeaderWidget> createState() => _HeaderWidgetState();
|
|
}
|
|
|
|
class _HeaderWidgetState extends State<_HeaderWidget> with ProducerMixin {
|
|
@override
|
|
void initState() {
|
|
super.initState();
|
|
}
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
var cellWidth = (MediaQuery.of(context).size.width - 60 - 60 - 25) / 2;
|
|
|
|
return Padding(
|
|
padding: const EdgeInsets.all(8),
|
|
child: Stack(
|
|
alignment: Alignment.center,
|
|
children: [
|
|
Row(
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
children: [
|
|
Visibility(
|
|
visible: true,
|
|
child: Container(
|
|
width: 60,
|
|
height: 60,
|
|
decoration: const BoxDecoration(
|
|
shape: BoxShape.circle,
|
|
color: Colors.white,
|
|
),
|
|
child: FittedBox(
|
|
child: GestureDetector(
|
|
onTap: () async {
|
|
sendMessage(
|
|
routingKey: Constants.messageTopicPopContentView,
|
|
payload: PopContentViewMessage(count: 1),
|
|
);
|
|
},
|
|
child: const CircleAvatar(
|
|
radius: 10,
|
|
backgroundColor: Constants.colorPrimary,
|
|
child: Padding(
|
|
padding: EdgeInsets.all(1.0),
|
|
child: Icon(Icons.arrow_back,
|
|
size: 20.0, color: Colors.white)),
|
|
),
|
|
),
|
|
),
|
|
),
|
|
),
|
|
Visibility(
|
|
visible: false,
|
|
child: Container(
|
|
width: 60,
|
|
height: 60,
|
|
decoration: const BoxDecoration(
|
|
shape: BoxShape.circle,
|
|
color: Colors.red,
|
|
),
|
|
child: FittedBox(
|
|
child: GestureDetector(
|
|
onTap: () async {
|
|
sendMessage(
|
|
routingKey: Constants.messageTopicPopContentView,
|
|
payload: PopContentViewMessage(count: 1),
|
|
);
|
|
},
|
|
child: const CircleAvatar(
|
|
backgroundColor: Constants.colorPrimary,
|
|
radius: 10,
|
|
child: Padding(
|
|
padding: EdgeInsets.all(1.0),
|
|
child: Icon(Icons.info_outline,
|
|
size: 20.0, color: Colors.white))),
|
|
),
|
|
),
|
|
),
|
|
),
|
|
],
|
|
),
|
|
SizedBox(
|
|
height: 100,
|
|
width: cellWidth * 2,
|
|
child: const Center(
|
|
child: Text(
|
|
textAlign: TextAlign.center,
|
|
"Details der Station",
|
|
style: TextStyle(
|
|
fontWeight: FontWeight.bold,
|
|
fontSize: 18,
|
|
color: Colors.white),
|
|
),
|
|
),
|
|
),
|
|
],
|
|
),
|
|
);
|
|
}
|
|
}
|