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
+109 -66

No files matched your search

+43 -22
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,9 +96,14 @@ 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(
padding: const EdgeInsets.all(4), padding: const EdgeInsets.all(4),
@@ -114,24 +121,28 @@ 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,
position: badges.BadgePosition.topEnd(top: -12, end: 0), position: badges.BadgePosition.topEnd(top: -12, end: 0),
badgeContent: Text( badgeContent: Text(
@@ -165,13 +176,11 @@ 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)
),
], ],
), ),
)), )),
); );
} }
columns.add(Align( columns.add(Align(
@@ -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),
), ),
), ),
), ),
@@ -313,4 +334,4 @@ class _HeaderWidgetState extends State<_HeaderWidget> with ProducerMixin {
), ),
); );
} }
} }
+65 -43
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,
@@ -16,49 +22,65 @@ showZipPopup(BuildContext context, String text, String buttonText, Function(Stri
} }
}, },
child: AlertDialog( child: AlertDialog(
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(),
height: 293, height: 293,
width: MediaQuery.of(context).size.width * 0.8, width: MediaQuery.of(context).size.width * 0.8,
child: Container( child: Container(
height: 100, height: 100,
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.circular(10), borderRadius: BorderRadius.circular(10),
color: Colors.white, color: Colors.white,
border: Border.all( border: Border.all(
color: Colors.grey, color: Colors.grey,
width: 0.5, width: 0.5,
), ),
), ),
child: Padding( child: Padding(
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,
const SizedBox(height: 20), style: const TextStyle(
Util.getDefaultTextField('Postleitzahl', fontWeight: FontWeight.bold)),
formatter: [DecimalTextInputFormatter(maxLength: 5, decimalPlaces: 0)], const SizedBox(height: 20),
textInputType: const TextInputType.numberWithOptions(signed: true, decimal: true), Util.getDefaultTextField('Postleitzahl',
controller: textEditingController, formatter: [
autofocus: true), FilteringTextInputFormatter.digitsOnly,
const SizedBox(height: 20), LengthLimitingTextInputFormatter(5),
getDefaultButton( ],
buttonText, textInputType: TextInputType.number,
() => { controller: textEditingController,
if (_checkInput(context, textEditingController.text)) focusNode: focusNode,
{Navigator.of(context).pop(), onFinished(textEditingController.text)}, autofocus: true),
}), const SizedBox(height: 20),
], getDefaultButton(
), buttonText,
), () => {
)); if (_checkInput(context,
}))); 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'