Skip to content
Snippets Groups Projects
Commit faa9a56f authored by Sara Savanovic Djordjevic's avatar Sara Savanovic Djordjevic
Browse files

fix: moving quick view issue

parent 13bfa301
Branches app
No related tags found
No related merge requests found
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment