Fehlerkorrekturen
This commit is contained in:
1 parent
4b0203b71b
commit
47ca1b1f98
8 files changed
+66
-43
No files matched your search
@@ -5,7 +5,7 @@ import 'package:stadtbote/tools/mqtt_core.dart';
|
||||
import 'package:stadtbote/tools/util.dart';
|
||||
|
||||
void showInfosPopup(BuildContext context, SessionStatus? status) async {
|
||||
var text = "Versionsnummer: a207\n";
|
||||
var text = "Versionsnummer: a208\n";
|
||||
text += "Verbindungsstatus: ${MqttCore.instance.connectionState == ConnectionStateEnum.connected ? "Verbunden" : "NICHT verbunden"}\n";
|
||||
text += "GPS-Status: ${MyApp.currentPosition != null ? MyApp.currentPosition!.timestamp.toString() : "Unbekannt"}\n";
|
||||
text += "\n";
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import 'package:carousel_slider/carousel_slider.dart';
|
||||
import 'package:flutter/foundation.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:image/image.dart' as imageLib;
|
||||
import 'package:stadtbote/model/task_info.dart';
|
||||
import 'package:stadtbote/tools/util.dart';
|
||||
|
||||
@@ -19,22 +20,35 @@ Future<void> showTakePhotosPopup(BuildContext context, TaskInfo taskInfo, Functi
|
||||
backgroundColor: Colors.white,
|
||||
content: StatefulBuilder(builder: (BuildContext context, StateSetter setState) {
|
||||
void capturePhoto() async {
|
||||
var photo = await Util.capturePhoto();
|
||||
try {
|
||||
var photo = await Util.capturePhoto();
|
||||
|
||||
if (photo != null) {
|
||||
var imageData = await photo.readAsBytes();
|
||||
photo.delete();
|
||||
if (photo != null) {
|
||||
var fullsizeImageData = await photo.readAsBytes();
|
||||
|
||||
imageDataList.add(imageData);
|
||||
imageLib.Image? image = imageLib.decodeImage(fullsizeImageData);
|
||||
|
||||
imageWidgetsList.add(GestureDetector(
|
||||
onTap: () {},
|
||||
child: Image.memory(imageData),
|
||||
));
|
||||
if (image != null) {
|
||||
var thumbnail = imageLib.copyResize(image, width: 800);
|
||||
|
||||
imageWidgetsListNotifier.value = imageWidgetsList;
|
||||
var resizedImageData = imageLib.encodeJpg(thumbnail);
|
||||
|
||||
setState(() {});
|
||||
photo.delete();
|
||||
|
||||
imageDataList.add(resizedImageData);
|
||||
|
||||
imageWidgetsList.add(GestureDetector(
|
||||
onTap: () {},
|
||||
child: Image.memory(resizedImageData),
|
||||
));
|
||||
|
||||
imageWidgetsListNotifier.value = imageWidgetsList;
|
||||
|
||||
setState(() {});
|
||||
}
|
||||
}
|
||||
} catch (ex) {
|
||||
Util.logException(ex.toString());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user