From 831d0ad9292bd68cd9e1b8e146b25c9e0e0e27c3 Mon Sep 17 00:00:00 2001 From: Sara <sarasdj@stud.ntnu.no> Date: Fri, 9 Feb 2024 15:31:04 +0100 Subject: [PATCH] update: preliminary marker selection mechanism --- app/lib/pages/default_page.dart | 5 +-- app/lib/pages/widgets/details_widget.dart | 38 ++++++++++++++++++----- 2 files changed, 33 insertions(+), 10 deletions(-) diff --git a/app/lib/pages/default_page.dart b/app/lib/pages/default_page.dart index 22779099..fd38e444 100644 --- a/app/lib/pages/default_page.dart +++ b/app/lib/pages/default_page.dart @@ -81,9 +81,10 @@ class _DefaultPageState extends State<DefaultPage> { children: [ MapContainerWidget(markerList: markerList), const SizedBox(height: 30), // Padding between widgets - const DetailedInfoContainerWidget(), + DetailsContainerWidget(markerData: markerList.first), ], ), ); } -} \ No newline at end of file +} + diff --git a/app/lib/pages/widgets/details_widget.dart b/app/lib/pages/widgets/details_widget.dart index d42c4d6f..240cb5d3 100644 --- a/app/lib/pages/widgets/details_widget.dart +++ b/app/lib/pages/widgets/details_widget.dart @@ -1,9 +1,17 @@ import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; +import '../marker_data.dart'; -class DetailedInfoContainerWidget extends StatelessWidget { - const DetailedInfoContainerWidget({super.key}); +class DetailsContainerWidget extends StatefulWidget { + const DetailsContainerWidget({Key? key, required this.markerData}) : super(key: key); + final MarkerTemplate markerData; + + @override + _DetailsContainerWidgetState createState() => _DetailsContainerWidgetState(); +} + +class _DetailsContainerWidgetState extends State<DetailsContainerWidget> { @override Widget build(BuildContext context) { double screenWidth = MediaQuery.of(context).size.width; @@ -14,16 +22,30 @@ class DetailedInfoContainerWidget extends StatelessWidget { width: screenWidth * boxWidth, height: screenWidth * boxHeight, color: Colors.blue, - child: const Align( + child: Align( alignment: Alignment.topLeft, child: Padding( - padding: EdgeInsets.only(top: 10, left: 10), // Edge padding, text - child: Text( - 'Placeholder text', - style: TextStyle(fontSize: 20, color: Colors.black), + padding: const EdgeInsets.only(top: 10, left: 10), // Edge padding, text + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + const Text( + 'Ice thickness details', + style: TextStyle(fontSize: 30, color: Colors.black), + ), + Text( + 'Latitude: ${widget.markerData.geoData.latitude}', + style: TextStyle(fontSize: 20, color: Colors.black), + ), + Text( + 'Longitude: ${widget.markerData.geoData.longitude}', + style: TextStyle(fontSize: 20, color: Colors.black), + ), + // Add more information widgets here + ], ), ), ), ); } -} \ No newline at end of file +} -- GitLab