add payment

This commit is contained in:
Sai Naw Wun
2020-10-28 05:11:06 +06:30
parent 2786acfd08
commit d5c2407545
28 changed files with 740 additions and 601 deletions

View File

@@ -1,11 +1,6 @@
import 'dart:io';
import 'package:fcs/helpers/api_helper.dart';
import 'package:fcs/helpers/firebase_helper.dart';
import 'package:fcs/helpers/theme.dart';
import 'package:fcs/pages/invoice/invoice_shipment_list.dart';
import 'package:fcs/pages/invoice/model/invoice_model.dart';
import 'package:fcs/pages/invoice/payment_pdf_screen.dart';
import 'package:fcs/pages/widgets/local_popup_menu_button.dart';
import 'package:fcs/pages/widgets/local_popupmenu.dart';
import 'package:fcs/pages/widgets/local_text.dart';
@@ -38,8 +33,9 @@ class _InvoiceListState extends State<InvoiceList> {
}
});
Provider.of<InvoiceModel>(context, listen: false)
.initData(widget.forCustomer, true, false);
InvoiceModel invoiceModel =
Provider.of<InvoiceModel>(context, listen: false);
invoiceModel.initData(widget.forCustomer, true, false);
}
@override
@@ -49,7 +45,6 @@ class _InvoiceListState extends State<InvoiceList> {
@override
Widget build(BuildContext context) {
var owner = true;
var invoiceModel = Provider.of<InvoiceModel>(context);
final popupMenu = LocalPopupMenuButton(
@@ -98,8 +93,9 @@ class _InvoiceListState extends State<InvoiceList> {
color: Colors.white, fontSize: 20),
actions: <Widget>[popupMenu],
),
floatingActionButton: owner
? FloatingActionButton.extended(
floatingActionButton: widget.forCustomer
? null
: FloatingActionButton.extended(
onPressed: () {
_newInvoice();
},
@@ -107,8 +103,7 @@ class _InvoiceListState extends State<InvoiceList> {
label:
LocalText(context, 'invoices.add', color: Colors.white),
backgroundColor: primaryColor,
)
: null,
),
body: Column(
children: <Widget>[
Expanded(
@@ -118,9 +113,9 @@ class _InvoiceListState extends State<InvoiceList> {
controller: _controller,
separatorBuilder: (context, index) => Divider(
color: Colors.black,
height: 1,
),
scrollDirection: Axis.vertical,
padding: EdgeInsets.only(top: 15),
shrinkWrap: true,
itemCount: invoiceModel.invoices.length,
itemBuilder: (BuildContext context, int index) {