1
1
import 'package:apple/Alert/alert.dart' ;
2
2
import 'package:apple/Data/chart3.dart' ;
3
3
import 'package:apple/Data/chart1.dart' ;
4
- import 'package:apple/Data/info .dart' ;
4
+ import 'package:apple/Data/definition .dart' ;
5
5
import 'package:apple/Screens/view1.dart' ;
6
6
import 'package:apple/Screens/view2.dart' ;
7
7
import 'package:apple/Screens/view3.dart' ;
8
8
import 'package:apple/Templates/card.dart' ;
9
+ import 'package:apple/Templates/info.dart' ;
10
+ import 'package:apple/Templates/title.dart' ;
9
11
import 'package:intl/intl.dart' ;
10
12
import 'package:syncfusion_flutter_charts/charts.dart' ;
11
13
import 'package:flutter/cupertino.dart' ;
@@ -14,7 +16,6 @@ import 'package:apple/Screens/profile.dart';
14
16
import 'package:apple/Screens/setting.dart' ;
15
17
import 'package:cloud_firestore/cloud_firestore.dart' ;
16
18
import 'package:firebase_auth/firebase_auth.dart' ;
17
- import 'package:syncfusion_flutter_sliders/sliders.dart' ;
18
19
19
20
late User _currentUser;
20
21
@@ -220,25 +221,7 @@ class _HomeState extends State<Home> {
220
221
children: < Widget > [
221
222
Card (
222
223
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 ()),
242
225
Divider (
243
226
height: 1.0 ,
244
227
color: CupertinoColors .systemGrey,
@@ -338,28 +321,7 @@ class _HomeState extends State<Home> {
338
321
height: 5.0 ,
339
322
color: CupertinoColors .systemGrey,
340
323
),
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),
363
325
Divider (
364
326
height: 15.0 ,
365
327
color: CupertinoColors .systemGrey,
@@ -406,25 +368,7 @@ class _HomeState extends State<Home> {
406
368
),
407
369
Card (
408
370
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 ()),
428
372
Divider (
429
373
height: 1.0 ,
430
374
color: CupertinoColors .systemGrey,
@@ -707,7 +651,7 @@ class _HomeState extends State<Home> {
707
651
},
708
652
child: Padding (
709
653
padding: const EdgeInsets .fromLTRB (10 , 5 , 0 , 0 ),
710
- child: info ('Current Production & Presplit ' , _production)
654
+ child: defintion ('Current Production & Presplit ' , _production)
711
655
),
712
656
),
713
657
Divider (
@@ -753,24 +697,7 @@ class _HomeState extends State<Home> {
753
697
Card (
754
698
child: Column (
755
699
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 ()),
774
701
Divider (
775
702
height: 1.0 ,
776
703
color: CupertinoColors .systemGrey,
@@ -885,7 +812,7 @@ class _HomeState extends State<Home> {
885
812
},
886
813
child: Padding (
887
814
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 ))
889
816
),
890
817
),
891
818
InkWell (
@@ -903,7 +830,7 @@ class _HomeState extends State<Home> {
903
830
},
904
831
child: Padding (
905
832
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 ))
907
834
),
908
835
),
909
836
InkWell (
@@ -912,7 +839,7 @@ class _HomeState extends State<Home> {
912
839
},
913
840
child: Padding (
914
841
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 ))
916
843
),
917
844
),
918
845
],
0 commit comments