Skip to content
Snippets Groups Projects

App2

Merged Sara Savanovic Djordjevic requested to merge app2 into main
1 file
+ 16
3
Compare changes
  • Side-by-side
  • Inline
@@ -7,6 +7,9 @@ import 'sat_layer.dart';
import 'package:flutter_map/flutter_map.dart';
import 'package:latlong2/latlong.dart';
/// MapContainerWidget is the main widget that contains the map with all
/// its layers, polygons and markers.
class MapContainerWidget extends StatefulWidget {
final List<Measurement> markerList;
@@ -24,6 +27,8 @@ class _MapContainerWidgetState extends State<MapContainerWidget> {
@override
Widget build(BuildContext context) {
// Initialise selectedMarker to first element in markerList
selectedMarker ??= widget.markerList[0];
const double contPadding = 30; // Container padding space
@@ -95,7 +100,7 @@ class _MapContainerWidgetState extends State<MapContainerWidget> {
return Marker(
width: 50,
height: 50, // NB: temporary point value
height: 50,
point: point(corners),
builder: (ctx) => GestureDetector(
onTap: () {
@@ -178,7 +183,6 @@ class _MapContainerWidgetState extends State<MapContainerWidget> {
setState(() {
satLayer = !satLayer; // Toggle satellite layer state on press
});
print("satLayer? : $satLayer");
},
child: Container(
padding: const EdgeInsets.all(8),
@@ -211,9 +215,18 @@ class _MapContainerWidgetState extends State<MapContainerWidget> {
style: titleStyle,
),
Text(
'Time of measurement: ${selectedMarker?.timeMeasured}',
'Time of measurement',
style: regTextStyle,
),
Text(
'Date ${(selectedMarker?.timeMeasured.day ?? '-')}/${(selectedMarker?.timeMeasured.month ?? '-')}/${(selectedMarker?.timeMeasured.year ?? '-')}',
style: regTextStyle,
),
Text(
'Time: ${selectedMarker?.timeMeasured.hour}:00',
style: regTextStyle,
),
const SizedBox(height: contPadding),
Text(
'Location: (placeholder, placeholder)',
style: regTextStyle,
Loading