Fehlerkorrekturen
This commit is contained in:
1 parent
e3da2193b5
commit
aec2a29d74
4 files changed
+668
-12
No files matched your search
@@ -9,6 +9,7 @@ import 'package:stadtbote/content_views/utils/header_info.dart';
|
||||
import 'package:stadtbote/messages/pop_content_view_message.dart';
|
||||
import 'package:stadtbote/model/job.dart';
|
||||
import 'package:stadtbote/model/job_tour.dart';
|
||||
import 'package:stadtbote/model/pictures.dart';
|
||||
import 'package:stadtbote/popups/tasks_popups/arrived_popup.dart';
|
||||
import 'package:stadtbote/popups/tasks_popups/commision_number_popup.dart';
|
||||
import 'package:stadtbote/popups/tasks_popups/pickup_delivery_status_popup.dart';
|
||||
@@ -65,8 +66,6 @@ class _TaskListPageState extends State<TaskListPage> {
|
||||
|
||||
late List<TaskInfo> _taskList;
|
||||
|
||||
List<Uint8List> _photos = [];
|
||||
|
||||
late String _commisionNumber;
|
||||
|
||||
@override
|
||||
@@ -319,9 +318,21 @@ class _TaskListPageState extends State<TaskListPage> {
|
||||
}
|
||||
|
||||
_processTakePhotos(TaskInfo taskInfo) {
|
||||
showTakePhotosPopup(context, taskInfo, (List<Uint8List>? photos) {
|
||||
showTakePhotosPopup(context, taskInfo, (List<Uint8List>? photos) async {
|
||||
if (photos != null) {
|
||||
_photos = photos;
|
||||
await MyApp.isarInstance.writeTxn(() async {
|
||||
await MyApp.isarInstance.pictures.filter().tourIdEqualTo(widget.tour.id).deleteAll();
|
||||
|
||||
for (int i = 0; i < photos.length; i++) {
|
||||
var pictureData = photos[i];
|
||||
|
||||
var picture = Picture();
|
||||
picture.number = i;
|
||||
picture.tourId = widget.tour.id;
|
||||
picture.data = base64Encode(pictureData);
|
||||
await MyApp.isarInstance.pictures.put(picture);
|
||||
}
|
||||
});
|
||||
|
||||
taskInfo.additionalText = "Fotos aufgenommen";
|
||||
taskInfo.completed = true;
|
||||
@@ -512,16 +523,16 @@ class _TaskListPageState extends State<TaskListPage> {
|
||||
}
|
||||
|
||||
_sendImages() {
|
||||
Future.delayed(const Duration(seconds: 1), () {
|
||||
if (_photos.isNotEmpty) {
|
||||
int photoIndex = 0;
|
||||
Future.delayed(const Duration(seconds: 1), () async {
|
||||
var pictures = await MyApp.isarInstance.pictures.where().filter().tourIdEqualTo(widget.tour.id).findAll();
|
||||
|
||||
for (var photoData in _photos) {
|
||||
if (pictures.isNotEmpty) {
|
||||
for (var picture in pictures) {
|
||||
var message = PicData();
|
||||
message.trId = widget.tour.id;
|
||||
message.num = photoIndex;
|
||||
message.trId = picture.tourId;
|
||||
message.num = picture.number;
|
||||
message.time = DateTime.now().millisecondsSinceEpoch;
|
||||
message.data = base64Encode(photoData);
|
||||
message.data = picture.data;
|
||||
|
||||
MessageService().publish<PublishPayloadMessage>(Constants.messageTopicPublishPayload, arguments: PublishPayloadMessage(topic: "pic", message: message.toJson()));
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user