11import 'package:apple/Alert/alert.dart' ;
22import 'package:apple/Data/chart3.dart' ;
33import 'package:apple/Data/chart1.dart' ;
4- import 'package:apple/Data/info .dart' ;
4+ import 'package:apple/Data/definition .dart' ;
55import 'package:apple/Screens/view1.dart' ;
66import 'package:apple/Screens/view2.dart' ;
77import 'package:apple/Screens/view3.dart' ;
88import 'package:apple/Templates/card.dart' ;
9+ import 'package:apple/Templates/info.dart' ;
10+ import 'package:apple/Templates/title.dart' ;
911import 'package:intl/intl.dart' ;
1012import 'package:syncfusion_flutter_charts/charts.dart' ;
1113import 'package:flutter/cupertino.dart' ;
@@ -14,7 +16,6 @@ import 'package:apple/Screens/profile.dart';
1416import 'package:apple/Screens/setting.dart' ;
1517import 'package:cloud_firestore/cloud_firestore.dart' ;
1618import 'package:firebase_auth/firebase_auth.dart' ;
17- import 'package:syncfusion_flutter_sliders/sliders.dart' ;
1819
1920late User _currentUser;
2021
@@ -220,25 +221,7 @@ class _HomeState extends State<Home> {
220221 children: < Widget > [
221222 Card (
222223 child: Column (children: < Widget > [
223- ListTile (
224- leading: Text (
225- "Target Overview" ,
226- style: TextStyle (
227- fontSize: 18 ,
228- fontWeight: FontWeight .w600,
229- ),
230- ),
231- trailing: CupertinoButton (
232- child: Icon (CupertinoIcons .fullscreen),
233- onPressed: () {
234- Navigator .push (
235- context,
236- MaterialPageRoute (
237- builder: (context) => View1 ())
238- );
239- },
240- ),
241- ),
224+ CardTitle ("Target Overview" , View1 ()),
242225 Divider (
243226 height: 1.0 ,
244227 color: CupertinoColors .systemGrey,
@@ -338,28 +321,7 @@ class _HomeState extends State<Home> {
338321 height: 5.0 ,
339322 color: CupertinoColors .systemGrey,
340323 ),
341- Row (
342- children: [
343- InkWell (
344- onTap: () {
345- showProdInfo (context);
346- },
347- child: Padding (
348- padding: const EdgeInsets .fromLTRB (10 , 5 , 0 , 0 ),
349- child: info ('Total Production ' , _production)
350- ),
351- ),
352- InkWell (
353- onTap: () {
354- showTenderInfo (context);
355- },
356- child: Padding (
357- padding: const EdgeInsets .fromLTRB (10 , 5 , 0 , 0 ),
358- child: info ('Total Tender ' , _tender)
359- ),
360- ),
361- ],
362- ),
324+ Info (_production, _tender),
363325 Divider (
364326 height: 15.0 ,
365327 color: CupertinoColors .systemGrey,
@@ -406,25 +368,7 @@ class _HomeState extends State<Home> {
406368 ),
407369 Card (
408370 child: Column (children: < Widget > [
409- ListTile (
410- leading: Text (
411- "Target Overview" ,
412- style: TextStyle (
413- fontSize: 18 ,
414- fontWeight: FontWeight .w600,
415- ),
416- ),
417- trailing: CupertinoButton (
418- child: Icon (CupertinoIcons .fullscreen),
419- onPressed: () {
420- Navigator .push (
421- context,
422- MaterialPageRoute (
423- builder: (context) => View2 ())
424- );
425- },
426- ),
427- ),
371+ CardTitle ("Target Overview" , View2 ()),
428372 Divider (
429373 height: 1.0 ,
430374 color: CupertinoColors .systemGrey,
@@ -707,7 +651,7 @@ class _HomeState extends State<Home> {
707651 },
708652 child: Padding (
709653 padding: const EdgeInsets .fromLTRB (10 , 5 , 0 , 0 ),
710- child: info ('Current Production & Presplit ' , _production)
654+ child: defintion ('Current Production & Presplit ' , _production)
711655 ),
712656 ),
713657 Divider (
@@ -753,24 +697,7 @@ class _HomeState extends State<Home> {
753697 Card (
754698 child: Column (
755699 children: [
756- ListTile (
757- leading: Text (
758- "Target Comparison" ,
759- style: TextStyle (
760- fontSize: 18 ,
761- fontWeight: FontWeight .w600,
762- ),
763- ),
764- trailing: CupertinoButton (
765- onPressed: () {
766- Navigator .push (
767- context,
768- MaterialPageRoute (
769- builder: (context) => View3 ())
770- );
771- },
772- child: Icon (CupertinoIcons .fullscreen)),
773- ),
700+ CardTitle ("Target Comparison" , View3 ()),
774701 Divider (
775702 height: 1.0 ,
776703 color: CupertinoColors .systemGrey,
@@ -885,7 +812,7 @@ class _HomeState extends State<Home> {
885812 },
886813 child: Padding (
887814 padding: const EdgeInsets .fromLTRB (10 , 5 , 0 , 0 ),
888- child: info ('Total Presplit ' , roundDouble (presplitTotal (_chartData1), 2 ))
815+ child: defintion ('Total Presplit ' , roundDouble (presplitTotal (_chartData1), 2 ))
889816 ),
890817 ),
891818 InkWell (
@@ -903,7 +830,7 @@ class _HomeState extends State<Home> {
903830 },
904831 child: Padding (
905832 padding: const EdgeInsets .fromLTRB (10 , 5 , 0 , 0 ),
906- child: info ('Total Prod & Presplit ' , roundDouble (total (_chartData1), 2 ))
833+ child: defintion ('Total Prod & Presplit ' , roundDouble (total (_chartData1), 2 ))
907834 ),
908835 ),
909836 InkWell (
@@ -912,7 +839,7 @@ class _HomeState extends State<Home> {
912839 },
913840 child: Padding (
914841 padding: const EdgeInsets .fromLTRB (10 , 5 , 5 , 0 ),
915- child: info ('Total Tender ' , roundDouble (tenTotal (_chartData1), 2 ))
842+ child: defintion ('Total Tender ' , roundDouble (tenTotal (_chartData1), 2 ))
916843 ),
917844 ),
918845 ],
0 commit comments