Erweiterungen
This commit is contained in:
1 parent
2e53482a3c
commit
c21633e0d2
3 files changed
+117
-8
No files matched your search
@@ -4,6 +4,7 @@ import 'package:stadtbote/content_views/tour_details_page.dart';
|
||||
import 'package:stadtbote/content_views/utils/content_view_widget.dart';
|
||||
import 'package:stadtbote/content_views/utils/header_info.dart';
|
||||
import 'package:stadtbote/model/job_tour.dart';
|
||||
import 'package:stadtbote/popups/map_popup.dart';
|
||||
|
||||
import '../model/job.dart';
|
||||
import '../tools/constants.dart';
|
||||
@@ -80,18 +81,36 @@ class _TourListPageState extends State<TourListPage> {
|
||||
Row(
|
||||
children: [
|
||||
Text(
|
||||
widget.job.crFilter != null ? widget.job.crFilter.toString() : "Kein CR-Filter vorhanden",
|
||||
widget.job.crFilter != null ? widget.job.crFilter.toString() : "",
|
||||
textAlign: TextAlign.left,
|
||||
),
|
||||
],
|
||||
),
|
||||
Row(
|
||||
children: [
|
||||
const Icon(Icons.arrow_back, size: 30.0, color: Colors.black),
|
||||
Image.asset("assets/${mapVehicleTypeToImageName(widget.job.vhtId)}", width: 60, height: 60),
|
||||
const SizedBox(width: 10),
|
||||
Text(
|
||||
widget.job.vhtId.toString()
|
||||
Expanded(
|
||||
child: Text(
|
||||
mapVehicleTypeToText(widget.job.vhtId)
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 10),
|
||||
SizedBox(
|
||||
width: 100,
|
||||
child: ElevatedButton(
|
||||
style: ButtonStyle(
|
||||
shape: MaterialStateProperty.all<RoundedRectangleBorder>(
|
||||
RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(8.0),
|
||||
side: const BorderSide(color: Colors.grey),
|
||||
),
|
||||
),
|
||||
backgroundColor: MaterialStateProperty.all<Color>(Colors.lightGreen),
|
||||
foregroundColor: MaterialStateProperty.all<Color>(Colors.black),
|
||||
),
|
||||
onPressed: () => { showMapPopup(context, widget.job.tours[0], widget.job.tours)},
|
||||
child: const Text("Karte")))
|
||||
],
|
||||
),
|
||||
Expanded(
|
||||
@@ -112,6 +131,10 @@ class _TourListPageState extends State<TourListPage> {
|
||||
for (var tour in _tours) {
|
||||
Color color = Colors.transparent;
|
||||
switch(tour.state) {
|
||||
case 0:
|
||||
color = Colors.white;
|
||||
break;
|
||||
|
||||
case 1:
|
||||
color = Colors.lightGreen;
|
||||
break;
|
||||
@@ -165,6 +188,8 @@ class _TourListPageState extends State<TourListPage> {
|
||||
}
|
||||
|
||||
void _clicked(JobTour tour) {
|
||||
BroadcastReceiver().publish<ContentViewWidget>(Constants.messageTopicPushContentView, arguments: TourDetailsPage(job: widget.job, tour: tour));
|
||||
if (tour.state == 0) {
|
||||
BroadcastReceiver().publish<ContentViewWidget>(Constants.messageTopicPushContentView, arguments: TourDetailsPage(job: widget.job, tour: tour));
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user