Umstellung auf UTC Timestamp

This commit is contained in:
Sven committed 2025-09-14 14:51:06 +02:00
1 parent 2e3210765c
commit 304cae926e
3 files changed
+70 -27

No files matched your search

+39 -18
View File
@@ -1,4 +1,3 @@
import 'package:dart_mq/dart_mq.dart'; import 'package:dart_mq/dart_mq.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:isar/isar.dart'; import 'package:isar/isar.dart';
@@ -28,7 +27,8 @@ class ApproachAreaPage extends ContentViewWidget {
} }
} }
class _ApproachAreaPageState extends State<ApproachAreaPage> with ProducerMixin, ConsumerMixin { class _ApproachAreaPageState extends State<ApproachAreaPage>
with ProducerMixin, ConsumerMixin {
late Ranking? _ranking; late Ranking? _ranking;
late bool _initCompleted = false; late bool _initCompleted = false;
@@ -74,7 +74,9 @@ class _ApproachAreaPageState extends State<ApproachAreaPage> with ProducerMixin,
scrollDirection: Axis.vertical, scrollDirection: Axis.vertical,
child: SingleChildScrollView( child: SingleChildScrollView(
scrollDirection: Axis.horizontal, scrollDirection: Axis.horizontal,
child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: _fillColumns()), child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: _fillColumns()),
), ),
), ),
), ),
@@ -94,8 +96,13 @@ class _ApproachAreaPageState extends State<ApproachAreaPage> with ProducerMixin,
entries.add( entries.add(
GestureDetector( GestureDetector(
onTap: () => { onTap: () => {
if (i == 0) { if (i == 0)
showZipPopup(context, 'ACHTUNG: Wenn Sie Ihre PLZ ändern, verlieren Sie Ihr Ranking!\n', 'Freimelden', (zip) => {_sendZip(rank, zip)}), {
showZipPopup(
context,
'ACHTUNG: Wenn Sie Ihre PLZ ändern, verlieren Sie Ihr Ranking!\n',
'Freimelden',
(zip) => {_sendZip(rank, zip)}),
} }
}, },
child: Container( child: Container(
@@ -114,22 +121,26 @@ class _ApproachAreaPageState extends State<ApproachAreaPage> with ProducerMixin,
child: Column(children: [ child: Column(children: [
Text( Text(
rank.zip, rank.zip,
style: TextStyle(fontSize: 20, color: (i == 0 ? Colors.white : Colors.black)), style: TextStyle(
fontSize: 20,
color: (i == 0 ? Colors.white : Colors.black)),
), ),
Text( Text(
rankArea, rankArea,
style: TextStyle(fontSize: 13, color: (i == 0 ? Colors.white : Colors.black)), style: TextStyle(
fontSize: 13,
color: (i == 0 ? Colors.white : Colors.black)),
) )
] ])),
)
),
), ),
); );
for (int j = 0; j < rank.vehicles.length; j++) { for (int j = 0; j < rank.vehicles.length; j++) {
var vehicle = rank.vehicles[j]; var vehicle = rank.vehicles[j];
var imageFilename = vehicle.self == true ? "assets/mein_${mapVehicleTypeToImageName(vehicle.type)}" : "assets/${mapVehicleTypeToImageName(vehicle.type)}"; var imageFilename = vehicle.self == true
? "assets/mein_${mapVehicleTypeToImageName(vehicle.type)}"
: "assets/${mapVehicleTypeToImageName(vehicle.type)}";
entries.add( entries.add(
badges.Badge( badges.Badge(
showBadge: vehicle.cnt != null && vehicle.cnt! > 0, showBadge: vehicle.cnt != null && vehicle.cnt! > 0,
@@ -165,9 +176,7 @@ class _ApproachAreaPageState extends State<ApproachAreaPage> with ProducerMixin,
children: [ children: [
Image.asset(imageFilename, width: 30, height: 30), Image.asset(imageFilename, width: 30, height: 30),
const SizedBox(width: 10), const SizedBox(width: 10),
Text( Text(mapVehicleTypeToText(vehicle.type)),
mapVehicleTypeToText(vehicle.type)
),
], ],
), ),
)), )),
@@ -204,7 +213,10 @@ class _ApproachAreaPageState extends State<ApproachAreaPage> with ProducerMixin,
sendMessage( sendMessage(
routingKey: Constants.messageTopicPublishPayload, routingKey: Constants.messageTopicPublishPayload,
payload: PublishPayloadMessage(topic: "set_zip", message: setPosMessage.toJson(), acknowledgeRequired: false), payload: PublishPayloadMessage(
topic: "set_zip",
message: setPosMessage.toJson(),
acknowledgeRequired: false),
); );
} }
@@ -265,7 +277,10 @@ class _HeaderWidgetState extends State<_HeaderWidget> with ProducerMixin {
child: const CircleAvatar( child: const CircleAvatar(
radius: 10, radius: 10,
backgroundColor: Constants.colorPrimary, backgroundColor: Constants.colorPrimary,
child: Padding(padding: EdgeInsets.all(1.0), child: Icon(Icons.arrow_back, size: 20.0, color: Colors.white)), child: Padding(
padding: EdgeInsets.all(1.0),
child: Icon(Icons.arrow_back,
size: 20.0, color: Colors.white)),
), ),
), ),
), ),
@@ -291,7 +306,10 @@ class _HeaderWidgetState extends State<_HeaderWidget> with ProducerMixin {
child: const CircleAvatar( child: const CircleAvatar(
backgroundColor: Constants.colorPrimary, backgroundColor: Constants.colorPrimary,
radius: 10, radius: 10,
child: Padding(padding: EdgeInsets.all(1.0), child: Icon(Icons.info_outline, size: 20.0, color: Colors.white))), child: Padding(
padding: EdgeInsets.all(1.0),
child: Icon(Icons.info_outline,
size: 20.0, color: Colors.white))),
), ),
), ),
), ),
@@ -305,7 +323,10 @@ class _HeaderWidgetState extends State<_HeaderWidget> with ProducerMixin {
child: Text( child: Text(
textAlign: TextAlign.center, textAlign: TextAlign.center,
"Anfahrtsbereich", "Anfahrtsbereich",
style: TextStyle(fontWeight: FontWeight.bold, fontSize: 18, color: Colors.white), style: TextStyle(
fontWeight: FontWeight.bold,
fontSize: 18,
color: Colors.white),
), ),
), ),
), ),
+30 -8
View File
@@ -1,9 +1,15 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:stadtbote/tools/util.dart'; import 'package:stadtbote/tools/util.dart';
showZipPopup(BuildContext context, String text, String buttonText, Function(String) onFinished) async { showZipPopup(BuildContext context, String text, String buttonText,
Function(String) onFinished) async {
final TextEditingController textEditingController = TextEditingController();
final FocusNode focusNode = FocusNode();
await showDialog( await showDialog(
context: context, context: context,
barrierDismissible: false,
builder: (BuildContext context) { builder: (BuildContext context) {
return PopScope( return PopScope(
canPop: false, canPop: false,
@@ -19,8 +25,13 @@ showZipPopup(BuildContext context, String text, String buttonText, Function(Stri
contentPadding: EdgeInsets.zero, contentPadding: EdgeInsets.zero,
shadowColor: Colors.transparent, shadowColor: Colors.transparent,
backgroundColor: Colors.white, backgroundColor: Colors.white,
content: StatefulBuilder(builder: (BuildContext context, StateSetter setState) { content: StatefulBuilder(
TextEditingController textEditingController = TextEditingController(); builder: (BuildContext context, StateSetter setState) {
WidgetsBinding.instance.addPostFrameCallback((_) {
if (context.mounted && !focusNode.hasFocus) {
focusNode.requestFocus();
}
});
return SizedBox( return SizedBox(
key: GlobalKey(), key: GlobalKey(),
@@ -40,19 +51,30 @@ showZipPopup(BuildContext context, String text, String buttonText, Function(Stri
padding: const EdgeInsets.all(35.0), padding: const EdgeInsets.all(35.0),
child: Column( child: Column(
children: [ children: [
Text(text, style: const TextStyle(fontWeight: FontWeight.bold)), Text(text,
style: const TextStyle(
fontWeight: FontWeight.bold)),
const SizedBox(height: 20), const SizedBox(height: 20),
Util.getDefaultTextField('Postleitzahl', Util.getDefaultTextField('Postleitzahl',
formatter: [DecimalTextInputFormatter(maxLength: 5, decimalPlaces: 0)], formatter: [
textInputType: const TextInputType.numberWithOptions(signed: true, decimal: true), FilteringTextInputFormatter.digitsOnly,
LengthLimitingTextInputFormatter(5),
],
textInputType: TextInputType.number,
controller: textEditingController, controller: textEditingController,
focusNode: focusNode,
autofocus: true), autofocus: true),
const SizedBox(height: 20), const SizedBox(height: 20),
getDefaultButton( getDefaultButton(
buttonText, buttonText,
() => { () => {
if (_checkInput(context, textEditingController.text)) if (_checkInput(context,
{Navigator.of(context).pop(), onFinished(textEditingController.text)}, textEditingController.text))
{
Navigator.of(context).pop(),
onFinished(
textEditingController.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: 344.0.0+344 version: 345.0.0+345
environment: environment:
sdk: '>=3.5.0 <4.0.0' sdk: '>=3.5.0 <4.0.0'