This commit is contained in:
PhyoThandar
2020-06-25 09:06:01 +06:30
parent 7d69f8ee70
commit d894b506bb
6 changed files with 48 additions and 42 deletions

View File

@@ -553,6 +553,7 @@
"invoice.form.title":"INVOICE", "invoice.form.title":"INVOICE",
"invoice.payment":"Payment Receipt", "invoice.payment":"Payment Receipt",
"invoice.add_box":"Add Box", "invoice.add_box":"Add Box",
"invoice.add_package":"Add Package",
"term":"TERMS", "term":"TERMS",
"term.btn":"Terms of services", "term.btn":"Terms of services",
@@ -570,5 +571,9 @@
"payment.title": "PAYMENT", "payment.title": "PAYMENT",
"payment.date": "Date", "payment.date": "Date",
"payment.amount": "Amount" "payment.amount": "Amount",
"payment.receipt":"Payment Receipt Amount",
"payment.attachment":"Payment Attachment",
"pdf_view.title":"Payment File",
"remaining_balance":"Remaining Balance : "
} }

View File

@@ -571,10 +571,11 @@
"invoices.btn": "ငွေတောင်းခံလွှာများ", "invoices.btn": "ငွေတောင်းခံလွှာများ",
"invoices.title": "ငွေတောင်းခံလွှာများ", "invoices.title": "ငွေတောင်းခံလွှာများ",
"invoices.add":"New Invoice", "invoices.add":"ငွေတောင်းခံလွှာအသစ်",
"invoice.form.title":"INVOICE", "invoice.form.title":"ငွေတောင်းခံလွှာ",
"invoice.payment":"Payment Receipt", "invoice.payment":"လက်ခံဖြတ်ပိုင်း",
"invoice.add_package":"Add Package", "invoice.add_package":"Add Package",
"invoice.add_box":"Add Box",
"term":"စည်းကမ်းချက်များ", "term":"စည်းကမ်းချက်များ",
"term.btn":"စည်းကမ်းချက်များ", "term.btn":"စည်းကမ်းချက်များ",
@@ -590,6 +591,10 @@
"contact.mm.phone": "မြန်မာ ဖုန်းနံပါတ်", "contact.mm.phone": "မြန်မာ ဖုန်းနံပါတ်",
"payment.title": "ငွေပေးချေခြင်း", "payment.title": "ငွေပေးချေခြင်း",
"payment.date": "Date", "payment.date": "ရက်စွဲ",
"payment.amount": "Amount" "payment.amount": "ပမာဏ",
"payment.receipt":"ပေးချေပြီးပမာဏများ",
"payment.attachment":"ပေးချေပြီးဖိုင်များ",
"pdf_view.title":"ပေးဆောင်ခြင်းဖိုင်",
"remaining_balance":"ပေးချေရန်ကျန်ရှိငွေ : "
} }

View File

@@ -298,7 +298,7 @@ class _InvoiceEditorState extends State<InvoiceEditor> {
child: FloatingActionButton.extended( child: FloatingActionButton.extended(
icon: Icon(Icons.add), icon: Icon(Icons.add),
label: Text(AppTranslations.of(context) label: Text(AppTranslations.of(context)
.text("invoice.add_box")), .text("invoice.add_package")),
backgroundColor: primaryColor, backgroundColor: primaryColor,
onPressed: () { onPressed: () {
Navigator.of(context) Navigator.of(context)

View File

@@ -41,11 +41,11 @@ class _InvoiceListRowState extends State<InvoiceListRow> {
_invoice = widget.invoice; _invoice = widget.invoice;
} }
fromAsset('assets/demo.pdf', 'demo.pdf').then((f) { // fromAsset('assets/demo.pdf', 'demo.pdf').then((f) {
setState(() { // setState(() {
pdfPath = f.path; // pdfPath = f.path;
}); // });
}); // });
} }
Future<File> fromAsset(String asset, String filename) async { Future<File> fromAsset(String asset, String filename) async {
@@ -62,7 +62,7 @@ class _InvoiceListRowState extends State<InvoiceListRow> {
await file.writeAsBytes(bytes, flush: true); await file.writeAsBytes(bytes, flush: true);
completer.complete(file); completer.complete(file);
} catch (e) { } catch (e) {
throw Exception('Error parsing asset file!'+ e.toString()); throw Exception('Error parsing asset file! ===> ' + e.toString());
} }
return completer.future; return completer.future;
@@ -78,9 +78,10 @@ class _InvoiceListRowState extends State<InvoiceListRow> {
owner owner
? Navigator.of(context) ? Navigator.of(context)
.push(BottomUpPageRoute(InvoiceEditor(invoice: _invoice))) .push(BottomUpPageRoute(InvoiceEditor(invoice: _invoice)))
: Navigator.of(context).push(BottomUpPageRoute(PaymentPDFScreen( : Navigator.pop(context);
path: pdfPath, // Navigator.of(context).push(BottomUpPageRoute(PaymentPDFScreen(
))); // path: pdfPath,
// )));
}, },
child: Row( child: Row(
children: <Widget>[ children: <Widget>[
@@ -167,7 +168,18 @@ class _InvoiceListRowState extends State<InvoiceListRow> {
return CupertinoActionSheet( return CupertinoActionSheet(
actions: <Widget>[ actions: <Widget>[
CupertinoActionSheetAction( 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: () { onPressed: () {
Navigator.pop(context); Navigator.pop(context);
}, },

View File

@@ -86,10 +86,8 @@ class _PaymentPageState extends State<PaymentPage> {
child: Container( child: Container(
child: Row( child: Row(
children: <Widget>[ children: <Widget>[
Text( LocalText(context, 'remaining_balance',
'Remaining Balance : ', color: Colors.black, fontSize: 16),
style: TextStyle(fontSize: 16),
),
Text( Text(
'${_invoice.amount}', '${_invoice.amount}',
style: TextStyle( style: TextStyle(
@@ -104,7 +102,8 @@ class _PaymentPageState extends State<PaymentPage> {
child: ListView( child: ListView(
children: [ children: [
ExpansionTile( ExpansionTile(
title: Text('Payment Attachment'), title: LocalText(context, 'payment.attachment',
color: Colors.black, fontSize: 16),
children: <Widget>[ children: <Widget>[
Container( Container(
padding: EdgeInsets.only(left: 20), padding: EdgeInsets.only(left: 20),
@@ -127,7 +126,8 @@ class _PaymentPageState extends State<PaymentPage> {
], ],
), ),
ExpansionTile( ExpansionTile(
title: Text('Receipt'), title: LocalText(context, 'payment.receipt',
color: Colors.black, fontSize: 16),
children: <Widget>[ children: <Widget>[
Container( Container(
child: SingleChildScrollView( child: SingleChildScrollView(
@@ -155,24 +155,6 @@ class _PaymentPageState extends State<PaymentPage> {
), ),
), ),
), ),
owner
? Container(
padding: EdgeInsets.only(top: 20),
child: Align(
alignment: Alignment.bottomRight,
child: FloatingActionButton.extended(
icon: Icon(Icons.add),
label: Text(AppTranslations.of(context)
.text("invoice.add_box")),
backgroundColor: primaryColor,
onPressed: () {
// Navigator.of(context)
// .push(BottomUpPageRoute(PackageAddition()));
},
),
),
)
: Container(),
SizedBox(height: 25), SizedBox(height: 25),
], ],
), ),

View File

@@ -1,6 +1,7 @@
import 'dart:async'; import 'dart:async';
import 'package:fcs/theme/theme.dart'; import 'package:fcs/theme/theme.dart';
import 'package:fcs/widget/local_text.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_pdfview/flutter_pdfview.dart'; import 'package:flutter_pdfview/flutter_pdfview.dart';
@@ -29,7 +30,8 @@ class _PaymentPDFScreenState extends State<PaymentPDFScreen>
return Scaffold( return Scaffold(
appBar: AppBar( appBar: AppBar(
backgroundColor: primaryColor, backgroundColor: primaryColor,
title: Text("Document"), title: LocalText(context, 'pdf_view.title',
color: Colors.white, fontSize: 20),
actions: <Widget>[ actions: <Widget>[
IconButton( IconButton(
icon: Icon(Icons.share), icon: Icon(Icons.share),