Erweiterungen
This commit is contained in:
1 parent
52415e0759
commit
265d75a99b
10 files changed
+481
-406
No files matched your search
@@ -25,7 +25,8 @@ class AcceptedJobsPage extends ContentViewWidget {
|
||||
}
|
||||
}
|
||||
|
||||
class _AcceptedJobsPageState extends State<AcceptedJobsPage> with ProducerMixin {
|
||||
class _AcceptedJobsPageState extends State<AcceptedJobsPage>
|
||||
with ProducerMixin {
|
||||
late List<Job> _jobs;
|
||||
|
||||
late bool _initCompleted = false;
|
||||
@@ -33,7 +34,10 @@ class _AcceptedJobsPageState extends State<AcceptedJobsPage> with ProducerMixin
|
||||
@override
|
||||
void initState() {
|
||||
Future.delayed(const Duration(seconds: 0), () async {
|
||||
_jobs = await MyApp.isarInstance.jobs.filter().stateEqualTo(Constants.stateAccepted).findAll();
|
||||
_jobs = await MyApp.isarInstance.jobs
|
||||
.filter()
|
||||
.stateEqualTo(Constants.stateAccepted)
|
||||
.findAll();
|
||||
_jobs.sort((job1, job2) {
|
||||
var date1 = DateTime.parse(job1.ordertime).millisecondsSinceEpoch;
|
||||
var date2 = DateTime.parse(job2.ordertime).millisecondsSinceEpoch;
|
||||
@@ -61,9 +65,7 @@ class _AcceptedJobsPageState extends State<AcceptedJobsPage> with ProducerMixin
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: Scrollbar(
|
||||
thumbVisibility: true,
|
||||
child: ListView(
|
||||
children: jobWidgets
|
||||
),
|
||||
child: ListView(children: jobWidgets),
|
||||
),
|
||||
);
|
||||
}
|
||||
@@ -72,53 +74,58 @@ class _AcceptedJobsPageState extends State<AcceptedJobsPage> with ProducerMixin
|
||||
List<Widget> jobWidgets = [];
|
||||
|
||||
for (var job in _jobs) {
|
||||
var bottomText = "${job.id}\n${job.tours[0].comp}\n${job.tours[0].street}\n${job.tours[0].city}";
|
||||
var bottomText =
|
||||
"${job.id}\n${job.tours[0].comp}\n${job.tours[0].street}\n${job.tours[0].city}";
|
||||
if (job.rem.trim().isNotEmpty) {
|
||||
bottomText += "\n\n${job.rem.trim()}";
|
||||
}
|
||||
|
||||
jobWidgets.add(
|
||||
ListTile(
|
||||
onTap: () {
|
||||
_clicked(job);
|
||||
},
|
||||
title: Container(
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white,
|
||||
border: Border.all(color: Colors.grey, width: 0.5),
|
||||
borderRadius: const BorderRadius.all(Radius.circular(13))
|
||||
),
|
||||
padding: const EdgeInsets.all(15.0),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: <Widget>[
|
||||
Text(
|
||||
DateFormat('dd.MM.yyyy HH:mm').format(DateTime.parse(job.ordertime).toLocal()).toString(),
|
||||
style: TextStyle(backgroundColor: isJobTooFarInFuture(job) ? Colors.red : Colors.transparent),
|
||||
textAlign: TextAlign.left,
|
||||
),
|
||||
Text(
|
||||
job.crFilter != null ? job.crFilter.toString() : "",
|
||||
textAlign: TextAlign.left,
|
||||
),
|
||||
Row(
|
||||
children: [
|
||||
Image.asset("assets/${mapVehicleTypeToImageName(job.vhtId)}", width: 60, height: 60),
|
||||
const SizedBox(width: 10),
|
||||
Text(
|
||||
mapVehicleTypeToText(job.vhtId)
|
||||
),
|
||||
],
|
||||
),
|
||||
Text(
|
||||
bottomText,
|
||||
textAlign: TextAlign.left,
|
||||
),
|
||||
],
|
||||
),
|
||||
)
|
||||
),
|
||||
onTap: () {
|
||||
_clicked(job);
|
||||
},
|
||||
title: Container(
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white,
|
||||
border: Border.all(color: Colors.grey, width: 0.5),
|
||||
borderRadius: const BorderRadius.all(Radius.circular(13))),
|
||||
padding: const EdgeInsets.all(15.0),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: <Widget>[
|
||||
Text(
|
||||
DateFormat('dd.MM.yyyy HH:mm')
|
||||
.format(DateTime.parse(job.ordertime).toLocal())
|
||||
.toString(),
|
||||
style: TextStyle(
|
||||
backgroundColor: isJobTooFarInFuture(job)
|
||||
? Colors.red
|
||||
: Colors.transparent),
|
||||
textAlign: TextAlign.left,
|
||||
),
|
||||
Text(
|
||||
job.crFilter != null ? job.crFilter.toString() : "",
|
||||
textAlign: TextAlign.left,
|
||||
),
|
||||
Row(
|
||||
children: [
|
||||
Image.asset(
|
||||
"assets/${mapVehicleTypeToImageName(job.vhtId)}",
|
||||
width: 60,
|
||||
height: 60),
|
||||
const SizedBox(width: 10),
|
||||
Text(mapVehicleTypeToText(job.vhtId)),
|
||||
],
|
||||
),
|
||||
Text(
|
||||
bottomText,
|
||||
textAlign: TextAlign.left,
|
||||
),
|
||||
],
|
||||
),
|
||||
)),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -126,13 +133,10 @@ class _AcceptedJobsPageState extends State<AcceptedJobsPage> with ProducerMixin
|
||||
}
|
||||
|
||||
void _clicked(Job job) async {
|
||||
// TODO MESSAGING
|
||||
sendMessage(
|
||||
routingKey: Constants.messageTopicPushContentView,
|
||||
payload: TourListPage(job: job),
|
||||
);
|
||||
|
||||
//await MessageService().publish<ContentViewWidget>(Constants.messageTopicPushContentView, arguments: TourListPage(job: job));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -171,18 +175,18 @@ class _HeaderWidgetState extends State<_HeaderWidget> with ProducerMixin {
|
||||
child: FittedBox(
|
||||
child: GestureDetector(
|
||||
onTap: () async {
|
||||
// TODO MESSAGING
|
||||
sendMessage(
|
||||
routingKey: Constants.messageTopicPopContentView,
|
||||
payload: PopContentViewMessage(count: 1),
|
||||
);
|
||||
|
||||
//await MessageService().publish<PopContentViewMessage>(Constants.messageTopicPopContentView, arguments: 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)),
|
||||
child: Padding(
|
||||
padding: EdgeInsets.all(1.0),
|
||||
child: Icon(Icons.arrow_back,
|
||||
size: 20.0, color: Colors.white)),
|
||||
),
|
||||
),
|
||||
),
|
||||
@@ -200,18 +204,18 @@ class _HeaderWidgetState extends State<_HeaderWidget> with ProducerMixin {
|
||||
child: FittedBox(
|
||||
child: GestureDetector(
|
||||
onTap: () async {
|
||||
// TODO MESSAGING
|
||||
sendMessage(
|
||||
routingKey: Constants.messageTopicPopContentView,
|
||||
payload: PopContentViewMessage(count: 1),
|
||||
);
|
||||
|
||||
//await MessageService().publish<PopContentViewMessage>(Constants.messageTopicPopContentView, arguments: 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))),
|
||||
child: Padding(
|
||||
padding: EdgeInsets.all(1.0),
|
||||
child: Icon(Icons.info_outline,
|
||||
size: 20.0, color: Colors.white))),
|
||||
),
|
||||
),
|
||||
),
|
||||
@@ -225,7 +229,10 @@ class _HeaderWidgetState extends State<_HeaderWidget> with ProducerMixin {
|
||||
child: Text(
|
||||
textAlign: TextAlign.center,
|
||||
"Angenommene Aufträge",
|
||||
style: TextStyle(fontWeight: FontWeight.bold, fontSize: 18, color: Colors.white),
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: 18,
|
||||
color: Colors.white),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
@@ -25,7 +25,8 @@ class FinishedJobsPage extends ContentViewWidget {
|
||||
}
|
||||
}
|
||||
|
||||
class _FinishedJobsPageState extends State<FinishedJobsPage> with ProducerMixin {
|
||||
class _FinishedJobsPageState extends State<FinishedJobsPage>
|
||||
with ProducerMixin {
|
||||
late List<Job> _jobs;
|
||||
|
||||
late bool _initCompleted = false;
|
||||
@@ -33,7 +34,10 @@ class _FinishedJobsPageState extends State<FinishedJobsPage> with ProducerMixin
|
||||
@override
|
||||
void initState() {
|
||||
Future.delayed(const Duration(seconds: 0), () async {
|
||||
_jobs = await MyApp.isarInstance.jobs.filter().stateEqualTo(Constants.stateFinished).findAll();
|
||||
_jobs = await MyApp.isarInstance.jobs
|
||||
.filter()
|
||||
.stateEqualTo(Constants.stateFinished)
|
||||
.findAll();
|
||||
|
||||
_initCompleted = true;
|
||||
|
||||
@@ -55,9 +59,7 @@ class _FinishedJobsPageState extends State<FinishedJobsPage> with ProducerMixin
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: Scrollbar(
|
||||
thumbVisibility: true,
|
||||
child: ListView(
|
||||
children: jobWidgets
|
||||
),
|
||||
child: ListView(children: jobWidgets),
|
||||
),
|
||||
);
|
||||
}
|
||||
@@ -66,7 +68,8 @@ class _FinishedJobsPageState extends State<FinishedJobsPage> with ProducerMixin
|
||||
List<Widget> jobWidgets = [];
|
||||
|
||||
for (var job in _jobs) {
|
||||
var bottomText = "${job.id}\n${job.tours[0].comp}\n${job.tours[0].street}\n${job.tours[0].city}";
|
||||
var bottomText =
|
||||
"${job.id}\n${job.tours[0].comp}\n${job.tours[0].street}\n${job.tours[0].city}";
|
||||
if (job.rem.trim().isNotEmpty) {
|
||||
bottomText += "\n\n${job.rem.trim()}";
|
||||
}
|
||||
@@ -80,15 +83,16 @@ class _FinishedJobsPageState extends State<FinishedJobsPage> with ProducerMixin
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white,
|
||||
border: Border.all(color: Colors.grey, width: 0.5),
|
||||
borderRadius: const BorderRadius.all(Radius.circular(13))
|
||||
),
|
||||
borderRadius: const BorderRadius.all(Radius.circular(13))),
|
||||
padding: const EdgeInsets.all(15.0),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: <Widget>[
|
||||
Text(
|
||||
DateFormat('dd.MM.yyyy HH:mm').format(DateTime.parse(job.ordertime).toLocal()).toString(),
|
||||
DateFormat('dd.MM.yyyy HH:mm')
|
||||
.format(DateTime.parse(job.ordertime).toLocal())
|
||||
.toString(),
|
||||
textAlign: TextAlign.left,
|
||||
),
|
||||
Text(
|
||||
@@ -97,11 +101,12 @@ class _FinishedJobsPageState extends State<FinishedJobsPage> with ProducerMixin
|
||||
),
|
||||
Row(
|
||||
children: [
|
||||
Image.asset("assets/${mapVehicleTypeToImageName(job.vhtId)}", width: 60, height: 60),
|
||||
Image.asset(
|
||||
"assets/${mapVehicleTypeToImageName(job.vhtId)}",
|
||||
width: 60,
|
||||
height: 60),
|
||||
const SizedBox(width: 10),
|
||||
Text(
|
||||
mapVehicleTypeToText(job.vhtId)
|
||||
),
|
||||
Text(mapVehicleTypeToText(job.vhtId)),
|
||||
],
|
||||
),
|
||||
Text(
|
||||
@@ -110,8 +115,7 @@ class _FinishedJobsPageState extends State<FinishedJobsPage> with ProducerMixin
|
||||
),
|
||||
],
|
||||
),
|
||||
)
|
||||
),
|
||||
)),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -119,13 +123,10 @@ class _FinishedJobsPageState extends State<FinishedJobsPage> with ProducerMixin
|
||||
}
|
||||
|
||||
void _clicked(Job job) async {
|
||||
// TODO MESSAGING
|
||||
sendMessage(
|
||||
routingKey: Constants.messageTopicPushContentView,
|
||||
payload: TourListPage(job: job, readOnly: true),
|
||||
);
|
||||
|
||||
//await MessageService().publish<ContentViewWidget>(Constants.messageTopicPushContentView, arguments: TourListPage(job: job, readOnly: true,));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -164,18 +165,18 @@ class _HeaderWidgetState extends State<_HeaderWidget> with ProducerMixin {
|
||||
child: FittedBox(
|
||||
child: GestureDetector(
|
||||
onTap: () async {
|
||||
// TODO MESSAGING
|
||||
sendMessage(
|
||||
routingKey: Constants.messageTopicPopContentView,
|
||||
payload: PopContentViewMessage(count: 1),
|
||||
);
|
||||
|
||||
//await MessageService().publish<PopContentViewMessage>(Constants.messageTopicPopContentView, arguments: 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)),
|
||||
child: Padding(
|
||||
padding: EdgeInsets.all(1.0),
|
||||
child: Icon(Icons.arrow_back,
|
||||
size: 20.0, color: Colors.white)),
|
||||
),
|
||||
),
|
||||
),
|
||||
@@ -193,18 +194,18 @@ class _HeaderWidgetState extends State<_HeaderWidget> with ProducerMixin {
|
||||
child: FittedBox(
|
||||
child: GestureDetector(
|
||||
onTap: () async {
|
||||
// TODO MESSAGING
|
||||
sendMessage(
|
||||
routingKey: Constants.messageTopicPushContentView,
|
||||
payload: PopContentViewMessage(count: 1),
|
||||
);
|
||||
|
||||
//await MessageService().publish<PopContentViewMessage>(Constants.messageTopicPopContentView, arguments: 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))),
|
||||
child: Padding(
|
||||
padding: EdgeInsets.all(1.0),
|
||||
child: Icon(Icons.info_outline,
|
||||
size: 20.0, color: Colors.white))),
|
||||
),
|
||||
),
|
||||
),
|
||||
@@ -218,7 +219,10 @@ class _HeaderWidgetState extends State<_HeaderWidget> with ProducerMixin {
|
||||
child: Text(
|
||||
textAlign: TextAlign.center,
|
||||
"Erledigte Aufträge",
|
||||
style: TextStyle(fontWeight: FontWeight.bold, fontSize: 18, color: Colors.white),
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: 18,
|
||||
color: Colors.white),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
+130
-105
@@ -91,22 +91,21 @@ class _MainPageState extends State<MainPage> with ConsumerMixin, ProducerMixin {
|
||||
badgeColor: Colors.red,
|
||||
padding: const EdgeInsets.all(10),
|
||||
borderRadius: BorderRadius.circular(4),
|
||||
borderSide: const BorderSide(color: Colors.white, width: 0),
|
||||
borderSide:
|
||||
const BorderSide(color: Colors.white, width: 0),
|
||||
elevation: 0,
|
||||
),
|
||||
child: getDefaultButton(
|
||||
'Zugewiesene Aufträge',
|
||||
image: Image.asset('assets/zugewiesene_auftraege.png', width: 30, height: 30),
|
||||
image: Image.asset('assets/zugewiesene_auftraege.png',
|
||||
width: 30, height: 30),
|
||||
() async => {
|
||||
// TODO MESSAGING
|
||||
sendMessage(
|
||||
routingKey: Constants.messageTopicPushContentView,
|
||||
payload: const AssignedJobsPage(),
|
||||
)
|
||||
|
||||
//await MessageService().publish<ContentViewWidget>(Constants.messageTopicPushContentView, arguments: const AssignedJobsPage())
|
||||
}
|
||||
),
|
||||
sendMessage(
|
||||
routingKey:
|
||||
Constants.messageTopicPushContentView,
|
||||
payload: const AssignedJobsPage(),
|
||||
)
|
||||
}),
|
||||
);
|
||||
},
|
||||
),
|
||||
@@ -119,7 +118,8 @@ class _MainPageState extends State<MainPage> with ConsumerMixin, ProducerMixin {
|
||||
builder: (context, value, child) {
|
||||
return badges.Badge(
|
||||
showBadge: value > 0,
|
||||
position: badges.BadgePosition.topEnd(top: -12, end: -5),
|
||||
position:
|
||||
badges.BadgePosition.topEnd(top: -12, end: -5),
|
||||
badgeContent: Text(
|
||||
value.toString(),
|
||||
style: const TextStyle(
|
||||
@@ -131,23 +131,23 @@ class _MainPageState extends State<MainPage> with ConsumerMixin, ProducerMixin {
|
||||
badgeColor: Colors.red,
|
||||
padding: const EdgeInsets.all(10),
|
||||
borderRadius: BorderRadius.circular(4),
|
||||
borderSide: const BorderSide(color: Colors.white, width: 0),
|
||||
borderSide:
|
||||
const BorderSide(color: Colors.white, width: 0),
|
||||
elevation: 0,
|
||||
),
|
||||
child: getDefaultButton(
|
||||
'Angenommene Aufträge',
|
||||
image: Image.asset('assets/angenommene_auftraege.png', width: 30, height: 30),
|
||||
image: Image.asset(
|
||||
'assets/angenommene_auftraege.png',
|
||||
width: 30,
|
||||
height: 30),
|
||||
() async => {
|
||||
// TODO MESSAGING
|
||||
sendMessage(
|
||||
routingKey: Constants.messageTopicPushContentView,
|
||||
payload: const AcceptedJobsPage(),
|
||||
)
|
||||
|
||||
//await MessageService().publish<ContentViewWidget>(Constants.messageTopicPushContentView, arguments: const AcceptedJobsPage())
|
||||
}
|
||||
)
|
||||
);
|
||||
sendMessage(
|
||||
routingKey:
|
||||
Constants.messageTopicPushContentView,
|
||||
payload: const AcceptedJobsPage(),
|
||||
)
|
||||
}));
|
||||
},
|
||||
),
|
||||
),
|
||||
@@ -156,17 +156,14 @@ class _MainPageState extends State<MainPage> with ConsumerMixin, ProducerMixin {
|
||||
visible: !_loggedOut,
|
||||
child: getDefaultButton(
|
||||
'Erledigte Aufträge',
|
||||
image: Image.asset('assets/erledigte_auftraege.png', width: 30, height: 30),
|
||||
image: Image.asset('assets/erledigte_auftraege.png',
|
||||
width: 30, height: 30),
|
||||
() async => {
|
||||
// TODO MESSAGING
|
||||
sendMessage(
|
||||
routingKey: Constants.messageTopicPushContentView,
|
||||
payload: const FinishedJobsPage(),
|
||||
)
|
||||
|
||||
//await MessageService().publish<ContentViewWidget>(Constants.messageTopicPushContentView, arguments: const FinishedJobsPage())
|
||||
}
|
||||
),
|
||||
sendMessage(
|
||||
routingKey: Constants.messageTopicPushContentView,
|
||||
payload: const FinishedJobsPage(),
|
||||
)
|
||||
}),
|
||||
),
|
||||
SizedBox(height: _loggedOut == true ? 0 : 20),
|
||||
Visibility(
|
||||
@@ -176,7 +173,8 @@ class _MainPageState extends State<MainPage> with ConsumerMixin, ProducerMixin {
|
||||
builder: (context, value, child) {
|
||||
return badges.Badge(
|
||||
showBadge: value > 0,
|
||||
position: badges.BadgePosition.topEnd(top: -12, end: -5),
|
||||
position:
|
||||
badges.BadgePosition.topEnd(top: -12, end: -5),
|
||||
badgeContent: Text(
|
||||
value.toString(),
|
||||
style: const TextStyle(
|
||||
@@ -188,23 +186,21 @@ class _MainPageState extends State<MainPage> with ConsumerMixin, ProducerMixin {
|
||||
badgeColor: Colors.red,
|
||||
padding: const EdgeInsets.all(10),
|
||||
borderRadius: BorderRadius.circular(4),
|
||||
borderSide: const BorderSide(color: Colors.white, width: 0),
|
||||
borderSide:
|
||||
const BorderSide(color: Colors.white, width: 0),
|
||||
elevation: 0,
|
||||
),
|
||||
child: getDefaultButton(
|
||||
'Nachrichten',
|
||||
image: Image.asset('assets/nachrichten.png', width: 30, height: 30),
|
||||
image: Image.asset('assets/nachrichten.png',
|
||||
width: 30, height: 30),
|
||||
() async => {
|
||||
// TODO MESSAGING
|
||||
sendMessage(
|
||||
routingKey: Constants.messageTopicPushContentView,
|
||||
payload: const MessagesPage(),
|
||||
)
|
||||
|
||||
//await MessageService().publish<ContentViewWidget>(Constants.messageTopicPushContentView, arguments: const MessagesPage())
|
||||
}
|
||||
)
|
||||
);
|
||||
sendMessage(
|
||||
routingKey:
|
||||
Constants.messageTopicPushContentView,
|
||||
payload: const MessagesPage(),
|
||||
)
|
||||
}));
|
||||
},
|
||||
),
|
||||
),
|
||||
@@ -213,30 +209,37 @@ class _MainPageState extends State<MainPage> with ConsumerMixin, ProducerMixin {
|
||||
visible: !_loggedOut,
|
||||
child: getDefaultButton(
|
||||
'Anfahrtsbereich',
|
||||
image: Image.asset('assets/anfahrtsbereich.png', width: 30, height: 30),
|
||||
() async => {
|
||||
sendMessage(
|
||||
routingKey: Constants.messageTopicPushContentView,
|
||||
payload: const ApproachAreaPage(),
|
||||
)
|
||||
}),
|
||||
image: Image.asset('assets/anfahrtsbereich.png',
|
||||
width: 30, height: 30),
|
||||
() async => {
|
||||
sendMessage(
|
||||
routingKey: Constants.messageTopicPushContentView,
|
||||
payload: const ApproachAreaPage(),
|
||||
)
|
||||
}),
|
||||
),
|
||||
SizedBox(height: _loggedOut == true ? 0 : 20),
|
||||
Visibility(
|
||||
visible: !_loggedOut && _showBWVButton,
|
||||
child: getDefaultButton(
|
||||
'Wunschziel für heute',
|
||||
image: Image.asset('assets/wunsch_plz.png', width: 30, height: 30),
|
||||
() async => {
|
||||
sendMessage(
|
||||
routingKey: Constants.messageTopicPushContentView,
|
||||
payload: const SetDesiredZipPage(),
|
||||
)
|
||||
}),
|
||||
image: Image.asset('assets/wunsch_plz.png',
|
||||
width: 30, height: 30),
|
||||
() async => {
|
||||
sendMessage(
|
||||
routingKey: Constants.messageTopicPushContentView,
|
||||
payload: const SetDesiredZipPage(),
|
||||
)
|
||||
}),
|
||||
),
|
||||
SizedBox(height: _loggedOut == true ? 0 : 20),
|
||||
getDefaultButton(_loggedOut ? 'Anmelden' : 'Abmelden',
|
||||
image: Image.asset(_loggedOut ? 'assets/anmelden.png' : 'assets/abmelden.png', width: 30, height: 30), () async {
|
||||
image: Image.asset(
|
||||
_loggedOut
|
||||
? 'assets/anmelden.png'
|
||||
: 'assets/abmelden.png',
|
||||
width: 30,
|
||||
height: 30), () async {
|
||||
_logout(context);
|
||||
}),
|
||||
Expanded(
|
||||
@@ -299,19 +302,24 @@ class _MainPageState extends State<MainPage> with ConsumerMixin, ProducerMixin {
|
||||
);
|
||||
|
||||
subscribe(
|
||||
queueId: Constants.messageTopicBWVEnabled,
|
||||
callback: (message) {
|
||||
setState(() {
|
||||
_showBWVButton = Util.preferencesGetBool(Constants.prefsBWVEnabled, false);
|
||||
queueId: Constants.messageTopicBWVEnabled,
|
||||
callback: (message) {
|
||||
setState(() {
|
||||
_showBWVButton =
|
||||
Util.preferencesGetBool(Constants.prefsBWVEnabled, false);
|
||||
});
|
||||
});
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
void _refreshBadges() async {
|
||||
_assignedJobsValueNotifier.value = await MyApp.isarInstance.jobs.filter().stateEqualTo(0).count();
|
||||
_acceptedJobsValueNotifier.value = await MyApp.isarInstance.jobs.filter().stateEqualTo(1).count();
|
||||
_messagesValueNotifier.value = await MyApp.isarInstance.chatMessages.filter().readEqualTo(false).count();
|
||||
_assignedJobsValueNotifier.value =
|
||||
await MyApp.isarInstance.jobs.filter().stateEqualTo(0).count();
|
||||
_acceptedJobsValueNotifier.value =
|
||||
await MyApp.isarInstance.jobs.filter().stateEqualTo(1).count();
|
||||
_messagesValueNotifier.value = await MyApp.isarInstance.chatMessages
|
||||
.filter()
|
||||
.readEqualTo(false)
|
||||
.count();
|
||||
}
|
||||
|
||||
void _jobReceived(Job job) {
|
||||
@@ -329,7 +337,7 @@ class _MainPageState extends State<MainPage> with ConsumerMixin, ProducerMixin {
|
||||
|
||||
_loggedOut = false;
|
||||
|
||||
setState(() { });
|
||||
setState(() {});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -339,7 +347,8 @@ class _MainPageState extends State<MainPage> with ConsumerMixin, ProducerMixin {
|
||||
onPressed: () async {
|
||||
Navigator.of(context).pop();
|
||||
|
||||
showMessageDialog(context, "Information", "Sie werden abgemeldet.\nBitte warten...");
|
||||
showMessageDialog(
|
||||
context, "Information", "Sie werden abgemeldet.\nBitte warten...");
|
||||
|
||||
_sendLogoutMessage();
|
||||
|
||||
@@ -352,14 +361,11 @@ class _MainPageState extends State<MainPage> with ConsumerMixin, ProducerMixin {
|
||||
);
|
||||
|
||||
Future.delayed(const Duration(seconds: 3), () async {
|
||||
// TODO MESSAGING
|
||||
sendMessage(
|
||||
routingKey: Constants.messageTopicDisconnectClient,
|
||||
payload: DisconnectClientMessage(),
|
||||
);
|
||||
|
||||
//await MessageService().publish<DisconnectClientMessage>(Constants.messageTopicDisconnectClient, arguments: DisconnectClientMessage());
|
||||
|
||||
Navigator.of(MyApp.appNavigatorKey.currentContext!).pop();
|
||||
|
||||
setState(() {});
|
||||
@@ -406,13 +412,13 @@ class _MainPageState extends State<MainPage> with ConsumerMixin, ProducerMixin {
|
||||
logoutMessage.pos!.acc = position.accuracy.toInt();
|
||||
}
|
||||
|
||||
// TODO MESSAGING
|
||||
sendMessage(
|
||||
routingKey: Constants.messageTopicPublishPayload,
|
||||
payload: PublishPayloadMessage(topic: "logout", message: logoutMessage.toJson(), acknowledgeRequired: false),
|
||||
payload: PublishPayloadMessage(
|
||||
topic: "logout",
|
||||
message: logoutMessage.toJson(),
|
||||
acknowledgeRequired: false),
|
||||
);
|
||||
|
||||
//await MessageService().publish<PublishPayloadMessage>(Constants.messageTopicPublishPayload, arguments: PublishPayloadMessage(topic: "logout", message: logoutMessage.toJson(), qos: MqttQos.exactlyOnce));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -458,12 +464,14 @@ class _HeaderWidgetState extends State<_HeaderWidget> with ConsumerMixin {
|
||||
),
|
||||
child: FittedBox(
|
||||
child: GestureDetector(
|
||||
onTap: () async {
|
||||
},
|
||||
onTap: () async {},
|
||||
child: const CircleAvatar(
|
||||
radius: 10,
|
||||
backgroundColor: Constants.colorPrimary,
|
||||
child: Padding(padding: EdgeInsets.all(1.0), child: Icon(Icons.info_outline, size: 20.0, color: Colors.white)),
|
||||
child: Padding(
|
||||
padding: EdgeInsets.all(1.0),
|
||||
child: Icon(Icons.info_outline,
|
||||
size: 20.0, color: Colors.white)),
|
||||
),
|
||||
),
|
||||
),
|
||||
@@ -481,18 +489,24 @@ class _HeaderWidgetState extends State<_HeaderWidget> with ConsumerMixin {
|
||||
child: FittedBox(
|
||||
child: GestureDetector(
|
||||
onTap: () async {
|
||||
var sessionStatus = await MyApp.isarInstance.sessionStatus.where().findFirst();
|
||||
var sessionStatus = await MyApp
|
||||
.isarInstance.sessionStatus
|
||||
.where()
|
||||
.findFirst();
|
||||
|
||||
showInfosPopup(sessionStatus);
|
||||
},
|
||||
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))),
|
||||
),
|
||||
backgroundColor: Constants.colorPrimary,
|
||||
radius: 10,
|
||||
child: Padding(
|
||||
padding: EdgeInsets.all(1.0),
|
||||
child: Icon(Icons.info_outline,
|
||||
size: 20.0, color: Colors.white))),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
SizedBox(
|
||||
@@ -501,7 +515,8 @@ class _HeaderWidgetState extends State<_HeaderWidget> with ConsumerMixin {
|
||||
child: Column(
|
||||
children: [
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween, // Verteilt die Texte gleichmäßig in der Zeile
|
||||
mainAxisAlignment: MainAxisAlignment
|
||||
.spaceBetween, // Verteilt die Texte gleichmäßig in der Zeile
|
||||
children: <Widget>[
|
||||
SizedBox(
|
||||
width: cellWidth,
|
||||
@@ -522,21 +537,24 @@ class _HeaderWidgetState extends State<_HeaderWidget> with ConsumerMixin {
|
||||
],
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween, // Verteilt die Texte gleichmäßig in der Zeile
|
||||
mainAxisAlignment: MainAxisAlignment
|
||||
.spaceBetween, // Verteilt die Texte gleichmäßig in der Zeile
|
||||
children: <Widget>[
|
||||
SizedBox(
|
||||
width: cellWidth,
|
||||
child: ValueListenableBuilder<String>(
|
||||
valueListenable: _zipValueNotifier,
|
||||
builder: (context, value, child) {
|
||||
return Text(
|
||||
textAlign: TextAlign.center,
|
||||
value,
|
||||
style: const TextStyle(fontWeight: FontWeight.bold, fontSize: 18, color: Colors.white),
|
||||
);
|
||||
},
|
||||
)
|
||||
),
|
||||
width: cellWidth,
|
||||
child: ValueListenableBuilder<String>(
|
||||
valueListenable: _zipValueNotifier,
|
||||
builder: (context, value, child) {
|
||||
return Text(
|
||||
textAlign: TextAlign.center,
|
||||
value,
|
||||
style: const TextStyle(
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: 18,
|
||||
color: Colors.white),
|
||||
);
|
||||
},
|
||||
)),
|
||||
SizedBox(
|
||||
width: cellWidth,
|
||||
child: ValueListenableBuilder<String>(
|
||||
@@ -545,7 +563,10 @@ class _HeaderWidgetState extends State<_HeaderWidget> with ConsumerMixin {
|
||||
return Text(
|
||||
textAlign: TextAlign.center,
|
||||
value,
|
||||
style: const TextStyle(fontWeight: FontWeight.bold, fontSize: 18, color: Colors.white),
|
||||
style: const TextStyle(
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: 18,
|
||||
color: Colors.white),
|
||||
);
|
||||
},
|
||||
),
|
||||
@@ -565,7 +586,10 @@ class _HeaderWidgetState extends State<_HeaderWidget> with ConsumerMixin {
|
||||
return Text(
|
||||
textAlign: TextAlign.center,
|
||||
value,
|
||||
style: const TextStyle(fontWeight: FontWeight.bold, fontSize: 18, color: Colors.white),
|
||||
style: const TextStyle(
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: 18,
|
||||
color: Colors.white),
|
||||
);
|
||||
},
|
||||
),
|
||||
@@ -597,7 +621,8 @@ class _HeaderWidgetState extends State<_HeaderWidget> with ConsumerMixin {
|
||||
|
||||
_updateHeader() async {
|
||||
var status = await MyApp.isarInstance.locationStatus.where().findFirst();
|
||||
var sessionStatus = await MyApp.isarInstance.sessionStatus.where().findFirst();
|
||||
var sessionStatus =
|
||||
await MyApp.isarInstance.sessionStatus.where().findFirst();
|
||||
|
||||
if (status != null) {
|
||||
_zipValueNotifier.value = status.zip;
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
|
||||
import 'package:dart_mq/dart_mq.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_chat_ui/flutter_chat_ui.dart';
|
||||
@@ -73,14 +72,13 @@ class _MessagesPageState extends State<MessagesPage> with ProducerMixin {
|
||||
children: [
|
||||
Chat(
|
||||
messages: _messages,
|
||||
textMessageOptions:const TextMessageOptions(isTextSelectable:false),
|
||||
textMessageOptions: const TextMessageOptions(isTextSelectable: false),
|
||||
onSendPressed: _handleSendPressed,
|
||||
showUserAvatars: false,
|
||||
showUserNames: false,
|
||||
user: _user,
|
||||
onMessageTap: (context, message) => {
|
||||
_showDeleteMessageDialog(context, message)
|
||||
},
|
||||
onMessageTap: (context, message) =>
|
||||
{_showDeleteMessageDialog(context, message)},
|
||||
),
|
||||
],
|
||||
);
|
||||
@@ -103,15 +101,20 @@ class _MessagesPageState extends State<MessagesPage> with ProducerMixin {
|
||||
|
||||
sendMessage(
|
||||
routingKey: Constants.messageTopicPublishPayload,
|
||||
payload: PublishPayloadMessage(topic: "message", message: message.toJson(), acknowledgeRequired: true),
|
||||
payload: PublishPayloadMessage(
|
||||
topic: "message",
|
||||
message: message.toJson(),
|
||||
acknowledgeRequired: true),
|
||||
);
|
||||
|
||||
_messages.insert(0, types.TextMessage(
|
||||
author: _user,
|
||||
createdAt: now.millisecondsSinceEpoch,
|
||||
id: message.id.toString(),
|
||||
text: text.text,
|
||||
));
|
||||
_messages.insert(
|
||||
0,
|
||||
types.TextMessage(
|
||||
author: _user,
|
||||
createdAt: now.millisecondsSinceEpoch,
|
||||
id: message.id.toString(),
|
||||
text: text.text,
|
||||
));
|
||||
|
||||
setState(() {});
|
||||
}
|
||||
@@ -123,7 +126,8 @@ class _MessagesPageState extends State<MessagesPage> with ProducerMixin {
|
||||
for (var message in messages) {
|
||||
_messages.add(types.TextMessage(
|
||||
author: message.from == _sid ? _user : _central,
|
||||
createdAt: DateTime.parse(message.time).toLocal().millisecondsSinceEpoch,
|
||||
createdAt:
|
||||
DateTime.parse(message.time).toLocal().millisecondsSinceEpoch,
|
||||
id: message.id.toString(),
|
||||
text: "${message.subj}\n${message.text}",
|
||||
));
|
||||
@@ -147,14 +151,12 @@ class _MessagesPageState extends State<MessagesPage> with ProducerMixin {
|
||||
contentPadding: EdgeInsets.zero,
|
||||
shadowColor: Colors.transparent,
|
||||
backgroundColor: Colors.white,
|
||||
content: StatefulBuilder(builder: (BuildContext context, StateSetter setState) {
|
||||
content: StatefulBuilder(
|
||||
builder: (BuildContext context, StateSetter setState) {
|
||||
return SizedBox(
|
||||
key: GlobalKey(),
|
||||
height: 120,
|
||||
width: MediaQuery
|
||||
.of(context)
|
||||
.size
|
||||
.width * 1.2,
|
||||
width: MediaQuery.of(context).size.width * 1.2,
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: Container(
|
||||
@@ -166,28 +168,34 @@ class _MessagesPageState extends State<MessagesPage> with ProducerMixin {
|
||||
const SizedBox(height: 20),
|
||||
Row(children: [
|
||||
Expanded(
|
||||
child: getDefaultButton('Nein', () => {Navigator.of(context).pop()}),
|
||||
child: getDefaultButton('Nein',
|
||||
() => {Navigator.of(context).pop()}),
|
||||
),
|
||||
const SizedBox(width: 20),
|
||||
Expanded(
|
||||
child: getDefaultButton('Ja', () async => {
|
||||
await MyApp.isarInstance.writeTxn(() async => { await MyApp.isarInstance.chatMessages.delete(int.parse(message.id))}),
|
||||
|
||||
_fetchMessages(),
|
||||
|
||||
setState(() {}),
|
||||
|
||||
Navigator.of(MyApp.appNavigatorKey.currentContext!).pop()
|
||||
}),
|
||||
child: getDefaultButton(
|
||||
'Ja',
|
||||
() async => {
|
||||
await MyApp.isarInstance.writeTxn(
|
||||
() async => {
|
||||
await MyApp.isarInstance
|
||||
.chatMessages
|
||||
.delete(int.parse(
|
||||
message.id))
|
||||
}),
|
||||
_fetchMessages(),
|
||||
setState(() {}),
|
||||
Navigator.of(MyApp.appNavigatorKey
|
||||
.currentContext!)
|
||||
.pop()
|
||||
}),
|
||||
)
|
||||
])
|
||||
],
|
||||
),
|
||||
),
|
||||
)
|
||||
);
|
||||
})
|
||||
);
|
||||
));
|
||||
}));
|
||||
});
|
||||
}
|
||||
|
||||
@@ -199,7 +207,7 @@ class _MessagesPageState extends State<MessagesPage> with ProducerMixin {
|
||||
|
||||
if (unreadChatMessages.isNotEmpty) {
|
||||
List<String> chatMessageIds = [];
|
||||
for(var message in unreadChatMessages) {
|
||||
for (var message in unreadChatMessages) {
|
||||
chatMessageIds.add(message.id.toString());
|
||||
}
|
||||
|
||||
@@ -209,7 +217,10 @@ class _MessagesPageState extends State<MessagesPage> with ProducerMixin {
|
||||
|
||||
sendMessage(
|
||||
routingKey: Constants.messageTopicPublishPayload,
|
||||
payload: PublishPayloadMessage(topic: "mssg_received", message: chatMessagesShowed.toJson(), acknowledgeRequired: false),
|
||||
payload: PublishPayloadMessage(
|
||||
topic: "mssg_received",
|
||||
message: chatMessagesShowed.toJson(),
|
||||
acknowledgeRequired: false),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -250,18 +261,18 @@ class _HeaderWidgetState extends State<_HeaderWidget> with ProducerMixin {
|
||||
child: FittedBox(
|
||||
child: GestureDetector(
|
||||
onTap: () async {
|
||||
// TODO MESSAGING
|
||||
sendMessage(
|
||||
routingKey: Constants.messageTopicPopContentView,
|
||||
payload: PopContentViewMessage(count: 1),
|
||||
);
|
||||
|
||||
//await MessageService().publish<PopContentViewMessage>(Constants.messageTopicPopContentView, arguments: 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)),
|
||||
child: Padding(
|
||||
padding: EdgeInsets.all(1.0),
|
||||
child: Icon(Icons.arrow_back,
|
||||
size: 20.0, color: Colors.white)),
|
||||
),
|
||||
),
|
||||
),
|
||||
@@ -279,18 +290,18 @@ class _HeaderWidgetState extends State<_HeaderWidget> with ProducerMixin {
|
||||
child: FittedBox(
|
||||
child: GestureDetector(
|
||||
onTap: () async {
|
||||
// TODO MESSAGING
|
||||
sendMessage(
|
||||
routingKey: Constants.messageTopicPopContentView,
|
||||
payload: PopContentViewMessage(count: 1),
|
||||
);
|
||||
|
||||
//await MessageService().publish<PopContentViewMessage>(Constants.messageTopicPopContentView, arguments: 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))),
|
||||
child: Padding(
|
||||
padding: EdgeInsets.all(1.0),
|
||||
child: Icon(Icons.info_outline,
|
||||
size: 20.0, color: Colors.white))),
|
||||
),
|
||||
),
|
||||
),
|
||||
@@ -304,7 +315,10 @@ class _HeaderWidgetState extends State<_HeaderWidget> with ProducerMixin {
|
||||
child: Text(
|
||||
textAlign: TextAlign.center,
|
||||
"Nachrichten",
|
||||
style: TextStyle(fontWeight: FontWeight.bold, fontSize: 18, color: Colors.white),
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: 18,
|
||||
color: Colors.white),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
@@ -23,12 +23,14 @@ class SetDesiredZipPage extends ContentViewWidget {
|
||||
}
|
||||
}
|
||||
|
||||
class _SetDesiredZipPageState extends State<SetDesiredZipPage> with ProducerMixin {
|
||||
class _SetDesiredZipPageState extends State<SetDesiredZipPage>
|
||||
with ProducerMixin {
|
||||
TextEditingController textEditController = TextEditingController();
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
var savedDesiredZip = Util.preferencesGetString(Constants.prefsDesiredZip, null);
|
||||
var savedDesiredZip =
|
||||
Util.preferencesGetString(Constants.prefsDesiredZip, null);
|
||||
if (savedDesiredZip != null) {
|
||||
textEditController.text = savedDesiredZip;
|
||||
}
|
||||
@@ -40,50 +42,51 @@ class _SetDesiredZipPageState extends State<SetDesiredZipPage> with ProducerMixi
|
||||
Widget build(BuildContext context) {
|
||||
return Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: Column(
|
||||
children:
|
||||
[
|
||||
const Text("Bitte geben Sie Ihr Wunschziel für heute ein"),
|
||||
const SizedBox(height: 20),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center, // Zentriert das Textfeld horizontal
|
||||
children: [
|
||||
SizedBox(
|
||||
width: 120, // Festlegen der Breite des Textfelds
|
||||
child:
|
||||
Util.getDefaultTextField('PLZ',
|
||||
textInputType: TextInputType.number,
|
||||
formatter: [
|
||||
// Erlaubt nur Ziffern
|
||||
FilteringTextInputFormatter.digitsOnly,
|
||||
// Begrenzt die maximale Eingabelänge auf 5 Zeichen
|
||||
LengthLimitingTextInputFormatter(5),
|
||||
],
|
||||
controller: textEditController,
|
||||
maxLength: 5,
|
||||
autofocus: true
|
||||
),
|
||||
),
|
||||
child: Column(children: [
|
||||
const Text("Bitte geben Sie Ihr Wunschziel für heute ein"),
|
||||
const SizedBox(height: 20),
|
||||
Row(
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.center, // Zentriert das Textfeld horizontal
|
||||
children: [
|
||||
SizedBox(
|
||||
width: 120, // Festlegen der Breite des Textfelds
|
||||
child: Util.getDefaultTextField('PLZ',
|
||||
textInputType: TextInputType.number,
|
||||
formatter: [
|
||||
// Erlaubt nur Ziffern
|
||||
FilteringTextInputFormatter.digitsOnly,
|
||||
// Begrenzt die maximale Eingabelänge auf 5 Zeichen
|
||||
LengthLimitingTextInputFormatter(5),
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 20),
|
||||
getDefaultButton('Übernehmen', () =>
|
||||
{
|
||||
if (textEditController.text.isEmpty || textEditController.text.length == 5) {
|
||||
Util.preferencesSaveString(Constants.prefsDesiredZip, textEditController.text),
|
||||
|
||||
_sendDesiredZipMessage(textEditController.text),
|
||||
|
||||
sendMessage(
|
||||
routingKey: Constants.messageTopicPopContentView,
|
||||
payload: PopContentViewMessage(count: 1),
|
||||
)
|
||||
} else {
|
||||
showAlertDialog("Fehler", "Das Feld muss leer sein, oder es müssen fünf Zahlen eingegeben werden")
|
||||
}
|
||||
controller: textEditController,
|
||||
maxLength: 5,
|
||||
autofocus: true),
|
||||
),
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 20),
|
||||
getDefaultButton(
|
||||
'Übernehmen',
|
||||
() => {
|
||||
if (textEditController.text.isEmpty ||
|
||||
textEditController.text.length == 5)
|
||||
{
|
||||
Util.preferencesSaveString(
|
||||
Constants.prefsDesiredZip, textEditController.text),
|
||||
_sendDesiredZipMessage(textEditController.text),
|
||||
sendMessage(
|
||||
routingKey: Constants.messageTopicPopContentView,
|
||||
payload: PopContentViewMessage(count: 1),
|
||||
)
|
||||
}
|
||||
else
|
||||
{
|
||||
showAlertDialog("Fehler",
|
||||
"Das Feld muss leer sein, oder es müssen fünf Zahlen eingegeben werden")
|
||||
}
|
||||
})
|
||||
]
|
||||
),
|
||||
]),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -93,7 +96,10 @@ class _SetDesiredZipPageState extends State<SetDesiredZipPage> with ProducerMixi
|
||||
|
||||
sendMessage(
|
||||
routingKey: Constants.messageTopicPublishPayload,
|
||||
payload: PublishPayloadMessage(topic: "set_desired_zip", message: desiredZipMessage.toJson(), acknowledgeRequired: true),
|
||||
payload: PublishPayloadMessage(
|
||||
topic: "set_desired_zip",
|
||||
message: desiredZipMessage.toJson(),
|
||||
acknowledgeRequired: true),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -133,18 +139,18 @@ class _HeaderWidgetState extends State<_HeaderWidget> with ProducerMixin {
|
||||
child: FittedBox(
|
||||
child: GestureDetector(
|
||||
onTap: () async {
|
||||
// TODO MESSAGING
|
||||
sendMessage(
|
||||
routingKey: Constants.messageTopicPopContentView,
|
||||
payload: PopContentViewMessage(count: 1),
|
||||
);
|
||||
|
||||
//await MessageService().publish<PopContentViewMessage>(Constants.messageTopicPopContentView, arguments: 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)),
|
||||
child: Padding(
|
||||
padding: EdgeInsets.all(1.0),
|
||||
child: Icon(Icons.arrow_back,
|
||||
size: 20.0, color: Colors.white)),
|
||||
),
|
||||
),
|
||||
),
|
||||
@@ -162,18 +168,18 @@ class _HeaderWidgetState extends State<_HeaderWidget> with ProducerMixin {
|
||||
child: FittedBox(
|
||||
child: GestureDetector(
|
||||
onTap: () async {
|
||||
// TODO MESSAGING
|
||||
sendMessage(
|
||||
routingKey: Constants.messageTopicPopContentView,
|
||||
payload: PopContentViewMessage(count: 1),
|
||||
);
|
||||
|
||||
//await MessageService().publish<PopContentViewMessage>(Constants.messageTopicPopContentView, arguments: 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))),
|
||||
child: Padding(
|
||||
padding: EdgeInsets.all(1.0),
|
||||
child: Icon(Icons.info_outline,
|
||||
size: 20.0, color: Colors.white))),
|
||||
),
|
||||
),
|
||||
),
|
||||
@@ -187,7 +193,10 @@ class _HeaderWidgetState extends State<_HeaderWidget> with ProducerMixin {
|
||||
child: Text(
|
||||
textAlign: TextAlign.center,
|
||||
"Wunschziel für heute",
|
||||
style: TextStyle(fontWeight: FontWeight.bold, fontSize: 18, color: Colors.white),
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: 18,
|
||||
color: Colors.white),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
@@ -11,7 +11,11 @@ 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});
|
||||
const TourDetailsPage(
|
||||
{super.key,
|
||||
required this.job,
|
||||
required this.tour,
|
||||
this.readOnly = false});
|
||||
|
||||
final Job job;
|
||||
|
||||
@@ -63,56 +67,60 @@ class _TourDetailsPageState extends State<TourDetailsPage> with ProducerMixin {
|
||||
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))
|
||||
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 ${widget.tour.sort}"} ${mapTourMode(widget.tour.mode)}",
|
||||
textAlign: TextAlign.left,
|
||||
),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||
children: [
|
||||
Text(
|
||||
"${"Station ${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(
|
||||
"Tel.: ${widget.tour.phone}",
|
||||
textAlign: TextAlign.left,
|
||||
),
|
||||
Text(
|
||||
"Komm-#: ${widget.tour.com}",
|
||||
textAlign: TextAlign.left,
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
getDefaultButton('Karte', () =>
|
||||
{
|
||||
if (widget.tour.pos != null) {
|
||||
showMapPopup(context, widget.tour, widget.job.tours)
|
||||
} else {
|
||||
showAlertDialog('Information', 'Es liegt keine Position für diese Station vor')
|
||||
}
|
||||
}),
|
||||
],
|
||||
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(
|
||||
"Tel.: ${widget.tour.phone}",
|
||||
textAlign: TextAlign.left,
|
||||
),
|
||||
Text(
|
||||
"Komm-#: ${widget.tour.com}",
|
||||
textAlign: TextAlign.left,
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
getDefaultButton(
|
||||
'Karte',
|
||||
() => {
|
||||
if (widget.tour.pos != null)
|
||||
{
|
||||
showMapPopup(
|
||||
context, widget.tour, widget.job.tours)
|
||||
}
|
||||
else
|
||||
{
|
||||
showAlertDialog('Information',
|
||||
'Es liegt keine Position für diese Station vor')
|
||||
}
|
||||
}),
|
||||
],
|
||||
),
|
||||
)),
|
||||
const SizedBox(height: 10),
|
||||
Expanded(
|
||||
child: Container(
|
||||
@@ -120,24 +128,29 @@ class _TourDetailsPageState extends State<TourDetailsPage> with ProducerMixin {
|
||||
decoration: BoxDecoration(
|
||||
border: Border.all(color: Colors.grey, width: 1.5),
|
||||
color: Colors.transparent,
|
||||
borderRadius: const BorderRadius.all(Radius.circular(13))
|
||||
),
|
||||
borderRadius: const BorderRadius.all(Radius.circular(13))),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||
children: [
|
||||
Expanded(child: Scrollbar(thumbVisibility: true, child: SingleChildScrollView(child: Text(remark)))),
|
||||
]
|
||||
),
|
||||
Expanded(
|
||||
child: Scrollbar(
|
||||
thumbVisibility: true,
|
||||
child: SingleChildScrollView(child: Text(remark)))),
|
||||
]),
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
getDefaultButton('Weiter', () async =>
|
||||
{
|
||||
sendMessage(
|
||||
routingKey: Constants.messageTopicPushContentView,
|
||||
payload: TaskListPage(job: widget.job, tour: widget.tour, readOnly: widget.readOnly),
|
||||
)
|
||||
}),
|
||||
getDefaultButton(
|
||||
'Weiter',
|
||||
() async => {
|
||||
sendMessage(
|
||||
routingKey: Constants.messageTopicPushContentView,
|
||||
payload: TaskListPage(
|
||||
job: widget.job,
|
||||
tour: widget.tour,
|
||||
readOnly: widget.readOnly),
|
||||
)
|
||||
}),
|
||||
],
|
||||
),
|
||||
);
|
||||
@@ -179,18 +192,18 @@ class _HeaderWidgetState extends State<_HeaderWidget> with ProducerMixin {
|
||||
child: FittedBox(
|
||||
child: GestureDetector(
|
||||
onTap: () async {
|
||||
// TODO MESSAGING
|
||||
sendMessage(
|
||||
routingKey: Constants.messageTopicPopContentView,
|
||||
payload: PopContentViewMessage(count: 1),
|
||||
);
|
||||
|
||||
//await MessageService().publish<PopContentViewMessage>(Constants.messageTopicPopContentView, arguments: 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)),
|
||||
child: Padding(
|
||||
padding: EdgeInsets.all(1.0),
|
||||
child: Icon(Icons.arrow_back,
|
||||
size: 20.0, color: Colors.white)),
|
||||
),
|
||||
),
|
||||
),
|
||||
@@ -208,18 +221,18 @@ class _HeaderWidgetState extends State<_HeaderWidget> with ProducerMixin {
|
||||
child: FittedBox(
|
||||
child: GestureDetector(
|
||||
onTap: () async {
|
||||
// TODO MESSAGING
|
||||
sendMessage(
|
||||
routingKey: Constants.messageTopicPopContentView,
|
||||
payload: PopContentViewMessage(count: 1),
|
||||
);
|
||||
|
||||
//await MessageService().publish<PopContentViewMessage>(Constants.messageTopicPopContentView, arguments: 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))),
|
||||
child: Padding(
|
||||
padding: EdgeInsets.all(1.0),
|
||||
child: Icon(Icons.info_outline,
|
||||
size: 20.0, color: Colors.white))),
|
||||
),
|
||||
),
|
||||
),
|
||||
@@ -233,7 +246,10 @@ class _HeaderWidgetState extends State<_HeaderWidget> with ProducerMixin {
|
||||
child: Text(
|
||||
textAlign: TextAlign.center,
|
||||
"Details der Station",
|
||||
style: TextStyle(fontWeight: FontWeight.bold, fontSize: 18, color: Colors.white),
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: 18,
|
||||
color: Colors.white),
|
||||
),
|
||||
),
|
||||
),
|
||||
@@ -241,4 +257,4 @@ class _HeaderWidgetState extends State<_HeaderWidget> with ProducerMixin {
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user