Umstellung auf UTC Timestamp

This commit is contained in:
Sven committed 2025-09-04 09:21:19 +02:00
1 parent fcb3ecdbb4
commit d5ec222efd
41 files changed
+144 -664

No files matched your search

+1
View File
@@ -11,6 +11,7 @@
.svn/ .svn/
.swiftpm/ .swiftpm/
migrate_working_dir/ migrate_working_dir/
android/
# IntelliJ related # IntelliJ related
*.iml *.iml
@@ -1,92 +0,0 @@
{
"cmake" :
{
"generator" :
{
"multiConfig" : false,
"name" : "Ninja"
},
"paths" :
{
"cmake" : "/Users/svencarstensen/Library/Android/sdk/cmake/3.22.1/bin/cmake",
"cpack" : "/Users/svencarstensen/Library/Android/sdk/cmake/3.22.1/bin/cpack",
"ctest" : "/Users/svencarstensen/Library/Android/sdk/cmake/3.22.1/bin/ctest",
"root" : "/Users/svencarstensen/Library/Android/sdk/cmake/3.22.1/share/cmake-3.22"
},
"version" :
{
"isDirty" : false,
"major" : 3,
"minor" : 22,
"patch" : 1,
"string" : "3.22.1-g37088a8",
"suffix" : "g37088a8"
}
},
"objects" :
[
{
"jsonFile" : "codemodel-v2-730fa8c91c7c6cba98c8.json",
"kind" : "codemodel",
"version" :
{
"major" : 2,
"minor" : 3
}
},
{
"jsonFile" : "cache-v2-d50372243c9a5f2816d1.json",
"kind" : "cache",
"version" :
{
"major" : 2,
"minor" : 0
}
},
{
"jsonFile" : "cmakeFiles-v1-dbb9ccb3b307022eb6d3.json",
"kind" : "cmakeFiles",
"version" :
{
"major" : 1,
"minor" : 0
}
}
],
"reply" :
{
"client-agp" :
{
"cache-v2" :
{
"jsonFile" : "cache-v2-d50372243c9a5f2816d1.json",
"kind" : "cache",
"version" :
{
"major" : 2,
"minor" : 0
}
},
"cmakeFiles-v1" :
{
"jsonFile" : "cmakeFiles-v1-dbb9ccb3b307022eb6d3.json",
"kind" : "cmakeFiles",
"version" :
{
"major" : 1,
"minor" : 0
}
},
"codemodel-v2" :
{
"jsonFile" : "codemodel-v2-730fa8c91c7c6cba98c8.json",
"kind" : "codemodel",
"version" :
{
"major" : 2,
"minor" : 3
}
}
}
}
}
@@ -1,15 +0,0 @@
set(CMAKE_HOST_SYSTEM "Darwin-24.3.0")
set(CMAKE_HOST_SYSTEM_NAME "Darwin")
set(CMAKE_HOST_SYSTEM_VERSION "24.3.0")
set(CMAKE_HOST_SYSTEM_PROCESSOR "arm64")
include("/Users/svencarstensen/Library/Android/sdk/ndk/26.3.11579264/build/cmake/android.toolchain.cmake")
set(CMAKE_SYSTEM "Android-1")
set(CMAKE_SYSTEM_NAME "Android")
set(CMAKE_SYSTEM_VERSION "1")
set(CMAKE_SYSTEM_PROCESSOR "aarch64")
set(CMAKE_CROSSCOMPILING "TRUE")
set(CMAKE_SYSTEM_LOADED 1)
@@ -1,92 +0,0 @@
{
"cmake" :
{
"generator" :
{
"multiConfig" : false,
"name" : "Ninja"
},
"paths" :
{
"cmake" : "/Users/svencarstensen/Library/Android/sdk/cmake/3.22.1/bin/cmake",
"cpack" : "/Users/svencarstensen/Library/Android/sdk/cmake/3.22.1/bin/cpack",
"ctest" : "/Users/svencarstensen/Library/Android/sdk/cmake/3.22.1/bin/ctest",
"root" : "/Users/svencarstensen/Library/Android/sdk/cmake/3.22.1/share/cmake-3.22"
},
"version" :
{
"isDirty" : false,
"major" : 3,
"minor" : 22,
"patch" : 1,
"string" : "3.22.1-g37088a8",
"suffix" : "g37088a8"
}
},
"objects" :
[
{
"jsonFile" : "codemodel-v2-e9db841d2091564beb48.json",
"kind" : "codemodel",
"version" :
{
"major" : 2,
"minor" : 3
}
},
{
"jsonFile" : "cache-v2-edf40734f3397fcbedfd.json",
"kind" : "cache",
"version" :
{
"major" : 2,
"minor" : 0
}
},
{
"jsonFile" : "cmakeFiles-v1-04f76f5d5179aa001dbe.json",
"kind" : "cmakeFiles",
"version" :
{
"major" : 1,
"minor" : 0
}
}
],
"reply" :
{
"client-agp" :
{
"cache-v2" :
{
"jsonFile" : "cache-v2-edf40734f3397fcbedfd.json",
"kind" : "cache",
"version" :
{
"major" : 2,
"minor" : 0
}
},
"cmakeFiles-v1" :
{
"jsonFile" : "cmakeFiles-v1-04f76f5d5179aa001dbe.json",
"kind" : "cmakeFiles",
"version" :
{
"major" : 1,
"minor" : 0
}
},
"codemodel-v2" :
{
"jsonFile" : "codemodel-v2-e9db841d2091564beb48.json",
"kind" : "codemodel",
"version" :
{
"major" : 2,
"minor" : 3
}
}
}
}
}
@@ -1,15 +0,0 @@
set(CMAKE_HOST_SYSTEM "Darwin-24.3.0")
set(CMAKE_HOST_SYSTEM_NAME "Darwin")
set(CMAKE_HOST_SYSTEM_VERSION "24.3.0")
set(CMAKE_HOST_SYSTEM_PROCESSOR "arm64")
include("/Users/svencarstensen/Library/Android/sdk/ndk/26.3.11579264/build/cmake/android.toolchain.cmake")
set(CMAKE_SYSTEM "Android-1")
set(CMAKE_SYSTEM_NAME "Android")
set(CMAKE_SYSTEM_VERSION "1")
set(CMAKE_SYSTEM_PROCESSOR "armv7-a")
set(CMAKE_CROSSCOMPILING "TRUE")
set(CMAKE_SYSTEM_LOADED 1)
@@ -1,92 +0,0 @@
{
"cmake" :
{
"generator" :
{
"multiConfig" : false,
"name" : "Ninja"
},
"paths" :
{
"cmake" : "/Users/svencarstensen/Library/Android/sdk/cmake/3.22.1/bin/cmake",
"cpack" : "/Users/svencarstensen/Library/Android/sdk/cmake/3.22.1/bin/cpack",
"ctest" : "/Users/svencarstensen/Library/Android/sdk/cmake/3.22.1/bin/ctest",
"root" : "/Users/svencarstensen/Library/Android/sdk/cmake/3.22.1/share/cmake-3.22"
},
"version" :
{
"isDirty" : false,
"major" : 3,
"minor" : 22,
"patch" : 1,
"string" : "3.22.1-g37088a8",
"suffix" : "g37088a8"
}
},
"objects" :
[
{
"jsonFile" : "codemodel-v2-67b951521e487f9d6811.json",
"kind" : "codemodel",
"version" :
{
"major" : 2,
"minor" : 3
}
},
{
"jsonFile" : "cache-v2-42ad4ed1b8ed2282a7f0.json",
"kind" : "cache",
"version" :
{
"major" : 2,
"minor" : 0
}
},
{
"jsonFile" : "cmakeFiles-v1-946cac3c916784c772b9.json",
"kind" : "cmakeFiles",
"version" :
{
"major" : 1,
"minor" : 0
}
}
],
"reply" :
{
"client-agp" :
{
"cache-v2" :
{
"jsonFile" : "cache-v2-42ad4ed1b8ed2282a7f0.json",
"kind" : "cache",
"version" :
{
"major" : 2,
"minor" : 0
}
},
"cmakeFiles-v1" :
{
"jsonFile" : "cmakeFiles-v1-946cac3c916784c772b9.json",
"kind" : "cmakeFiles",
"version" :
{
"major" : 1,
"minor" : 0
}
},
"codemodel-v2" :
{
"jsonFile" : "codemodel-v2-67b951521e487f9d6811.json",
"kind" : "codemodel",
"version" :
{
"major" : 2,
"minor" : 3
}
}
}
}
}
@@ -1,15 +0,0 @@
set(CMAKE_HOST_SYSTEM "Darwin-24.3.0")
set(CMAKE_HOST_SYSTEM_NAME "Darwin")
set(CMAKE_HOST_SYSTEM_VERSION "24.3.0")
set(CMAKE_HOST_SYSTEM_PROCESSOR "arm64")
include("/Users/svencarstensen/Library/Android/sdk/ndk/26.3.11579264/build/cmake/android.toolchain.cmake")
set(CMAKE_SYSTEM "Android-1")
set(CMAKE_SYSTEM_NAME "Android")
set(CMAKE_SYSTEM_VERSION "1")
set(CMAKE_SYSTEM_PROCESSOR "i686")
set(CMAKE_CROSSCOMPILING "TRUE")
set(CMAKE_SYSTEM_LOADED 1)
@@ -1,92 +0,0 @@
{
"cmake" :
{
"generator" :
{
"multiConfig" : false,
"name" : "Ninja"
},
"paths" :
{
"cmake" : "/Users/svencarstensen/Library/Android/sdk/cmake/3.22.1/bin/cmake",
"cpack" : "/Users/svencarstensen/Library/Android/sdk/cmake/3.22.1/bin/cpack",
"ctest" : "/Users/svencarstensen/Library/Android/sdk/cmake/3.22.1/bin/ctest",
"root" : "/Users/svencarstensen/Library/Android/sdk/cmake/3.22.1/share/cmake-3.22"
},
"version" :
{
"isDirty" : false,
"major" : 3,
"minor" : 22,
"patch" : 1,
"string" : "3.22.1-g37088a8",
"suffix" : "g37088a8"
}
},
"objects" :
[
{
"jsonFile" : "codemodel-v2-5a374c9561e5f4c57936.json",
"kind" : "codemodel",
"version" :
{
"major" : 2,
"minor" : 3
}
},
{
"jsonFile" : "cache-v2-434c6c8119615dd6fa39.json",
"kind" : "cache",
"version" :
{
"major" : 2,
"minor" : 0
}
},
{
"jsonFile" : "cmakeFiles-v1-04e39d9239cb8595d767.json",
"kind" : "cmakeFiles",
"version" :
{
"major" : 1,
"minor" : 0
}
}
],
"reply" :
{
"client-agp" :
{
"cache-v2" :
{
"jsonFile" : "cache-v2-434c6c8119615dd6fa39.json",
"kind" : "cache",
"version" :
{
"major" : 2,
"minor" : 0
}
},
"cmakeFiles-v1" :
{
"jsonFile" : "cmakeFiles-v1-04e39d9239cb8595d767.json",
"kind" : "cmakeFiles",
"version" :
{
"major" : 1,
"minor" : 0
}
},
"codemodel-v2" :
{
"jsonFile" : "codemodel-v2-5a374c9561e5f4c57936.json",
"kind" : "codemodel",
"version" :
{
"major" : 2,
"minor" : 3
}
}
}
}
}
@@ -1,15 +0,0 @@
set(CMAKE_HOST_SYSTEM "Darwin-24.3.0")
set(CMAKE_HOST_SYSTEM_NAME "Darwin")
set(CMAKE_HOST_SYSTEM_VERSION "24.3.0")
set(CMAKE_HOST_SYSTEM_PROCESSOR "arm64")
include("/Users/svencarstensen/Library/Android/sdk/ndk/26.3.11579264/build/cmake/android.toolchain.cmake")
set(CMAKE_SYSTEM "Android-1")
set(CMAKE_SYSTEM_NAME "Android")
set(CMAKE_SYSTEM_VERSION "1")
set(CMAKE_SYSTEM_PROCESSOR "x86_64")
set(CMAKE_CROSSCOMPILING "TRUE")
set(CMAKE_SYSTEM_LOADED 1)
+1 -1
View File
@@ -195,7 +195,7 @@ class _ApproachAreaPageState extends State<ApproachAreaPage> with ProducerMixin,
if (position != null) { if (position != null) {
setPosMessage.track = ZipTrack(); setPosMessage.track = ZipTrack();
setPosMessage.track!.time = DateTime.now().toIso8601String(); setPosMessage.track!.time = Util.toUnixMillisUtc(DateTime.now());
setPosMessage.track!.pos = ZipTrackPos(); setPosMessage.track!.pos = ZipTrackPos();
setPosMessage.track!.pos!.lat = position.latitude; setPosMessage.track!.pos!.lat = position.latitude;
setPosMessage.track!.pos!.long = position.longitude; setPosMessage.track!.pos!.long = position.longitude;
+1 -1
View File
@@ -231,7 +231,7 @@ class _AssignedJobsPageState extends State<AssignedJobsPage> with ProducerMixin,
message.ver = job.ver.toString(); message.ver = job.ver.toString();
message.item = item; message.item = item;
message.track = Track(); message.track = Track();
message.track.time = DateTime.now().toUtc().toIso8601String(); message.track.time = Util.toUnixMillisUtc(DateTime.now().toUtc());
message.track.pos = FinTaskPos(); message.track.pos = FinTaskPos();
message.track.pos!.lat = currentPosition != null ? currentPosition.latitude : 0.0; message.track.pos!.lat = currentPosition != null ? currentPosition.latitude : 0.0;
message.track.pos!.long = currentPosition != null ? currentPosition.longitude : 0.0; message.track.pos!.long = currentPosition != null ? currentPosition.longitude : 0.0;
+1 -1
View File
@@ -420,7 +420,7 @@ class _MainPageState extends State<MainPage> with ConsumerMixin, ProducerMixin {
var logoutMessage = LogoutMessage(); var logoutMessage = LogoutMessage();
if (position != null) { if (position != null) {
logoutMessage.pos = LogoutMessagePosition(); logoutMessage.pos = LogoutMessagePosition();
logoutMessage.pos!.time = position.timestamp.toIso8601String(); logoutMessage.pos!.time = Util.toUnixMillisUtc(position.timestamp);
logoutMessage.pos!.lat = position.latitude; logoutMessage.pos!.lat = position.latitude;
logoutMessage.pos!.long = position.longitude; logoutMessage.pos!.long = position.longitude;
logoutMessage.pos!.acc = position.accuracy.toInt(); logoutMessage.pos!.acc = position.accuracy.toInt();
+3 -4
View File
@@ -93,7 +93,7 @@ class _MessagesPageState extends State<MessagesPage> with ProducerMixin {
message.text = text.text; message.text = text.text;
message.from = _sid; message.from = _sid;
message.subj = ''; message.subj = '';
message.time = now.toUtc().toIso8601String(); message.time = Util.toUnixMillisUtc(now.toUtc());
message.read = true; message.read = true;
message.id = await sbmessage.ChatMessage.getNextId(); message.id = await sbmessage.ChatMessage.getNextId();
@@ -128,8 +128,7 @@ class _MessagesPageState extends State<MessagesPage> with ProducerMixin {
for (var message in messages) { for (var message in messages) {
_messages.add(types.TextMessage( _messages.add(types.TextMessage(
author: message.from == _sid ? _user : _central, author: message.from == _sid ? _user : _central,
createdAt: createdAt: message.time * 1000,
DateTime.parse(message.time).toLocal().millisecondsSinceEpoch,
id: message.id.toString(), id: message.id.toString(),
text: "${message.subj}\n${message.text}", text: "${message.subj}\n${message.text}",
)); ));
@@ -215,7 +214,7 @@ class _MessagesPageState extends State<MessagesPage> with ProducerMixin {
var chatMessagesShowed = ChatMessagesReceived(); var chatMessagesShowed = ChatMessagesReceived();
chatMessagesShowed.ids = chatMessageIds; chatMessagesShowed.ids = chatMessageIds;
chatMessagesShowed.time = DateTime.now().toUtc().toIso8601String(); chatMessagesShowed.time = Util.toUnixMillisUtc(DateTime.now().toUtc());
sendMessage( sendMessage(
routingKey: Constants.messageTopicPublishPayload, routingKey: Constants.messageTopicPublishPayload,
+9 -10
View File
@@ -400,10 +400,9 @@ class _TaskListPageState extends State<TaskListPage> with ProducerMixin {
void _processPickupDeliveryStatusTask(TaskInfo taskInfo) { void _processPickupDeliveryStatusTask(TaskInfo taskInfo) {
Util.logInfo('Task ${taskInfo.task.sId} called'); Util.logInfo('Task ${taskInfo.task.sId} called');
final currentContext = context;
Future.delayed(const Duration(seconds: 1), () async { Future.delayed(const Duration(seconds: 1), () async {
if (!mounted) return; if (!context.mounted) return;
showPickupDeliveryStatusPopup(currentContext, taskInfo, (tourEntry, remark) async { showPickupDeliveryStatusPopup(MyApp.appNavigatorKey.currentContext!, taskInfo, (tourEntry, remark) async {
var answer = await _createAnswerHeader(taskInfo); var answer = await _createAnswerHeader(taskInfo);
answer.code = tourEntry!.code; answer.code = tourEntry!.code;
answer.val = remark; answer.val = remark;
@@ -428,10 +427,9 @@ class _TaskListPageState extends State<TaskListPage> with ProducerMixin {
SystemChrome.setPreferredOrientations([DeviceOrientation.landscapeLeft]); SystemChrome.setPreferredOrientations([DeviceOrientation.landscapeLeft]);
final currentContext = context;
Future.delayed(const Duration(seconds: 1), () async { Future.delayed(const Duration(seconds: 1), () async {
if (!mounted) return; if (!context.mounted) return;
showSignaturePopup(currentContext, taskInfo, (String? signature) async { showSignaturePopup(MyApp.appNavigatorKey.currentContext!, taskInfo, (String? signature) async {
MyApp.suppressAcceptDialog = false; MyApp.suppressAcceptDialog = false;
SystemChrome.setPreferredOrientations([DeviceOrientation.portraitUp]); SystemChrome.setPreferredOrientations([DeviceOrientation.portraitUp]);
@@ -491,12 +489,12 @@ class _TaskListPageState extends State<TaskListPage> with ProducerMixin {
message.trId = widget.tour.id; message.trId = widget.tour.id;
message.task = Task(); message.task = Task();
message.task.sId = taskInfo.task.sId; message.task.sId = taskInfo.task.sId;
message.task.time = DateTime.now().toIso8601String(); message.task.time = Util.toUnixMillisUtc(DateTime.now().toUtc());
var position = await MyApp.getCurrentPosition(); var position = await MyApp.getCurrentPosition();
if (position != null) { if (position != null) {
message.task.pos = FinTaskPos(); message.task.pos = FinTaskPos();
message.task.pos!.time = DateTime.now().toIso8601String(); message.task.pos!.time = Util.toUnixMillisUtc(position.timestamp);
message.task.pos!.lat = position.latitude; message.task.pos!.lat = position.latitude;
message.task.pos!.long = position.longitude; message.task.pos!.long = position.longitude;
} else { } else {
@@ -514,9 +512,10 @@ class _TaskListPageState extends State<TaskListPage> with ProducerMixin {
var finTourTask = FinTourTask(); var finTourTask = FinTourTask();
finTourTask.sId = taskInfo.task.sId; finTourTask.sId = taskInfo.task.sId;
finTourTask.time = DateTime.now().toIso8601String(); finTourTask.time = Util.toUnixMillisUtc(DateTime.now().toUtc());
if (position != null) { if (position != null) {
finTourTask.pos = FinTaskPos(); finTourTask.pos = FinTaskPos();
finTourTask.pos!.time = Util.toUnixMillisUtc(position.timestamp);
finTourTask.pos!.lat = position.latitude; finTourTask.pos!.lat = position.latitude;
finTourTask.pos!.long = position.longitude; finTourTask.pos!.long = position.longitude;
finTourTask.pos!.acc = position.accuracy.toInt(); finTourTask.pos!.acc = position.accuracy.toInt();
@@ -535,7 +534,7 @@ class _TaskListPageState extends State<TaskListPage> with ProducerMixin {
var position = await MyApp.getCurrentPosition(); var position = await MyApp.getCurrentPosition();
if (position != null) { if (position != null) {
finTourMessage.track = Track(); finTourMessage.track = Track();
finTourMessage.track!.time = DateTime.now().toIso8601String(); finTourMessage.track!.time = Util.toUnixMillisUtc(DateTime.now().toUtc());
finTourMessage.track!.pos = FinTaskPos(); finTourMessage.track!.pos = FinTaskPos();
finTourMessage.track!.pos!.lat = position.latitude; finTourMessage.track!.pos!.lat = position.latitude;
finTourMessage.track!.pos!.long = position.longitude; finTourMessage.track!.pos!.long = position.longitude;
+6 -12
View File
@@ -426,7 +426,6 @@ class _MainState extends State<Main> with SingleTickerProviderStateMixin, Produc
} }
void _replaceContentView(ContentViewWidget widget) async { void _replaceContentView(ContentViewWidget widget) async {
final currentContext = context;
Future.delayed(const Duration(seconds: 0), () async { Future.delayed(const Duration(seconds: 0), () async {
contentStack.clear(); contentStack.clear();
@@ -436,9 +435,8 @@ class _MainState extends State<Main> with SingleTickerProviderStateMixin, Produc
}); });
} }
if (mounted) { if (!context.mounted) return;
_currentTitleWidget = await _currentContent.getHeaderWidget(currentContext); _currentTitleWidget = await _currentContent.getHeaderWidget(MyApp.appNavigatorKey.currentContext!);
}
if (mounted) { if (mounted) {
setState(() {}); setState(() {});
@@ -447,7 +445,6 @@ class _MainState extends State<Main> with SingleTickerProviderStateMixin, Produc
} }
void _popContentView(int count) { void _popContentView(int count) {
final currentContext = context;
Future.delayed(const Duration(seconds: 0), () async { Future.delayed(const Duration(seconds: 0), () async {
for (int i = 0; i < count - 1; i++) { for (int i = 0; i < count - 1; i++) {
contentStack.pop(); contentStack.pop();
@@ -457,9 +454,8 @@ class _MainState extends State<Main> with SingleTickerProviderStateMixin, Produc
_currentContent = previousContentView; _currentContent = previousContentView;
if (mounted) { if (!context.mounted) return;
_currentTitleWidget = await _currentContent.getHeaderWidget(currentContext); _currentTitleWidget = await _currentContent.getHeaderWidget(MyApp.appNavigatorKey.currentContext!);
}
if (mounted) { if (mounted) {
setState(() {}); setState(() {});
@@ -468,15 +464,13 @@ class _MainState extends State<Main> with SingleTickerProviderStateMixin, Produc
} }
void _pushContentView(ContentViewWidget widget) { void _pushContentView(ContentViewWidget widget) {
final currentContext = context;
Future.delayed(const Duration(seconds: 0), () async { Future.delayed(const Duration(seconds: 0), () async {
contentStack.push(_currentContent); contentStack.push(_currentContent);
_currentContent = widget; _currentContent = widget;
if (mounted) { if (!context.mounted) return;
_currentTitleWidget = await _currentContent.getHeaderWidget(currentContext); _currentTitleWidget = await _currentContent.getHeaderWidget(MyApp.appNavigatorKey.currentContext!);
}
if (mounted) { if (mounted) {
setState(() {}); setState(() {});
+1 -1
View File
@@ -10,7 +10,7 @@ part 'chat_message.g.dart';
class ChatMessage { class ChatMessage {
late Id id; late Id id;
late String time; late int time;
late String from; late String from;
+13 -93
View File
@@ -40,7 +40,7 @@ const ChatMessageSchema = CollectionSchema(
r'time': PropertySchema( r'time': PropertySchema(
id: 4, id: 4,
name: r'time', name: r'time',
type: IsarType.string, type: IsarType.long,
) )
}, },
estimateSize: _chatMessageEstimateSize, estimateSize: _chatMessageEstimateSize,
@@ -66,7 +66,6 @@ int _chatMessageEstimateSize(
bytesCount += 3 + object.from.length * 3; bytesCount += 3 + object.from.length * 3;
bytesCount += 3 + object.subj.length * 3; bytesCount += 3 + object.subj.length * 3;
bytesCount += 3 + object.text.length * 3; bytesCount += 3 + object.text.length * 3;
bytesCount += 3 + object.time.length * 3;
return bytesCount; return bytesCount;
} }
@@ -80,7 +79,7 @@ void _chatMessageSerialize(
writer.writeBool(offsets[1], object.read); writer.writeBool(offsets[1], object.read);
writer.writeString(offsets[2], object.subj); writer.writeString(offsets[2], object.subj);
writer.writeString(offsets[3], object.text); writer.writeString(offsets[3], object.text);
writer.writeString(offsets[4], object.time); writer.writeLong(offsets[4], object.time);
} }
ChatMessage _chatMessageDeserialize( ChatMessage _chatMessageDeserialize(
@@ -95,7 +94,7 @@ ChatMessage _chatMessageDeserialize(
object.read = reader.readBoolOrNull(offsets[1]); object.read = reader.readBoolOrNull(offsets[1]);
object.subj = reader.readString(offsets[2]); object.subj = reader.readString(offsets[2]);
object.text = reader.readString(offsets[3]); object.text = reader.readString(offsets[3]);
object.time = reader.readString(offsets[4]); object.time = reader.readLong(offsets[4]);
return object; return object;
} }
@@ -115,7 +114,7 @@ P _chatMessageDeserializeProp<P>(
case 3: case 3:
return (reader.readString(offset)) as P; return (reader.readString(offset)) as P;
case 4: case 4:
return (reader.readString(offset)) as P; return (reader.readLong(offset)) as P;
default: default:
throw IsarError('Unknown property with id $propertyId'); throw IsarError('Unknown property with id $propertyId');
} }
@@ -688,54 +687,46 @@ extension ChatMessageQueryFilter
} }
QueryBuilder<ChatMessage, ChatMessage, QAfterFilterCondition> timeEqualTo( QueryBuilder<ChatMessage, ChatMessage, QAfterFilterCondition> timeEqualTo(
String value, { int value) {
bool caseSensitive = true,
}) {
return QueryBuilder.apply(this, (query) { return QueryBuilder.apply(this, (query) {
return query.addFilterCondition(FilterCondition.equalTo( return query.addFilterCondition(FilterCondition.equalTo(
property: r'time', property: r'time',
value: value, value: value,
caseSensitive: caseSensitive,
)); ));
}); });
} }
QueryBuilder<ChatMessage, ChatMessage, QAfterFilterCondition> timeGreaterThan( QueryBuilder<ChatMessage, ChatMessage, QAfterFilterCondition> timeGreaterThan(
String value, { int value, {
bool include = false, bool include = false,
bool caseSensitive = true,
}) { }) {
return QueryBuilder.apply(this, (query) { return QueryBuilder.apply(this, (query) {
return query.addFilterCondition(FilterCondition.greaterThan( return query.addFilterCondition(FilterCondition.greaterThan(
include: include, include: include,
property: r'time', property: r'time',
value: value, value: value,
caseSensitive: caseSensitive,
)); ));
}); });
} }
QueryBuilder<ChatMessage, ChatMessage, QAfterFilterCondition> timeLessThan( QueryBuilder<ChatMessage, ChatMessage, QAfterFilterCondition> timeLessThan(
String value, { int value, {
bool include = false, bool include = false,
bool caseSensitive = true,
}) { }) {
return QueryBuilder.apply(this, (query) { return QueryBuilder.apply(this, (query) {
return query.addFilterCondition(FilterCondition.lessThan( return query.addFilterCondition(FilterCondition.lessThan(
include: include, include: include,
property: r'time', property: r'time',
value: value, value: value,
caseSensitive: caseSensitive,
)); ));
}); });
} }
QueryBuilder<ChatMessage, ChatMessage, QAfterFilterCondition> timeBetween( QueryBuilder<ChatMessage, ChatMessage, QAfterFilterCondition> timeBetween(
String lower, int lower,
String upper, { int upper, {
bool includeLower = true, bool includeLower = true,
bool includeUpper = true, bool includeUpper = true,
bool caseSensitive = true,
}) { }) {
return QueryBuilder.apply(this, (query) { return QueryBuilder.apply(this, (query) {
return query.addFilterCondition(FilterCondition.between( return query.addFilterCondition(FilterCondition.between(
@@ -744,76 +735,6 @@ extension ChatMessageQueryFilter
includeLower: includeLower, includeLower: includeLower,
upper: upper, upper: upper,
includeUpper: includeUpper, includeUpper: includeUpper,
caseSensitive: caseSensitive,
));
});
}
QueryBuilder<ChatMessage, ChatMessage, QAfterFilterCondition> timeStartsWith(
String value, {
bool caseSensitive = true,
}) {
return QueryBuilder.apply(this, (query) {
return query.addFilterCondition(FilterCondition.startsWith(
property: r'time',
value: value,
caseSensitive: caseSensitive,
));
});
}
QueryBuilder<ChatMessage, ChatMessage, QAfterFilterCondition> timeEndsWith(
String value, {
bool caseSensitive = true,
}) {
return QueryBuilder.apply(this, (query) {
return query.addFilterCondition(FilterCondition.endsWith(
property: r'time',
value: value,
caseSensitive: caseSensitive,
));
});
}
QueryBuilder<ChatMessage, ChatMessage, QAfterFilterCondition> timeContains(
String value,
{bool caseSensitive = true}) {
return QueryBuilder.apply(this, (query) {
return query.addFilterCondition(FilterCondition.contains(
property: r'time',
value: value,
caseSensitive: caseSensitive,
));
});
}
QueryBuilder<ChatMessage, ChatMessage, QAfterFilterCondition> timeMatches(
String pattern,
{bool caseSensitive = true}) {
return QueryBuilder.apply(this, (query) {
return query.addFilterCondition(FilterCondition.matches(
property: r'time',
wildcard: pattern,
caseSensitive: caseSensitive,
));
});
}
QueryBuilder<ChatMessage, ChatMessage, QAfterFilterCondition> timeIsEmpty() {
return QueryBuilder.apply(this, (query) {
return query.addFilterCondition(FilterCondition.equalTo(
property: r'time',
value: '',
));
});
}
QueryBuilder<ChatMessage, ChatMessage, QAfterFilterCondition>
timeIsNotEmpty() {
return QueryBuilder.apply(this, (query) {
return query.addFilterCondition(FilterCondition.greaterThan(
property: r'time',
value: '',
)); ));
}); });
} }
@@ -992,10 +913,9 @@ extension ChatMessageQueryWhereDistinct
}); });
} }
QueryBuilder<ChatMessage, ChatMessage, QDistinct> distinctByTime( QueryBuilder<ChatMessage, ChatMessage, QDistinct> distinctByTime() {
{bool caseSensitive = true}) {
return QueryBuilder.apply(this, (query) { return QueryBuilder.apply(this, (query) {
return query.addDistinctBy(r'time', caseSensitive: caseSensitive); return query.addDistinctBy(r'time');
}); });
} }
} }
@@ -1032,7 +952,7 @@ extension ChatMessageQueryProperty
}); });
} }
QueryBuilder<ChatMessage, String, QQueryOperations> timeProperty() { QueryBuilder<ChatMessage, int, QQueryOperations> timeProperty() {
return QueryBuilder.apply(this, (query) { return QueryBuilder.apply(this, (query) {
return query.addPropertyName(r'time'); return query.addPropertyName(r'time');
}); });
@@ -1045,7 +965,7 @@ extension ChatMessageQueryProperty
ChatMessage _$ChatMessageFromJson(Map<String, dynamic> json) => ChatMessage() ChatMessage _$ChatMessageFromJson(Map<String, dynamic> json) => ChatMessage()
..id = (json['id'] as num).toInt() ..id = (json['id'] as num).toInt()
..time = json['time'] as String ..time = (json['time'] as num).toInt()
..from = json['from'] as String ..from = json['from'] as String
..subj = json['subj'] as String ..subj = json['subj'] as String
..text = json['text'] as String ..text = json['text'] as String
+1 -1
View File
@@ -19,7 +19,7 @@ class Reaction {
@JsonSerializable() @JsonSerializable()
@JsonSerializable()class Track { @JsonSerializable()class Track {
late String time; late int time;
FinTaskPos? pos; FinTaskPos? pos;
@@ -20,7 +20,7 @@ Map<String, dynamic> _$ReactionToJson(Reaction instance) => <String, dynamic>{
}; };
Track _$TrackFromJson(Map<String, dynamic> json) => Track() Track _$TrackFromJson(Map<String, dynamic> json) => Track()
..time = json['time'] as String ..time = (json['time'] as num).toInt()
..pos = json['pos'] == null ..pos = json['pos'] == null
? null ? null
: FinTaskPos.fromJson(json['pos'] as Map<String, dynamic>); : FinTaskPos.fromJson(json['pos'] as Map<String, dynamic>);
+1 -1
View File
@@ -20,7 +20,7 @@ class MessageContent
late String subj; late String subj;
late String time; late int time;
MessageContent(); MessageContent();
+1 -1
View File
@@ -18,7 +18,7 @@ MessageContent _$MessageContentFromJson(Map<String, dynamic> json) =>
MessageContent() MessageContent()
..text = json['text'] as String ..text = json['text'] as String
..subj = json['subj'] as String ..subj = json['subj'] as String
..time = json['time'] as String; ..time = (json['time'] as num).toInt();
Map<String, dynamic> _$MessageContentToJson(MessageContent instance) => Map<String, dynamic> _$MessageContentToJson(MessageContent instance) =>
<String, dynamic>{ <String, dynamic>{
+2 -2
View File
@@ -33,7 +33,7 @@ class Task {
@JsonKey(name: 's_id') @JsonKey(name: 's_id')
late int sId; late int sId;
late String time; late int time;
FinTaskPos? pos; FinTaskPos? pos;
@@ -47,7 +47,7 @@ class Task {
@embedded @embedded
@JsonSerializable() @JsonSerializable()
class FinTaskPos { class FinTaskPos {
late String time; late int time;
late double lat; late double lat;
+65 -1
View File
@@ -27,6 +27,11 @@ const FinTaskPosSchema = Schema(
id: 2, id: 2,
name: r'long', name: r'long',
type: IsarType.double, type: IsarType.double,
),
r'time': PropertySchema(
id: 3,
name: r'time',
type: IsarType.long,
) )
}, },
estimateSize: _finTaskPosEstimateSize, estimateSize: _finTaskPosEstimateSize,
@@ -53,6 +58,7 @@ void _finTaskPosSerialize(
writer.writeLong(offsets[0], object.acc); writer.writeLong(offsets[0], object.acc);
writer.writeDouble(offsets[1], object.lat); writer.writeDouble(offsets[1], object.lat);
writer.writeDouble(offsets[2], object.long); writer.writeDouble(offsets[2], object.long);
writer.writeLong(offsets[3], object.time);
} }
FinTaskPos _finTaskPosDeserialize( FinTaskPos _finTaskPosDeserialize(
@@ -65,6 +71,7 @@ FinTaskPos _finTaskPosDeserialize(
object.acc = reader.readLong(offsets[0]); object.acc = reader.readLong(offsets[0]);
object.lat = reader.readDouble(offsets[1]); object.lat = reader.readDouble(offsets[1]);
object.long = reader.readDouble(offsets[2]); object.long = reader.readDouble(offsets[2]);
object.time = reader.readLong(offsets[3]);
return object; return object;
} }
@@ -81,6 +88,8 @@ P _finTaskPosDeserializeProp<P>(
return (reader.readDouble(offset)) as P; return (reader.readDouble(offset)) as P;
case 2: case 2:
return (reader.readDouble(offset)) as P; return (reader.readDouble(offset)) as P;
case 3:
return (reader.readLong(offset)) as P;
default: default:
throw IsarError('Unknown property with id $propertyId'); throw IsarError('Unknown property with id $propertyId');
} }
@@ -264,6 +273,59 @@ extension FinTaskPosQueryFilter
)); ));
}); });
} }
QueryBuilder<FinTaskPos, FinTaskPos, QAfterFilterCondition> timeEqualTo(
int value) {
return QueryBuilder.apply(this, (query) {
return query.addFilterCondition(FilterCondition.equalTo(
property: r'time',
value: value,
));
});
}
QueryBuilder<FinTaskPos, FinTaskPos, QAfterFilterCondition> timeGreaterThan(
int value, {
bool include = false,
}) {
return QueryBuilder.apply(this, (query) {
return query.addFilterCondition(FilterCondition.greaterThan(
include: include,
property: r'time',
value: value,
));
});
}
QueryBuilder<FinTaskPos, FinTaskPos, QAfterFilterCondition> timeLessThan(
int value, {
bool include = false,
}) {
return QueryBuilder.apply(this, (query) {
return query.addFilterCondition(FilterCondition.lessThan(
include: include,
property: r'time',
value: value,
));
});
}
QueryBuilder<FinTaskPos, FinTaskPos, QAfterFilterCondition> timeBetween(
int lower,
int upper, {
bool includeLower = true,
bool includeUpper = true,
}) {
return QueryBuilder.apply(this, (query) {
return query.addFilterCondition(FilterCondition.between(
property: r'time',
lower: lower,
includeLower: includeLower,
upper: upper,
includeUpper: includeUpper,
));
});
}
} }
extension FinTaskPosQueryObject extension FinTaskPosQueryObject
@@ -293,7 +355,7 @@ Map<String, dynamic> _$FinTaskToJson(FinTask instance) => <String, dynamic>{
Task _$TaskFromJson(Map<String, dynamic> json) => Task() Task _$TaskFromJson(Map<String, dynamic> json) => Task()
..sId = (json['s_id'] as num).toInt() ..sId = (json['s_id'] as num).toInt()
..time = json['time'] as String ..time = (json['time'] as num).toInt()
..pos = json['pos'] == null ..pos = json['pos'] == null
? null ? null
: FinTaskPos.fromJson(json['pos'] as Map<String, dynamic>); : FinTaskPos.fromJson(json['pos'] as Map<String, dynamic>);
@@ -305,12 +367,14 @@ Map<String, dynamic> _$TaskToJson(Task instance) => <String, dynamic>{
}; };
FinTaskPos _$FinTaskPosFromJson(Map<String, dynamic> json) => FinTaskPos() FinTaskPos _$FinTaskPosFromJson(Map<String, dynamic> json) => FinTaskPos()
..time = (json['time'] as num).toInt()
..lat = (json['lat'] as num).toDouble() ..lat = (json['lat'] as num).toDouble()
..long = (json['long'] as num).toDouble() ..long = (json['long'] as num).toDouble()
..acc = (json['acc'] as num).toInt(); ..acc = (json['acc'] as num).toInt();
Map<String, dynamic> _$FinTaskPosToJson(FinTaskPos instance) => Map<String, dynamic> _$FinTaskPosToJson(FinTaskPos instance) =>
<String, dynamic>{ <String, dynamic>{
'time': instance.time,
'lat': instance.lat, 'lat': instance.lat,
'long': instance.long, 'long': instance.long,
'acc': instance.acc, 'acc': instance.acc,
+1 -1
View File
@@ -39,7 +39,7 @@ class FinTourTask {
@JsonKey(name: 's_id') @JsonKey(name: 's_id')
late int sId; late int sId;
late String time; late int time;
String? val; String? val;
+1 -1
View File
@@ -34,7 +34,7 @@ Map<String, dynamic> _$FinTourToJson(FinTour instance) => <String, dynamic>{
FinTourTask _$FinTourTaskFromJson(Map<String, dynamic> json) => FinTourTask() FinTourTask _$FinTourTaskFromJson(Map<String, dynamic> json) => FinTourTask()
..sId = (json['s_id'] as num).toInt() ..sId = (json['s_id'] as num).toInt()
..time = json['time'] as String ..time = (json['time'] as num).toInt()
..val = json['val'] as String? ..val = json['val'] as String?
..code = (json['code'] as num?)?.toInt() ..code = (json['code'] as num?)?.toInt()
..sign = json['sign'] as String? ..sign = json['sign'] as String?
+1 -1
View File
@@ -15,7 +15,7 @@ class LogoutMessage {
@JsonSerializable() @JsonSerializable()
class LogoutMessagePosition { class LogoutMessagePosition {
late String time; late int time;
late double lat; late double lat;
+1 -1
View File
@@ -20,7 +20,7 @@ Map<String, dynamic> _$LogoutMessageToJson(LogoutMessage instance) =>
LogoutMessagePosition _$LogoutMessagePositionFromJson( LogoutMessagePosition _$LogoutMessagePositionFromJson(
Map<String, dynamic> json) => Map<String, dynamic> json) =>
LogoutMessagePosition() LogoutMessagePosition()
..time = json['time'] as String ..time = (json['time'] as num).toInt()
..lat = (json['lat'] as num).toDouble() ..lat = (json['lat'] as num).toDouble()
..long = (json['long'] as num).toDouble() ..long = (json['long'] as num).toDouble()
..acc = (json['acc'] as num).toInt(); ..acc = (json['acc'] as num).toInt();
+1 -1
View File
@@ -6,7 +6,7 @@ part 'messages_showed.g.dart';
class ChatMessagesReceived { class ChatMessagesReceived {
late List<String> ids; late List<String> ids;
late String time; late int time;
ChatMessagesReceived(); ChatMessagesReceived();
+1 -1
View File
@@ -10,7 +10,7 @@ ChatMessagesReceived _$ChatMessagesReceivedFromJson(
Map<String, dynamic> json) => Map<String, dynamic> json) =>
ChatMessagesReceived() ChatMessagesReceived()
..ids = (json['ids'] as List<dynamic>).map((e) => e as String).toList() ..ids = (json['ids'] as List<dynamic>).map((e) => e as String).toList()
..time = json['time'] as String; ..time = (json['time'] as num).toInt();
Map<String, dynamic> _$ChatMessagesReceivedToJson( Map<String, dynamic> _$ChatMessagesReceivedToJson(
ChatMessagesReceived instance) => ChatMessagesReceived instance) =>
+1 -1
View File
@@ -46,7 +46,7 @@ class SyncJobMessageJob {
@JsonSerializable() @JsonSerializable()
class SyncMessagePos { class SyncMessagePos {
late String time; late int time;
late double lat; late double lat;
@@ -48,12 +48,14 @@ Map<String, dynamic> _$SyncJobMessageJobToJson(SyncJobMessageJob instance) =>
SyncMessagePos _$SyncMessagePosFromJson(Map<String, dynamic> json) => SyncMessagePos _$SyncMessagePosFromJson(Map<String, dynamic> json) =>
SyncMessagePos() SyncMessagePos()
..time = (json['time'] as num).toInt()
..lat = (json['lat'] as num).toDouble() ..lat = (json['lat'] as num).toDouble()
..long = (json['long'] as num).toDouble() ..long = (json['long'] as num).toDouble()
..acc = (json['acc'] as num).toInt(); ..acc = (json['acc'] as num).toInt();
Map<String, dynamic> _$SyncMessagePosToJson(SyncMessagePos instance) => Map<String, dynamic> _$SyncMessagePosToJson(SyncMessagePos instance) =>
<String, dynamic>{ <String, dynamic>{
'time': instance.time,
'lat': instance.lat, 'lat': instance.lat,
'long': instance.long, 'long': instance.long,
'acc': instance.acc, 'acc': instance.acc,
+1 -1
View File
@@ -4,7 +4,7 @@ part 'track_message.g.dart';
@JsonSerializable() @JsonSerializable()
class TrackPosition { class TrackPosition {
late String time; late int time;
late double lat; late double lat;
+1 -1
View File
@@ -8,7 +8,7 @@ part of 'track_message.dart';
TrackPosition _$TrackPositionFromJson(Map<String, dynamic> json) => TrackPosition _$TrackPositionFromJson(Map<String, dynamic> json) =>
TrackPosition() TrackPosition()
..time = json['time'] as String ..time = (json['time'] as num).toInt()
..lat = (json['lat'] as num).toDouble() ..lat = (json['lat'] as num).toDouble()
..long = (json['long'] as num).toDouble() ..long = (json['long'] as num).toDouble()
..acc = (json['acc'] as num).toInt(); ..acc = (json['acc'] as num).toInt();
@@ -8,7 +8,7 @@ class TrackStationMessage {
@JsonKey(name: 's_id') @JsonKey(name: 's_id')
late int sid; late int sid;
late String time; late int time;
FinTaskPos? pos; FinTaskPos? pos;
@@ -9,7 +9,7 @@ part of 'track_station_message.dart';
TrackStationMessage _$TrackStationMessageFromJson(Map<String, dynamic> json) => TrackStationMessage _$TrackStationMessageFromJson(Map<String, dynamic> json) =>
TrackStationMessage() TrackStationMessage()
..sid = (json['s_id'] as num).toInt() ..sid = (json['s_id'] as num).toInt()
..time = json['time'] as String ..time = (json['time'] as num).toInt()
..pos = json['pos'] == null ..pos = json['pos'] == null
? null ? null
: FinTaskPos.fromJson(json['pos'] as Map<String, dynamic>); : FinTaskPos.fromJson(json['pos'] as Map<String, dynamic>);
+1 -1
View File
@@ -20,7 +20,7 @@ class ZipSetPos {
@embedded @embedded
@JsonSerializable() @JsonSerializable()
class ZipTrack { class ZipTrack {
late String time; late int time;
ZipTrackPos? pos; ZipTrackPos? pos;
+10 -88
View File
@@ -274,7 +274,7 @@ const ZipTrackSchema = Schema(
r'time': PropertySchema( r'time': PropertySchema(
id: 1, id: 1,
name: r'time', name: r'time',
type: IsarType.string, type: IsarType.long,
) )
}, },
estimateSize: _zipTrackEstimateSize, estimateSize: _zipTrackEstimateSize,
@@ -297,7 +297,6 @@ int _zipTrackEstimateSize(
value, allOffsets[ZipTrackPos]!, allOffsets); value, allOffsets[ZipTrackPos]!, allOffsets);
} }
} }
bytesCount += 3 + object.time.length * 3;
return bytesCount; return bytesCount;
} }
@@ -313,7 +312,7 @@ void _zipTrackSerialize(
ZipTrackPosSchema.serialize, ZipTrackPosSchema.serialize,
object.pos, object.pos,
); );
writer.writeString(offsets[1], object.time); writer.writeLong(offsets[1], object.time);
} }
ZipTrack _zipTrackDeserialize( ZipTrack _zipTrackDeserialize(
@@ -328,7 +327,7 @@ ZipTrack _zipTrackDeserialize(
ZipTrackPosSchema.deserialize, ZipTrackPosSchema.deserialize,
allOffsets, allOffsets,
); );
object.time = reader.readString(offsets[1]); object.time = reader.readLong(offsets[1]);
return object; return object;
} }
@@ -346,7 +345,7 @@ P _zipTrackDeserializeProp<P>(
allOffsets, allOffsets,
)) as P; )) as P;
case 1: case 1:
return (reader.readString(offset)) as P; return (reader.readLong(offset)) as P;
default: default:
throw IsarError('Unknown property with id $propertyId'); throw IsarError('Unknown property with id $propertyId');
} }
@@ -371,54 +370,46 @@ extension ZipTrackQueryFilter
} }
QueryBuilder<ZipTrack, ZipTrack, QAfterFilterCondition> timeEqualTo( QueryBuilder<ZipTrack, ZipTrack, QAfterFilterCondition> timeEqualTo(
String value, { int value) {
bool caseSensitive = true,
}) {
return QueryBuilder.apply(this, (query) { return QueryBuilder.apply(this, (query) {
return query.addFilterCondition(FilterCondition.equalTo( return query.addFilterCondition(FilterCondition.equalTo(
property: r'time', property: r'time',
value: value, value: value,
caseSensitive: caseSensitive,
)); ));
}); });
} }
QueryBuilder<ZipTrack, ZipTrack, QAfterFilterCondition> timeGreaterThan( QueryBuilder<ZipTrack, ZipTrack, QAfterFilterCondition> timeGreaterThan(
String value, { int value, {
bool include = false, bool include = false,
bool caseSensitive = true,
}) { }) {
return QueryBuilder.apply(this, (query) { return QueryBuilder.apply(this, (query) {
return query.addFilterCondition(FilterCondition.greaterThan( return query.addFilterCondition(FilterCondition.greaterThan(
include: include, include: include,
property: r'time', property: r'time',
value: value, value: value,
caseSensitive: caseSensitive,
)); ));
}); });
} }
QueryBuilder<ZipTrack, ZipTrack, QAfterFilterCondition> timeLessThan( QueryBuilder<ZipTrack, ZipTrack, QAfterFilterCondition> timeLessThan(
String value, { int value, {
bool include = false, bool include = false,
bool caseSensitive = true,
}) { }) {
return QueryBuilder.apply(this, (query) { return QueryBuilder.apply(this, (query) {
return query.addFilterCondition(FilterCondition.lessThan( return query.addFilterCondition(FilterCondition.lessThan(
include: include, include: include,
property: r'time', property: r'time',
value: value, value: value,
caseSensitive: caseSensitive,
)); ));
}); });
} }
QueryBuilder<ZipTrack, ZipTrack, QAfterFilterCondition> timeBetween( QueryBuilder<ZipTrack, ZipTrack, QAfterFilterCondition> timeBetween(
String lower, int lower,
String upper, { int upper, {
bool includeLower = true, bool includeLower = true,
bool includeUpper = true, bool includeUpper = true,
bool caseSensitive = true,
}) { }) {
return QueryBuilder.apply(this, (query) { return QueryBuilder.apply(this, (query) {
return query.addFilterCondition(FilterCondition.between( return query.addFilterCondition(FilterCondition.between(
@@ -427,75 +418,6 @@ extension ZipTrackQueryFilter
includeLower: includeLower, includeLower: includeLower,
upper: upper, upper: upper,
includeUpper: includeUpper, includeUpper: includeUpper,
caseSensitive: caseSensitive,
));
});
}
QueryBuilder<ZipTrack, ZipTrack, QAfterFilterCondition> timeStartsWith(
String value, {
bool caseSensitive = true,
}) {
return QueryBuilder.apply(this, (query) {
return query.addFilterCondition(FilterCondition.startsWith(
property: r'time',
value: value,
caseSensitive: caseSensitive,
));
});
}
QueryBuilder<ZipTrack, ZipTrack, QAfterFilterCondition> timeEndsWith(
String value, {
bool caseSensitive = true,
}) {
return QueryBuilder.apply(this, (query) {
return query.addFilterCondition(FilterCondition.endsWith(
property: r'time',
value: value,
caseSensitive: caseSensitive,
));
});
}
QueryBuilder<ZipTrack, ZipTrack, QAfterFilterCondition> timeContains(
String value,
{bool caseSensitive = true}) {
return QueryBuilder.apply(this, (query) {
return query.addFilterCondition(FilterCondition.contains(
property: r'time',
value: value,
caseSensitive: caseSensitive,
));
});
}
QueryBuilder<ZipTrack, ZipTrack, QAfterFilterCondition> timeMatches(
String pattern,
{bool caseSensitive = true}) {
return QueryBuilder.apply(this, (query) {
return query.addFilterCondition(FilterCondition.matches(
property: r'time',
wildcard: pattern,
caseSensitive: caseSensitive,
));
});
}
QueryBuilder<ZipTrack, ZipTrack, QAfterFilterCondition> timeIsEmpty() {
return QueryBuilder.apply(this, (query) {
return query.addFilterCondition(FilterCondition.equalTo(
property: r'time',
value: '',
));
});
}
QueryBuilder<ZipTrack, ZipTrack, QAfterFilterCondition> timeIsNotEmpty() {
return QueryBuilder.apply(this, (query) {
return query.addFilterCondition(FilterCondition.greaterThan(
property: r'time',
value: '',
)); ));
}); });
} }
@@ -790,7 +712,7 @@ Map<String, dynamic> _$ZipSetPosToJson(ZipSetPos instance) => <String, dynamic>{
}; };
ZipTrack _$ZipTrackFromJson(Map<String, dynamic> json) => ZipTrack() ZipTrack _$ZipTrackFromJson(Map<String, dynamic> json) => ZipTrack()
..time = json['time'] as String ..time = (json['time'] as num).toInt()
..pos = json['pos'] == null ..pos = json['pos'] == null
? null ? null
: ZipTrackPos.fromJson(json['pos'] as Map<String, dynamic>); : ZipTrackPos.fromJson(json['pos'] as Map<String, dynamic>);
+1 -1
View File
@@ -375,7 +375,7 @@ _sendAnswer(SharedMapReference mapReference, Job job, int item) async {
message.ver = job.ver.toString(); message.ver = job.ver.toString();
message.item = item; message.item = item;
message.track = Track(); message.track = Track();
message.track.time = DateTime.now().toUtc().toIso8601String(); message.track.time = Util.toUnixMillisUtc(DateTime.now().toUtc());
message.track.pos = FinTaskPos(); message.track.pos = FinTaskPos();
message.track.pos!.lat = currentPosition != null ? currentPosition.latitude : 0.0; message.track.pos!.lat = currentPosition != null ? currentPosition.latitude : 0.0;
message.track.pos!.long = currentPosition != null ? currentPosition.longitude : 0.0; message.track.pos!.long = currentPosition != null ? currentPosition.longitude : 0.0;
+2 -2
View File
@@ -595,7 +595,7 @@ class MqttCore with ProducerMixin, ConsumerMixin {
answer.utcUnixTime = DateTime.now().toUtc().millisecondsSinceEpoch ~/ 1000; answer.utcUnixTime = DateTime.now().toUtc().millisecondsSinceEpoch ~/ 1000;
answer.pos = SyncMessagePos(); answer.pos = SyncMessagePos();
answer.pos!.time = DateTime.now().toUtc().toIso8601String(); answer.pos!.time = currentPosition != null ? Util.toUnixMillisUtc(currentPosition.timestamp.toUtc()) : 0;
answer.pos!.lat = currentPosition != null ? currentPosition.latitude : 0.0; answer.pos!.lat = currentPosition != null ? currentPosition.latitude : 0.0;
answer.pos!.long = currentPosition != null ? currentPosition.longitude : 0.0; answer.pos!.long = currentPosition != null ? currentPosition.longitude : 0.0;
answer.pos!.acc = currentPosition != null ? currentPosition.accuracy.toInt() : 0; answer.pos!.acc = currentPosition != null ? currentPosition.accuracy.toInt() : 0;
@@ -622,7 +622,7 @@ class MqttCore with ProducerMixin, ConsumerMixin {
var trackMessage = TrackPosition(); var trackMessage = TrackPosition();
if (position != null) { if (position != null) {
trackMessage.time = position.timestamp.toIso8601String(); trackMessage.time = Util.toUnixMillisUtc(position.timestamp);
trackMessage.lat = position.latitude; trackMessage.lat = position.latitude;
trackMessage.long = position.longitude; trackMessage.long = position.longitude;
trackMessage.acc = position.accuracy.toInt(); trackMessage.acc = position.accuracy.toInt();
+9 -2
View File
@@ -18,6 +18,13 @@ import '../Tools/colored_safe_area.dart';
class Util { class Util {
static late SharedPreferences prefs; static late SharedPreferences prefs;
// DateTime → UTC Unix timestamps
static int toUnixMillisUtc(DateTime dt) => dt.toUtc().millisecondsSinceEpoch;
static int nowUnixMillisUtc() => DateTime.now().toUtc().millisecondsSinceEpoch;
// Optional: Unix seconds
static int toUnixSecondsUtc(DateTime dt) => dt.toUtc().millisecondsSinceEpoch ~/ 1000;
static init() async { static init() async {
prefs = await SharedPreferences.getInstance(); prefs = await SharedPreferences.getInstance();
} }
@@ -440,9 +447,9 @@ class DecimalTextInputFormatter extends TextInputFormatter {
if (text != "") { if (text != "") {
RegExp regExp; RegExp regExp;
if (decimalPlaces > 0) { if (decimalPlaces > 0) {
regExp = RegExp(r'[0-9]+[,]{0,1}[0-9]{0,${' + decimalPlaces.toString() + '}'); regExp = RegExp(r'[0-9]+[,]{0,1}[0-9]{0,${decimalPlaces}');
} else { } else {
regExp = RegExp(r'[0-9]{0,' + maxLength.toString() +'}'); regExp = RegExp(r'[0-9]{0,${maxLength}}');
} }
filteredText = regExp.stringMatch(text); filteredText = regExp.stringMatch(text);
} }
+1 -1
View File
@@ -16,7 +16,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
# In Windows, build-name is used as the major, minor, and patch parts # In Windows, build-name is used as the major, minor, and patch parts
# of the product and file versions while build-number is used as the build suffix. # of the product and file versions while build-number is used as the build suffix.
version: 339.0.0+339 version: 340.0.0+340
environment: environment:
sdk: '>=2.19.6 <3.0.0' sdk: '>=2.19.6 <3.0.0'