modify
This commit is contained in:
@@ -41,11 +41,11 @@ class _InvoiceListRowState extends State<InvoiceListRow> {
|
||||
_invoice = widget.invoice;
|
||||
}
|
||||
|
||||
fromAsset('assets/demo.pdf', 'demo.pdf').then((f) {
|
||||
setState(() {
|
||||
pdfPath = f.path;
|
||||
});
|
||||
});
|
||||
// fromAsset('assets/demo.pdf', 'demo.pdf').then((f) {
|
||||
// setState(() {
|
||||
// pdfPath = f.path;
|
||||
// });
|
||||
// });
|
||||
}
|
||||
|
||||
Future<File> fromAsset(String asset, String filename) async {
|
||||
@@ -62,7 +62,7 @@ class _InvoiceListRowState extends State<InvoiceListRow> {
|
||||
await file.writeAsBytes(bytes, flush: true);
|
||||
completer.complete(file);
|
||||
} catch (e) {
|
||||
throw Exception('Error parsing asset file!'+ e.toString());
|
||||
throw Exception('Error parsing asset file! ===> ' + e.toString());
|
||||
}
|
||||
|
||||
return completer.future;
|
||||
@@ -78,9 +78,10 @@ class _InvoiceListRowState extends State<InvoiceListRow> {
|
||||
owner
|
||||
? Navigator.of(context)
|
||||
.push(BottomUpPageRoute(InvoiceEditor(invoice: _invoice)))
|
||||
: Navigator.of(context).push(BottomUpPageRoute(PaymentPDFScreen(
|
||||
path: pdfPath,
|
||||
)));
|
||||
: Navigator.pop(context);
|
||||
// Navigator.of(context).push(BottomUpPageRoute(PaymentPDFScreen(
|
||||
// path: pdfPath,
|
||||
// )));
|
||||
},
|
||||
child: Row(
|
||||
children: <Widget>[
|
||||
@@ -167,7 +168,18 @@ class _InvoiceListRowState extends State<InvoiceListRow> {
|
||||
return CupertinoActionSheet(
|
||||
actions: <Widget>[
|
||||
CupertinoActionSheetAction(
|
||||
child: Text("Download"),
|
||||
child: Row(
|
||||
children: <Widget>[
|
||||
Icon(Icons.file_download),
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(left: 8.0),
|
||||
child: Text(
|
||||
'Download',
|
||||
style: TextStyle(fontSize: 16, color: Colors.black),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
onPressed: () {
|
||||
Navigator.pop(context);
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user