Erweiterungen
This commit is contained in:
1 parent
3dab4025e7
commit
3d7ae9de2a
16 files changed
+438
-327
No files matched your search
@@ -3,13 +3,16 @@ import 'dart:convert';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:flutter_broadcast_receiver/flutter_broadcast_receiver.dart';
|
||||
import 'package:isar/isar.dart';
|
||||
import 'package:stadtbote/content_views/accepted_jobs_page.dart';
|
||||
import 'package:stadtbote/content_views/assigned_jobs_page.dart';
|
||||
import 'package:stadtbote/content_views/finished_jobs_page.dart';
|
||||
import 'package:stadtbote/content_views/messages_page.dart';
|
||||
import 'package:stadtbote/content_views/utils/content_view_widget.dart';
|
||||
import 'package:stadtbote/content_views/utils/header_info.dart';
|
||||
import 'package:stadtbote/model/status.dart';
|
||||
import 'package:stadtbote/popups/infos_popup.dart';
|
||||
import 'package:stadtbote/tools/session_info_update.dart';
|
||||
|
||||
import '../main.dart';
|
||||
import '../model/job.dart';
|
||||
@@ -17,7 +20,16 @@ import '../tools/constants.dart';
|
||||
import '../tools/util.dart';
|
||||
|
||||
class MainPage extends ContentViewWidget {
|
||||
const MainPage({super.key});
|
||||
final ValueNotifier<String> _zipValueNotifier = ValueNotifier("----");
|
||||
final ValueNotifier<String> _sidValueNotifier = ValueNotifier("----");
|
||||
|
||||
MainPage({super.key}) {
|
||||
Status? status = MyApp.isarInstance.status.where().findFirstSync();
|
||||
if (status != null) {
|
||||
_zipValueNotifier.value = status.locZip;
|
||||
_sidValueNotifier.value = status.sid;
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
State<MainPage> createState() => _MainPageState();
|
||||
@@ -27,21 +39,31 @@ class MainPage extends ContentViewWidget {
|
||||
return HeaderInfo(
|
||||
titleWidget: Container(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 5, vertical: 3),
|
||||
child: const Column(children: [
|
||||
Text(
|
||||
'Zeile 1',
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 18.0,
|
||||
),
|
||||
child: Column(children: [
|
||||
ValueListenableBuilder<String>(
|
||||
valueListenable: _zipValueNotifier,
|
||||
builder: (context, value, child) {
|
||||
return Text(
|
||||
value,
|
||||
style: const TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 18.0,
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
SizedBox(height: 5),
|
||||
Text(
|
||||
'Zeile 2',
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 18.0,
|
||||
),
|
||||
const SizedBox(height: 5),
|
||||
ValueListenableBuilder<String>(
|
||||
valueListenable: _sidValueNotifier,
|
||||
builder: (context, value, child) {
|
||||
return Text(
|
||||
value,
|
||||
style: const TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 18.0,
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
]),
|
||||
),
|
||||
@@ -55,6 +77,13 @@ class MainPage extends ContentViewWidget {
|
||||
}
|
||||
|
||||
class _MainPageState extends State<MainPage> {
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
|
||||
_initMessages();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Stack(
|
||||
@@ -123,7 +152,7 @@ class _MainPageState extends State<MainPage> {
|
||||
);
|
||||
}
|
||||
|
||||
void _test() async {
|
||||
_test() async {
|
||||
var json = await rootBundle.loadString('assets/job.json');
|
||||
var jsonMap = jsonDecode(json);
|
||||
var payload = jsonMap["payload"];
|
||||
@@ -138,4 +167,10 @@ class _MainPageState extends State<MainPage> {
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
_initMessages() {
|
||||
BroadcastReceiver().subscribe<StatusInfoUpdate>(Constants.messageTopicStatusInfoUpdate, (statusInfoUpdate) {
|
||||
widget._sidValueNotifier.value = statusInfoUpdate.status.sid;
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -13,6 +13,7 @@ import 'package:stadtbote/popups/tasks_popups/scan_barcodes_popup.dart';
|
||||
import 'package:stadtbote/popups/tasks_popups/signature_popup.dart';
|
||||
import 'package:stadtbote/popups/tasks_popups/station_notice_popup.dart';
|
||||
import 'package:stadtbote/popups/tasks_popups/take_photos_popup.dart';
|
||||
import 'package:stadtbote/tools/constants.dart';
|
||||
|
||||
import '../main.dart';
|
||||
import '../model/task_info.dart';
|
||||
@@ -105,11 +106,11 @@ class _TaskListPageState extends State<TaskListPage> {
|
||||
children: [
|
||||
Positioned(
|
||||
left: 16.5,
|
||||
top: i == 0 ? 5 : 0,
|
||||
top: i == 0 ? 40 : 40,
|
||||
child: Container(
|
||||
height: i == widget.tour.tasks.length - 1 ? 1: 60,
|
||||
height: i == widget.tour.tasks.length - 1 ? 0 : 20,
|
||||
width: 6,
|
||||
color: Colors.green
|
||||
color: isTaskActive(i) ? Constants.colorPrimary : Constants.colorPrimaryOpaque,
|
||||
),
|
||||
),
|
||||
Column(
|
||||
@@ -117,9 +118,9 @@ class _TaskListPageState extends State<TaskListPage> {
|
||||
Container(
|
||||
width: 40,
|
||||
height: 40,
|
||||
decoration: const BoxDecoration(
|
||||
decoration: BoxDecoration(
|
||||
shape: BoxShape.circle,
|
||||
color: Colors.grey,
|
||||
color: isTaskActive(i) ? Constants.colorPrimary : Constants.colorPrimaryOpaque,
|
||||
),
|
||||
child: const Icon(Icons.check, size: 30.0, color: Colors.white),
|
||||
),
|
||||
@@ -130,7 +131,7 @@ class _TaskListPageState extends State<TaskListPage> {
|
||||
const SizedBox(width: 20),
|
||||
Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
taskInfo.task.topic,
|
||||
@@ -142,7 +143,7 @@ class _TaskListPageState extends State<TaskListPage> {
|
||||
),
|
||||
const SizedBox(height: 5),
|
||||
Text(
|
||||
taskInfo.additionalText ?? 'Additonal text',
|
||||
taskInfo.additionalText ?? '',
|
||||
textAlign: TextAlign.left,
|
||||
style: const TextStyle(
|
||||
color: Colors.blue,
|
||||
@@ -169,12 +170,14 @@ class _TaskListPageState extends State<TaskListPage> {
|
||||
|
||||
for(var task in widget.tour.tasks) {
|
||||
var taskInfo = await MyApp.isarInstance.taskInfos.filter().sIdEqualTo(task.sId).findFirst();
|
||||
taskInfo ??= TaskInfo();
|
||||
if (taskInfo == null) {
|
||||
taskInfo = TaskInfo();
|
||||
taskInfo.answer = null;
|
||||
taskInfo.additionalText = null;
|
||||
taskInfo.completed = task.opt as bool;
|
||||
}
|
||||
|
||||
taskInfo.task = task;
|
||||
|
||||
taskInfo.answer = null;
|
||||
taskInfo.additionalText = null;
|
||||
|
||||
taskList.add(taskInfo);
|
||||
}
|
||||
|
||||
@@ -225,6 +228,7 @@ class _TaskListPageState extends State<TaskListPage> {
|
||||
DateFormat dateFormat = DateFormat("dd.MM.yyyy HH:mm");
|
||||
|
||||
taskInfo.additionalText = dateFormat.format(DateTime.now());
|
||||
taskInfo.completed = true;
|
||||
|
||||
setState(() {});
|
||||
}
|
||||
@@ -239,6 +243,7 @@ class _TaskListPageState extends State<TaskListPage> {
|
||||
_popup.dismiss(context);
|
||||
|
||||
taskInfo.additionalText = comissionNumber;
|
||||
taskInfo.completed = true;
|
||||
|
||||
setState(() {});
|
||||
}
|
||||
@@ -253,16 +258,26 @@ class _TaskListPageState extends State<TaskListPage> {
|
||||
_popup.dismiss(context);
|
||||
|
||||
taskInfo.additionalText = "Barcodes gescannt";
|
||||
taskInfo.completed = true;
|
||||
|
||||
setState(() {});
|
||||
}
|
||||
|
||||
void _processTakePhotos(TaskInfo taskInfo) {
|
||||
_processTakePhotos(TaskInfo taskInfo) {
|
||||
_popup = showTakePhotosPopup(context, taskInfo, () => {
|
||||
_popup.dismiss(context)
|
||||
_finishProcessTakePhotos(taskInfo)
|
||||
});
|
||||
}
|
||||
|
||||
_finishProcessTakePhotos(TaskInfo taskInfo) {
|
||||
_popup.dismiss(context);
|
||||
|
||||
taskInfo.additionalText = "Fotos aufgenommen";
|
||||
taskInfo.completed = true;
|
||||
|
||||
setState(() {});
|
||||
}
|
||||
|
||||
void _processStationNotice(TaskInfo taskInfo) {
|
||||
_popup = showStationNoticePopup(context, taskInfo, (notice) => {
|
||||
_finishProcessStationNotice(taskInfo, notice)
|
||||
@@ -273,6 +288,7 @@ class _TaskListPageState extends State<TaskListPage> {
|
||||
_popup.dismiss(context);
|
||||
|
||||
taskInfo.additionalText = notice;
|
||||
taskInfo.completed = true;
|
||||
|
||||
setState(() {});
|
||||
}
|
||||
@@ -287,6 +303,7 @@ class _TaskListPageState extends State<TaskListPage> {
|
||||
_popup.dismiss(context);
|
||||
|
||||
taskInfo.additionalText = receiptGiver;
|
||||
taskInfo.completed = true;
|
||||
|
||||
setState(() {});
|
||||
}
|
||||
@@ -298,8 +315,20 @@ class _TaskListPageState extends State<TaskListPage> {
|
||||
_popup = showSignaturePopup(context, taskInfo, () => {
|
||||
_popup.dismiss(context),
|
||||
|
||||
SystemChrome.setPreferredOrientations([DeviceOrientation.portraitUp])
|
||||
taskInfo.completed = true,
|
||||
|
||||
SystemChrome.setPreferredOrientations([DeviceOrientation.portraitUp])
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
bool isTaskActive(int index) {
|
||||
for (int i = 0; i < index; i++) {
|
||||
var taskInfo = _taskList[i];
|
||||
|
||||
if (!taskInfo.completed) return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
+7
-5
@@ -92,7 +92,7 @@ class _MainState extends State<Main> {
|
||||
WidgetsBinding.instance.addPostFrameCallback((_) async {
|
||||
_initMessages();
|
||||
|
||||
_currentContent = const MainPage();
|
||||
_currentContent = MainPage();
|
||||
|
||||
var headerInfo = await _currentContent.getHeaderInfo(context);
|
||||
_currentTitleWidget = headerInfo.titleWidget;
|
||||
@@ -152,8 +152,8 @@ class _MainState extends State<Main> {
|
||||
Visibility(
|
||||
visible: _leftButtonVisible,
|
||||
child: Container(
|
||||
width: 40,
|
||||
height: 40,
|
||||
width: 60,
|
||||
height: 60,
|
||||
decoration: const BoxDecoration(
|
||||
shape: BoxShape.circle,
|
||||
color: Colors.white,
|
||||
@@ -165,6 +165,7 @@ class _MainState extends State<Main> {
|
||||
},
|
||||
child: CircleAvatar(
|
||||
radius: 15,
|
||||
backgroundColor: Constants.colorPrimary,
|
||||
child: Padding(padding: const EdgeInsets.all(1.0), child: _leftIconButton),
|
||||
),
|
||||
),
|
||||
@@ -174,8 +175,8 @@ class _MainState extends State<Main> {
|
||||
Visibility(
|
||||
visible: _rightButtonVisible,
|
||||
child: Container(
|
||||
width: 40,
|
||||
height: 40,
|
||||
width: 60,
|
||||
height: 60,
|
||||
decoration: const BoxDecoration(
|
||||
shape: BoxShape.circle,
|
||||
color: Colors.red,
|
||||
@@ -186,6 +187,7 @@ class _MainState extends State<Main> {
|
||||
_rightButtonOnPressed();
|
||||
},
|
||||
child: CircleAvatar(
|
||||
backgroundColor: Constants.colorPrimary,
|
||||
radius: 15,
|
||||
child: Padding(padding: const EdgeInsets.all(1.0), child: _rightIconButton),
|
||||
),
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
import 'package:isar/isar.dart';
|
||||
import 'package:json_annotation/json_annotation.dart';
|
||||
import 'package:stadtbote/tools/util.dart';
|
||||
|
||||
part 'start_session_message.g.dart';
|
||||
|
||||
@JsonSerializable()
|
||||
class StartSessionMessage {
|
||||
Id get isarId => Util.fastHash(messageId);
|
||||
|
||||
late String recv;
|
||||
|
||||
late bool store;
|
||||
|
||||
late String messageId;
|
||||
|
||||
late Payload payload;
|
||||
|
||||
StartSessionMessage();
|
||||
|
||||
factory StartSessionMessage.fromJson(Map<String, dynamic> json) => _$StartSessionMessageFromJson(json);
|
||||
|
||||
Map<String, dynamic> toJson() => _$StartSessionMessageToJson(this);
|
||||
}
|
||||
|
||||
@JsonSerializable()
|
||||
class Payload {
|
||||
@JsonKey(name:'start_session')
|
||||
late String startSession;
|
||||
|
||||
Payload();
|
||||
|
||||
factory Payload.fromJson(Map<String, dynamic> json) => _$PayloadFromJson(json);
|
||||
|
||||
Map<String, dynamic> toJson() => _$PayloadToJson(this);
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'start_session_message.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
StartSessionMessage _$StartSessionMessageFromJson(Map<String, dynamic> json) =>
|
||||
StartSessionMessage()
|
||||
..recv = json['recv'] as String
|
||||
..store = json['store'] as bool
|
||||
..messageId = json['messageId'] as String
|
||||
..payload = Payload.fromJson(json['payload'] as Map<String, dynamic>);
|
||||
|
||||
Map<String, dynamic> _$StartSessionMessageToJson(
|
||||
StartSessionMessage instance) =>
|
||||
<String, dynamic>{
|
||||
'recv': instance.recv,
|
||||
'store': instance.store,
|
||||
'messageId': instance.messageId,
|
||||
'payload': instance.payload,
|
||||
};
|
||||
|
||||
Payload _$PayloadFromJson(Map<String, dynamic> json) =>
|
||||
Payload()..startSession = json['start_session'] as String;
|
||||
|
||||
Map<String, dynamic> _$PayloadToJson(Payload instance) => <String, dynamic>{
|
||||
'start_session': instance.startSession,
|
||||
};
|
||||
@@ -9,21 +9,21 @@ class Status {
|
||||
final Id id = 0;
|
||||
|
||||
@JsonKey(name: 'cust_id')
|
||||
int? custId;
|
||||
late int custId;
|
||||
@JsonKey(name: 'hq_id')
|
||||
int? hqId;
|
||||
late int hqId;
|
||||
@JsonKey(name: 'usr_id')
|
||||
int? usrId;
|
||||
late int usrId;
|
||||
@JsonKey(name: 'cr_id')
|
||||
int? crId;
|
||||
late int crId;
|
||||
@JsonKey(name: 'sid')
|
||||
String? sid;
|
||||
late String sid;
|
||||
@JsonKey(name: 'vht_id')
|
||||
int? vhtId;
|
||||
late int vhtId;
|
||||
@JsonKey(name: 'loc_zip')
|
||||
String? locZip;
|
||||
late String locZip;
|
||||
|
||||
Status({this.hqId, this.usrId, this.crId, this.sid, this.vhtId, this.locZip, this.custId});
|
||||
Status();
|
||||
|
||||
factory Status.fromJson(Map<String, dynamic> json) => _$StatusFromJson(json);
|
||||
|
||||
|
||||
+67
-192
@@ -73,18 +73,8 @@ int _statusEstimateSize(
|
||||
Map<Type, List<int>> allOffsets,
|
||||
) {
|
||||
var bytesCount = offsets.last;
|
||||
{
|
||||
final value = object.locZip;
|
||||
if (value != null) {
|
||||
bytesCount += 3 + value.length * 3;
|
||||
}
|
||||
}
|
||||
{
|
||||
final value = object.sid;
|
||||
if (value != null) {
|
||||
bytesCount += 3 + value.length * 3;
|
||||
}
|
||||
}
|
||||
bytesCount += 3 + object.locZip.length * 3;
|
||||
bytesCount += 3 + object.sid.length * 3;
|
||||
return bytesCount;
|
||||
}
|
||||
|
||||
@@ -109,15 +99,14 @@ Status _statusDeserialize(
|
||||
List<int> offsets,
|
||||
Map<Type, List<int>> allOffsets,
|
||||
) {
|
||||
final object = Status(
|
||||
crId: reader.readLongOrNull(offsets[0]),
|
||||
custId: reader.readLongOrNull(offsets[1]),
|
||||
hqId: reader.readLongOrNull(offsets[2]),
|
||||
locZip: reader.readStringOrNull(offsets[3]),
|
||||
sid: reader.readStringOrNull(offsets[4]),
|
||||
usrId: reader.readLongOrNull(offsets[5]),
|
||||
vhtId: reader.readLongOrNull(offsets[6]),
|
||||
);
|
||||
final object = Status();
|
||||
object.crId = reader.readLong(offsets[0]);
|
||||
object.custId = reader.readLong(offsets[1]);
|
||||
object.hqId = reader.readLong(offsets[2]);
|
||||
object.locZip = reader.readString(offsets[3]);
|
||||
object.sid = reader.readString(offsets[4]);
|
||||
object.usrId = reader.readLong(offsets[5]);
|
||||
object.vhtId = reader.readLong(offsets[6]);
|
||||
return object;
|
||||
}
|
||||
|
||||
@@ -129,19 +118,19 @@ P _statusDeserializeProp<P>(
|
||||
) {
|
||||
switch (propertyId) {
|
||||
case 0:
|
||||
return (reader.readLongOrNull(offset)) as P;
|
||||
return (reader.readLong(offset)) as P;
|
||||
case 1:
|
||||
return (reader.readLongOrNull(offset)) as P;
|
||||
return (reader.readLong(offset)) as P;
|
||||
case 2:
|
||||
return (reader.readLongOrNull(offset)) as P;
|
||||
return (reader.readLong(offset)) as P;
|
||||
case 3:
|
||||
return (reader.readStringOrNull(offset)) as P;
|
||||
return (reader.readString(offset)) as P;
|
||||
case 4:
|
||||
return (reader.readStringOrNull(offset)) as P;
|
||||
return (reader.readString(offset)) as P;
|
||||
case 5:
|
||||
return (reader.readLongOrNull(offset)) as P;
|
||||
return (reader.readLong(offset)) as P;
|
||||
case 6:
|
||||
return (reader.readLongOrNull(offset)) as P;
|
||||
return (reader.readLong(offset)) as P;
|
||||
default:
|
||||
throw IsarError('Unknown property with id $propertyId');
|
||||
}
|
||||
@@ -233,23 +222,7 @@ extension StatusQueryWhere on QueryBuilder<Status, Status, QWhereClause> {
|
||||
}
|
||||
|
||||
extension StatusQueryFilter on QueryBuilder<Status, Status, QFilterCondition> {
|
||||
QueryBuilder<Status, Status, QAfterFilterCondition> crIdIsNull() {
|
||||
return QueryBuilder.apply(this, (query) {
|
||||
return query.addFilterCondition(const FilterCondition.isNull(
|
||||
property: r'crId',
|
||||
));
|
||||
});
|
||||
}
|
||||
|
||||
QueryBuilder<Status, Status, QAfterFilterCondition> crIdIsNotNull() {
|
||||
return QueryBuilder.apply(this, (query) {
|
||||
return query.addFilterCondition(const FilterCondition.isNotNull(
|
||||
property: r'crId',
|
||||
));
|
||||
});
|
||||
}
|
||||
|
||||
QueryBuilder<Status, Status, QAfterFilterCondition> crIdEqualTo(int? value) {
|
||||
QueryBuilder<Status, Status, QAfterFilterCondition> crIdEqualTo(int value) {
|
||||
return QueryBuilder.apply(this, (query) {
|
||||
return query.addFilterCondition(FilterCondition.equalTo(
|
||||
property: r'crId',
|
||||
@@ -259,7 +232,7 @@ extension StatusQueryFilter on QueryBuilder<Status, Status, QFilterCondition> {
|
||||
}
|
||||
|
||||
QueryBuilder<Status, Status, QAfterFilterCondition> crIdGreaterThan(
|
||||
int? value, {
|
||||
int value, {
|
||||
bool include = false,
|
||||
}) {
|
||||
return QueryBuilder.apply(this, (query) {
|
||||
@@ -272,7 +245,7 @@ extension StatusQueryFilter on QueryBuilder<Status, Status, QFilterCondition> {
|
||||
}
|
||||
|
||||
QueryBuilder<Status, Status, QAfterFilterCondition> crIdLessThan(
|
||||
int? value, {
|
||||
int value, {
|
||||
bool include = false,
|
||||
}) {
|
||||
return QueryBuilder.apply(this, (query) {
|
||||
@@ -285,8 +258,8 @@ extension StatusQueryFilter on QueryBuilder<Status, Status, QFilterCondition> {
|
||||
}
|
||||
|
||||
QueryBuilder<Status, Status, QAfterFilterCondition> crIdBetween(
|
||||
int? lower,
|
||||
int? upper, {
|
||||
int lower,
|
||||
int upper, {
|
||||
bool includeLower = true,
|
||||
bool includeUpper = true,
|
||||
}) {
|
||||
@@ -301,24 +274,7 @@ extension StatusQueryFilter on QueryBuilder<Status, Status, QFilterCondition> {
|
||||
});
|
||||
}
|
||||
|
||||
QueryBuilder<Status, Status, QAfterFilterCondition> custIdIsNull() {
|
||||
return QueryBuilder.apply(this, (query) {
|
||||
return query.addFilterCondition(const FilterCondition.isNull(
|
||||
property: r'custId',
|
||||
));
|
||||
});
|
||||
}
|
||||
|
||||
QueryBuilder<Status, Status, QAfterFilterCondition> custIdIsNotNull() {
|
||||
return QueryBuilder.apply(this, (query) {
|
||||
return query.addFilterCondition(const FilterCondition.isNotNull(
|
||||
property: r'custId',
|
||||
));
|
||||
});
|
||||
}
|
||||
|
||||
QueryBuilder<Status, Status, QAfterFilterCondition> custIdEqualTo(
|
||||
int? value) {
|
||||
QueryBuilder<Status, Status, QAfterFilterCondition> custIdEqualTo(int value) {
|
||||
return QueryBuilder.apply(this, (query) {
|
||||
return query.addFilterCondition(FilterCondition.equalTo(
|
||||
property: r'custId',
|
||||
@@ -328,7 +284,7 @@ extension StatusQueryFilter on QueryBuilder<Status, Status, QFilterCondition> {
|
||||
}
|
||||
|
||||
QueryBuilder<Status, Status, QAfterFilterCondition> custIdGreaterThan(
|
||||
int? value, {
|
||||
int value, {
|
||||
bool include = false,
|
||||
}) {
|
||||
return QueryBuilder.apply(this, (query) {
|
||||
@@ -341,7 +297,7 @@ extension StatusQueryFilter on QueryBuilder<Status, Status, QFilterCondition> {
|
||||
}
|
||||
|
||||
QueryBuilder<Status, Status, QAfterFilterCondition> custIdLessThan(
|
||||
int? value, {
|
||||
int value, {
|
||||
bool include = false,
|
||||
}) {
|
||||
return QueryBuilder.apply(this, (query) {
|
||||
@@ -354,8 +310,8 @@ extension StatusQueryFilter on QueryBuilder<Status, Status, QFilterCondition> {
|
||||
}
|
||||
|
||||
QueryBuilder<Status, Status, QAfterFilterCondition> custIdBetween(
|
||||
int? lower,
|
||||
int? upper, {
|
||||
int lower,
|
||||
int upper, {
|
||||
bool includeLower = true,
|
||||
bool includeUpper = true,
|
||||
}) {
|
||||
@@ -370,23 +326,7 @@ extension StatusQueryFilter on QueryBuilder<Status, Status, QFilterCondition> {
|
||||
});
|
||||
}
|
||||
|
||||
QueryBuilder<Status, Status, QAfterFilterCondition> hqIdIsNull() {
|
||||
return QueryBuilder.apply(this, (query) {
|
||||
return query.addFilterCondition(const FilterCondition.isNull(
|
||||
property: r'hqId',
|
||||
));
|
||||
});
|
||||
}
|
||||
|
||||
QueryBuilder<Status, Status, QAfterFilterCondition> hqIdIsNotNull() {
|
||||
return QueryBuilder.apply(this, (query) {
|
||||
return query.addFilterCondition(const FilterCondition.isNotNull(
|
||||
property: r'hqId',
|
||||
));
|
||||
});
|
||||
}
|
||||
|
||||
QueryBuilder<Status, Status, QAfterFilterCondition> hqIdEqualTo(int? value) {
|
||||
QueryBuilder<Status, Status, QAfterFilterCondition> hqIdEqualTo(int value) {
|
||||
return QueryBuilder.apply(this, (query) {
|
||||
return query.addFilterCondition(FilterCondition.equalTo(
|
||||
property: r'hqId',
|
||||
@@ -396,7 +336,7 @@ extension StatusQueryFilter on QueryBuilder<Status, Status, QFilterCondition> {
|
||||
}
|
||||
|
||||
QueryBuilder<Status, Status, QAfterFilterCondition> hqIdGreaterThan(
|
||||
int? value, {
|
||||
int value, {
|
||||
bool include = false,
|
||||
}) {
|
||||
return QueryBuilder.apply(this, (query) {
|
||||
@@ -409,7 +349,7 @@ extension StatusQueryFilter on QueryBuilder<Status, Status, QFilterCondition> {
|
||||
}
|
||||
|
||||
QueryBuilder<Status, Status, QAfterFilterCondition> hqIdLessThan(
|
||||
int? value, {
|
||||
int value, {
|
||||
bool include = false,
|
||||
}) {
|
||||
return QueryBuilder.apply(this, (query) {
|
||||
@@ -422,8 +362,8 @@ extension StatusQueryFilter on QueryBuilder<Status, Status, QFilterCondition> {
|
||||
}
|
||||
|
||||
QueryBuilder<Status, Status, QAfterFilterCondition> hqIdBetween(
|
||||
int? lower,
|
||||
int? upper, {
|
||||
int lower,
|
||||
int upper, {
|
||||
bool includeLower = true,
|
||||
bool includeUpper = true,
|
||||
}) {
|
||||
@@ -490,24 +430,8 @@ extension StatusQueryFilter on QueryBuilder<Status, Status, QFilterCondition> {
|
||||
});
|
||||
}
|
||||
|
||||
QueryBuilder<Status, Status, QAfterFilterCondition> locZipIsNull() {
|
||||
return QueryBuilder.apply(this, (query) {
|
||||
return query.addFilterCondition(const FilterCondition.isNull(
|
||||
property: r'locZip',
|
||||
));
|
||||
});
|
||||
}
|
||||
|
||||
QueryBuilder<Status, Status, QAfterFilterCondition> locZipIsNotNull() {
|
||||
return QueryBuilder.apply(this, (query) {
|
||||
return query.addFilterCondition(const FilterCondition.isNotNull(
|
||||
property: r'locZip',
|
||||
));
|
||||
});
|
||||
}
|
||||
|
||||
QueryBuilder<Status, Status, QAfterFilterCondition> locZipEqualTo(
|
||||
String? value, {
|
||||
String value, {
|
||||
bool caseSensitive = true,
|
||||
}) {
|
||||
return QueryBuilder.apply(this, (query) {
|
||||
@@ -520,7 +444,7 @@ extension StatusQueryFilter on QueryBuilder<Status, Status, QFilterCondition> {
|
||||
}
|
||||
|
||||
QueryBuilder<Status, Status, QAfterFilterCondition> locZipGreaterThan(
|
||||
String? value, {
|
||||
String value, {
|
||||
bool include = false,
|
||||
bool caseSensitive = true,
|
||||
}) {
|
||||
@@ -535,7 +459,7 @@ extension StatusQueryFilter on QueryBuilder<Status, Status, QFilterCondition> {
|
||||
}
|
||||
|
||||
QueryBuilder<Status, Status, QAfterFilterCondition> locZipLessThan(
|
||||
String? value, {
|
||||
String value, {
|
||||
bool include = false,
|
||||
bool caseSensitive = true,
|
||||
}) {
|
||||
@@ -550,8 +474,8 @@ extension StatusQueryFilter on QueryBuilder<Status, Status, QFilterCondition> {
|
||||
}
|
||||
|
||||
QueryBuilder<Status, Status, QAfterFilterCondition> locZipBetween(
|
||||
String? lower,
|
||||
String? upper, {
|
||||
String lower,
|
||||
String upper, {
|
||||
bool includeLower = true,
|
||||
bool includeUpper = true,
|
||||
bool caseSensitive = true,
|
||||
@@ -636,24 +560,8 @@ extension StatusQueryFilter on QueryBuilder<Status, Status, QFilterCondition> {
|
||||
});
|
||||
}
|
||||
|
||||
QueryBuilder<Status, Status, QAfterFilterCondition> sidIsNull() {
|
||||
return QueryBuilder.apply(this, (query) {
|
||||
return query.addFilterCondition(const FilterCondition.isNull(
|
||||
property: r'sid',
|
||||
));
|
||||
});
|
||||
}
|
||||
|
||||
QueryBuilder<Status, Status, QAfterFilterCondition> sidIsNotNull() {
|
||||
return QueryBuilder.apply(this, (query) {
|
||||
return query.addFilterCondition(const FilterCondition.isNotNull(
|
||||
property: r'sid',
|
||||
));
|
||||
});
|
||||
}
|
||||
|
||||
QueryBuilder<Status, Status, QAfterFilterCondition> sidEqualTo(
|
||||
String? value, {
|
||||
String value, {
|
||||
bool caseSensitive = true,
|
||||
}) {
|
||||
return QueryBuilder.apply(this, (query) {
|
||||
@@ -666,7 +574,7 @@ extension StatusQueryFilter on QueryBuilder<Status, Status, QFilterCondition> {
|
||||
}
|
||||
|
||||
QueryBuilder<Status, Status, QAfterFilterCondition> sidGreaterThan(
|
||||
String? value, {
|
||||
String value, {
|
||||
bool include = false,
|
||||
bool caseSensitive = true,
|
||||
}) {
|
||||
@@ -681,7 +589,7 @@ extension StatusQueryFilter on QueryBuilder<Status, Status, QFilterCondition> {
|
||||
}
|
||||
|
||||
QueryBuilder<Status, Status, QAfterFilterCondition> sidLessThan(
|
||||
String? value, {
|
||||
String value, {
|
||||
bool include = false,
|
||||
bool caseSensitive = true,
|
||||
}) {
|
||||
@@ -696,8 +604,8 @@ extension StatusQueryFilter on QueryBuilder<Status, Status, QFilterCondition> {
|
||||
}
|
||||
|
||||
QueryBuilder<Status, Status, QAfterFilterCondition> sidBetween(
|
||||
String? lower,
|
||||
String? upper, {
|
||||
String lower,
|
||||
String upper, {
|
||||
bool includeLower = true,
|
||||
bool includeUpper = true,
|
||||
bool caseSensitive = true,
|
||||
@@ -780,23 +688,7 @@ extension StatusQueryFilter on QueryBuilder<Status, Status, QFilterCondition> {
|
||||
});
|
||||
}
|
||||
|
||||
QueryBuilder<Status, Status, QAfterFilterCondition> usrIdIsNull() {
|
||||
return QueryBuilder.apply(this, (query) {
|
||||
return query.addFilterCondition(const FilterCondition.isNull(
|
||||
property: r'usrId',
|
||||
));
|
||||
});
|
||||
}
|
||||
|
||||
QueryBuilder<Status, Status, QAfterFilterCondition> usrIdIsNotNull() {
|
||||
return QueryBuilder.apply(this, (query) {
|
||||
return query.addFilterCondition(const FilterCondition.isNotNull(
|
||||
property: r'usrId',
|
||||
));
|
||||
});
|
||||
}
|
||||
|
||||
QueryBuilder<Status, Status, QAfterFilterCondition> usrIdEqualTo(int? value) {
|
||||
QueryBuilder<Status, Status, QAfterFilterCondition> usrIdEqualTo(int value) {
|
||||
return QueryBuilder.apply(this, (query) {
|
||||
return query.addFilterCondition(FilterCondition.equalTo(
|
||||
property: r'usrId',
|
||||
@@ -806,7 +698,7 @@ extension StatusQueryFilter on QueryBuilder<Status, Status, QFilterCondition> {
|
||||
}
|
||||
|
||||
QueryBuilder<Status, Status, QAfterFilterCondition> usrIdGreaterThan(
|
||||
int? value, {
|
||||
int value, {
|
||||
bool include = false,
|
||||
}) {
|
||||
return QueryBuilder.apply(this, (query) {
|
||||
@@ -819,7 +711,7 @@ extension StatusQueryFilter on QueryBuilder<Status, Status, QFilterCondition> {
|
||||
}
|
||||
|
||||
QueryBuilder<Status, Status, QAfterFilterCondition> usrIdLessThan(
|
||||
int? value, {
|
||||
int value, {
|
||||
bool include = false,
|
||||
}) {
|
||||
return QueryBuilder.apply(this, (query) {
|
||||
@@ -832,8 +724,8 @@ extension StatusQueryFilter on QueryBuilder<Status, Status, QFilterCondition> {
|
||||
}
|
||||
|
||||
QueryBuilder<Status, Status, QAfterFilterCondition> usrIdBetween(
|
||||
int? lower,
|
||||
int? upper, {
|
||||
int lower,
|
||||
int upper, {
|
||||
bool includeLower = true,
|
||||
bool includeUpper = true,
|
||||
}) {
|
||||
@@ -848,23 +740,7 @@ extension StatusQueryFilter on QueryBuilder<Status, Status, QFilterCondition> {
|
||||
});
|
||||
}
|
||||
|
||||
QueryBuilder<Status, Status, QAfterFilterCondition> vhtIdIsNull() {
|
||||
return QueryBuilder.apply(this, (query) {
|
||||
return query.addFilterCondition(const FilterCondition.isNull(
|
||||
property: r'vhtId',
|
||||
));
|
||||
});
|
||||
}
|
||||
|
||||
QueryBuilder<Status, Status, QAfterFilterCondition> vhtIdIsNotNull() {
|
||||
return QueryBuilder.apply(this, (query) {
|
||||
return query.addFilterCondition(const FilterCondition.isNotNull(
|
||||
property: r'vhtId',
|
||||
));
|
||||
});
|
||||
}
|
||||
|
||||
QueryBuilder<Status, Status, QAfterFilterCondition> vhtIdEqualTo(int? value) {
|
||||
QueryBuilder<Status, Status, QAfterFilterCondition> vhtIdEqualTo(int value) {
|
||||
return QueryBuilder.apply(this, (query) {
|
||||
return query.addFilterCondition(FilterCondition.equalTo(
|
||||
property: r'vhtId',
|
||||
@@ -874,7 +750,7 @@ extension StatusQueryFilter on QueryBuilder<Status, Status, QFilterCondition> {
|
||||
}
|
||||
|
||||
QueryBuilder<Status, Status, QAfterFilterCondition> vhtIdGreaterThan(
|
||||
int? value, {
|
||||
int value, {
|
||||
bool include = false,
|
||||
}) {
|
||||
return QueryBuilder.apply(this, (query) {
|
||||
@@ -887,7 +763,7 @@ extension StatusQueryFilter on QueryBuilder<Status, Status, QFilterCondition> {
|
||||
}
|
||||
|
||||
QueryBuilder<Status, Status, QAfterFilterCondition> vhtIdLessThan(
|
||||
int? value, {
|
||||
int value, {
|
||||
bool include = false,
|
||||
}) {
|
||||
return QueryBuilder.apply(this, (query) {
|
||||
@@ -900,8 +776,8 @@ extension StatusQueryFilter on QueryBuilder<Status, Status, QFilterCondition> {
|
||||
}
|
||||
|
||||
QueryBuilder<Status, Status, QAfterFilterCondition> vhtIdBetween(
|
||||
int? lower,
|
||||
int? upper, {
|
||||
int lower,
|
||||
int upper, {
|
||||
bool includeLower = true,
|
||||
bool includeUpper = true,
|
||||
}) {
|
||||
@@ -1158,43 +1034,43 @@ extension StatusQueryProperty on QueryBuilder<Status, Status, QQueryProperty> {
|
||||
});
|
||||
}
|
||||
|
||||
QueryBuilder<Status, int?, QQueryOperations> crIdProperty() {
|
||||
QueryBuilder<Status, int, QQueryOperations> crIdProperty() {
|
||||
return QueryBuilder.apply(this, (query) {
|
||||
return query.addPropertyName(r'crId');
|
||||
});
|
||||
}
|
||||
|
||||
QueryBuilder<Status, int?, QQueryOperations> custIdProperty() {
|
||||
QueryBuilder<Status, int, QQueryOperations> custIdProperty() {
|
||||
return QueryBuilder.apply(this, (query) {
|
||||
return query.addPropertyName(r'custId');
|
||||
});
|
||||
}
|
||||
|
||||
QueryBuilder<Status, int?, QQueryOperations> hqIdProperty() {
|
||||
QueryBuilder<Status, int, QQueryOperations> hqIdProperty() {
|
||||
return QueryBuilder.apply(this, (query) {
|
||||
return query.addPropertyName(r'hqId');
|
||||
});
|
||||
}
|
||||
|
||||
QueryBuilder<Status, String?, QQueryOperations> locZipProperty() {
|
||||
QueryBuilder<Status, String, QQueryOperations> locZipProperty() {
|
||||
return QueryBuilder.apply(this, (query) {
|
||||
return query.addPropertyName(r'locZip');
|
||||
});
|
||||
}
|
||||
|
||||
QueryBuilder<Status, String?, QQueryOperations> sidProperty() {
|
||||
QueryBuilder<Status, String, QQueryOperations> sidProperty() {
|
||||
return QueryBuilder.apply(this, (query) {
|
||||
return query.addPropertyName(r'sid');
|
||||
});
|
||||
}
|
||||
|
||||
QueryBuilder<Status, int?, QQueryOperations> usrIdProperty() {
|
||||
QueryBuilder<Status, int, QQueryOperations> usrIdProperty() {
|
||||
return QueryBuilder.apply(this, (query) {
|
||||
return query.addPropertyName(r'usrId');
|
||||
});
|
||||
}
|
||||
|
||||
QueryBuilder<Status, int?, QQueryOperations> vhtIdProperty() {
|
||||
QueryBuilder<Status, int, QQueryOperations> vhtIdProperty() {
|
||||
return QueryBuilder.apply(this, (query) {
|
||||
return query.addPropertyName(r'vhtId');
|
||||
});
|
||||
@@ -1205,15 +1081,14 @@ extension StatusQueryProperty on QueryBuilder<Status, Status, QQueryProperty> {
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
Status _$StatusFromJson(Map<String, dynamic> json) => Status(
|
||||
hqId: json['hq_id'] as int?,
|
||||
usrId: json['usr_id'] as int?,
|
||||
crId: json['cr_id'] as int?,
|
||||
sid: json['sid'] as String?,
|
||||
vhtId: json['vht_id'] as int?,
|
||||
locZip: json['loc_zip'] as String?,
|
||||
custId: json['cust_id'] as int?,
|
||||
);
|
||||
Status _$StatusFromJson(Map<String, dynamic> json) => Status()
|
||||
..custId = json['cust_id'] as int
|
||||
..hqId = json['hq_id'] as int
|
||||
..usrId = json['usr_id'] as int
|
||||
..crId = json['cr_id'] as int
|
||||
..sid = json['sid'] as String
|
||||
..vhtId = json['vht_id'] as int
|
||||
..locZip = json['loc_zip'] as String;
|
||||
|
||||
Map<String, dynamic> _$StatusToJson(Status instance) => <String, dynamic>{
|
||||
'cust_id': instance.custId,
|
||||
|
||||
@@ -13,6 +13,8 @@ class TaskInfo {
|
||||
|
||||
late String? answer;
|
||||
|
||||
late bool completed;
|
||||
|
||||
@ignore
|
||||
late TourTask task;
|
||||
|
||||
|
||||
@@ -27,8 +27,13 @@ const TaskInfoSchema = CollectionSchema(
|
||||
name: r'answer',
|
||||
type: IsarType.string,
|
||||
),
|
||||
r'sId': PropertySchema(
|
||||
r'completed': PropertySchema(
|
||||
id: 2,
|
||||
name: r'completed',
|
||||
type: IsarType.bool,
|
||||
),
|
||||
r'sId': PropertySchema(
|
||||
id: 3,
|
||||
name: r'sId',
|
||||
type: IsarType.long,
|
||||
)
|
||||
@@ -76,7 +81,8 @@ void _taskInfoSerialize(
|
||||
) {
|
||||
writer.writeString(offsets[0], object.additionalText);
|
||||
writer.writeString(offsets[1], object.answer);
|
||||
writer.writeLong(offsets[2], object.sId);
|
||||
writer.writeBool(offsets[2], object.completed);
|
||||
writer.writeLong(offsets[3], object.sId);
|
||||
}
|
||||
|
||||
TaskInfo _taskInfoDeserialize(
|
||||
@@ -88,8 +94,9 @@ TaskInfo _taskInfoDeserialize(
|
||||
final object = TaskInfo();
|
||||
object.additionalText = reader.readStringOrNull(offsets[0]);
|
||||
object.answer = reader.readStringOrNull(offsets[1]);
|
||||
object.completed = reader.readBool(offsets[2]);
|
||||
object.id = id;
|
||||
object.sId = reader.readLong(offsets[2]);
|
||||
object.sId = reader.readLong(offsets[3]);
|
||||
return object;
|
||||
}
|
||||
|
||||
@@ -105,6 +112,8 @@ P _taskInfoDeserializeProp<P>(
|
||||
case 1:
|
||||
return (reader.readStringOrNull(offset)) as P;
|
||||
case 2:
|
||||
return (reader.readBool(offset)) as P;
|
||||
case 3:
|
||||
return (reader.readLong(offset)) as P;
|
||||
default:
|
||||
throw IsarError('Unknown property with id $propertyId');
|
||||
@@ -499,6 +508,16 @@ extension TaskInfoQueryFilter
|
||||
});
|
||||
}
|
||||
|
||||
QueryBuilder<TaskInfo, TaskInfo, QAfterFilterCondition> completedEqualTo(
|
||||
bool value) {
|
||||
return QueryBuilder.apply(this, (query) {
|
||||
return query.addFilterCondition(FilterCondition.equalTo(
|
||||
property: r'completed',
|
||||
value: value,
|
||||
));
|
||||
});
|
||||
}
|
||||
|
||||
QueryBuilder<TaskInfo, TaskInfo, QAfterFilterCondition> idEqualTo(Id value) {
|
||||
return QueryBuilder.apply(this, (query) {
|
||||
return query.addFilterCondition(FilterCondition.equalTo(
|
||||
@@ -636,6 +655,18 @@ extension TaskInfoQuerySortBy on QueryBuilder<TaskInfo, TaskInfo, QSortBy> {
|
||||
});
|
||||
}
|
||||
|
||||
QueryBuilder<TaskInfo, TaskInfo, QAfterSortBy> sortByCompleted() {
|
||||
return QueryBuilder.apply(this, (query) {
|
||||
return query.addSortBy(r'completed', Sort.asc);
|
||||
});
|
||||
}
|
||||
|
||||
QueryBuilder<TaskInfo, TaskInfo, QAfterSortBy> sortByCompletedDesc() {
|
||||
return QueryBuilder.apply(this, (query) {
|
||||
return query.addSortBy(r'completed', Sort.desc);
|
||||
});
|
||||
}
|
||||
|
||||
QueryBuilder<TaskInfo, TaskInfo, QAfterSortBy> sortBySId() {
|
||||
return QueryBuilder.apply(this, (query) {
|
||||
return query.addSortBy(r'sId', Sort.asc);
|
||||
@@ -675,6 +706,18 @@ extension TaskInfoQuerySortThenBy
|
||||
});
|
||||
}
|
||||
|
||||
QueryBuilder<TaskInfo, TaskInfo, QAfterSortBy> thenByCompleted() {
|
||||
return QueryBuilder.apply(this, (query) {
|
||||
return query.addSortBy(r'completed', Sort.asc);
|
||||
});
|
||||
}
|
||||
|
||||
QueryBuilder<TaskInfo, TaskInfo, QAfterSortBy> thenByCompletedDesc() {
|
||||
return QueryBuilder.apply(this, (query) {
|
||||
return query.addSortBy(r'completed', Sort.desc);
|
||||
});
|
||||
}
|
||||
|
||||
QueryBuilder<TaskInfo, TaskInfo, QAfterSortBy> thenById() {
|
||||
return QueryBuilder.apply(this, (query) {
|
||||
return query.addSortBy(r'id', Sort.asc);
|
||||
@@ -717,6 +760,12 @@ extension TaskInfoQueryWhereDistinct
|
||||
});
|
||||
}
|
||||
|
||||
QueryBuilder<TaskInfo, TaskInfo, QDistinct> distinctByCompleted() {
|
||||
return QueryBuilder.apply(this, (query) {
|
||||
return query.addDistinctBy(r'completed');
|
||||
});
|
||||
}
|
||||
|
||||
QueryBuilder<TaskInfo, TaskInfo, QDistinct> distinctBySId() {
|
||||
return QueryBuilder.apply(this, (query) {
|
||||
return query.addDistinctBy(r'sId');
|
||||
@@ -744,6 +793,12 @@ extension TaskInfoQueryProperty
|
||||
});
|
||||
}
|
||||
|
||||
QueryBuilder<TaskInfo, bool, QQueryOperations> completedProperty() {
|
||||
return QueryBuilder.apply(this, (query) {
|
||||
return query.addPropertyName(r'completed');
|
||||
});
|
||||
}
|
||||
|
||||
QueryBuilder<TaskInfo, int, QQueryOperations> sIdProperty() {
|
||||
return QueryBuilder.apply(this, (query) {
|
||||
return query.addPropertyName(r'sId');
|
||||
|
||||
@@ -138,8 +138,8 @@ TourTask _tourTaskDeserialize(
|
||||
object.max = reader.readLongOrNull(offsets[0]);
|
||||
object.maxLen = reader.readLongOrNull(offsets[1]);
|
||||
object.min = reader.readLongOrNull(offsets[2]);
|
||||
object.opt = reader.readBoolOrNull(offsets[3]);
|
||||
object.reenter = reader.readBoolOrNull(offsets[4]);
|
||||
object.opt = reader.readBool(offsets[3]);
|
||||
object.reenter = reader.readBool(offsets[4]);
|
||||
object.rt = reader.readBoolOrNull(offsets[5]);
|
||||
object.sId = reader.readLong(offsets[6]);
|
||||
object.taskArrival = reader.readLongOrNull(offsets[7]);
|
||||
@@ -165,9 +165,9 @@ P _tourTaskDeserializeProp<P>(
|
||||
case 2:
|
||||
return (reader.readLongOrNull(offset)) as P;
|
||||
case 3:
|
||||
return (reader.readBoolOrNull(offset)) as P;
|
||||
return (reader.readBool(offset)) as P;
|
||||
case 4:
|
||||
return (reader.readBoolOrNull(offset)) as P;
|
||||
return (reader.readBool(offset)) as P;
|
||||
case 5:
|
||||
return (reader.readBoolOrNull(offset)) as P;
|
||||
case 6:
|
||||
@@ -398,24 +398,8 @@ extension TourTaskQueryFilter
|
||||
});
|
||||
}
|
||||
|
||||
QueryBuilder<TourTask, TourTask, QAfterFilterCondition> optIsNull() {
|
||||
return QueryBuilder.apply(this, (query) {
|
||||
return query.addFilterCondition(const FilterCondition.isNull(
|
||||
property: r'opt',
|
||||
));
|
||||
});
|
||||
}
|
||||
|
||||
QueryBuilder<TourTask, TourTask, QAfterFilterCondition> optIsNotNull() {
|
||||
return QueryBuilder.apply(this, (query) {
|
||||
return query.addFilterCondition(const FilterCondition.isNotNull(
|
||||
property: r'opt',
|
||||
));
|
||||
});
|
||||
}
|
||||
|
||||
QueryBuilder<TourTask, TourTask, QAfterFilterCondition> optEqualTo(
|
||||
bool? value) {
|
||||
bool value) {
|
||||
return QueryBuilder.apply(this, (query) {
|
||||
return query.addFilterCondition(FilterCondition.equalTo(
|
||||
property: r'opt',
|
||||
@@ -424,24 +408,8 @@ extension TourTaskQueryFilter
|
||||
});
|
||||
}
|
||||
|
||||
QueryBuilder<TourTask, TourTask, QAfterFilterCondition> reenterIsNull() {
|
||||
return QueryBuilder.apply(this, (query) {
|
||||
return query.addFilterCondition(const FilterCondition.isNull(
|
||||
property: r'reenter',
|
||||
));
|
||||
});
|
||||
}
|
||||
|
||||
QueryBuilder<TourTask, TourTask, QAfterFilterCondition> reenterIsNotNull() {
|
||||
return QueryBuilder.apply(this, (query) {
|
||||
return query.addFilterCondition(const FilterCondition.isNotNull(
|
||||
property: r'reenter',
|
||||
));
|
||||
});
|
||||
}
|
||||
|
||||
QueryBuilder<TourTask, TourTask, QAfterFilterCondition> reenterEqualTo(
|
||||
bool? value) {
|
||||
bool value) {
|
||||
return QueryBuilder.apply(this, (query) {
|
||||
return query.addFilterCondition(FilterCondition.equalTo(
|
||||
property: r'reenter',
|
||||
@@ -1123,8 +1091,8 @@ TourTask _$TourTaskFromJson(Map<String, dynamic> json) => TourTask()
|
||||
..sId = json['s_id'] as int
|
||||
..type = json['type'] as int
|
||||
..topic = json['topic'] as String
|
||||
..opt = json['opt'] as bool?
|
||||
..reenter = json['reenter'] as bool?
|
||||
..opt = json['opt'] as bool
|
||||
..reenter = json['reenter'] as bool
|
||||
..min = json['min'] as int?
|
||||
..max = json['max'] as int?
|
||||
..maxLen = json['max_len'] as int?
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:stadtbote/tools/constants.dart';
|
||||
|
||||
class ColoredSafeArea extends StatelessWidget {
|
||||
final Widget child;
|
||||
@@ -9,7 +10,7 @@ class ColoredSafeArea extends StatelessWidget {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Container(
|
||||
color: Theme.of(context).colorScheme.primaryContainer,
|
||||
color: Constants.colorPrimary,
|
||||
child: SafeArea(
|
||||
child: child,
|
||||
),
|
||||
|
||||
@@ -1,9 +1,12 @@
|
||||
import 'dart:ui';
|
||||
|
||||
class Constants {
|
||||
static const Color colorPrimary = Color(0xff0095DB);
|
||||
static const Color colorPrimary = Color(0xFFE00029);
|
||||
static const Color colorPrimaryOpaque = Color(0x33E00029);
|
||||
|
||||
static const String messageTopicConnectionStatusChanged = "connection_status_changed";
|
||||
static const String messageTopicSessionInfoUpdate = "status_info_updated";
|
||||
static const String messageTopicStatusInfoUpdate = "session_info_updated";
|
||||
static const String messageTopicPushContentView = "push_content_view";
|
||||
static const String messageTopicPopContentView = "pop_content_view";
|
||||
static const String messageTopicReplaceContentView = "replace_content_view";
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import 'dart:async';
|
||||
import 'dart:convert';
|
||||
import 'dart:math';
|
||||
import 'dart:typed_data' as typed;
|
||||
|
||||
import 'package:flutter_broadcast_receiver/flutter_broadcast_receiver.dart';
|
||||
import 'package:mqtt_client/mqtt_client.dart';
|
||||
@@ -9,9 +10,12 @@ import 'package:stadtbote/model/bootstrap_request.dart';
|
||||
import 'package:stadtbote/model/bootstrap_response_payload.dart';
|
||||
import 'package:stadtbote/model/device_object.dart';
|
||||
import 'package:stadtbote/model/job.dart';
|
||||
import 'package:stadtbote/model/start_session_message.dart';
|
||||
import 'package:stadtbote/tools/connection_status.dart';
|
||||
import 'package:stadtbote/tools/session_info_update.dart';
|
||||
import 'package:typed_data/typed_buffers.dart';
|
||||
import 'package:http/http.dart' as http;
|
||||
import 'package:uuid/uuid.dart';
|
||||
|
||||
import '../main.dart';
|
||||
import '../model/status.dart';
|
||||
@@ -64,6 +68,8 @@ class MqttCore {
|
||||
_reconnectDelay = 0;
|
||||
|
||||
_setupSubscriptions();
|
||||
|
||||
_initSession();
|
||||
} else {
|
||||
Util.logInfo('Verbindung zum MQTT-Broker fehlgeschlagen!');
|
||||
|
||||
@@ -146,6 +152,8 @@ class MqttCore {
|
||||
await MyApp.isarInstance.writeTxn(() async {
|
||||
await MyApp.isarInstance.status.put(statusMessage);
|
||||
});
|
||||
|
||||
BroadcastReceiver().publish<StatusInfoUpdate>(Constants.messageTopicStatusInfoUpdate, arguments: StatusInfoUpdate(status: statusMessage));
|
||||
}
|
||||
|
||||
void _jobMessageReceived(payloadData) async {
|
||||
@@ -211,4 +219,64 @@ class MqttCore {
|
||||
_startReconnectTimer();
|
||||
}
|
||||
}
|
||||
|
||||
_initSession() {
|
||||
var playload = Payload();
|
||||
playload.startSession = "true";
|
||||
|
||||
var startSessionMessage = StartSessionMessage();
|
||||
startSessionMessage.recv = "server";
|
||||
startSessionMessage.store = true;
|
||||
startSessionMessage.messageId = const Uuid().v4();;
|
||||
startSessionMessage.payload = playload;
|
||||
|
||||
var jsonMap = startSessionMessage.toJson();
|
||||
var json = jsonEncode(jsonMap);
|
||||
Util.logInfo("json: $json");
|
||||
|
||||
final builder = MqttClientPayloadBuilder();
|
||||
builder.addString(json);
|
||||
var payload = builder.payload;
|
||||
|
||||
var topic = "$_toServerTopic/init";
|
||||
Util.logInfo("topic: $topic");
|
||||
|
||||
var messageId = _mqttClient.publishMessage(topic, MqttQos.exactlyOnce, payload!);
|
||||
Util.logInfo("messageId: $messageId");
|
||||
}
|
||||
|
||||
/*
|
||||
private async void StartSession()
|
||||
{
|
||||
App.Logger.Debug("StartSession called");
|
||||
|
||||
App.Logger.Debug("Setting state to start session");
|
||||
_mqttState = MqttStateEnum.StartSession;
|
||||
|
||||
var startSession = new JObject
|
||||
{
|
||||
new JProperty("recv", "server"),
|
||||
new JProperty("store", true),
|
||||
new JProperty("id", Guid.NewGuid().ToString()),
|
||||
new JProperty("payload", new JObject(
|
||||
new JProperty("start_session", "true")))
|
||||
};
|
||||
|
||||
var json = JsonConvert.SerializeObject(startSession);
|
||||
|
||||
var topic = _toServerTopic + "/init";
|
||||
var message = new MqttApplicationMessage()
|
||||
{
|
||||
Topic = topic,
|
||||
Payload = Encoding.UTF8.GetBytes(json),
|
||||
QualityOfServiceLevel = MqttQualityOfServiceLevel.ExactlyOnce,
|
||||
Retain = true,
|
||||
MessageExpiryInterval = 3600,
|
||||
};
|
||||
await _mqttClient.PublishAsync(message);
|
||||
App.Logger.Debug("StartSession message " + json + " published to " + topic);
|
||||
|
||||
SendEnqueuedMessages();
|
||||
}
|
||||
*/
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
|
||||
import 'package:stadtbote/model/status.dart';
|
||||
|
||||
class StatusInfoUpdate {
|
||||
StatusInfoUpdate({required this.status});
|
||||
|
||||
final Status status;
|
||||
}
|
||||
+45
-45
@@ -69,10 +69,10 @@ packages:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: build
|
||||
sha256: "3fbda25365741f8251b39f3917fb3c8e286a96fd068a5a242e11c2012d495777"
|
||||
sha256: "80184af8b6cb3e5c1c4ec6d8544d27711700bc3e6d2efad04238c7b5290889f0"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.3.1"
|
||||
version: "2.4.1"
|
||||
build_config:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -85,34 +85,34 @@ packages:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: build_daemon
|
||||
sha256: "757153e5d9cd88253cb13f28c2fb55a537dc31fefd98137549895b5beb7c6169"
|
||||
sha256: "0343061a33da9c5810b2d6cee51945127d8f4c060b7fbdd9d54917f0a3feaaa1"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "3.1.1"
|
||||
version: "4.0.1"
|
||||
build_resolvers:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: build_resolvers
|
||||
sha256: "0713a05b0386bd97f9e63e78108805a4feca5898a4b821d6610857f10c91e975"
|
||||
sha256: "64e12b0521812d1684b1917bc80945625391cb9bdd4312536b1d69dcb6133ed8"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.4.0"
|
||||
version: "2.4.1"
|
||||
build_runner:
|
||||
dependency: "direct dev"
|
||||
description:
|
||||
name: build_runner
|
||||
sha256: b0a8a7b8a76c493e85f1b84bffa0588859a06197863dba8c9036b15581fd9727
|
||||
sha256: "10c6bcdbf9d049a0b666702cf1cee4ddfdc38f02a19d35ae392863b47519848b"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.3.3"
|
||||
version: "2.4.6"
|
||||
build_runner_core:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: build_runner_core
|
||||
sha256: "0671ad4162ed510b70d0eb4ad6354c249f8429cab4ae7a4cec86bbc2886eb76e"
|
||||
sha256: c9e32d21dd6626b5c163d48b037ce906bbe428bc23ab77bcd77bb21e593b6185
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "7.2.7+1"
|
||||
version: "7.2.11"
|
||||
built_collection:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -285,26 +285,26 @@ packages:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: ffi
|
||||
sha256: ed5337a5660c506388a9f012be0288fb38b49020ce2b45fe1f8b8323fe429f99
|
||||
sha256: "7bf0adc28a23d395f19f3f1eb21dd7cfd1dd9f8e1c50051c069122e6853bc878"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.0.2"
|
||||
version: "2.1.0"
|
||||
file:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: file
|
||||
sha256: "1b92bec4fc2a72f59a8e15af5f52cd441e4a7860b49499d69dfa817af20e925d"
|
||||
sha256: "5fc22d7c25582e38ad9a8515372cd9a93834027aacf1801cf01164dac0ffa08c"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "6.1.4"
|
||||
version: "7.0.0"
|
||||
file_picker:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: file_picker
|
||||
sha256: "9d6e95ec73abbd31ec54d0e0df8a961017e165aba1395e462e5b31ea0c165daf"
|
||||
sha256: be325344c1f3070354a1d84a231a1ba75ea85d413774ec4bdf444c023342e030
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "5.3.1"
|
||||
version: "5.5.0"
|
||||
file_selector_linux:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -418,10 +418,10 @@ packages:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: flutter_osm_interface
|
||||
sha256: "68a4c0280413a0491b9ed7bc8f035ffa954579fc277d8daf4c12bbc395110fcc"
|
||||
sha256: "9d1c747635ce8a58ceb623825f0fe4d469272645458ce839d466f9d03dff2729"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "0.3.5"
|
||||
version: "0.7.0"
|
||||
flutter_osm_plugin:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
@@ -458,10 +458,10 @@ packages:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: flutter_svg
|
||||
sha256: f991fdb1533c3caeee0cdc14b04f50f0c3916f0dbcbc05237ccbe4e3c6b93f3f
|
||||
sha256: d39e7f95621fc84376bc0f7d504f05c3a41488c562f4a8ad410569127507402c
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.0.5"
|
||||
version: "2.0.9"
|
||||
flutter_test:
|
||||
dependency: "direct dev"
|
||||
description: flutter
|
||||
@@ -652,10 +652,10 @@ packages:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: js
|
||||
sha256: "5528c2f391ededb7775ec1daa69e65a2d61276f7552de2b5f7b8d34ee9fd4ab7"
|
||||
sha256: f2c445dce49627136094980615a031419f7f3eb393237e4ecd97ac15dea343f3
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "0.6.5"
|
||||
version: "0.6.7"
|
||||
json_annotation:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
@@ -668,10 +668,10 @@ packages:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: json_serializable
|
||||
sha256: "43793352f90efa5d8b251893a63d767b2f7c833120e3cc02adad55eefec04dc7"
|
||||
sha256: aa1f5a8912615733e0fdc7a02af03308933c93235bdc8d50d0b0c8a8ccb0b969
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "6.6.2"
|
||||
version: "6.7.1"
|
||||
kumi_popup_window:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
@@ -700,10 +700,10 @@ packages:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: lints
|
||||
sha256: "5e4a9cd06d447758280a8ac2405101e0e2094d2a1dbdd3756aec3fe7775ba593"
|
||||
sha256: "0a217c6c989d21039f1498c3ed9f3ed71b354e69873f13a8dfc3c9fe76f1b452"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.0.1"
|
||||
version: "2.1.1"
|
||||
lists:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -724,10 +724,10 @@ packages:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: lottie
|
||||
sha256: "23522951540d20a57a60202ed7022e6376bed206a4eee1c347a91f58bd57eb9f"
|
||||
sha256: a93542cc2d60a7057255405f62252533f8e8956e7e06754955669fd32fb4b216
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.3.2"
|
||||
version: "2.7.0"
|
||||
matcher:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -900,10 +900,10 @@ packages:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: petitparser
|
||||
sha256: "49392a45ced973e8d94a85fdb21293fbb40ba805fc49f2965101ae748a3683b4"
|
||||
sha256: cb3798bef7fc021ac45b308f4b51208a152792445cce0448c9a4ba5879dd8750
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "5.1.0"
|
||||
version: "5.4.0"
|
||||
photo_view:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -1081,10 +1081,10 @@ packages:
|
||||
dependency: "direct dev"
|
||||
description:
|
||||
name: source_gen
|
||||
sha256: "373f96cf5a8744bc9816c1ff41cf5391bbdbe3d7a96fe98c622b6738a8a7bd33"
|
||||
sha256: fc0da689e5302edb6177fdd964efcb7f58912f43c28c2047a808f5bfff643d16
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.3.2"
|
||||
version: "1.4.0"
|
||||
source_helper:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -1182,7 +1182,7 @@ packages:
|
||||
source: hosted
|
||||
version: "2.0.2"
|
||||
typed_data:
|
||||
dependency: "direct main"
|
||||
dependency: transitive
|
||||
description:
|
||||
name: typed_data
|
||||
sha256: facc8d6582f16042dd49f2463ff1bd6e2c9ef9f3d5da3d9b087e244a7b564b3c
|
||||
@@ -1273,26 +1273,26 @@ packages:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: vector_graphics
|
||||
sha256: ea8d3fc7b2e0f35de38a7465063ecfcf03d8217f7962aa2a6717132cb5d43a79
|
||||
sha256: "0f0c746dd2d6254a0057218ff980fc7f5670fd0fcf5e4db38a490d31eed4ad43"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.1.5"
|
||||
version: "1.1.9+1"
|
||||
vector_graphics_codec:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: vector_graphics_codec
|
||||
sha256: a5eaa5d19e123ad4f61c3718ca1ed921c4e6254238d9145f82aa214955d9aced
|
||||
sha256: "0edf6d630d1bfd5589114138ed8fada3234deacc37966bec033d3047c29248b7"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.1.5"
|
||||
version: "1.1.9+1"
|
||||
vector_graphics_compiler:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: vector_graphics_compiler
|
||||
sha256: "15edc42f7eaa478ce854eaf1fbb9062a899c0e4e56e775dd73b7f4709c97c4ca"
|
||||
sha256: d24333727332d9bd20990f1483af4e09abdb9b1fc7c3db940b56ab5c42790c26
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.1.5"
|
||||
version: "1.1.9+1"
|
||||
vector_math:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -1313,10 +1313,10 @@ packages:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: watcher
|
||||
sha256: "6a7f46926b01ce81bfc339da6a7f20afbe7733eff9846f6d6a5466aa4c6667c0"
|
||||
sha256: "3d2ad6751b3c16cf07c7fca317a1413b3f26530319181b37e3b9039b84fc01d8"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.0.2"
|
||||
version: "1.1.0"
|
||||
web:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -1337,10 +1337,10 @@ packages:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: win32
|
||||
sha256: "5a751eddf9db89b3e5f9d50c20ab8612296e4e8db69009788d6c8b060a84191c"
|
||||
sha256: "7c99c0e1e2fa190b48d25c81ca5e42036d5cac81430ef249027d97b0935c553f"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "4.1.4"
|
||||
version: "5.1.0"
|
||||
wkt_parser:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -1361,10 +1361,10 @@ packages:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: xml
|
||||
sha256: "979ee37d622dec6365e2efa4d906c37470995871fe9ae080d967e192d88286b5"
|
||||
sha256: "5bc72e1e45e941d825fd7468b9b4cc3b9327942649aeb6fc5cdbf135f0a86e84"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "6.2.2"
|
||||
version: "6.3.0"
|
||||
xxh3:
|
||||
dependency: transitive
|
||||
description:
|
||||
|
||||
@@ -49,7 +49,6 @@ dependencies:
|
||||
json_serializable: ^6.6.2
|
||||
json_annotation: ^4.8.1
|
||||
shared_preferences: ^2.1.1
|
||||
typed_data: ^1.3.2
|
||||
flutter_broadcast_receiver: ^1.0.0+2
|
||||
intl: ^0.18.0
|
||||
another_stepper: ^1.2.2
|
||||
|
||||
Reference in new issue
Block a user