From d894b506bbecf7705330cfb77a8da909dfab811d Mon Sep 17 00:00:00 2001 From: PhyoThandar Date: Thu, 25 Jun 2020 09:06:01 +0630 Subject: [PATCH] modify --- assets/local/localization_en.json | 7 ++++- assets/local/localization_mu.json | 15 +++++++---- lib/pages/invoice/invoice_editor.dart | 2 +- lib/pages/invoice/invoice_list_row.dart | 32 ++++++++++++++++------- lib/pages/invoice/payment_page.dart | 30 +++++---------------- lib/pages/invoice/payment_pdf_screen.dart | 4 ++- 6 files changed, 48 insertions(+), 42 deletions(-) diff --git a/assets/local/localization_en.json b/assets/local/localization_en.json index dcf1c95..9cc24d5 100644 --- a/assets/local/localization_en.json +++ b/assets/local/localization_en.json @@ -553,6 +553,7 @@ "invoice.form.title":"INVOICE", "invoice.payment":"Payment Receipt", "invoice.add_box":"Add Box", + "invoice.add_package":"Add Package", "term":"TERMS", "term.btn":"Terms of services", @@ -570,5 +571,9 @@ "payment.title": "PAYMENT", "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 : " } \ No newline at end of file diff --git a/assets/local/localization_mu.json b/assets/local/localization_mu.json index 748bea1..9e72887 100644 --- a/assets/local/localization_mu.json +++ b/assets/local/localization_mu.json @@ -571,10 +571,11 @@ "invoices.btn": "ငွေတောင်းခံလွှာများ", "invoices.title": "ငွေတောင်းခံလွှာများ", - "invoices.add":"New Invoice", - "invoice.form.title":"INVOICE", - "invoice.payment":"Payment Receipt", + "invoices.add":"ငွေတောင်းခံလွှာအသစ်", + "invoice.form.title":"ငွေတောင်းခံလွှာ", + "invoice.payment":"လက်ခံဖြတ်ပိုင်း", "invoice.add_package":"Add Package", + "invoice.add_box":"Add Box", "term":"စည်းကမ်းချက်များ", "term.btn":"စည်းကမ်းချက်များ", @@ -590,6 +591,10 @@ "contact.mm.phone": "မြန်မာ ဖုန်းနံပါတ်", "payment.title": "ငွေပေးချေခြင်း", - "payment.date": "Date", - "payment.amount": "Amount" + "payment.date": "ရက်စွဲ", + "payment.amount": "ပမာဏ", + "payment.receipt":"ပေးချေပြီးပမာဏများ", + "payment.attachment":"ပေးချေပြီးဖိုင်များ", + "pdf_view.title":"ပေးဆောင်ခြင်းဖိုင်", + "remaining_balance":"ပေးချေရန်ကျန်ရှိငွေ : " } \ No newline at end of file diff --git a/lib/pages/invoice/invoice_editor.dart b/lib/pages/invoice/invoice_editor.dart index 6747cf5..623cb35 100644 --- a/lib/pages/invoice/invoice_editor.dart +++ b/lib/pages/invoice/invoice_editor.dart @@ -298,7 +298,7 @@ class _InvoiceEditorState extends State { child: FloatingActionButton.extended( icon: Icon(Icons.add), label: Text(AppTranslations.of(context) - .text("invoice.add_box")), + .text("invoice.add_package")), backgroundColor: primaryColor, onPressed: () { Navigator.of(context) diff --git a/lib/pages/invoice/invoice_list_row.dart b/lib/pages/invoice/invoice_list_row.dart index a84a49f..f0972d4 100644 --- a/lib/pages/invoice/invoice_list_row.dart +++ b/lib/pages/invoice/invoice_list_row.dart @@ -41,11 +41,11 @@ class _InvoiceListRowState extends State { _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 fromAsset(String asset, String filename) async { @@ -62,7 +62,7 @@ class _InvoiceListRowState extends State { 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 { 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: [ @@ -167,7 +168,18 @@ class _InvoiceListRowState extends State { return CupertinoActionSheet( actions: [ CupertinoActionSheetAction( - child: Text("Download"), + child: Row( + children: [ + 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); }, diff --git a/lib/pages/invoice/payment_page.dart b/lib/pages/invoice/payment_page.dart index a67361a..5aaff11 100644 --- a/lib/pages/invoice/payment_page.dart +++ b/lib/pages/invoice/payment_page.dart @@ -86,10 +86,8 @@ class _PaymentPageState extends State { child: Container( child: Row( children: [ - Text( - 'Remaining Balance : ', - style: TextStyle(fontSize: 16), - ), + LocalText(context, 'remaining_balance', + color: Colors.black, fontSize: 16), Text( '${_invoice.amount}', style: TextStyle( @@ -104,7 +102,8 @@ class _PaymentPageState extends State { child: ListView( children: [ ExpansionTile( - title: Text('Payment Attachment'), + title: LocalText(context, 'payment.attachment', + color: Colors.black, fontSize: 16), children: [ Container( padding: EdgeInsets.only(left: 20), @@ -127,7 +126,8 @@ class _PaymentPageState extends State { ], ), ExpansionTile( - title: Text('Receipt'), + title: LocalText(context, 'payment.receipt', + color: Colors.black, fontSize: 16), children: [ Container( child: SingleChildScrollView( @@ -155,24 +155,6 @@ class _PaymentPageState extends State { ), ), ), - 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), ], ), diff --git a/lib/pages/invoice/payment_pdf_screen.dart b/lib/pages/invoice/payment_pdf_screen.dart index f666483..15d5a2d 100644 --- a/lib/pages/invoice/payment_pdf_screen.dart +++ b/lib/pages/invoice/payment_pdf_screen.dart @@ -1,6 +1,7 @@ import 'dart:async'; import 'package:fcs/theme/theme.dart'; +import 'package:fcs/widget/local_text.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:flutter_pdfview/flutter_pdfview.dart'; @@ -29,7 +30,8 @@ class _PaymentPDFScreenState extends State return Scaffold( appBar: AppBar( backgroundColor: primaryColor, - title: Text("Document"), + title: LocalText(context, 'pdf_view.title', + color: Colors.white, fontSize: 20), actions: [ IconButton( icon: Icon(Icons.share),