Merge branch 'A2XX' into new_appserver
# Conflicts: # lib/model/rank.dart # lib/model/rank.g.dart # lib/tools/mqtt_core.dart # pubspec.lock # pubspec.yaml
This commit is contained in:
commit
0fa45c05d2
4 files changed
+59
-18
No files matched your search
@@ -1,12 +1,12 @@
|
|||||||
buildscript {
|
buildscript {
|
||||||
ext.kotlin_version = '1.7.10'
|
ext.kotlin_version = '1.8.0'
|
||||||
repositories {
|
repositories {
|
||||||
google()
|
google()
|
||||||
mavenCentral()
|
mavenCentral()
|
||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
classpath 'com.android.tools.build:gradle:7.2.0'
|
classpath 'com.android.tools.build:gradle:7.2.2'
|
||||||
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
|
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,27 @@
|
|||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:flutter_test/flutter_test.dart';
|
||||||
|
import 'package:stadtbote/main.dart';
|
||||||
|
|
||||||
|
void main() {
|
||||||
|
testWidgets('tap on the floating action button, verify counter',
|
||||||
|
(tester) async {
|
||||||
|
// Load app widget.
|
||||||
|
await tester.pumpWidget(MyApp());
|
||||||
|
|
||||||
|
// Verify the counter starts at 0.
|
||||||
|
expect(find.text('HH1091'), findsOneWidget);
|
||||||
|
|
||||||
|
// Finds the floating action button to tap on.
|
||||||
|
//final fab = find.byKey(const Key('increment'));
|
||||||
|
|
||||||
|
// Emulate a tap on the floating action button.
|
||||||
|
//await tester.tap(fab);
|
||||||
|
|
||||||
|
// Trigger a frame.
|
||||||
|
//await tester.pumpAndSettle();
|
||||||
|
|
||||||
|
// Verify the counter increments by 1.
|
||||||
|
//expect(find.text('0'), findsNothing);
|
||||||
|
//expect(find.text('1'), findsOneWidget);
|
||||||
|
});
|
||||||
|
}
|
||||||
@@ -77,6 +77,12 @@ class _AcceptedJobsPageState extends State<AcceptedJobsPage> {
|
|||||||
List<Widget> jobWidgets = [];
|
List<Widget> jobWidgets = [];
|
||||||
|
|
||||||
for (var job in _jobs) {
|
for (var job in _jobs) {
|
||||||
|
String remarkString = '';
|
||||||
|
for (var remark in job.rem) {
|
||||||
|
remarkString += '$remark\n';
|
||||||
|
}
|
||||||
|
remarkString = remarkString.trim();
|
||||||
|
|
||||||
jobWidgets.add(
|
jobWidgets.add(
|
||||||
ListTile(
|
ListTile(
|
||||||
onTap: () {
|
onTap: () {
|
||||||
@@ -111,6 +117,10 @@ class _AcceptedJobsPageState extends State<AcceptedJobsPage> {
|
|||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
Text(
|
||||||
|
remarkString,
|
||||||
|
textAlign: TextAlign.left,
|
||||||
|
),
|
||||||
Text(
|
Text(
|
||||||
job.id.toString(),
|
job.id.toString(),
|
||||||
textAlign: TextAlign.left,
|
textAlign: TextAlign.left,
|
||||||
|
|||||||
+20
-16
@@ -94,12 +94,14 @@ class MqttCore {
|
|||||||
|
|
||||||
_mqttClient = MqttServerClient.withPort(_brokerUri, clientId, _brokerPort);
|
_mqttClient = MqttServerClient.withPort(_brokerUri, clientId, _brokerPort);
|
||||||
_mqttClient.logging(on: false);
|
_mqttClient.logging(on: false);
|
||||||
_mqttClient.keepAlivePeriod = 20;
|
_mqttClient.keepAlivePeriod = 5;
|
||||||
_mqttClient.autoReconnect = false;
|
_mqttClient.disconnectOnNoResponsePeriod = 10;
|
||||||
|
_mqttClient.autoReconnect = true;
|
||||||
_mqttClient.onDisconnected = _clientDisconnected;
|
_mqttClient.onDisconnected = _clientDisconnected;
|
||||||
|
_mqttClient.onAutoReconnect = _clientDisconnected;
|
||||||
|
_mqttClient.onAutoReconnected = _clientConnected;
|
||||||
_mqttClient.connectionMessage = MqttConnectMessage()
|
_mqttClient.connectionMessage = MqttConnectMessage()
|
||||||
.withClientIdentifier(await Util.getAppUuid())
|
.withClientIdentifier(await Util.getAppUuid())
|
||||||
.withWillQos(MqttQos.atMostOnce)
|
|
||||||
.authenticateAs("app", "apppwd");
|
.authenticateAs("app", "apppwd");
|
||||||
|
|
||||||
await _mqttClient.connect();
|
await _mqttClient.connect();
|
||||||
@@ -116,13 +118,9 @@ class MqttCore {
|
|||||||
Util.logInfo('Verbindung zum MQTT-Broker fehlgeschlagen!');
|
Util.logInfo('Verbindung zum MQTT-Broker fehlgeschlagen!');
|
||||||
|
|
||||||
MessageService().publish<ConnectionStatus>(Constants.messageTopicConnectionStatusChanged, arguments: ConnectionStatus(status: ConnectionStatusEnum.notConnected));
|
MessageService().publish<ConnectionStatus>(Constants.messageTopicConnectionStatusChanged, arguments: ConnectionStatus(status: ConnectionStatusEnum.notConnected));
|
||||||
|
|
||||||
_startReconnectTimer();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
} catch (ex) {
|
} catch (ex) {
|
||||||
_startReconnectTimer();
|
|
||||||
|
|
||||||
Util.logInfo('Verbindung zum MQTT-Broker fehlgeschlagen!: $ex');
|
Util.logInfo('Verbindung zum MQTT-Broker fehlgeschlagen!: $ex');
|
||||||
|
|
||||||
MessageService().publish<ConnectionStatus>(Constants.messageTopicConnectionStatusChanged, arguments: ConnectionStatus(status: ConnectionStatusEnum.notConnected));
|
MessageService().publish<ConnectionStatus>(Constants.messageTopicConnectionStatusChanged, arguments: ConnectionStatus(status: ConnectionStatusEnum.notConnected));
|
||||||
@@ -328,7 +326,7 @@ class MqttCore {
|
|||||||
publishBinary(topic, gzipBytes!);
|
publishBinary(topic, gzipBytes!);
|
||||||
}
|
}
|
||||||
|
|
||||||
void _startReconnectTimer() {
|
void _startBootstrapReconnectTimer() {
|
||||||
connectionState = ConnectionStateEnum.notConnected;
|
connectionState = ConnectionStateEnum.notConnected;
|
||||||
|
|
||||||
if (!_disconnectInProgress) {
|
if (!_disconnectInProgress) {
|
||||||
@@ -349,17 +347,23 @@ class MqttCore {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void _clientDisconnected() {
|
void _clientDisconnected() {
|
||||||
connectionState = ConnectionStateEnum.notConnected;
|
|
||||||
|
|
||||||
_cancelTrackTimer();
|
|
||||||
|
|
||||||
Util.logInfo("_clientDisconnected called");
|
Util.logInfo("_clientDisconnected called");
|
||||||
|
|
||||||
MessageService().publish<ConnectionStatus>(Constants.messageTopicConnectionStatusChanged, arguments: ConnectionStatus(status: ConnectionStatusEnum.notConnected));
|
connectionState = ConnectionStateEnum.notConnected;
|
||||||
|
|
||||||
if (!_disconnectInProgress) {
|
_startTrackTimer();
|
||||||
_startReconnectTimer();
|
|
||||||
|
MessageService().publish<ConnectionStatus>(Constants.messageTopicConnectionStatusChanged, arguments: ConnectionStatus(status: ConnectionStatusEnum.notConnected));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void _clientConnected() {
|
||||||
|
Util.logInfo("_clientDisconnected called");
|
||||||
|
|
||||||
|
connectionState = ConnectionStateEnum.connected;
|
||||||
|
|
||||||
|
_initSession();
|
||||||
|
|
||||||
|
MessageService().publish<ConnectionStatus>(Constants.messageTopicConnectionStatusChanged, arguments: ConnectionStatus(status: ConnectionStatusEnum.connected));
|
||||||
}
|
}
|
||||||
|
|
||||||
void _processBootstrap() async {
|
void _processBootstrap() async {
|
||||||
@@ -401,7 +405,7 @@ class MqttCore {
|
|||||||
|
|
||||||
_connectToBroker();
|
_connectToBroker();
|
||||||
} catch (ex) {
|
} catch (ex) {
|
||||||
_startReconnectTimer();
|
_startBootstrapReconnectTimer();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user