Erweiterungen
This commit is contained in:
1 parent
69dcd1d2a7
commit
dba59bdf2d
3 files changed
+18
-6
No files matched your search
@@ -1,4 +1,3 @@
|
||||
|
||||
import 'package:expandable/expandable.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:isar/isar.dart';
|
||||
@@ -158,7 +157,7 @@ class _AssignedJobsPageState extends State<AssignedJobsPage> {
|
||||
const SizedBox(height: 20),
|
||||
Row(children: [
|
||||
Expanded(
|
||||
child: getDefaultButton(!job.global ? 'Ablehnen' : 'Ignorieren', () => { _sendAnswer(job, !job.global ? 2: 3)}),
|
||||
child: getDefaultButton(!job.global ? 'Ablehnen' : 'Ignorieren', () => {_sendAnswer(job, !job.global ? 2 : 3)}),
|
||||
),
|
||||
const SizedBox(width: 20),
|
||||
Expanded(
|
||||
@@ -177,7 +176,7 @@ class _AssignedJobsPageState extends State<AssignedJobsPage> {
|
||||
return entries;
|
||||
}
|
||||
|
||||
_sendAnswer(Job job, int item) {
|
||||
_sendAnswer(Job job, int item) async {
|
||||
var message = AcceptJobMessage();
|
||||
message.reaction = Reaction();
|
||||
message.reaction.id = job.id.toString();
|
||||
@@ -191,4 +190,12 @@ class _AssignedJobsPageState extends State<AssignedJobsPage> {
|
||||
message.reaction.track.pos.acc = 1;
|
||||
|
||||
MqttCore.instance.publishPayloadMessage("job", message.toJson());
|
||||
}}
|
||||
|
||||
job.state = 9;
|
||||
MyApp.isarInstance.writeTxnSync(() => {MyApp.isarInstance.jobs.putSync(job)});
|
||||
|
||||
_entries = await _createListEntries();
|
||||
|
||||
setState(() {});
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user