diff --git a/app/lib/pages/widgets/map_widget.dart b/app/lib/pages/widgets/map_widget.dart index fb4f8d6fdbec0ff9ed5eab63349992ae1d43626c..439253742f208604e47dc46a5fc1b5e809ff9827 100644 --- a/app/lib/pages/widgets/map_widget.dart +++ b/app/lib/pages/widgets/map_widget.dart @@ -37,84 +37,88 @@ class _MapContainerWidgetState extends State<MapContainerWidget> { const SizedBox(height: contPadding), ClipRRect( borderRadius: BorderRadius.circular(20), - child: Container( - width: screenWidth * boxWidth, - height: screenWidth * boxHeight, - child: FlutterMap( - options: MapOptions( - center: LatLng(60.7666, 10.8471), - zoom: 9.0, - ), - children: [ - TileLayer( - urlTemplate: "https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png", - subdomains: const ['a', 'b', 'c'], - ), - MarkerLayer( - markers: widget.markerList.map((MarkerTemplate markerTemplate) { - return Marker( - width: markerTemplate.size, - height: markerTemplate.size, - point: markerTemplate.location, - builder: (ctx) => GestureDetector( - onTap: () { - setState(() { - selectedMarker = markerTemplate; - }); - }, - child: Image.asset( - 'assets/icons/circle-red.png', - color: markerTemplate.color, + child: Stack( + children: [ + SizedBox( + width: screenWidth * boxWidth, + height: screenWidth * boxHeight, + child: FlutterMap( + options: MapOptions( + center: LatLng(60.7666, 10.8471), + zoom: 9.0, + ), + children: [ + TileLayer( + urlTemplate: "https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png", + subdomains: const ['a', 'b', 'c'], + ), + MarkerLayer( + markers: widget.markerList.map((MarkerTemplate markerTemplate) { + return Marker( width: markerTemplate.size, height: markerTemplate.size, - ), - ), - ); - }).toList(), + point: markerTemplate.location, + builder: (ctx) => GestureDetector( + onTap: () { + setState(() { + selectedMarker = markerTemplate; + }); + }, + child: Image.asset( + 'assets/icons/circle-red.png', + color: markerTemplate.color, + width: markerTemplate.size, + height: markerTemplate.size, + ), + ), + ); + }).toList(), + ), + ], ), - Positioned( - bottom: 10, - right: 10, - child: ClipRRect( - borderRadius: BorderRadius.circular(10), - child: Container( - width: (screenWidth * boxWidth) / 2.4, - height: isMinimized ? 20 : (screenWidth * boxWidth) / 2.4, - color: Colors.blue.withOpacity(0.7), - child: Stack( - children: [ - Visibility( // Content only visible when box is maximized - visible: !isMinimized && selectedMarker != null, - child: Center( - child: Padding( - padding: const EdgeInsets.only(right: 16.0, top: 17.0), - child: SizedBox( - width: (screenWidth * boxWidth) / 2.3, - height: (screenWidth * boxWidth) / 2.3, - child: const QuickViewChart(), - ), + ), + Positioned( + bottom: 10, + right: 10, + child: ClipRRect( + borderRadius: BorderRadius.circular(10), + child: Container( + width: (screenWidth * boxWidth) / 2.4, + height: isMinimized ? 20 : (screenWidth * boxWidth) / 2.4, + color: Colors.blue.withOpacity(0.7), + child: Stack( + children: [ + Visibility( // Content only visible when box is maximized + visible: !isMinimized && selectedMarker != null, + child: Center( + child: Padding( + padding: const EdgeInsets.only(right: 16.0, top: 17.0), + child: SizedBox( + width: (screenWidth * boxWidth) / 2.3, + height: (screenWidth * boxWidth) / 2.3, + child: const QuickViewChart(), ), ), ), - Positioned( - top: 0, - right: 5, - child: GestureDetector( - onTap: () { - setState(() { - isMinimized = !isMinimized; // Toggle the minimized state - }); - }, - child: Icon(isMinimized ? Icons.arrow_drop_up : Icons.arrow_drop_down), - ), + ), + Positioned( + top: 0, + right: 5, + child: GestureDetector( + onTap: () { + setState(() { + isMinimized = !isMinimized; // Toggle minimized state + }); + }, + child: Icon(isMinimized ? Icons.arrow_drop_up : Icons.arrow_drop_down), ), - ], - ), + ), + ], ), ), ), - ], - ), + ), + ], ), ), const SizedBox(height: contPadding), // Padding between containers