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

add: chart w/sample data to quick view

parent 242ee6f2
Branches
No related tags found
No related merge requests found
...@@ -4,6 +4,7 @@ import '../consts.dart'; ...@@ -4,6 +4,7 @@ import '../consts.dart';
import 'package:flutter_map/flutter_map.dart'; import 'package:flutter_map/flutter_map.dart';
import 'package:latlong2/latlong.dart'; import 'package:latlong2/latlong.dart';
import 'package:fl_chart/fl_chart.dart'; import 'package:fl_chart/fl_chart.dart';
import 'quick_view_chart.dart';
class MapContainerWidget extends StatefulWidget { class MapContainerWidget extends StatefulWidget {
final List<MarkerTemplate> markerList; final List<MarkerTemplate> markerList;
...@@ -90,16 +91,12 @@ class _MapContainerWidgetState extends State<MapContainerWidget> { ...@@ -90,16 +91,12 @@ class _MapContainerWidgetState extends State<MapContainerWidget> {
child: Stack( child: Stack(
children: [ children: [
Visibility( // Content only visible when box is maximized Visibility( // Content only visible when box is maximized
visible: !isMinimized, visible: !isMinimized && selectedMarker != null,
child: Center( child: Center(
child: SizedBox( child: SizedBox(
width: (screenWidth * boxWidth) / 2.3, width: (screenWidth * boxWidth) / 2.3,
height: (screenWidth * boxWidth) / 2.3, height: (screenWidth * boxWidth) / 2.3,
child: Text( child: const QuickViewChart(),
'Placeholder',
style: regTextStyle,
),
//child: YourChartWidget(), // Replace YourChartWidget with your actual chart widget
), ),
), ),
), ),
......
import 'package:flutter/material.dart';
import 'package:fl_chart/fl_chart.dart';
class QuickViewChart extends StatelessWidget {
const QuickViewChart({super.key});
@override
Widget build(BuildContext context) {
return LineChart(
LineChartData(
titlesData: FlTitlesData(
leftTitles: SideTitles(showTitles: true),
bottomTitles: SideTitles(showTitles: true),
),
borderData: FlBorderData(
show: true,
),
minX: 0, // Test data
maxX: 4,
minY: 0,
maxY: 50,
lineBarsData: [
LineChartBarData(
spots: [
FlSpot(0, 10), // Test data
FlSpot(1, 20),
FlSpot(2, 30),
FlSpot(3, 40),
],
isCurved: true,
colors: [Colors.blue],
),
],
),
);
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment