Erweiterungen
This commit is contained in:
1 parent
efb55331d2
commit
20a1309946
1 file changed
+51
-62
@@ -93,38 +93,32 @@ class _TourListPageState extends State<TourListPage> {
|
|||||||
Image.asset("assets/${mapVehicleTypeToImageName(widget.job.vhtId)}", width: 60, height: 60),
|
Image.asset("assets/${mapVehicleTypeToImageName(widget.job.vhtId)}", width: 60, height: 60),
|
||||||
const SizedBox(width: 10),
|
const SizedBox(width: 10),
|
||||||
Expanded(
|
Expanded(
|
||||||
child: Text(
|
child: Text(mapVehicleTypeToText(widget.job.vhtId)),
|
||||||
mapVehicleTypeToText(widget.job.vhtId)
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
const SizedBox(width: 10),
|
const SizedBox(width: 10),
|
||||||
SizedBox(
|
SizedBox(
|
||||||
width: 100,
|
width: 100,
|
||||||
child: Visibility(
|
child: Visibility(
|
||||||
visible: widget.job.tours[0].pos != null,
|
visible: widget.job.tours[0].pos != null,
|
||||||
child: ElevatedButton(
|
child: ElevatedButton(
|
||||||
style: ButtonStyle(
|
style: ButtonStyle(
|
||||||
shape: MaterialStateProperty.all<RoundedRectangleBorder>(
|
shape: MaterialStateProperty.all<RoundedRectangleBorder>(
|
||||||
RoundedRectangleBorder(
|
RoundedRectangleBorder(
|
||||||
borderRadius: BorderRadius.circular(8.0),
|
borderRadius: BorderRadius.circular(8.0),
|
||||||
side: const BorderSide(color: Colors.grey),
|
side: const BorderSide(color: Colors.grey),
|
||||||
|
),
|
||||||
),
|
),
|
||||||
|
backgroundColor: MaterialStateProperty.all<Color>(Colors.lightGreen),
|
||||||
|
foregroundColor: MaterialStateProperty.all<Color>(Colors.black),
|
||||||
),
|
),
|
||||||
backgroundColor: MaterialStateProperty.all<Color>(Colors.lightGreen),
|
onPressed: () => {showMapPopup(context, widget.job.tours[0], widget.job.tours)},
|
||||||
foregroundColor: MaterialStateProperty.all<Color>(Colors.black),
|
child: const Text("Karte")),
|
||||||
),
|
))
|
||||||
onPressed: () => { showMapPopup(context, widget.job.tours[0], widget.job.tours)},
|
|
||||||
child: const Text("Karte")),
|
|
||||||
))
|
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
Expanded(
|
Expanded(
|
||||||
child: ListView(
|
child: ListView(padding: const EdgeInsets.all(0), children: jobWidgets),
|
||||||
padding: const EdgeInsets.all(0),
|
|
||||||
children: jobWidgets
|
|
||||||
),
|
|
||||||
)
|
)
|
||||||
|
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
@@ -135,7 +129,7 @@ class _TourListPageState extends State<TourListPage> {
|
|||||||
|
|
||||||
for (var tour in _tours) {
|
for (var tour in _tours) {
|
||||||
Color color = Colors.transparent;
|
Color color = Colors.transparent;
|
||||||
switch(tour.state) {
|
switch (tour.state) {
|
||||||
case 0:
|
case 0:
|
||||||
color = Colors.white;
|
color = Colors.white;
|
||||||
break;
|
break;
|
||||||
@@ -151,41 +145,37 @@ class _TourListPageState extends State<TourListPage> {
|
|||||||
|
|
||||||
jobWidgets.add(
|
jobWidgets.add(
|
||||||
ListTile(
|
ListTile(
|
||||||
contentPadding: const EdgeInsets.all(0),
|
contentPadding: const EdgeInsets.all(0),
|
||||||
onTap: () {
|
onTap: () {
|
||||||
_clicked(tour);
|
_clicked(tour);
|
||||||
},
|
},
|
||||||
title: Container(
|
title: Container(
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
border: Border.all(color: Colors.grey, width: 0.5),
|
border: Border.all(color: Colors.grey, width: 0.5), color: color, borderRadius: const BorderRadius.all(Radius.circular(13))),
|
||||||
color: color,
|
padding: const EdgeInsets.all(5.0),
|
||||||
borderRadius: const BorderRadius.all(Radius.circular(13))
|
child: Column(
|
||||||
),
|
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||||
padding: const EdgeInsets.all(5.0),
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
child: Column(
|
children: <Widget>[
|
||||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
Text(
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
"${"Station ${tour.sort}"} ${mapTourMode(tour.mode)}",
|
||||||
children: <Widget>[
|
textAlign: TextAlign.left,
|
||||||
Text(
|
),
|
||||||
"${"Station ${tour.sort}"} ${mapTourMode(tour.mode)}",
|
Text(
|
||||||
textAlign: TextAlign.left,
|
tour.comp,
|
||||||
),
|
textAlign: TextAlign.left,
|
||||||
Text(
|
),
|
||||||
tour.comp,
|
Text(
|
||||||
textAlign: TextAlign.left,
|
tour.street,
|
||||||
),
|
textAlign: TextAlign.left,
|
||||||
Text(
|
),
|
||||||
tour.street,
|
Text(
|
||||||
textAlign: TextAlign.left,
|
tour.city,
|
||||||
),
|
textAlign: TextAlign.left,
|
||||||
Text(
|
),
|
||||||
tour.city,
|
],
|
||||||
textAlign: TextAlign.left,
|
),
|
||||||
),
|
)),
|
||||||
],
|
|
||||||
),
|
|
||||||
)
|
|
||||||
),
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -193,8 +183,7 @@ class _TourListPageState extends State<TourListPage> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void _clicked(JobTour tour) {
|
void _clicked(JobTour tour) {
|
||||||
if (tour.state == 0) {
|
MessageService().publish<ContentViewWidget>(Constants.messageTopicPushContentView,
|
||||||
MessageService().publish<ContentViewWidget>(Constants.messageTopicPushContentView, arguments: TourDetailsPage(job: widget.job, tour: tour, readOnly: widget.readOnly));
|
arguments: TourDetailsPage(job: widget.job, tour: tour, readOnly: tour.state != 0));
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in new issue
Block a user