modify
This commit is contained in:
@@ -30,7 +30,6 @@ class _InvoiceListRowState extends State<InvoiceListRow> {
|
||||
var dateFormatter = new DateFormat('dd MMM yyyy');
|
||||
final double dotSize = 15.0;
|
||||
Invoice _invoice = new Invoice();
|
||||
// String pdfPath = 'assets/Invoice-A092(A)-32.pdf';
|
||||
String pdfPath = '';
|
||||
|
||||
@override
|
||||
@@ -41,11 +40,12 @@ class _InvoiceListRowState extends State<InvoiceListRow> {
|
||||
_invoice = widget.invoice;
|
||||
}
|
||||
|
||||
// fromAsset('assets/demo.pdf', 'demo.pdf').then((f) {
|
||||
// setState(() {
|
||||
// pdfPath = f.path;
|
||||
// });
|
||||
// });
|
||||
fromAsset('assets/Invoice-A092(A)-32.pdf', 'Invoice-A092(A)-32.pdf')
|
||||
.then((f) {
|
||||
setState(() {
|
||||
pdfPath = f.path;
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
Future<File> fromAsset(String asset, String filename) async {
|
||||
@@ -73,21 +73,21 @@ class _InvoiceListRowState extends State<InvoiceListRow> {
|
||||
var owner = Provider.of<MainModel>(context).isOwner();
|
||||
return Container(
|
||||
padding: EdgeInsets.only(left: 15, right: 15),
|
||||
child: InkWell(
|
||||
onTap: () {
|
||||
owner
|
||||
? Navigator.of(context)
|
||||
.push(BottomUpPageRoute(InvoiceEditor(invoice: _invoice)))
|
||||
: Navigator.pop(context);
|
||||
// Navigator.of(context).push(BottomUpPageRoute(PaymentPDFScreen(
|
||||
// path: pdfPath,
|
||||
// )));
|
||||
},
|
||||
child: Row(
|
||||
children: <Widget>[
|
||||
Expanded(
|
||||
child: new Padding(
|
||||
padding: const EdgeInsets.symmetric(vertical: 10.0),
|
||||
child: Row(
|
||||
children: <Widget>[
|
||||
Expanded(
|
||||
child: new Padding(
|
||||
padding: const EdgeInsets.symmetric(vertical: 10.0),
|
||||
child: InkWell(
|
||||
onTap: () {
|
||||
owner
|
||||
? Navigator.of(context).push(
|
||||
BottomUpPageRoute(InvoiceEditor(invoice: _invoice)))
|
||||
: Navigator.of(context)
|
||||
.push(BottomUpPageRoute(PaymentPDFScreen(
|
||||
path: pdfPath,
|
||||
)));
|
||||
},
|
||||
child: new Row(
|
||||
children: <Widget>[
|
||||
Container(
|
||||
@@ -127,39 +127,39 @@ class _InvoiceListRowState extends State<InvoiceListRow> {
|
||||
),
|
||||
),
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsets.all(0),
|
||||
child: getStatus(_invoice.status),
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(left: 10.0),
|
||||
child: InkWell(
|
||||
child: Icon(
|
||||
Icons.payment,
|
||||
color: primaryColor,
|
||||
),
|
||||
onTap: () {
|
||||
Navigator.of(context)
|
||||
.push(BottomUpPageRoute(PaymentPage(invoice: _invoice)));
|
||||
},
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsets.all(0),
|
||||
child: getStatus(_invoice.status),
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(left: 10.0),
|
||||
child: InkWell(
|
||||
child: Icon(
|
||||
Icons.payment,
|
||||
color: primaryColor,
|
||||
),
|
||||
onTap: () {
|
||||
Navigator.of(context)
|
||||
.push(BottomUpPageRoute(PaymentPage(invoice: _invoice)));
|
||||
},
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(left: 8.0),
|
||||
child: InkWell(
|
||||
child: Icon(
|
||||
Icons.more_vert,
|
||||
color: primaryColor,
|
||||
),
|
||||
onTap: () {
|
||||
var act = actionSheet(context);
|
||||
showCupertinoModalPopup(
|
||||
context: context, builder: (BuildContext context) => act);
|
||||
},
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(left: 8.0),
|
||||
child: InkWell(
|
||||
child: Icon(
|
||||
Icons.more_vert,
|
||||
color: primaryColor,
|
||||
),
|
||||
onTap: () {
|
||||
var act = actionSheet(context);
|
||||
showCupertinoModalPopup(
|
||||
context: context, builder: (BuildContext context) => act);
|
||||
},
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user