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