@@ -376,6 +376,7 @@ class ReceiptInputController extends State<ReceiptForm> {
376
376
],
377
377
),
378
378
getItems (),
379
+ getItemListButton ()
379
380
],
380
381
),
381
382
))),
@@ -550,7 +551,7 @@ class ReceiptInputController extends State<ReceiptForm> {
550
551
)),
551
552
Container (
552
553
color: Colors .white,
553
- height: (75 * itemList.length).toDouble () - 20 ,
554
+ height: (50 * itemList.length).toDouble (),
554
555
child: ListView .builder (
555
556
padding: const EdgeInsets .all (8.0 ),
556
557
itemCount: itemList.length,
@@ -559,27 +560,6 @@ class ReceiptInputController extends State<ReceiptForm> {
559
560
final receipt = itemList[index];
560
561
return _item (receipt);
561
562
})),
562
- PaddingFactory .create (Align (
563
- alignment: Alignment .topRight,
564
- child: RaisedButton (
565
- onPressed: () {
566
- log ("Add itemlist" );
567
- setState (() {
568
- List <dynamic > item = ["Receipt item" , "0.00" ];
569
- this .itemList.add (item);
570
- });
571
- },
572
- shape: RoundedRectangleBorder (
573
- borderRadius: BorderRadius .circular (18.0 ),
574
- side: BorderSide (color: Colors .black)),
575
- child: Column (children: [Icon (Icons .add, color: Colors .white)]),
576
- color: Colors .black,
577
- textColor: Colors .black,
578
- elevation: 5 ,
579
- ))),
580
- Container (
581
- height: 50 ,
582
- )
583
563
]);
584
564
;
585
565
}
@@ -678,4 +658,27 @@ class ReceiptInputController extends State<ReceiptForm> {
678
658
storeNameController.clear ();
679
659
dateController.clear ();
680
660
}
661
+
662
+ Widget getItemListButton () {
663
+ if (itemList == null ) return Container ();
664
+
665
+ return PaddingFactory .create (Align (
666
+ alignment: Alignment .topRight,
667
+ child: RaisedButton (
668
+ onPressed: () {
669
+ log ("Add itemlist" );
670
+ setState (() {
671
+ List <dynamic > item = ["Receipt item" , "0.00" ];
672
+ this .itemList.add (item);
673
+ });
674
+ },
675
+ shape: RoundedRectangleBorder (
676
+ borderRadius: BorderRadius .circular (18.0 ),
677
+ side: BorderSide (color: Colors .black)),
678
+ child: Column (children: [Icon (Icons .add, color: Colors .white)]),
679
+ color: Colors .black,
680
+ textColor: Colors .black,
681
+ elevation: 5 ,
682
+ )));
683
+ }
681
684
}
0 commit comments