Fehlerkorrekturen und Erweiterungen
This commit is contained in:
1 parent
1f3cc1e995
commit
6c4294512e
8 files changed
+166
-75
No files matched your search
@@ -1,7 +1,5 @@
|
||||
import 'dart:async';
|
||||
|
||||
import 'package:expandable/expandable.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:intl/intl.dart';
|
||||
import 'package:shared_map/shared_map.dart';
|
||||
@@ -138,18 +136,109 @@ Future<List<Widget>> _fetchJobWidgets(StateSetter dialogState, Function() onFini
|
||||
for (var jobEntry in entries) {
|
||||
var job = jobEntry.value;
|
||||
|
||||
ExpandableController controller = ExpandableController();
|
||||
controller.expanded = false;
|
||||
|
||||
controller.addListener(() {
|
||||
if (controller.expanded) {
|
||||
_infoExpandedMap[job.id] = true;
|
||||
} else {
|
||||
_infoExpandedMap[job.id] = false;
|
||||
}
|
||||
});
|
||||
var scrollController = ScrollController();
|
||||
|
||||
widgets.add(StatefulBuilder(builder: (BuildContext context, StateSetter setState) {
|
||||
return ListTile(
|
||||
contentPadding: const EdgeInsets.symmetric(horizontal: 8, vertical: 8),
|
||||
title: Container(
|
||||
height: 280,
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(10),
|
||||
border: Border.all(
|
||||
color: Constants.colorPrimary,
|
||||
width: 1,
|
||||
),
|
||||
),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: Column(
|
||||
children: [
|
||||
SizedBox(
|
||||
height: 200,
|
||||
child: Scrollbar(
|
||||
controller: scrollController,
|
||||
thumbVisibility: true,
|
||||
child: SingleChildScrollView(
|
||||
controller: scrollController,
|
||||
child: Column(
|
||||
children: [
|
||||
SizedBox(
|
||||
width: double.infinity,
|
||||
child: Text(
|
||||
DateFormat('dd.MM.yyyy HH:mm').format(DateTime.parse(job.ordertime).toLocal()).toString(),
|
||||
textAlign: TextAlign.left,
|
||||
style: TextStyle(backgroundColor: isJobTooFarInFuture(job) ? Colors.red : Colors.transparent),
|
||||
),
|
||||
),
|
||||
SizedBox(width: double.infinity, child: Text('Auftragsnummer: ${job.id}', textAlign: TextAlign.left)),
|
||||
SizedBox(width: double.infinity, child: Text(job.tours[0].comp, textAlign: TextAlign.left)),
|
||||
SizedBox(width: double.infinity, child: Text(job.tours[0].street, textAlign: TextAlign.left)),
|
||||
SizedBox(width: double.infinity, child: Text(job.tours[0].city, textAlign: TextAlign.left)),
|
||||
Row(
|
||||
children: [
|
||||
Image.asset("assets/${mapVehicleTypeToImageName(job.vhtId)}", width: 60, height: 60),
|
||||
const SizedBox(width: 10),
|
||||
Text(mapVehicleTypeToText(job.vhtId)),
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
SizedBox(width: double.infinity, child: Text(job.rem, textAlign: TextAlign.left)),
|
||||
SizedBox(width: double.infinity, child: Text(job.rem, textAlign: TextAlign.left)),
|
||||
SizedBox(width: double.infinity, child: Text(job.rem, textAlign: TextAlign.left)),
|
||||
SizedBox(width: double.infinity, child: Text(job.rem, textAlign: TextAlign.left)),
|
||||
SizedBox(width: double.infinity, child: Text(job.rem, textAlign: TextAlign.left)),
|
||||
SizedBox(width: double.infinity, child: Text(job.rem, textAlign: TextAlign.left)),
|
||||
SizedBox(width: double.infinity, child: Text(job.rem, textAlign: TextAlign.left)),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
Row(children: [
|
||||
Expanded(
|
||||
child: getDefaultButton(!job.global ? 'Ablehnen' : 'Ignorieren', () {
|
||||
dialogState(() {
|
||||
_sendAnswer(mapReference, job, !job.global ? 2 : 3);
|
||||
|
||||
jobMap.remove(job.id);
|
||||
|
||||
job.sendMessage(
|
||||
routingKey: Constants.messageTopicRemoveJob,
|
||||
payload: RemoveJobMessage(id: job.id),
|
||||
);
|
||||
|
||||
setState(() {});
|
||||
});
|
||||
}),
|
||||
),
|
||||
const SizedBox(width: 20),
|
||||
Expanded(
|
||||
child: getDefaultButton('Annehmen', enabledTimerActive: false, () {
|
||||
dialogState(() {
|
||||
_sendAnswer(mapReference, job, 1);
|
||||
|
||||
jobMap.remove(job.id);
|
||||
|
||||
job.sendMessage(
|
||||
routingKey: Constants.messageTopicRemoveJob,
|
||||
payload: RemoveJobMessage(id: job.id),
|
||||
);
|
||||
|
||||
setState(() {});
|
||||
});
|
||||
}),
|
||||
)
|
||||
])
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}));
|
||||
|
||||
/*widgets.add(StatefulBuilder(builder: (BuildContext context, StateSetter setState) {
|
||||
return ExpandableNotifier(
|
||||
child: ListTile(
|
||||
contentPadding: const EdgeInsets.symmetric(horizontal: 8, vertical: 8),
|
||||
@@ -283,7 +372,8 @@ Future<List<Widget>> _fetchJobWidgets(StateSetter dialogState, Function() onFini
|
||||
),
|
||||
),
|
||||
);
|
||||
}));
|
||||
}))*/
|
||||
;
|
||||
}
|
||||
|
||||
return widgets;
|
||||
|
||||
Reference in new issue
Block a user