Location Status eingebaut
Ranking wieder teilaktivert.
This commit is contained in:
1 parent
276b337b62
commit
cfbc0cf765
12 files changed
+566
-862
No files matched your search
@@ -1,17 +1,19 @@
|
||||
import 'dart:convert';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:isar/isar.dart';
|
||||
import 'package:stadtbote/content_views/utils/content_view_widget.dart';
|
||||
import 'package:stadtbote/content_views/utils/header_info.dart';
|
||||
//import 'package:stadtbote/model/ranking.dart';
|
||||
import 'package:stadtbote/main.dart';
|
||||
import 'package:stadtbote/model/rank.dart';
|
||||
import 'package:stadtbote/popups/tasks_popups/zip_popup.dart';
|
||||
import 'package:stadtbote/protocoll_messages/zip_message.dart';
|
||||
import 'package:stadtbote/tools/constants.dart';
|
||||
import 'package:stadtbote/tools/message_service.dart';
|
||||
import 'package:stadtbote/tools/mqtt_core.dart';
|
||||
|
||||
import '../tools/util.dart';
|
||||
|
||||
enum ModeEnum {
|
||||
set,
|
||||
request
|
||||
}
|
||||
|
||||
class ApproachAreaPage extends ContentViewWidget {
|
||||
const ApproachAreaPage({super.key});
|
||||
|
||||
@@ -38,7 +40,7 @@ class ApproachAreaPage extends ContentViewWidget {
|
||||
}
|
||||
|
||||
class _ApproachAreaPageState extends State<ApproachAreaPage> {
|
||||
//late Ranking? _ranking;
|
||||
late List<Rank>? _ranking;
|
||||
|
||||
late bool _initCompleted = false;
|
||||
|
||||
@@ -47,10 +49,12 @@ class _ApproachAreaPageState extends State<ApproachAreaPage> {
|
||||
super.initState();
|
||||
|
||||
Future.delayed(const Duration(seconds: 0), () async {
|
||||
//_ranking = await MyApp.isarInstance.rankings.where().findFirst();
|
||||
_ranking = await MyApp.isarInstance.ranks.where().findAll();
|
||||
|
||||
_initCompleted = true;
|
||||
|
||||
_sendZip(Rank(), "24893");
|
||||
|
||||
setState(() {});
|
||||
});
|
||||
|
||||
@@ -88,16 +92,16 @@ class _ApproachAreaPageState extends State<ApproachAreaPage> {
|
||||
List<Widget> _fillColumns() {
|
||||
List<Widget> columns = [];
|
||||
|
||||
/*if (_ranking != null) {
|
||||
for (int i = 0; i < _ranking!.ranks.length; i++) {
|
||||
var rank = _ranking!.ranks[i];
|
||||
if (_ranking != null) {
|
||||
for (int i = 0; i < _ranking!.length; i++) {
|
||||
var rank = _ranking![i];
|
||||
|
||||
List<Widget> entries = [];
|
||||
entries.add(
|
||||
GestureDetector(
|
||||
onTap: () => {
|
||||
if (i == 0) {
|
||||
showZipPopup(context, 'ACHTUNG: Wenn Sie Ihre PLZ ändern, verlieren Sie Ihr Ranking!\n', 'Freimelden', (zip) => {_sendZip(rank, zip, ModeEnum.set)}),
|
||||
showZipPopup(context, 'ACHTUNG: Wenn Sie Ihre PLZ ändern, verlieren Sie Ihr Ranking!\n', 'Freimelden', (zip) => {_sendZip(rank, zip)}),
|
||||
}
|
||||
},
|
||||
child: Container(
|
||||
@@ -165,36 +169,31 @@ class _ApproachAreaPageState extends State<ApproachAreaPage> {
|
||||
),
|
||||
));
|
||||
}
|
||||
}*/
|
||||
}
|
||||
|
||||
return columns;
|
||||
}
|
||||
|
||||
/*_sendZip(Rank rank, String zip, ModeEnum mode) {
|
||||
var zipMessage = ZipMessage();
|
||||
_sendZip(Rank rank, String zip) {
|
||||
var position = MyApp.currentPosition;
|
||||
|
||||
if (mode == ModeEnum.set) {
|
||||
var position = MyApp.currentPosition;
|
||||
var setPosMessage = ZipSetPos();
|
||||
setPosMessage.zip = zip;
|
||||
|
||||
zipMessage.setPos = ZipSetPos();
|
||||
zipMessage.setPos!.zip = zip;
|
||||
|
||||
if (position != null) {
|
||||
zipMessage.setPos!.track = ZipTrack();
|
||||
zipMessage.setPos!.track!.time = DateTime.now().toIso8601String();
|
||||
zipMessage.setPos!.track!.pos = ZipTrackPos();
|
||||
zipMessage.setPos!.track!.pos!.lat = position.latitude;
|
||||
zipMessage.setPos!.track!.pos!.long = position.longitude;
|
||||
zipMessage.setPos!.track!.pos!.acc = position.accuracy.toInt();
|
||||
}
|
||||
} else {
|
||||
zipMessage.reqZip = ZipReqZip();
|
||||
zipMessage.reqZip!.id = rank.id;
|
||||
zipMessage.reqZip!.zip = zip;
|
||||
if (position != null) {
|
||||
setPosMessage.track = ZipTrack();
|
||||
setPosMessage.track!.time = DateTime.now().toIso8601String();
|
||||
setPosMessage.track!.pos = ZipTrackPos();
|
||||
setPosMessage.track!.pos!.lat = position.latitude;
|
||||
setPosMessage.track!.pos!.long = position.longitude;
|
||||
setPosMessage.track!.pos!.acc = position.accuracy.toInt();
|
||||
}
|
||||
|
||||
MqttCore.instance.publishPayloadMessage("rank", zipMessage.toJson());
|
||||
}*/
|
||||
var json = jsonEncode(setPosMessage.toJson());
|
||||
Util.logInfo(json);
|
||||
|
||||
MqttCore.instance.publishMessage("set_zip", jsonEncode(setPosMessage.toJson()));
|
||||
}
|
||||
|
||||
_initMessages() {
|
||||
/*MessageService().subscribe<RankingUpdated>(Constants.messageTopicRankingUpdated, this, (rankingUpdateMessage) async {
|
||||
|
||||
@@ -13,7 +13,7 @@ import 'package:stadtbote/content_views/utils/header_info.dart';
|
||||
import 'package:stadtbote/model/job.dart';
|
||||
import 'package:stadtbote/model/message.dart';
|
||||
import 'package:stadtbote/model/session_status.dart';
|
||||
import 'package:stadtbote/model/status.dart';
|
||||
import 'package:stadtbote/model/location_status.dart';
|
||||
import 'package:stadtbote/popups/infos_popup.dart';
|
||||
import 'package:stadtbote/protocoll_messages/logout_message.dart';
|
||||
import 'package:stadtbote/tools/message_service.dart';
|
||||
@@ -265,7 +265,7 @@ class _MainPageState extends State<MainPage> {
|
||||
widget.sidValueNotifier.value = sessionStatusInfoUpdateMessage.status.sid;
|
||||
});
|
||||
|
||||
MessageService().subscribe<StatusInfoUpdate>(Constants.messageTopicStatusInfoUpdated, this, (statusInfoUpdateMessage) {
|
||||
MessageService().subscribe<LocationStatusUpdate>(Constants.messageTopicLocationStatusUpdated, this, (statusInfoUpdateMessage) {
|
||||
_updateHeader();
|
||||
});
|
||||
|
||||
@@ -303,11 +303,11 @@ class _MainPageState extends State<MainPage> {
|
||||
}
|
||||
|
||||
void _updateHeader() async {
|
||||
var status = await MyApp.isarInstance.status.where().findFirst();
|
||||
var status = await MyApp.isarInstance.locationStatus.where().findFirst();
|
||||
var sessionStatus = await MyApp.isarInstance.sessionStatus.where().findFirst();
|
||||
|
||||
if (status != null) {
|
||||
widget._zipValueNotifier.value = '${status.pos.zip} (${status.pos.zipReal})';
|
||||
widget._zipValueNotifier.value = '${status.zip} (${status.zipReal})';
|
||||
} else if (sessionStatus != null) {
|
||||
widget._zipValueNotifier.value = sessionStatus.locZip;
|
||||
} else {
|
||||
|
||||
+5
-3
@@ -8,7 +8,8 @@ import 'package:stadtbote/messages/pop_content_view_message.dart';
|
||||
import 'package:stadtbote/model/enqueued_message.dart';
|
||||
import 'package:stadtbote/model/log_entry.dart';
|
||||
import 'package:stadtbote/model/message.dart';
|
||||
import 'package:stadtbote/model/status.dart';
|
||||
import 'package:stadtbote/model/rank.dart';
|
||||
import 'package:stadtbote/model/location_status.dart';
|
||||
import 'package:stadtbote/model/task_info.dart';
|
||||
import 'package:stadtbote/popups/accept_jobs_popup.dart';
|
||||
import 'package:stadtbote/tools/colored_safe_area.dart';
|
||||
@@ -32,12 +33,13 @@ Future<void> main() async {
|
||||
final dir = await getApplicationDocumentsDirectory();
|
||||
MyApp.isarInstance = await Isar.open([
|
||||
SessionStatusSchema,
|
||||
StatusSchema,
|
||||
LocationStatusSchema,
|
||||
JobSchema,
|
||||
TaskInfoSchema,
|
||||
MessageSchema,
|
||||
EnqueuedMessageSchema,
|
||||
LogEntrySchema
|
||||
LogEntrySchema,
|
||||
RankSchema
|
||||
], directory: dir.path);
|
||||
|
||||
runZonedGuarded(() {}, (error, stackTrace) {
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
import 'package:isar/isar.dart';
|
||||
import 'package:json_annotation/json_annotation.dart';
|
||||
|
||||
part 'location_status.g.dart';
|
||||
|
||||
@collection
|
||||
@JsonSerializable()
|
||||
class LocationStatus {
|
||||
Id? id = 0;
|
||||
|
||||
late String zip;
|
||||
|
||||
late String area;
|
||||
|
||||
@JsonKey(name:'zip_real')
|
||||
late String zipReal;
|
||||
|
||||
LocationStatus();
|
||||
|
||||
factory LocationStatus.fromJson(Map<String, dynamic> json) => _$LocationStatusFromJson(json);
|
||||
|
||||
Map<String, dynamic> toJson() => _$LocationStatusToJson(this);
|
||||
}
|
||||
File diff suppressed because it is too large.
Load diff
@@ -1,36 +0,0 @@
|
||||
import 'package:isar/isar.dart';
|
||||
import 'package:json_annotation/json_annotation.dart';
|
||||
|
||||
part 'status.g.dart';
|
||||
|
||||
@collection
|
||||
@JsonSerializable()
|
||||
class Status {
|
||||
@JsonKey(name: "id", defaultValue: 0)
|
||||
Id? id;
|
||||
|
||||
late StatusPos pos;
|
||||
|
||||
Status();
|
||||
|
||||
factory Status.fromJson(Map<String, dynamic> json) => _$StatusFromJson(json);
|
||||
|
||||
Map<String, dynamic> toJson() => _$StatusToJson(this);
|
||||
}
|
||||
|
||||
@embedded
|
||||
@JsonSerializable()
|
||||
class StatusPos {
|
||||
late String zip;
|
||||
|
||||
late String area;
|
||||
|
||||
@JsonKey(name:'zip_real')
|
||||
late String zipReal;
|
||||
|
||||
StatusPos();
|
||||
|
||||
factory StatusPos.fromJson(Map<String, dynamic> json) => _$StatusPosFromJson(json);
|
||||
|
||||
Map<String, dynamic> toJson() => _$StatusPosToJson(this);
|
||||
}
|
||||
@@ -3,59 +3,6 @@ import 'package:json_annotation/json_annotation.dart';
|
||||
|
||||
part 'zip_message.g.dart';
|
||||
|
||||
/*
|
||||
{
|
||||
"recv": "rank",
|
||||
"payload": {
|
||||
"set_pos": {
|
||||
"zip": "22525",
|
||||
"track": {
|
||||
"time": "2021-03-01T12:55:51Z",
|
||||
"pos":
|
||||
{
|
||||
"lat": 53.595121,
|
||||
"long": 9.907433,
|
||||
"acc": 35
|
||||
}
|
||||
}
|
||||
},
|
||||
"reg_zip": {
|
||||
"id": 2,
|
||||
"zip": "22039"
|
||||
}
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
@JsonSerializable()
|
||||
class ZipMessage {
|
||||
@JsonKey(name: "set_pos")
|
||||
ZipSetPos? setPos;
|
||||
|
||||
@JsonKey(name: "req_zip")
|
||||
ZipReqZip? reqZip;
|
||||
|
||||
ZipMessage();
|
||||
|
||||
factory ZipMessage.fromJson(Map<String, dynamic> json) => _$ZipMessageFromJson(json);
|
||||
|
||||
Map<String, dynamic> toJson() => _$ZipMessageToJson(this);
|
||||
}
|
||||
|
||||
@embedded
|
||||
@JsonSerializable()
|
||||
class ZipReqZip {
|
||||
late int id;
|
||||
|
||||
late String zip;
|
||||
|
||||
ZipReqZip();
|
||||
|
||||
factory ZipReqZip.fromJson(Map<String, dynamic> json) => _$ZipReqZipFromJson(json);
|
||||
|
||||
Map<String, dynamic> toJson() => _$ZipReqZipToJson(this);
|
||||
}
|
||||
|
||||
@embedded
|
||||
@JsonSerializable()
|
||||
class ZipSetPos {
|
||||
@@ -99,22 +46,3 @@ class ZipTrackPos {
|
||||
|
||||
Map<String, dynamic> toJson() => _$ZipTrackPosToJson(this);
|
||||
}
|
||||
|
||||
/*
|
||||
@JsonSerializable()
|
||||
class MessageContent
|
||||
{
|
||||
late String text;
|
||||
|
||||
late String subj;
|
||||
|
||||
late String time;
|
||||
|
||||
MessageContent();
|
||||
|
||||
factory MessageContent.fromJson(Map<String, dynamic> json) => _$MessageContentFromJson(json);
|
||||
|
||||
Map<String, dynamic> toJson() => _$MessageContentToJson(this);
|
||||
}
|
||||
|
||||
*/
|
||||
@@ -9,267 +9,6 @@ part of 'zip_message.dart';
|
||||
// coverage:ignore-file
|
||||
// ignore_for_file: duplicate_ignore, non_constant_identifier_names, constant_identifier_names, invalid_use_of_protected_member, unnecessary_cast, prefer_const_constructors, lines_longer_than_80_chars, require_trailing_commas, inference_failure_on_function_invocation, unnecessary_parenthesis, unnecessary_raw_strings, unnecessary_null_checks, join_return_with_assignment, prefer_final_locals, avoid_js_rounded_ints, avoid_positional_boolean_parameters, always_specify_types
|
||||
|
||||
const ZipReqZipSchema = Schema(
|
||||
name: r'ZipReqZip',
|
||||
id: 2176882141139579108,
|
||||
properties: {
|
||||
r'id': PropertySchema(
|
||||
id: 0,
|
||||
name: r'id',
|
||||
type: IsarType.long,
|
||||
),
|
||||
r'zip': PropertySchema(
|
||||
id: 1,
|
||||
name: r'zip',
|
||||
type: IsarType.string,
|
||||
)
|
||||
},
|
||||
estimateSize: _zipReqZipEstimateSize,
|
||||
serialize: _zipReqZipSerialize,
|
||||
deserialize: _zipReqZipDeserialize,
|
||||
deserializeProp: _zipReqZipDeserializeProp,
|
||||
);
|
||||
|
||||
int _zipReqZipEstimateSize(
|
||||
ZipReqZip object,
|
||||
List<int> offsets,
|
||||
Map<Type, List<int>> allOffsets,
|
||||
) {
|
||||
var bytesCount = offsets.last;
|
||||
bytesCount += 3 + object.zip.length * 3;
|
||||
return bytesCount;
|
||||
}
|
||||
|
||||
void _zipReqZipSerialize(
|
||||
ZipReqZip object,
|
||||
IsarWriter writer,
|
||||
List<int> offsets,
|
||||
Map<Type, List<int>> allOffsets,
|
||||
) {
|
||||
writer.writeLong(offsets[0], object.id);
|
||||
writer.writeString(offsets[1], object.zip);
|
||||
}
|
||||
|
||||
ZipReqZip _zipReqZipDeserialize(
|
||||
Id id,
|
||||
IsarReader reader,
|
||||
List<int> offsets,
|
||||
Map<Type, List<int>> allOffsets,
|
||||
) {
|
||||
final object = ZipReqZip();
|
||||
object.id = reader.readLong(offsets[0]);
|
||||
object.zip = reader.readString(offsets[1]);
|
||||
return object;
|
||||
}
|
||||
|
||||
P _zipReqZipDeserializeProp<P>(
|
||||
IsarReader reader,
|
||||
int propertyId,
|
||||
int offset,
|
||||
Map<Type, List<int>> allOffsets,
|
||||
) {
|
||||
switch (propertyId) {
|
||||
case 0:
|
||||
return (reader.readLong(offset)) as P;
|
||||
case 1:
|
||||
return (reader.readString(offset)) as P;
|
||||
default:
|
||||
throw IsarError('Unknown property with id $propertyId');
|
||||
}
|
||||
}
|
||||
|
||||
extension ZipReqZipQueryFilter
|
||||
on QueryBuilder<ZipReqZip, ZipReqZip, QFilterCondition> {
|
||||
QueryBuilder<ZipReqZip, ZipReqZip, QAfterFilterCondition> idEqualTo(
|
||||
int value) {
|
||||
return QueryBuilder.apply(this, (query) {
|
||||
return query.addFilterCondition(FilterCondition.equalTo(
|
||||
property: r'id',
|
||||
value: value,
|
||||
));
|
||||
});
|
||||
}
|
||||
|
||||
QueryBuilder<ZipReqZip, ZipReqZip, QAfterFilterCondition> idGreaterThan(
|
||||
int value, {
|
||||
bool include = false,
|
||||
}) {
|
||||
return QueryBuilder.apply(this, (query) {
|
||||
return query.addFilterCondition(FilterCondition.greaterThan(
|
||||
include: include,
|
||||
property: r'id',
|
||||
value: value,
|
||||
));
|
||||
});
|
||||
}
|
||||
|
||||
QueryBuilder<ZipReqZip, ZipReqZip, QAfterFilterCondition> idLessThan(
|
||||
int value, {
|
||||
bool include = false,
|
||||
}) {
|
||||
return QueryBuilder.apply(this, (query) {
|
||||
return query.addFilterCondition(FilterCondition.lessThan(
|
||||
include: include,
|
||||
property: r'id',
|
||||
value: value,
|
||||
));
|
||||
});
|
||||
}
|
||||
|
||||
QueryBuilder<ZipReqZip, ZipReqZip, QAfterFilterCondition> idBetween(
|
||||
int lower,
|
||||
int upper, {
|
||||
bool includeLower = true,
|
||||
bool includeUpper = true,
|
||||
}) {
|
||||
return QueryBuilder.apply(this, (query) {
|
||||
return query.addFilterCondition(FilterCondition.between(
|
||||
property: r'id',
|
||||
lower: lower,
|
||||
includeLower: includeLower,
|
||||
upper: upper,
|
||||
includeUpper: includeUpper,
|
||||
));
|
||||
});
|
||||
}
|
||||
|
||||
QueryBuilder<ZipReqZip, ZipReqZip, QAfterFilterCondition> zipEqualTo(
|
||||
String value, {
|
||||
bool caseSensitive = true,
|
||||
}) {
|
||||
return QueryBuilder.apply(this, (query) {
|
||||
return query.addFilterCondition(FilterCondition.equalTo(
|
||||
property: r'zip',
|
||||
value: value,
|
||||
caseSensitive: caseSensitive,
|
||||
));
|
||||
});
|
||||
}
|
||||
|
||||
QueryBuilder<ZipReqZip, ZipReqZip, QAfterFilterCondition> zipGreaterThan(
|
||||
String value, {
|
||||
bool include = false,
|
||||
bool caseSensitive = true,
|
||||
}) {
|
||||
return QueryBuilder.apply(this, (query) {
|
||||
return query.addFilterCondition(FilterCondition.greaterThan(
|
||||
include: include,
|
||||
property: r'zip',
|
||||
value: value,
|
||||
caseSensitive: caseSensitive,
|
||||
));
|
||||
});
|
||||
}
|
||||
|
||||
QueryBuilder<ZipReqZip, ZipReqZip, QAfterFilterCondition> zipLessThan(
|
||||
String value, {
|
||||
bool include = false,
|
||||
bool caseSensitive = true,
|
||||
}) {
|
||||
return QueryBuilder.apply(this, (query) {
|
||||
return query.addFilterCondition(FilterCondition.lessThan(
|
||||
include: include,
|
||||
property: r'zip',
|
||||
value: value,
|
||||
caseSensitive: caseSensitive,
|
||||
));
|
||||
});
|
||||
}
|
||||
|
||||
QueryBuilder<ZipReqZip, ZipReqZip, QAfterFilterCondition> zipBetween(
|
||||
String lower,
|
||||
String upper, {
|
||||
bool includeLower = true,
|
||||
bool includeUpper = true,
|
||||
bool caseSensitive = true,
|
||||
}) {
|
||||
return QueryBuilder.apply(this, (query) {
|
||||
return query.addFilterCondition(FilterCondition.between(
|
||||
property: r'zip',
|
||||
lower: lower,
|
||||
includeLower: includeLower,
|
||||
upper: upper,
|
||||
includeUpper: includeUpper,
|
||||
caseSensitive: caseSensitive,
|
||||
));
|
||||
});
|
||||
}
|
||||
|
||||
QueryBuilder<ZipReqZip, ZipReqZip, QAfterFilterCondition> zipStartsWith(
|
||||
String value, {
|
||||
bool caseSensitive = true,
|
||||
}) {
|
||||
return QueryBuilder.apply(this, (query) {
|
||||
return query.addFilterCondition(FilterCondition.startsWith(
|
||||
property: r'zip',
|
||||
value: value,
|
||||
caseSensitive: caseSensitive,
|
||||
));
|
||||
});
|
||||
}
|
||||
|
||||
QueryBuilder<ZipReqZip, ZipReqZip, QAfterFilterCondition> zipEndsWith(
|
||||
String value, {
|
||||
bool caseSensitive = true,
|
||||
}) {
|
||||
return QueryBuilder.apply(this, (query) {
|
||||
return query.addFilterCondition(FilterCondition.endsWith(
|
||||
property: r'zip',
|
||||
value: value,
|
||||
caseSensitive: caseSensitive,
|
||||
));
|
||||
});
|
||||
}
|
||||
|
||||
QueryBuilder<ZipReqZip, ZipReqZip, QAfterFilterCondition> zipContains(
|
||||
String value,
|
||||
{bool caseSensitive = true}) {
|
||||
return QueryBuilder.apply(this, (query) {
|
||||
return query.addFilterCondition(FilterCondition.contains(
|
||||
property: r'zip',
|
||||
value: value,
|
||||
caseSensitive: caseSensitive,
|
||||
));
|
||||
});
|
||||
}
|
||||
|
||||
QueryBuilder<ZipReqZip, ZipReqZip, QAfterFilterCondition> zipMatches(
|
||||
String pattern,
|
||||
{bool caseSensitive = true}) {
|
||||
return QueryBuilder.apply(this, (query) {
|
||||
return query.addFilterCondition(FilterCondition.matches(
|
||||
property: r'zip',
|
||||
wildcard: pattern,
|
||||
caseSensitive: caseSensitive,
|
||||
));
|
||||
});
|
||||
}
|
||||
|
||||
QueryBuilder<ZipReqZip, ZipReqZip, QAfterFilterCondition> zipIsEmpty() {
|
||||
return QueryBuilder.apply(this, (query) {
|
||||
return query.addFilterCondition(FilterCondition.equalTo(
|
||||
property: r'zip',
|
||||
value: '',
|
||||
));
|
||||
});
|
||||
}
|
||||
|
||||
QueryBuilder<ZipReqZip, ZipReqZip, QAfterFilterCondition> zipIsNotEmpty() {
|
||||
return QueryBuilder.apply(this, (query) {
|
||||
return query.addFilterCondition(FilterCondition.greaterThan(
|
||||
property: r'zip',
|
||||
value: '',
|
||||
));
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
extension ZipReqZipQueryObject
|
||||
on QueryBuilder<ZipReqZip, ZipReqZip, QFilterCondition> {}
|
||||
|
||||
// coverage:ignore-file
|
||||
// ignore_for_file: duplicate_ignore, non_constant_identifier_names, constant_identifier_names, invalid_use_of_protected_member, unnecessary_cast, prefer_const_constructors, lines_longer_than_80_chars, require_trailing_commas, inference_failure_on_function_invocation, unnecessary_parenthesis, unnecessary_raw_strings, unnecessary_null_checks, join_return_with_assignment, prefer_final_locals, avoid_js_rounded_ints, avoid_positional_boolean_parameters, always_specify_types
|
||||
|
||||
const ZipSetPosSchema = Schema(
|
||||
name: r'ZipSetPos',
|
||||
id: 2736271830323112702,
|
||||
@@ -1039,29 +778,6 @@ extension ZipTrackPosQueryObject
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
ZipMessage _$ZipMessageFromJson(Map<String, dynamic> json) => ZipMessage()
|
||||
..setPos = json['set_pos'] == null
|
||||
? null
|
||||
: ZipSetPos.fromJson(json['set_pos'] as Map<String, dynamic>)
|
||||
..reqZip = json['req_zip'] == null
|
||||
? null
|
||||
: ZipReqZip.fromJson(json['req_zip'] as Map<String, dynamic>);
|
||||
|
||||
Map<String, dynamic> _$ZipMessageToJson(ZipMessage instance) =>
|
||||
<String, dynamic>{
|
||||
'set_pos': instance.setPos,
|
||||
'req_zip': instance.reqZip,
|
||||
};
|
||||
|
||||
ZipReqZip _$ZipReqZipFromJson(Map<String, dynamic> json) => ZipReqZip()
|
||||
..id = json['id'] as int
|
||||
..zip = json['zip'] as String;
|
||||
|
||||
Map<String, dynamic> _$ZipReqZipToJson(ZipReqZip instance) => <String, dynamic>{
|
||||
'id': instance.id,
|
||||
'zip': instance.zip,
|
||||
};
|
||||
|
||||
ZipSetPos _$ZipSetPosFromJson(Map<String, dynamic> json) => ZipSetPos()
|
||||
..zip = json['zip'] as String
|
||||
..track = json['track'] == null
|
||||
|
||||
@@ -7,7 +7,7 @@ class Constants {
|
||||
static const String messageTopicConnectionStatusChanged = "connection_status_changed";
|
||||
static const String messageTopicSessionInfoUpdate = "status_info_updated";
|
||||
static const String messageTopicSessionStatusInfoUpdate = "session_status_info_updated";
|
||||
static const String messageTopicStatusInfoUpdated = "status_info_updated";
|
||||
static const String messageTopicLocationStatusUpdated = "status_info_updated";
|
||||
static const String messageTopicRankingUpdated = "ranking_updated";
|
||||
static const String messageTopicJobReceived = "job_received";
|
||||
static const String messageTopicJobDeleted = "job_deleted";
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import 'package:stadtbote/model/status.dart';
|
||||
import 'package:stadtbote/model/location_status.dart';
|
||||
|
||||
class StatusInfoUpdate {
|
||||
StatusInfoUpdate({required this.status});
|
||||
class LocationStatusUpdate {
|
||||
LocationStatusUpdate({required this.status});
|
||||
|
||||
final Status status;
|
||||
final LocationStatus status;
|
||||
}
|
||||
+10
-10
@@ -12,7 +12,7 @@ import 'package:stadtbote/model/enqueued_message.dart';
|
||||
import 'package:stadtbote/model/job.dart';
|
||||
import 'package:stadtbote/model/log_entry.dart';
|
||||
import 'package:stadtbote/model/message.dart';
|
||||
import 'package:stadtbote/model/status.dart';
|
||||
import 'package:stadtbote/model/location_status.dart';
|
||||
import 'package:stadtbote/protocoll_messages/acknowledge_job.dart';
|
||||
import 'package:stadtbote/protocoll_messages/bootstrap_request.dart';
|
||||
import 'package:stadtbote/protocoll_messages/bootstrap_response_payload.dart';
|
||||
@@ -170,12 +170,12 @@ class MqttCore {
|
||||
_sessionMessageReceived(jsonDecode(payload));
|
||||
break;
|
||||
|
||||
case 'status':
|
||||
_statusMessageReceived(jsonDecode(payload));
|
||||
case 'location_status':
|
||||
_locationSatusMessageReceived(jsonDecode(payload));
|
||||
break;
|
||||
|
||||
case 'ranks':
|
||||
//_rankingMessageReceived(messageData);
|
||||
case 'ranking':
|
||||
_rankingMessageReceived(jsonDecode(payload));
|
||||
break;
|
||||
|
||||
case 'job':
|
||||
@@ -235,15 +235,15 @@ class MqttCore {
|
||||
_startTrackTimer();
|
||||
}
|
||||
|
||||
void _statusMessageReceived(payloadData) async {
|
||||
var statusMessage = Status.fromJson(payloadData);
|
||||
void _locationSatusMessageReceived(payloadData) async {
|
||||
var locationStatus = LocationStatus.fromJson(payloadData);
|
||||
|
||||
await MyApp.isarInstance.writeTxn(() async {
|
||||
await MyApp.isarInstance.status.clear();
|
||||
await MyApp.isarInstance.status.put(statusMessage);
|
||||
await MyApp.isarInstance.locationStatus.clear();
|
||||
await MyApp.isarInstance.locationStatus.put(locationStatus);
|
||||
});
|
||||
|
||||
MessageService().publish<StatusInfoUpdate>(Constants.messageTopicStatusInfoUpdated, arguments: StatusInfoUpdate(status: statusMessage));
|
||||
MessageService().publish<LocationStatusUpdate>(Constants.messageTopicLocationStatusUpdated, arguments: LocationStatusUpdate(status: locationStatus));
|
||||
}
|
||||
|
||||
void _rankingMessageReceived(List<dynamic> payloadData) async {
|
||||
|
||||
+76
-44
@@ -165,10 +165,10 @@ packages:
|
||||
dependency: "direct dev"
|
||||
description:
|
||||
name: build_runner
|
||||
sha256: "581bacf68f89ec8792f5e5a0b2c4decd1c948e97ce659dc783688c8a88fbec21"
|
||||
sha256: "3ac61a79bfb6f6cc11f693591063a7f19a7af628dc52f141743edac5c16e8c22"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.4.8"
|
||||
version: "2.4.9"
|
||||
build_runner_core:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -189,10 +189,10 @@ packages:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: built_value
|
||||
sha256: fedde275e0a6b798c3296963c5cd224e3e1b55d0e478d5b7e65e6b540f363a0e
|
||||
sha256: c7913a9737ee4007efedaffc968c049fd0f3d0e49109e778edc10de9426005cb
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "8.9.1"
|
||||
version: "8.9.2"
|
||||
carousel_slider:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
@@ -333,10 +333,10 @@ packages:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: dio
|
||||
sha256: "49af28382aefc53562459104f64d16b9dfd1e8ef68c862d5af436cc8356ce5a8"
|
||||
sha256: "0978e9a3e45305a80a7210dbeaf79d6ee8bee33f70c8e542dc654c952070217f"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "5.4.1"
|
||||
version: "5.4.2+1"
|
||||
easy_stepper:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
@@ -381,10 +381,10 @@ packages:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: ffi
|
||||
sha256: "7bf0adc28a23d395f19f3f1eb21dd7cfd1dd9f8e1c50051c069122e6853bc878"
|
||||
sha256: "493f37e7df1804778ff3a53bd691d8692ddf69702cf4c1c1096a2e41b4779e21"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.1.0"
|
||||
version: "2.1.2"
|
||||
file:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -514,10 +514,10 @@ packages:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: flutter_osm_interface
|
||||
sha256: "9d1c747635ce8a58ceb623825f0fe4d469272645458ce839d466f9d03dff2729"
|
||||
sha256: f5ec50f7a5fee9c6c1f3622b1bf9285b451349b2ac30f5dacddd32b4608a2840
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "0.7.0"
|
||||
version: "1.0.1"
|
||||
flutter_osm_plugin:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
@@ -546,10 +546,10 @@ packages:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: flutter_plugin_android_lifecycle
|
||||
sha256: b068ffc46f82a55844acfa4fdbb61fad72fa2aef0905548419d97f0f95c456da
|
||||
sha256: "592dc01a18961a51c24ae5d963b724b2b7fa4a95c100fe8eb6ca8a5a4732cadf"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.0.17"
|
||||
version: "2.0.18"
|
||||
flutter_svg:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -572,10 +572,10 @@ packages:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: frontend_server_client
|
||||
sha256: "408e3ca148b31c20282ad6f37ebfa6f4bdc8fede5b74bc2f08d9d92b55db3612"
|
||||
sha256: f64a0333a82f30b0cca061bc3d143813a486dc086b574bfb233b7c1372427694
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "3.2.0"
|
||||
version: "4.0.0"
|
||||
geolocator:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
@@ -596,10 +596,10 @@ packages:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: geolocator_apple
|
||||
sha256: "2f2d4ee16c4df269e93c0e382be075cc01d5db6703c3196e4af20a634fe49ef4"
|
||||
sha256: bc2aca02423ad429cb0556121f56e60360a2b7d694c8570301d06ea0c00732fd
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.3.6"
|
||||
version: "2.3.7"
|
||||
geolocator_platform_interface:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -620,10 +620,10 @@ packages:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: geolocator_windows
|
||||
sha256: a92fae29779d5c6dc60e8411302f5221ade464968fe80a36d330e80a71f087af
|
||||
sha256: "53da08937d07c24b0d9952eb57a3b474e29aae2abf9dd717f7e1230995f13f0e"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "0.2.2"
|
||||
version: "0.2.3"
|
||||
glob:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -700,10 +700,10 @@ packages:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: image_picker_android
|
||||
sha256: "39f2bfe497e495450c81abcd44b62f56c2a36a37a175da7d137b4454977b51b1"
|
||||
sha256: "42c098e7fb6334746be37cdc30369ade356ed4f14d48b7a0313f95a9159f4321"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "0.8.9+3"
|
||||
version: "0.8.9+5"
|
||||
image_picker_for_web:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -716,10 +716,10 @@ packages:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: image_picker_ios
|
||||
sha256: fadafce49e8569257a0cad56d24438a6fa1f0cbd7ee0af9b631f7492818a4ca3
|
||||
sha256: "917a5cadd67d052554cfb258595e54217de53fac5b52939426e26319a02e6297"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "0.8.9+1"
|
||||
version: "0.8.9+2"
|
||||
image_picker_linux:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -740,10 +740,10 @@ packages:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: image_picker_platform_interface
|
||||
sha256: fa4e815e6fcada50e35718727d83ba1c92f1edf95c0b4436554cec301b56233b
|
||||
sha256: "9ec26d410ff46f483c5519c29c02ef0e02e13a543f882b152d4bfd2f06802f80"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.9.3"
|
||||
version: "2.10.0"
|
||||
image_picker_windows:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -824,6 +824,30 @@ packages:
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "0.8.2"
|
||||
leak_tracker:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: leak_tracker
|
||||
sha256: "78eb209deea09858f5269f5a5b02be4049535f568c07b275096836f01ea323fa"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "10.0.0"
|
||||
leak_tracker_flutter_testing:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: leak_tracker_flutter_testing
|
||||
sha256: b46c5e37c19120a8a01918cfaf293547f47269f7cb4b0058f21531c2465d6ef0
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.0.1"
|
||||
leak_tracker_testing:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: leak_tracker_testing
|
||||
sha256: a597f72a664dbd293f3bfc51f9ba69816f84dcd403cdac7066cb3f6003f3ab47
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.0.1"
|
||||
linkify:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -868,26 +892,26 @@ packages:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: matcher
|
||||
sha256: "1803e76e6653768d64ed8ff2e1e67bea3ad4b923eb5c56a295c3e634bad5960e"
|
||||
sha256: d2323aa2060500f906aa31a895b4030b6da3ebdcc5619d14ce1aada65cd161cb
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "0.12.16"
|
||||
version: "0.12.16+1"
|
||||
material_color_utilities:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: material_color_utilities
|
||||
sha256: "9528f2f296073ff54cb9fee677df673ace1218163c3bc7628093e7eed5203d41"
|
||||
sha256: "0e0a020085b65b6083975e499759762399b4475f766c21668c4ecca34ea74e5a"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "0.5.0"
|
||||
version: "0.8.0"
|
||||
meta:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: meta
|
||||
sha256: a6e590c838b18133bb482a2745ad77c5bb7715fb0451209e1a7567d416678b8e
|
||||
sha256: d584fa6707a52763a52446f02cc621b077888fb63b93bbcb1143a7be5a0c0c04
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.10.0"
|
||||
version: "1.11.0"
|
||||
mgrs_dart:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -948,10 +972,10 @@ packages:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: path
|
||||
sha256: "8829d8a55c13fc0e37127c29fedf290c102f4e40ae94ada574091fe0ff96c917"
|
||||
sha256: "087ce49c3f0dc39180befefc60fdb4acd8f8620e5682fe2476afd0b3688bb4af"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.8.3"
|
||||
version: "1.9.0"
|
||||
path_parsing:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -972,10 +996,10 @@ packages:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: path_provider_android
|
||||
sha256: "477184d672607c0a3bf68fbbf601805f92ef79c82b64b4d6eb318cbca4c48668"
|
||||
sha256: "51f0d2c554cfbc9d6a312ab35152fc77e2f0b758ce9f1a444a3a1e5b8f3c6b7f"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.2.2"
|
||||
version: "2.2.3"
|
||||
path_provider_foundation:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -1084,10 +1108,10 @@ packages:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: pointycastle
|
||||
sha256: "43ac87de6e10afabc85c445745a7b799e04de84cebaa4fd7bf55a5e1e9604d29"
|
||||
sha256: "70fe966348fe08c34bf929582f1d8247d9d9408130723206472b4687227e4333"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "3.7.4"
|
||||
version: "3.8.0"
|
||||
polylabel:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -1469,6 +1493,14 @@ packages:
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "0.4.0+2"
|
||||
vm_service:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: vm_service
|
||||
sha256: b3d56ff4341b8f182b96aceb2fa20e3dcb336b9f867bc0eafc0de10f1048e957
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "13.0.0"
|
||||
watcher:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -1481,26 +1513,26 @@ packages:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: web
|
||||
sha256: afe077240a270dcfd2aafe77602b4113645af95d0ad31128cc02bce5ac5d5152
|
||||
sha256: "4188706108906f002b3a293509234588823c8c979dc83304e229ff400c996b05"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "0.3.0"
|
||||
version: "0.4.2"
|
||||
web_socket_channel:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: web_socket_channel
|
||||
sha256: d88238e5eac9a42bb43ca4e721edba3c08c6354d4a53063afaa568516217621b
|
||||
sha256: "939ab60734a4f8fa95feacb55804fa278de28bdeef38e616dc08e44a84adea23"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.4.0"
|
||||
version: "2.4.3"
|
||||
win32:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: win32
|
||||
sha256: "464f5674532865248444b4c3daca12bd9bf2d7c47f759ce2617986e7229494a8"
|
||||
sha256: "0a989dc7ca2bb51eac91e8fd00851297cfffd641aa7538b165c62637ca0eaa4a"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "5.2.0"
|
||||
version: "5.4.0"
|
||||
win32_registry:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -1550,5 +1582,5 @@ packages:
|
||||
source: hosted
|
||||
version: "3.1.2"
|
||||
sdks:
|
||||
dart: ">=3.2.3 <4.0.0"
|
||||
flutter: ">=3.16.6"
|
||||
dart: ">=3.3.0 <4.0.0"
|
||||
flutter: ">=3.19.0"
|
||||
Reference in new issue
Block a user