Fix date + map marker selection

This commit is contained in:
Thomas Fransolet 2024-03-13 16:15:03 +01:00
parent e0154aae3f
commit f9f0564b5f
2 changed files with 8 additions and 5 deletions

View File

@ -50,7 +50,7 @@ class _MainViewWidget extends State<MainViewWidget> {
Size sizeScreen = new Size(1080.0, 1920.0); // Tablet resolution Size sizeScreen = new Size(1080.0, 1920.0); // Tablet resolution
SectionDTO? sectionSelected; SectionDTO? sectionSelected;
late ConfigurationDTO configurationDTO; late ConfigurationDTO configurationDTO;
ValueNotifier<DateTime?> currentHourDate = ValueNotifier<DateTime?>(DateTime.now()); ValueNotifier<DateTime?> currentHourDate = ValueNotifier<DateTime?>((DateTime.now().toUtc()).add(Duration(hours: 1)));
late Color backgroundColor; late Color backgroundColor;
int rowCount = 4; int rowCount = 4;
@ -75,7 +75,7 @@ class _MainViewWidget extends State<MainViewWidget> {
//setState(() { //setState(() {
//_timeString = formattedDateTime; //_timeString = formattedDateTime;
valueNotifier.value = DateTime.now(); valueNotifier.value = (DateTime.now().toUtc()).add(Duration(hours: 1));
//}); //});
} }

View File

@ -56,10 +56,11 @@ class _MapBoxViewState extends State<MapBoxView> {
createPoints() { createPoints() {
var options = <mapBox.PointAnnotationOptions>[]; var options = <mapBox.PointAnnotationOptions>[];
int i = 0;
pointsToShow!.forEach((point) { pointsToShow!.forEach((point) {
var textSansHTML = parse(point.title!.firstWhere((translation) => translation.language == widget.language).value); var textSansHTML = parse(point.title!.firstWhere((translation) => translation.language == widget.language).value);
var mapMarker = new MapMarker( var mapMarker = new MapMarker(
id: point.id, id: i,
title: parse(textSansHTML.body!.text).documentElement!.text, title: parse(textSansHTML.body!.text).documentElement!.text,
description: point.description!.firstWhere((translation) => translation.language == widget.language).value, description: point.description!.firstWhere((translation) => translation.language == widget.language).value,
longitude: point.longitude, longitude: point.longitude,
@ -67,7 +68,6 @@ class _MapBoxViewState extends State<MapBoxView> {
contents: point.contents contents: point.contents
); );
markersList.add(mapMarker); markersList.add(mapMarker);
print(widget.selectedMarkerIcon);
options.add(mapBox.PointAnnotationOptions( options.add(mapBox.PointAnnotationOptions(
geometry: mapBox.Point( geometry: mapBox.Point(
coordinates: mapBox.Position( coordinates: mapBox.Position(
@ -75,7 +75,7 @@ class _MapBoxViewState extends State<MapBoxView> {
double.tryParse(mapMarker.latitude!)!, double.tryParse(mapMarker.latitude!)!,
)).toJson(), )).toJson(),
iconSize: 1.3, iconSize: 1.3,
textField: mapMarker.id.toString(), textField: i.toString(),
textOpacity: 0.0, textOpacity: 0.0,
iconOffset: [0.0, 0.0], iconOffset: [0.0, 0.0],
symbolSortKey: 10, symbolSortKey: 10,
@ -83,7 +83,10 @@ class _MapBoxViewState extends State<MapBoxView> {
iconImage: null, iconImage: null,
image: widget.selectedMarkerIcon, //widget.selectedMarkerIcon, image: widget.selectedMarkerIcon, //widget.selectedMarkerIcon,
)); // , )); // ,
i++;
}); });
print(options.length); print(options.length);
return options; return options;