Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
PROG2900
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Sara Savanovic Djordjevic
PROG2900
Commits
53338255
Commit
53338255
authored
1 year ago
by
Sara Savanovic Djordjevic
Browse files
Options
Downloads
Patches
Plain Diff
update: selectedMarker initialisation
parent
e8840ed5
No related branches found
Branches containing commit
No related tags found
1 merge request
!2
App2
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
app/lib/pages/widgets/map_widget.dart
+16
-3
16 additions, 3 deletions
app/lib/pages/widgets/map_widget.dart
with
16 additions
and
3 deletions
app/lib/pages/widgets/map_widget.dart
+
16
−
3
View file @
53338255
...
...
@@ -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
,
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment