From 85e973c3ddbbe1bb2a71ab18776eb3f242c2cafd Mon Sep 17 00:00:00 2001 From: Sven Carstensen Date: Tue, 4 Jun 2024 12:06:26 +0200 Subject: [PATCH] Erweiterungen --- lib/popups/tasks_popups/signature_popup.dart | 9 ++++++++- lib/tools/mqtt_core.dart | 6 ++++-- pubspec.yaml | 2 +- 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/lib/popups/tasks_popups/signature_popup.dart b/lib/popups/tasks_popups/signature_popup.dart index ee702ed..973e8bd 100644 --- a/lib/popups/tasks_popups/signature_popup.dart +++ b/lib/popups/tasks_popups/signature_popup.dart @@ -1,4 +1,5 @@ import 'package:flutter/material.dart'; +import 'package:flutter/services.dart'; import 'package:signature/signature.dart'; import 'package:stadtbote/model/task_info.dart'; import 'package:stadtbote/tools/util.dart'; @@ -9,7 +10,13 @@ showSignaturePopup(BuildContext context, TaskInfo taskInfo, Function(String?) on builder: (BuildContext context) { return WillPopScope( onWillPop: () async { - return await taskDialogSecurityException(context); + var result = await taskDialogSecurityException(context); + + if (result) { + SystemChrome.setPreferredOrientations([DeviceOrientation.portraitUp]); + } + + return result; }, child: AlertDialog( contentPadding: EdgeInsets.zero, diff --git a/lib/tools/mqtt_core.dart b/lib/tools/mqtt_core.dart index 3a39def..a295d3e 100644 --- a/lib/tools/mqtt_core.dart +++ b/lib/tools/mqtt_core.dart @@ -104,7 +104,7 @@ class MqttCore { _mqttClient = MqttServerClient.withPort(_brokerUri, clientId, _brokerPort); _mqttClient!.logging(on: false); - _mqttClient!.keepAlivePeriod = 5; + _mqttClient!.keepAlivePeriod = 60; _mqttClient!.disconnectOnNoResponsePeriod = 10; _mqttClient!.autoReconnect = true; _mqttClient!.onDisconnected = _clientDisconnected; @@ -146,6 +146,7 @@ class MqttCore { _mqttClient!.publishMessage(messageTopic, MqttQos.exactlyOnce, buffer); Util.logInfo("message\n$text\nsend to $messageTopic"); + Util.logInfo("size in bytes: ${buffer.length}"); return true; } catch (ex) { @@ -170,6 +171,7 @@ class MqttCore { var topic = topicArraySplited[6]; Util.logInfo('message received\ntopic: $topic\n'); + Util.logInfo("size in bytes: ${message.payload.message.length.toString()}"); var messageBytes = message.payload.message; String payload = utf8.decode(GZipDecoder().decodeBytes(messageBytes)); @@ -484,7 +486,7 @@ class MqttCore { } void _startTrackTimer() { - _trackTimer ??= Timer.periodic(const Duration(seconds: 60), (Timer t) { + _trackTimer ??= Timer.periodic(const Duration(seconds: 120), (Timer t) { var position = MyApp.currentPosition; if (position != null) { var trackMessage = TrackPosition(); diff --git a/pubspec.yaml b/pubspec.yaml index dad1634..138fbfd 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -16,7 +16,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html # In Windows, build-name is used as the major, minor, and patch parts # of the product and file versions while build-number is used as the build suffix. -version: 312.0.0+312 +version: 314.0.0+314 environment: sdk: '>=2.19.6 <3.0.0'