@@ -19,59 +19,133 @@ class _AnalyticsPageState extends State<AnalyticsPage> {
1919 @override
2020 Widget build (BuildContext context) {
2121 return Scaffold (
22- body: Stack (
23- children: < Widget > [
22+ body: Column (
23+ children: [
24+ const SizedBox (
25+ height: 20 ,
26+ ),
27+ const Text (
28+ 'Weekly Analytics' ,
29+ style: TextStyle (
30+ fontSize: 24 ,
31+ fontWeight: FontWeight .normal,
32+ ),
33+ ),
34+ const SizedBox (
35+ height: 10 ,
36+ ),
2437 AspectRatio (
2538 aspectRatio: 1.70 ,
2639 child: Padding (
2740 padding: const EdgeInsets .only (
28- right: 18 ,
29- left: 12 ,
41+ right: 0 ,
42+ left: 0 ,
3043 top: 24 ,
3144 bottom: 12 ,
3245 ),
3346 child: LineChart (
3447 showAvg ? avgData () : mainData (),
3548 ),
3649 ),
50+ // child: AnimatedPositionedDirectional(
51+ // duration: const Duration(milliseconds: 500),
52+ // curve: Curves.easeInOut,
53+ // child: LineChart(
54+ // showAvg ? avgData() : mainData(),
55+ // ),
56+ // ),
57+ ),
58+ const SizedBox (
59+ height: 20 ,
60+ ),
61+ const Text (
62+ 'Todays Production:' ,
63+ textAlign: TextAlign .left,
64+ style: TextStyle (
65+ fontSize: 24 ,
66+ fontWeight: FontWeight .normal,
67+ ),
68+ ),
69+ const Text (
70+ '1.33k' ,
71+ textAlign: TextAlign .left,
72+ style: TextStyle (
73+ fontSize: 24 ,
74+ fontWeight: FontWeight .normal,
75+ color: Color .fromARGB (96 , 0 , 0 , 0 ),
76+ ),
77+ ),
78+ const SizedBox (
79+ height: 20 ,
80+ ),
81+ const Text (
82+ 'Monthly Production:' ,
83+ textAlign: TextAlign .left,
84+ style: TextStyle (
85+ fontSize: 24 ,
86+ fontWeight: FontWeight .normal,
87+ ),
88+ ),
89+ const Text (
90+ '1.33k' ,
91+ textAlign: TextAlign .left,
92+ style: TextStyle (
93+ fontSize: 24 ,
94+ fontWeight: FontWeight .normal,
95+ color: Color .fromARGB (96 , 0 , 0 , 0 ),
96+ ),
3797 ),
38- // SizedBox(
39- // width: 60,
40- // height: 34,
41- // child: TextButton(
42- // onPressed: () {
43- // setState(() {
44- // showAvg = !showAvg;
45- // });
46- // },
47- // child: Text(
48- // 'avg',
49- // style: TextStyle(
50- // fontSize: 12,
51- // color: showAvg ? Colors.white.withOpacity(0.5) : Colors.blue,
52- // ),
53- // ),
54- // ),
55- // ),
98+ const SizedBox (
99+ height: 20 ,
100+ ),
101+ const Text (
102+ 'Average Daily Production:' ,
103+ textAlign: TextAlign .left,
104+ style: TextStyle (
105+ fontSize: 24 ,
106+ fontWeight: FontWeight .normal,
107+ ),
108+ ),
109+ const Text (
110+ '28.33k' ,
111+ textAlign: TextAlign .left,
112+ style: TextStyle (
113+ fontSize: 24 ,
114+ fontWeight: FontWeight .normal,
115+ color: Color .fromARGB (96 , 0 , 0 , 0 ),
116+ ),
117+ )
56118 ],
57119 ));
58120 }
59121
60122 Widget bottomTitleWidgets (double value, TitleMeta meta) {
61123 const style = TextStyle (
62- fontWeight: FontWeight .bold,
63- fontSize: 16 ,
124+ // fontWeight: FontWeight.bold,
125+ fontSize: 13 ,
64126 );
65127 Widget text;
66128 switch (value.toInt ()) {
129+ case 1 :
130+ text = const Text ('Mon' , style: style);
131+ break ;
67132 case 2 :
68- text = const Text ('MAR' , style: style);
133+ text = const Text ('Tue' , style: style);
134+ break ;
135+ case 3 :
136+ text = const Text ('Wed' , style: style);
137+ break ;
138+ case 4 :
139+ text = const Text ('Thu' , style: style);
69140 break ;
70141 case 5 :
71- text = const Text ('JUN' , style: style);
142+ text = const Text ('Fri' , style: style);
143+ break ;
144+ case 6 :
145+ text = const Text ('Sat' , style: style);
72146 break ;
73- case 8 :
74- text = const Text ('SEP ' , style: style);
147+ case 7 :
148+ text = const Text ('Sun ' , style: style);
75149 break ;
76150 default :
77151 text = const Text ('' , style: style);
@@ -158,39 +232,42 @@ class _AnalyticsPageState extends State<AnalyticsPage> {
158232 border: Border .all (color: const Color (0xff37434d )),
159233 ),
160234 minX: 0 ,
161- maxX: 11 ,
235+ maxX: 8 ,
162236 minY: 0 ,
163237 maxY: 6 ,
164238 lineBarsData: [
165239 LineChartBarData (
166240 spots: const [
167- FlSpot (0 , 3 ),
168- FlSpot (2.6 , 2 ),
169- FlSpot (4.9 , 5 ),
170- FlSpot (6.8 , 3.1 ),
171- FlSpot (8 , 4 ),
172- FlSpot (9.5 , 3 ),
173- FlSpot (11 , 4 ),
241+ FlSpot (1 , 2 ),
242+ FlSpot (2 , 5 ),
243+ FlSpot (3 , 3.1 ),
244+ FlSpot (4 , 4 ),
245+ FlSpot (5 , 3 ),
246+ FlSpot (6 , 4 ),
247+ FlSpot (7 , 3 ),
174248 ],
175249 isCurved: true ,
176250 gradient: LinearGradient (
177251 colors: gradientColors,
178252 ),
179- shadow: const Shadow (
180- color: Color .fromARGB (183 , 0 , 0 , 0 ),
181- blurRadius: 8 ,
182- ),
253+ // shadow: const Shadow(
254+ // color: Color.fromARGB(183, 0, 0, 0),
255+ // blurRadius: 8,
256+ // ),
183257 barWidth: 5 ,
184258 isStrokeCapRound: true ,
185259 dotData: const FlDotData (
186260 show: false ,
187261 ),
188262 belowBarData: BarAreaData (
189- show: false , // change to true to show the area below the line
190- gradient: LinearGradient (
191- colors: gradientColors
192- .map ((color) => color.withOpacity (0.3 ))
193- .toList (),
263+ show: true , // change to true to show the area below the line
264+ gradient: const LinearGradient (
265+ begin: Alignment .topCenter,
266+ end: Alignment .bottomCenter,
267+ // colors: gradientColors
268+ // .map((color) => color.withOpacity(0.3))
269+ // .toList(),
270+ colors: [Color (0xFF50E4FF ), Color .fromARGB (0 , 255 , 255 , 255 )],
194271 ),
195272 ),
196273 ),
0 commit comments