Merge branch 'master' of phyothandar/fcs into master
This commit is contained in:
BIN
assets/Invoice-A092(A)-32.pdf
Normal file
BIN
assets/Invoice-A092(A)-32.pdf
Normal file
Binary file not shown.
51897
assets/demo.pdf
Normal file
51897
assets/demo.pdf
Normal file
File diff suppressed because it is too large
Load Diff
@@ -565,5 +565,9 @@
|
|||||||
"fcs.profile": "FCS PROFILE",
|
"fcs.profile": "FCS PROFILE",
|
||||||
|
|
||||||
"contact.usa.phone": "USA Phone",
|
"contact.usa.phone": "USA Phone",
|
||||||
"contact.mm.phone": "Myanmar Phone"
|
"contact.mm.phone": "Myanmar Phone",
|
||||||
|
|
||||||
|
"payment.title": "PAYMENT",
|
||||||
|
"payment.date": "Date",
|
||||||
|
"payment.amount": "Amount"
|
||||||
}
|
}
|
||||||
@@ -586,5 +586,9 @@
|
|||||||
"fcs.profile": "ပရိုဖိုင်",
|
"fcs.profile": "ပရိုဖိုင်",
|
||||||
|
|
||||||
"contact.usa.phone": "ယူအက်စ်အေ ဖုန်းနံပါတ်",
|
"contact.usa.phone": "ယူအက်စ်အေ ဖုန်းနံပါတ်",
|
||||||
"contact.mm.phone": "မြန်မာ ဖုန်းနံပါတ်"
|
"contact.mm.phone": "မြန်မာ ဖုန်းနံပါတ်",
|
||||||
|
|
||||||
|
"payment.title": "ငွေပေးချေခြင်း",
|
||||||
|
"payment.date": "Date",
|
||||||
|
"payment.amount": "Amount"
|
||||||
}
|
}
|
||||||
@@ -6,7 +6,7 @@ import 'base_model.dart';
|
|||||||
class InvoiceModel extends BaseModel {
|
class InvoiceModel extends BaseModel {
|
||||||
List<Invoice> invoices = [
|
List<Invoice> invoices = [
|
||||||
Invoice(
|
Invoice(
|
||||||
invoiceNumber: 'INV202004050010',
|
invoiceNumber: 'A092(A)-30',
|
||||||
invoiceDate: DateTime(2020, 4, 5, 12, 30),
|
invoiceDate: DateTime(2020, 4, 5, 12, 30),
|
||||||
customerName: 'Ko Nyi',
|
customerName: 'Ko Nyi',
|
||||||
customerPhoneNumber: '+959 888888888',
|
customerPhoneNumber: '+959 888888888',
|
||||||
@@ -34,9 +34,13 @@ class InvoiceModel extends BaseModel {
|
|||||||
status: "Received",
|
status: "Received",
|
||||||
arrivedDate: DateTime(2020, 6, 1),
|
arrivedDate: DateTime(2020, 6, 1),
|
||||||
receiverAddress: '1 Bo Yar Nyunt St.\nDagon Tsp, Yangon'),
|
receiverAddress: '1 Bo Yar Nyunt St.\nDagon Tsp, Yangon'),
|
||||||
|
],
|
||||||
|
receipts: [
|
||||||
|
Receipt(amount: 2000, date: DateTime(2020, 6, 1)),
|
||||||
|
Receipt(amount: 1000, date: DateTime(2020, 6, 16)),
|
||||||
]),
|
]),
|
||||||
Invoice(
|
Invoice(
|
||||||
invoiceNumber: 'INV202004050011',
|
invoiceNumber: 'A092(A)-31',
|
||||||
invoiceDate: DateTime(2020, 4, 5, 9, 30),
|
invoiceDate: DateTime(2020, 4, 5, 9, 30),
|
||||||
customerName: 'Ko Aung Myo',
|
customerName: 'Ko Aung Myo',
|
||||||
customerPhoneNumber: '+959 444444444',
|
customerPhoneNumber: '+959 444444444',
|
||||||
@@ -63,9 +67,12 @@ class InvoiceModel extends BaseModel {
|
|||||||
status: "Processing",
|
status: "Processing",
|
||||||
arrivedDate: DateTime(2020, 6, 1),
|
arrivedDate: DateTime(2020, 6, 1),
|
||||||
receiverAddress: '2 Shwe Taung Kyar St, Bahan Tsp, Yangon'),
|
receiverAddress: '2 Shwe Taung Kyar St, Bahan Tsp, Yangon'),
|
||||||
|
],
|
||||||
|
receipts: [
|
||||||
|
Receipt(amount: 2000, date: DateTime(2020, 6, 1)),
|
||||||
]),
|
]),
|
||||||
Invoice(
|
Invoice(
|
||||||
invoiceNumber: 'INV202004060010',
|
invoiceNumber: 'A092(A)-32',
|
||||||
invoiceDate: DateTime(2020, 4, 6, 10, 10),
|
invoiceDate: DateTime(2020, 4, 6, 10, 10),
|
||||||
customerName: 'Ko Zaw Thu',
|
customerName: 'Ko Zaw Thu',
|
||||||
customerPhoneNumber: '+959 777777777',
|
customerPhoneNumber: '+959 777777777',
|
||||||
@@ -92,14 +99,20 @@ class InvoiceModel extends BaseModel {
|
|||||||
status: "Delivered",
|
status: "Delivered",
|
||||||
arrivedDate: DateTime(2020, 5, 21),
|
arrivedDate: DateTime(2020, 5, 21),
|
||||||
receiverAddress: '3 Kambzwza St, Bahan Tsp, Yangon'),
|
receiverAddress: '3 Kambzwza St, Bahan Tsp, Yangon'),
|
||||||
|
],
|
||||||
|
receipts: [
|
||||||
|
Receipt(amount: 2000, date: DateTime(2020, 6, 1)),
|
||||||
]),
|
]),
|
||||||
Invoice(
|
Invoice(
|
||||||
invoiceNumber: 'INV202004060011',
|
invoiceNumber: 'A092(A)-33',
|
||||||
invoiceDate: DateTime(2020, 4, 6, 12, 15),
|
invoiceDate: DateTime(2020, 4, 6, 12, 15),
|
||||||
customerName: 'Ko Myo Min',
|
customerName: 'Ko Myo Min',
|
||||||
customerPhoneNumber: '+959 555555555',
|
customerPhoneNumber: '+959 555555555',
|
||||||
amount: 3000,
|
amount: 3000,
|
||||||
status: 'Pending',
|
status: 'Pending',
|
||||||
|
receipts: [
|
||||||
|
Receipt(amount: 2000, date: DateTime(2020, 6, 1)),
|
||||||
|
],
|
||||||
packages: [
|
packages: [
|
||||||
Package(
|
Package(
|
||||||
shipmentNumber: "A201",
|
shipmentNumber: "A201",
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ class PackageModel extends BaseModel {
|
|||||||
arrivedDate: DateTime(2020, 6, 1),
|
arrivedDate: DateTime(2020, 6, 1),
|
||||||
market: "Amazon",
|
market: "Amazon",
|
||||||
id: "PKG2039",
|
id: "PKG2039",
|
||||||
trackingID: "23-234s-asdfl"),
|
trackingID: "23-234s-asdfl",statusHistory: statusHistory),
|
||||||
Package(
|
Package(
|
||||||
shipmentNumber: "A202",
|
shipmentNumber: "A202",
|
||||||
receiverNumber: "3",
|
receiverNumber: "3",
|
||||||
@@ -46,7 +46,7 @@ class PackageModel extends BaseModel {
|
|||||||
market: "Macy",
|
market: "Macy",
|
||||||
trackingID: "asd-sdf-23498",
|
trackingID: "asd-sdf-23498",
|
||||||
id: "PKG2040",
|
id: "PKG2040",
|
||||||
receiverAddress: '1 Bo Yar Nyunt St.\nDagon Tsp, Yangon'),
|
receiverAddress: '1 Bo Yar Nyunt St.\nDagon Tsp, Yangon',statusHistory: statusHistory),
|
||||||
Package(
|
Package(
|
||||||
shipmentNumber: "A202",
|
shipmentNumber: "A202",
|
||||||
receiverNumber: "3",
|
receiverNumber: "3",
|
||||||
@@ -61,7 +61,7 @@ class PackageModel extends BaseModel {
|
|||||||
trackingID: "8923-234-sd",
|
trackingID: "8923-234-sd",
|
||||||
id: "PKG2041",
|
id: "PKG2041",
|
||||||
arrivedDate: DateTime(2020, 6, 1),
|
arrivedDate: DateTime(2020, 6, 1),
|
||||||
receiverAddress: '1 Bo Yar Nyunt St.\nDagon Tsp, Yangon'),
|
receiverAddress: '1 Bo Yar Nyunt St.\nDagon Tsp, Yangon',statusHistory: statusHistory),
|
||||||
Package(
|
Package(
|
||||||
shipmentNumber: "A202",
|
shipmentNumber: "A202",
|
||||||
receiverNumber: "2",
|
receiverNumber: "2",
|
||||||
@@ -76,7 +76,7 @@ class PackageModel extends BaseModel {
|
|||||||
cargoDesc: "Dietary supplement",
|
cargoDesc: "Dietary supplement",
|
||||||
id: "PKG2042",
|
id: "PKG2042",
|
||||||
arrivedDate: DateTime(2020, 6, 1),
|
arrivedDate: DateTime(2020, 6, 1),
|
||||||
receiverAddress: '2 Shwe Taung Kyar St, Bahan Tsp, Yangon'),
|
receiverAddress: '2 Shwe Taung Kyar St, Bahan Tsp, Yangon',statusHistory: statusHistory),
|
||||||
Package(
|
Package(
|
||||||
shipmentNumber: "A202",
|
shipmentNumber: "A202",
|
||||||
receiverNumber: "2",
|
receiverNumber: "2",
|
||||||
@@ -91,7 +91,7 @@ class PackageModel extends BaseModel {
|
|||||||
status: "Processed",
|
status: "Processed",
|
||||||
id: "PKG2043",
|
id: "PKG2043",
|
||||||
arrivedDate: DateTime(2020, 6, 1),
|
arrivedDate: DateTime(2020, 6, 1),
|
||||||
receiverAddress: '2 Shwe Taung Kyar St, Bahan Tsp, Yangon'),
|
receiverAddress: '2 Shwe Taung Kyar St, Bahan Tsp, Yangon',statusHistory: statusHistory),
|
||||||
Package(
|
Package(
|
||||||
shipmentNumber: "A201",
|
shipmentNumber: "A201",
|
||||||
receiverNumber: "1",
|
receiverNumber: "1",
|
||||||
@@ -106,7 +106,7 @@ class PackageModel extends BaseModel {
|
|||||||
trackingID: "sdf-asdf-23489",
|
trackingID: "sdf-asdf-23489",
|
||||||
id: "PKG2044",
|
id: "PKG2044",
|
||||||
arrivedDate: DateTime(2020, 5, 21),
|
arrivedDate: DateTime(2020, 5, 21),
|
||||||
receiverAddress: '3 Kambzwza St, Bahan Tsp, Yangon'),
|
receiverAddress: '3 Kambzwza St, Bahan Tsp, Yangon',statusHistory: statusHistory),
|
||||||
Package(
|
Package(
|
||||||
shipmentNumber: "A201",
|
shipmentNumber: "A201",
|
||||||
receiverNumber: "1",
|
receiverNumber: "1",
|
||||||
@@ -121,7 +121,7 @@ class PackageModel extends BaseModel {
|
|||||||
id: "PKG2045",
|
id: "PKG2045",
|
||||||
trackingID: "oiuw-sdfpo-234",
|
trackingID: "oiuw-sdfpo-234",
|
||||||
arrivedDate: DateTime(2020, 5, 21),
|
arrivedDate: DateTime(2020, 5, 21),
|
||||||
receiverAddress: '3 Kambzwza St, Bahan Tsp, Yangon'),
|
receiverAddress: '3 Kambzwza St, Bahan Tsp, Yangon',statusHistory: statusHistory),
|
||||||
];
|
];
|
||||||
|
|
||||||
List<Package> get completed {
|
List<Package> get completed {
|
||||||
|
|||||||
112
lib/pages/barcode_screen_page.dart
Normal file
112
lib/pages/barcode_screen_page.dart
Normal file
@@ -0,0 +1,112 @@
|
|||||||
|
import 'package:barcode_scan/barcode_scan.dart';
|
||||||
|
import 'package:barcode_scan/model/scan_result.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
|
||||||
|
import 'package:provider/provider.dart';
|
||||||
|
import 'package:fcs/model/product_model.dart';
|
||||||
|
import 'package:fcs/theme/theme.dart';
|
||||||
|
import 'package:fcs/vo/buyer.dart';
|
||||||
|
import 'package:fcs/vo/product.dart';
|
||||||
|
import 'package:fcs/widget/progress.dart';
|
||||||
|
|
||||||
|
class BarcodeScreenPage extends StatefulWidget {
|
||||||
|
final BuyerProduct buyerProduct;
|
||||||
|
const BarcodeScreenPage({Key key, this.buyerProduct}) : super(key: key);
|
||||||
|
@override
|
||||||
|
_BarcodeScreenPageState createState() => _BarcodeScreenPageState();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _BarcodeScreenPageState extends State<BarcodeScreenPage> {
|
||||||
|
final _formKey = GlobalKey<FormState>();
|
||||||
|
bool _isLoading = false;
|
||||||
|
ScanResult scanResult;
|
||||||
|
|
||||||
|
@override
|
||||||
|
void initState() {
|
||||||
|
super.initState();
|
||||||
|
}
|
||||||
|
|
||||||
|
Widget showProducts(BuildContext context, ProductModel productModel) {
|
||||||
|
return Row(
|
||||||
|
mainAxisSize: MainAxisSize.max,
|
||||||
|
children: <Widget>[
|
||||||
|
Icon(
|
||||||
|
FontAwesomeIcons.tag,
|
||||||
|
color: primaryColor,
|
||||||
|
size: 20,
|
||||||
|
),
|
||||||
|
SizedBox(
|
||||||
|
width: 20,
|
||||||
|
),
|
||||||
|
new Flexible(
|
||||||
|
child: Container(
|
||||||
|
width: 170.0,
|
||||||
|
child: DropdownButton<String>(
|
||||||
|
// value: currentProductID,
|
||||||
|
isExpanded: true,
|
||||||
|
hint: Text(
|
||||||
|
'Select Product',
|
||||||
|
style: labelStyle,
|
||||||
|
),
|
||||||
|
onChanged: changedProduct,
|
||||||
|
items: productModel.products
|
||||||
|
.map<DropdownMenuItem<String>>((Product product) {
|
||||||
|
return new DropdownMenuItem<String>(
|
||||||
|
value: product.id,
|
||||||
|
child: new Text(product.name, style: textStyle),
|
||||||
|
);
|
||||||
|
}).toList(),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
void changedProduct(selected) {
|
||||||
|
setState(() {
|
||||||
|
// currentProductID = selected;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return LocalProgress(
|
||||||
|
inAsyncCall: _isLoading,
|
||||||
|
child: Scaffold(
|
||||||
|
appBar: AppBar(
|
||||||
|
backgroundColor: primaryColor,
|
||||||
|
title: Text("Bar Code Scranner"),
|
||||||
|
),
|
||||||
|
body: Column(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||||
|
children: <Widget>[
|
||||||
|
RaisedButton(
|
||||||
|
child: Icon(Icons.scanner),
|
||||||
|
onPressed: () async {
|
||||||
|
await scan();
|
||||||
|
},
|
||||||
|
)
|
||||||
|
],
|
||||||
|
)),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
Future scan() async {
|
||||||
|
var result = await BarcodeScanner.scan();
|
||||||
|
print("ScanResult => $result");
|
||||||
|
setState(() => scanResult = result);
|
||||||
|
}
|
||||||
|
|
||||||
|
// _save() {
|
||||||
|
// if (currentProductID == null) return;
|
||||||
|
// this.buyerProduct.productID = currentProductID;
|
||||||
|
// var productName =
|
||||||
|
// Provider.of<ProductModel>(context).getProductName(currentProductID);
|
||||||
|
// this.buyerProduct.productName = productName;
|
||||||
|
// this.buyerProduct.storageCapacityQty = int.parse(_storage.text);
|
||||||
|
// this.buyerProduct.dailySaleQty = int.parse(_sales.text);
|
||||||
|
// Navigator.pop<BuyerProduct>(context, this.buyerProduct);
|
||||||
|
// }
|
||||||
|
}
|
||||||
@@ -249,7 +249,7 @@ class _InvoiceEditorState extends State<InvoiceEditor> {
|
|||||||
],
|
],
|
||||||
),
|
),
|
||||||
ExpansionTile(
|
ExpansionTile(
|
||||||
title: Text('Box Information'),
|
title: Text('Package Information'),
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
Container(
|
Container(
|
||||||
child: SingleChildScrollView(
|
child: SingleChildScrollView(
|
||||||
|
|||||||
@@ -1,13 +1,22 @@
|
|||||||
|
import 'dart:async';
|
||||||
|
import 'dart:io';
|
||||||
|
|
||||||
|
import 'package:fcs/model/main_model.dart';
|
||||||
|
import 'package:fcs/pages/invoice/payment_pdf_screen.dart';
|
||||||
import 'package:fcs/theme/theme.dart';
|
import 'package:fcs/theme/theme.dart';
|
||||||
import 'package:fcs/vo/invoice.dart';
|
import 'package:fcs/vo/invoice.dart';
|
||||||
import 'package:fcs/widget/bottom_up_page_route.dart';
|
import 'package:fcs/widget/bottom_up_page_route.dart';
|
||||||
|
import 'package:flutter/cupertino.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_icons/flutter_icons.dart';
|
import 'package:flutter/services.dart';
|
||||||
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
|
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
|
||||||
import 'package:intl/intl.dart';
|
import 'package:intl/intl.dart';
|
||||||
|
import 'package:path_provider/path_provider.dart';
|
||||||
|
import 'package:provider/provider.dart';
|
||||||
|
|
||||||
import '../util.dart';
|
import '../util.dart';
|
||||||
import 'invoice_editor.dart';
|
import 'invoice_editor.dart';
|
||||||
|
import 'payment_page.dart';
|
||||||
|
|
||||||
class InvoiceListRow extends StatefulWidget {
|
class InvoiceListRow extends StatefulWidget {
|
||||||
final Invoice invoice;
|
final Invoice invoice;
|
||||||
@@ -21,6 +30,8 @@ class _InvoiceListRowState extends State<InvoiceListRow> {
|
|||||||
var dateFormatter = new DateFormat('dd MMM yyyy');
|
var dateFormatter = new DateFormat('dd MMM yyyy');
|
||||||
final double dotSize = 15.0;
|
final double dotSize = 15.0;
|
||||||
Invoice _invoice = new Invoice();
|
Invoice _invoice = new Invoice();
|
||||||
|
// String pdfPath = 'assets/Invoice-A092(A)-32.pdf';
|
||||||
|
String pdfPath = '';
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void initState() {
|
void initState() {
|
||||||
@@ -29,16 +40,47 @@ class _InvoiceListRowState extends State<InvoiceListRow> {
|
|||||||
if (widget.invoice != null) {
|
if (widget.invoice != null) {
|
||||||
_invoice = widget.invoice;
|
_invoice = widget.invoice;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fromAsset('assets/demo.pdf', 'demo.pdf').then((f) {
|
||||||
|
setState(() {
|
||||||
|
pdfPath = f.path;
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<File> fromAsset(String asset, String filename) async {
|
||||||
|
// To open from assets, you can copy them to the app storage folder, and the access them "locally"
|
||||||
|
Completer<File> completer = Completer();
|
||||||
|
print('asset => $asset');
|
||||||
|
print('assest => ${await rootBundle.load(asset)}');
|
||||||
|
try {
|
||||||
|
var dir = await getApplicationDocumentsDirectory();
|
||||||
|
File file = File("${dir.path}/$filename");
|
||||||
|
var data = await rootBundle.load(asset);
|
||||||
|
print('data => $data');
|
||||||
|
var bytes = data.buffer.asUint8List();
|
||||||
|
await file.writeAsBytes(bytes, flush: true);
|
||||||
|
completer.complete(file);
|
||||||
|
} catch (e) {
|
||||||
|
throw Exception('Error parsing asset file!'+ e.toString());
|
||||||
|
}
|
||||||
|
|
||||||
|
return completer.future;
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
|
var owner = Provider.of<MainModel>(context).isOwner();
|
||||||
return Container(
|
return Container(
|
||||||
padding: EdgeInsets.only(left: 15, right: 15),
|
padding: EdgeInsets.only(left: 15, right: 15),
|
||||||
child: InkWell(
|
child: InkWell(
|
||||||
onTap: () {
|
onTap: () {
|
||||||
Navigator.of(context)
|
owner
|
||||||
.push(BottomUpPageRoute(InvoiceEditor(invoice: _invoice)));
|
? Navigator.of(context)
|
||||||
|
.push(BottomUpPageRoute(InvoiceEditor(invoice: _invoice)))
|
||||||
|
: Navigator.of(context).push(BottomUpPageRoute(PaymentPDFScreen(
|
||||||
|
path: pdfPath,
|
||||||
|
)));
|
||||||
},
|
},
|
||||||
child: Row(
|
child: Row(
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
@@ -88,9 +130,49 @@ class _InvoiceListRowState extends State<InvoiceListRow> {
|
|||||||
padding: const EdgeInsets.all(0),
|
padding: const EdgeInsets.all(0),
|
||||||
child: getStatus(_invoice.status),
|
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);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
actionSheet(BuildContext context) {
|
||||||
|
return CupertinoActionSheet(
|
||||||
|
actions: <Widget>[
|
||||||
|
CupertinoActionSheetAction(
|
||||||
|
child: Text("Download"),
|
||||||
|
onPressed: () {
|
||||||
|
Navigator.pop(context);
|
||||||
|
},
|
||||||
|
)
|
||||||
|
],
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
202
lib/pages/invoice/payment_page.dart
Normal file
202
lib/pages/invoice/payment_page.dart
Normal file
@@ -0,0 +1,202 @@
|
|||||||
|
import 'package:fcs/model/main_model.dart';
|
||||||
|
import 'package:fcs/pages/util.dart';
|
||||||
|
import 'package:fcs/theme/theme.dart';
|
||||||
|
import 'package:fcs/vo/invoice.dart';
|
||||||
|
import 'package:fcs/vo/package.dart';
|
||||||
|
import 'package:fcs/widget/local_text.dart';
|
||||||
|
import 'package:fcs/widget/localization/app_translations.dart';
|
||||||
|
import 'package:fcs/widget/multi_img_controller.dart';
|
||||||
|
import 'package:fcs/widget/multi_img_file.dart';
|
||||||
|
import 'package:fcs/widget/my_data_table.dart';
|
||||||
|
import 'package:fcs/widget/number_cell.dart';
|
||||||
|
import 'package:fcs/widget/progress.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:flutter_icons/flutter_icons.dart';
|
||||||
|
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
|
||||||
|
import 'package:intl/intl.dart';
|
||||||
|
import 'package:provider/provider.dart';
|
||||||
|
import 'package:timeline_list/timeline.dart';
|
||||||
|
import 'package:timeline_list/timeline_model.dart';
|
||||||
|
|
||||||
|
class PaymentPage extends StatefulWidget {
|
||||||
|
final Invoice invoice;
|
||||||
|
PaymentPage({this.invoice});
|
||||||
|
|
||||||
|
@override
|
||||||
|
_PaymentPageState createState() => _PaymentPageState();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _PaymentPageState extends State<PaymentPage> {
|
||||||
|
TextEditingController _addressEditingController = new TextEditingController();
|
||||||
|
TextEditingController _fromTimeEditingController =
|
||||||
|
new TextEditingController();
|
||||||
|
TextEditingController _toTimeEditingController = new TextEditingController();
|
||||||
|
TextEditingController _noOfPackageEditingController =
|
||||||
|
new TextEditingController();
|
||||||
|
TextEditingController _weightEditingController = new TextEditingController();
|
||||||
|
MultiImgController multiImgController = MultiImgController();
|
||||||
|
var dateFormatter = new DateFormat('dd MMM yyyy');
|
||||||
|
|
||||||
|
Invoice _invoice = new Invoice();
|
||||||
|
bool _isLoading = false;
|
||||||
|
List<String> _receipts = [
|
||||||
|
"assets/photos/1.jpg",
|
||||||
|
"assets/photos/2.jpg",
|
||||||
|
"assets/photos/3.jpg"
|
||||||
|
];
|
||||||
|
bool isNew;
|
||||||
|
|
||||||
|
@override
|
||||||
|
void initState() {
|
||||||
|
if (widget.invoice != null) {
|
||||||
|
_invoice = widget.invoice;
|
||||||
|
}
|
||||||
|
super.initState();
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
void dispose() {
|
||||||
|
super.dispose();
|
||||||
|
}
|
||||||
|
|
||||||
|
final DateFormat dateFormat = DateFormat("d MMM yyyy");
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
var owner = Provider.of<MainModel>(context).isOwner();
|
||||||
|
|
||||||
|
// var images = isNew ? [] : _images;
|
||||||
|
return LocalProgress(
|
||||||
|
inAsyncCall: _isLoading,
|
||||||
|
child: Scaffold(
|
||||||
|
appBar: AppBar(
|
||||||
|
centerTitle: true,
|
||||||
|
leading: new IconButton(
|
||||||
|
icon: new Icon(Icons.close),
|
||||||
|
onPressed: () => Navigator.of(context).pop(),
|
||||||
|
),
|
||||||
|
backgroundColor: primaryColor,
|
||||||
|
title: Text(AppTranslations.of(context).text("payment.title")),
|
||||||
|
),
|
||||||
|
body: Card(
|
||||||
|
child: Column(
|
||||||
|
children: <Widget>[
|
||||||
|
Padding(
|
||||||
|
padding: const EdgeInsets.all(15.0),
|
||||||
|
child: Container(
|
||||||
|
child: Row(
|
||||||
|
children: <Widget>[
|
||||||
|
Text(
|
||||||
|
'Remaining Balance : ',
|
||||||
|
style: TextStyle(fontSize: 16),
|
||||||
|
),
|
||||||
|
Text(
|
||||||
|
'${_invoice.amount}',
|
||||||
|
style: TextStyle(
|
||||||
|
color: primaryColor,
|
||||||
|
fontSize: 16,
|
||||||
|
fontWeight: FontWeight.bold),
|
||||||
|
)
|
||||||
|
],
|
||||||
|
)),
|
||||||
|
),
|
||||||
|
Expanded(
|
||||||
|
child: ListView(
|
||||||
|
children: [
|
||||||
|
ExpansionTile(
|
||||||
|
title: Text('Payment Attachment'),
|
||||||
|
children: <Widget>[
|
||||||
|
Container(
|
||||||
|
padding: EdgeInsets.only(left: 20),
|
||||||
|
child: Row(children: <Widget>[
|
||||||
|
LocalText(
|
||||||
|
context,
|
||||||
|
"invoice.payment",
|
||||||
|
color: Colors.grey,
|
||||||
|
fontSize: 14,
|
||||||
|
),
|
||||||
|
MultiImageFile(
|
||||||
|
enabled: true,
|
||||||
|
controller: multiImgController,
|
||||||
|
title: "Receipt File",
|
||||||
|
)
|
||||||
|
])),
|
||||||
|
SizedBox(
|
||||||
|
height: 25,
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
ExpansionTile(
|
||||||
|
title: Text('Receipt'),
|
||||||
|
children: <Widget>[
|
||||||
|
Container(
|
||||||
|
child: SingleChildScrollView(
|
||||||
|
scrollDirection: Axis.horizontal,
|
||||||
|
child: MyDataTable(
|
||||||
|
headingRowHeight: 40,
|
||||||
|
columnSpacing: 20,
|
||||||
|
columns: [
|
||||||
|
MyDataColumn(
|
||||||
|
label: LocalText(
|
||||||
|
context,
|
||||||
|
"payment.date",
|
||||||
|
color: Colors.grey,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
MyDataColumn(
|
||||||
|
label: LocalText(
|
||||||
|
context,
|
||||||
|
"payment.amount",
|
||||||
|
color: Colors.grey,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
rows: getPackageRow(context),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
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),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
List<MyDataRow> getPackageRow(BuildContext context) {
|
||||||
|
return _invoice.receipts.map((r) {
|
||||||
|
return MyDataRow(
|
||||||
|
onSelectChanged: (bool selected) {},
|
||||||
|
cells: [
|
||||||
|
MyDataCell(
|
||||||
|
new Text(dateFormatter.format(r.date), style: textStyle),
|
||||||
|
),
|
||||||
|
MyDataCell(NumberCell(r.amount))
|
||||||
|
],
|
||||||
|
);
|
||||||
|
}).toList();
|
||||||
|
}
|
||||||
|
}
|
||||||
113
lib/pages/invoice/payment_pdf_screen.dart
Normal file
113
lib/pages/invoice/payment_pdf_screen.dart
Normal file
@@ -0,0 +1,113 @@
|
|||||||
|
import 'dart:async';
|
||||||
|
|
||||||
|
import 'package:fcs/theme/theme.dart';
|
||||||
|
import 'package:flutter/cupertino.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:flutter_pdfview/flutter_pdfview.dart';
|
||||||
|
|
||||||
|
class PaymentPDFScreen extends StatefulWidget {
|
||||||
|
final String path;
|
||||||
|
|
||||||
|
PaymentPDFScreen({Key key, this.path}) : super(key: key);
|
||||||
|
|
||||||
|
_PaymentPDFScreenState createState() => _PaymentPDFScreenState();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _PaymentPDFScreenState extends State<PaymentPDFScreen>
|
||||||
|
with WidgetsBindingObserver {
|
||||||
|
final Completer<PDFViewController> _controller =
|
||||||
|
Completer<PDFViewController>();
|
||||||
|
int pages = 0;
|
||||||
|
int currentPage = 0;
|
||||||
|
bool isReady = false;
|
||||||
|
String errorMessage = '';
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
print(' widget.path => ${widget.path}');
|
||||||
|
print(' pages => ${pages}');
|
||||||
|
return Scaffold(
|
||||||
|
appBar: AppBar(
|
||||||
|
backgroundColor: primaryColor,
|
||||||
|
title: Text("Document"),
|
||||||
|
actions: <Widget>[
|
||||||
|
IconButton(
|
||||||
|
icon: Icon(Icons.share),
|
||||||
|
onPressed: () {},
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
body: Stack(
|
||||||
|
children: <Widget>[
|
||||||
|
PDFView(
|
||||||
|
filePath: widget.path,
|
||||||
|
enableSwipe: true,
|
||||||
|
swipeHorizontal: true,
|
||||||
|
autoSpacing: false,
|
||||||
|
pageFling: true,
|
||||||
|
pageSnap: true,
|
||||||
|
defaultPage: currentPage,
|
||||||
|
fitPolicy: FitPolicy.BOTH,
|
||||||
|
preventLinkNavigation:
|
||||||
|
false, // if set to true the link is handled in flutter
|
||||||
|
onRender: (_pages) {
|
||||||
|
print(('pages => $pages'));
|
||||||
|
setState(() {
|
||||||
|
pages = _pages;
|
||||||
|
isReady = true;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
// onError: (error) {
|
||||||
|
// setState(() {
|
||||||
|
// errorMessage = error.toString();
|
||||||
|
// });
|
||||||
|
// print(error.toString());
|
||||||
|
// },
|
||||||
|
// onPageError: (page, error) {
|
||||||
|
// setState(() {
|
||||||
|
// errorMessage = '$page: ${error.toString()}';
|
||||||
|
// });
|
||||||
|
// print('$page: ${error.toString()}');
|
||||||
|
// },
|
||||||
|
onViewCreated: (PDFViewController pdfViewController) {
|
||||||
|
_controller.complete(pdfViewController);
|
||||||
|
},
|
||||||
|
onLinkHandler: (String uri) {
|
||||||
|
print('goto uri: $uri');
|
||||||
|
},
|
||||||
|
onPageChanged: (int page, int total) {
|
||||||
|
print('page change: $page/$total');
|
||||||
|
setState(() {
|
||||||
|
currentPage = page;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
),
|
||||||
|
// errorMessage.isEmpty
|
||||||
|
// ? !isReady
|
||||||
|
// ? Center(
|
||||||
|
// child: CircularProgressIndicator(),
|
||||||
|
// )
|
||||||
|
// : Container()
|
||||||
|
// : Center(
|
||||||
|
// child: Text(errorMessage),
|
||||||
|
// )
|
||||||
|
],
|
||||||
|
),
|
||||||
|
floatingActionButton: FutureBuilder<PDFViewController>(
|
||||||
|
future: _controller.future,
|
||||||
|
builder: (context, AsyncSnapshot<PDFViewController> snapshot) {
|
||||||
|
if (snapshot.hasData) {
|
||||||
|
return FloatingActionButton.extended(
|
||||||
|
label: Text("Go to ${pages ~/ 2}"),
|
||||||
|
onPressed: () async {
|
||||||
|
await snapshot.data.setPage(pages ~/ 2);
|
||||||
|
},
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
return Container();
|
||||||
|
},
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -90,13 +90,13 @@ class _ShipmentRatesCalState extends State<ShipmentRatesCal> {
|
|||||||
SizedBox(height: 50),
|
SizedBox(height: 50),
|
||||||
Center(
|
Center(
|
||||||
child: Text(
|
child: Text(
|
||||||
"Delivery fee:\$ 5",
|
"Delivery fee:\$ 0",
|
||||||
style: TextStyle(color: primaryColor, fontSize: 16),
|
style: TextStyle(color: primaryColor, fontSize: 16),
|
||||||
)),
|
)),
|
||||||
SizedBox(height: 20),
|
SizedBox(height: 20),
|
||||||
Center(
|
Center(
|
||||||
child: Text(
|
child: Text(
|
||||||
"Total estimated amount:\$ 38",
|
"Total estimated amount:\$ 95",
|
||||||
style: TextStyle(color: primaryColor, fontSize: 20),
|
style: TextStyle(color: primaryColor, fontSize: 20),
|
||||||
))
|
))
|
||||||
],
|
],
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
import 'package:fcs/model/main_model.dart';
|
||||||
import 'package:fcs/pages/util.dart';
|
import 'package:fcs/pages/util.dart';
|
||||||
import 'package:fcs/vo/package.dart';
|
import 'package:fcs/vo/package.dart';
|
||||||
import 'package:fcs/widget/localization/app_translations.dart';
|
import 'package:fcs/widget/localization/app_translations.dart';
|
||||||
@@ -6,6 +7,7 @@ import 'package:flutter/material.dart';
|
|||||||
import 'package:flutter_icons/flutter_icons.dart';
|
import 'package:flutter_icons/flutter_icons.dart';
|
||||||
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
|
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
|
||||||
import 'package:intl/intl.dart';
|
import 'package:intl/intl.dart';
|
||||||
|
import 'package:provider/provider.dart';
|
||||||
import 'package:timeline_list/timeline.dart';
|
import 'package:timeline_list/timeline.dart';
|
||||||
import 'package:timeline_list/timeline_model.dart';
|
import 'package:timeline_list/timeline_model.dart';
|
||||||
|
|
||||||
@@ -61,8 +63,49 @@ class _PackageEditorState extends State<PackageEditor> {
|
|||||||
|
|
||||||
final DateFormat dateFormat = DateFormat("d MMM yyyy");
|
final DateFormat dateFormat = DateFormat("d MMM yyyy");
|
||||||
|
|
||||||
|
List<TimelineModel> _models() {
|
||||||
|
print('_package.statusHistory=> ${_package.statusHistory}');
|
||||||
|
return _package.statusHistory
|
||||||
|
.map((e) => TimelineModel(
|
||||||
|
Padding(
|
||||||
|
padding: const EdgeInsets.all(18.0),
|
||||||
|
child: Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: <Widget>[
|
||||||
|
Text(e.status,
|
||||||
|
style: TextStyle(
|
||||||
|
color: e.done ? primaryColor : Colors.grey,
|
||||||
|
fontSize: 16,
|
||||||
|
fontWeight: FontWeight.bold)),
|
||||||
|
e.status == "Processed"
|
||||||
|
? Text("(Waiting for payment)",
|
||||||
|
style: TextStyle(
|
||||||
|
color: e.done ? primaryColor : Colors.grey,
|
||||||
|
fontSize: 14,
|
||||||
|
fontWeight: FontWeight.bold))
|
||||||
|
: Container(),
|
||||||
|
Text(dateFormat.format(e.date)),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
iconBackground: e.done ? primaryColor : Colors.grey,
|
||||||
|
icon: Icon(
|
||||||
|
e.status == "Shipped"
|
||||||
|
? Ionicons.ios_airplane
|
||||||
|
: e.status == "Delivered"
|
||||||
|
? MaterialCommunityIcons.truck_fast
|
||||||
|
: e.status == "Processed"
|
||||||
|
? MaterialIcons.check
|
||||||
|
: Octicons.package,
|
||||||
|
color: Colors.white,
|
||||||
|
)))
|
||||||
|
.toList();
|
||||||
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
|
var owner = Provider.of<MainModel>(context).isOwner();
|
||||||
|
|
||||||
var images = isNew ? [] : _images;
|
var images = isNew ? [] : _images;
|
||||||
return LocalProgress(
|
return LocalProgress(
|
||||||
inAsyncCall: _isLoading,
|
inAsyncCall: _isLoading,
|
||||||
@@ -89,15 +132,18 @@ class _PackageEditorState extends State<PackageEditor> {
|
|||||||
Expanded(
|
Expanded(
|
||||||
child: ListView(
|
child: ListView(
|
||||||
children: [
|
children: [
|
||||||
ExpansionTile(
|
owner
|
||||||
|
? ExpansionTile(
|
||||||
title: Text(
|
title: Text(
|
||||||
'Receiving',
|
'Receiving',
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: primaryColor, fontWeight: FontWeight.bold),
|
color: primaryColor,
|
||||||
|
fontWeight: FontWeight.bold),
|
||||||
),
|
),
|
||||||
children: [
|
children: [
|
||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsets.only(left: 20.0, right: 20),
|
padding: const EdgeInsets.only(
|
||||||
|
left: 20.0, right: 20),
|
||||||
child: TextFormField(
|
child: TextFormField(
|
||||||
initialValue: isNew ? "" : "PKG2039",
|
initialValue: isNew ? "" : "PKG2039",
|
||||||
decoration: InputDecoration(
|
decoration: InputDecoration(
|
||||||
@@ -111,7 +157,8 @@ class _PackageEditorState extends State<PackageEditor> {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsets.only(left: 20.0, right: 20),
|
padding: const EdgeInsets.only(
|
||||||
|
left: 20.0, right: 20),
|
||||||
child: TextFormField(
|
child: TextFormField(
|
||||||
initialValue: isNew ? "" : "Amazon",
|
initialValue: isNew ? "" : "Amazon",
|
||||||
decoration: InputDecoration(
|
decoration: InputDecoration(
|
||||||
@@ -119,13 +166,15 @@ class _PackageEditorState extends State<PackageEditor> {
|
|||||||
labelText: 'Market',
|
labelText: 'Market',
|
||||||
hintText: 'FCS_ID',
|
hintText: 'FCS_ID',
|
||||||
filled: true,
|
filled: true,
|
||||||
icon: Icon(MaterialCommunityIcons.cart_outline,
|
icon: Icon(
|
||||||
|
MaterialCommunityIcons.cart_outline,
|
||||||
color: primaryColor),
|
color: primaryColor),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsets.only(left: 20.0, right: 20),
|
padding: const EdgeInsets.only(
|
||||||
|
left: 20.0, right: 20),
|
||||||
child: TextFormField(
|
child: TextFormField(
|
||||||
initialValue: isNew ? "" : "zdf-sdfl-37sdfks",
|
initialValue: isNew ? "" : "zdf-sdfl-37sdfks",
|
||||||
decoration: InputDecoration(
|
decoration: InputDecoration(
|
||||||
@@ -133,12 +182,14 @@ class _PackageEditorState extends State<PackageEditor> {
|
|||||||
labelText: 'Tracking ID',
|
labelText: 'Tracking ID',
|
||||||
hintText: 'Tracking ID',
|
hintText: 'Tracking ID',
|
||||||
filled: true,
|
filled: true,
|
||||||
icon: Icon(Octicons.package, color: primaryColor),
|
icon: Icon(Octicons.package,
|
||||||
|
color: primaryColor),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsets.only(left: 20.0, right: 20),
|
padding: const EdgeInsets.only(
|
||||||
|
left: 20.0, right: 20),
|
||||||
child: TextFormField(
|
child: TextFormField(
|
||||||
initialValue: isNew ? "" : "FCS-0203-390-2",
|
initialValue: isNew ? "" : "FCS-0203-390-2",
|
||||||
decoration: InputDecoration(
|
decoration: InputDecoration(
|
||||||
@@ -146,35 +197,40 @@ class _PackageEditorState extends State<PackageEditor> {
|
|||||||
labelText: 'FCS_ID',
|
labelText: 'FCS_ID',
|
||||||
hintText: 'FCS_ID',
|
hintText: 'FCS_ID',
|
||||||
filled: true,
|
filled: true,
|
||||||
icon: Icon(Feather.user, color: primaryColor),
|
icon: Icon(Feather.user,
|
||||||
|
color: primaryColor),
|
||||||
suffixIcon: IconButton(
|
suffixIcon: IconButton(
|
||||||
icon: Icon(Icons.search),
|
icon: Icon(Icons.search),
|
||||||
onPressed: () {})),
|
onPressed: () {})),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsets.only(left: 20.0, right: 20),
|
padding: const EdgeInsets.only(
|
||||||
|
left: 20.0, right: 20),
|
||||||
child: TextFormField(
|
child: TextFormField(
|
||||||
initialValue: _package.receiverName,
|
initialValue: _package.receiverName,
|
||||||
decoration: InputDecoration(
|
decoration: InputDecoration(
|
||||||
fillColor: Colors.white,
|
fillColor: Colors.white,
|
||||||
labelText: 'Customer Name',
|
labelText: 'Customer Name',
|
||||||
filled: true,
|
filled: true,
|
||||||
icon: Icon(Feather.user, color: Colors.white),
|
icon: Icon(Feather.user,
|
||||||
|
color: Colors.white),
|
||||||
suffixIcon: IconButton(
|
suffixIcon: IconButton(
|
||||||
icon: Icon(Icons.search),
|
icon: Icon(Icons.search),
|
||||||
onPressed: () {})),
|
onPressed: () {})),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsets.only(left: 20.0, right: 20),
|
padding: const EdgeInsets.only(
|
||||||
|
left: 20.0, right: 20),
|
||||||
child: TextFormField(
|
child: TextFormField(
|
||||||
initialValue: isNew ? "" : "",
|
initialValue: isNew ? "" : "",
|
||||||
decoration: InputDecoration(
|
decoration: InputDecoration(
|
||||||
fillColor: Colors.white,
|
fillColor: Colors.white,
|
||||||
labelText: 'Pickup ID',
|
labelText: 'Pickup ID',
|
||||||
filled: true,
|
filled: true,
|
||||||
icon: Icon(MaterialCommunityIcons.directions,
|
icon: Icon(
|
||||||
|
MaterialCommunityIcons.directions,
|
||||||
color: primaryColor),
|
color: primaryColor),
|
||||||
suffixIcon: IconButton(
|
suffixIcon: IconButton(
|
||||||
icon: Icon(Icons.search),
|
icon: Icon(Icons.search),
|
||||||
@@ -182,8 +238,10 @@ class _PackageEditorState extends State<PackageEditor> {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
)
|
||||||
isNew
|
: Container(),
|
||||||
|
owner
|
||||||
|
? isNew
|
||||||
? Container()
|
? Container()
|
||||||
: ExpansionTile(
|
: ExpansionTile(
|
||||||
title: Text(
|
title: Text(
|
||||||
@@ -209,7 +267,8 @@ class _PackageEditorState extends State<PackageEditor> {
|
|||||||
)),
|
)),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
)
|
||||||
|
: Container(),
|
||||||
isNew
|
isNew
|
||||||
? Container()
|
? Container()
|
||||||
: ExpansionTile(
|
: ExpansionTile(
|
||||||
@@ -267,10 +326,32 @@ class _PackageEditorState extends State<PackageEditor> {
|
|||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
isNew
|
||||||
|
? Container()
|
||||||
|
: ExpansionTile(
|
||||||
|
title: Text(
|
||||||
|
'Status',
|
||||||
|
style: TextStyle(
|
||||||
|
color: primaryColor,
|
||||||
|
fontWeight: FontWeight.bold),
|
||||||
|
),
|
||||||
|
children: <Widget>[
|
||||||
|
Container(
|
||||||
|
height: 500,
|
||||||
|
padding: EdgeInsets.only(left: 20),
|
||||||
|
child: isNew
|
||||||
|
? Container()
|
||||||
|
: Timeline(
|
||||||
|
children: _models(),
|
||||||
|
position: TimelinePosition.Left),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
)
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
widget.package == null
|
owner
|
||||||
|
? widget.package == null
|
||||||
? Align(
|
? Align(
|
||||||
alignment: Alignment.bottomCenter,
|
alignment: Alignment.bottomCenter,
|
||||||
child: Center(
|
child: Center(
|
||||||
@@ -304,6 +385,7 @@ class _PackageEditorState extends State<PackageEditor> {
|
|||||||
))),
|
))),
|
||||||
],
|
],
|
||||||
))
|
))
|
||||||
|
: Container()
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
import 'package:fcs/model/pickup_model.dart';
|
import 'package:fcs/model/pickup_model.dart';
|
||||||
import 'package:fcs/model_fcs/package_model.dart';
|
import 'package:fcs/model_fcs/package_model.dart';
|
||||||
|
import 'package:fcs/pages/barcode_screen_page.dart';
|
||||||
import 'package:fcs/pages/pickup_list_row.dart';
|
import 'package:fcs/pages/pickup_list_row.dart';
|
||||||
import 'package:fcs/pages/search_page.dart';
|
import 'package:fcs/pages/search_page.dart';
|
||||||
import 'package:fcs/pages_fcs/package_editor.dart';
|
import 'package:fcs/pages_fcs/package_editor.dart';
|
||||||
@@ -9,6 +10,7 @@ import 'package:fcs/widget/bottom_up_page_route.dart';
|
|||||||
import 'package:fcs/widget/localization/app_translations.dart';
|
import 'package:fcs/widget/localization/app_translations.dart';
|
||||||
import 'package:fcs/widget/progress.dart';
|
import 'package:fcs/widget/progress.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
|
||||||
import 'package:provider/provider.dart';
|
import 'package:provider/provider.dart';
|
||||||
|
|
||||||
import '../theme/theme.dart';
|
import '../theme/theme.dart';
|
||||||
@@ -49,6 +51,19 @@ class _PackageListState extends State<PackageList> {
|
|||||||
backgroundColor: primaryColor,
|
backgroundColor: primaryColor,
|
||||||
title: Text(AppTranslations.of(context).text("package.title")),
|
title: Text(AppTranslations.of(context).text("package.title")),
|
||||||
actions: <Widget>[
|
actions: <Widget>[
|
||||||
|
IconButton(
|
||||||
|
icon: Icon(
|
||||||
|
FontAwesomeIcons.barcode,
|
||||||
|
color: Colors.white,
|
||||||
|
),
|
||||||
|
iconSize: 30,
|
||||||
|
onPressed: () {
|
||||||
|
Navigator.push(
|
||||||
|
context,
|
||||||
|
BottomUpPageRoute(BarcodeScreenPage()),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
),
|
||||||
IconButton(
|
IconButton(
|
||||||
icon: Icon(
|
icon: Icon(
|
||||||
Icons.search,
|
Icons.search,
|
||||||
|
|||||||
@@ -90,6 +90,10 @@ class _PackageListRowtate extends State<PackageListRow> {
|
|||||||
),
|
),
|
||||||
Column(
|
Column(
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
|
Padding(
|
||||||
|
padding: const EdgeInsets.all(3.0),
|
||||||
|
child: getStatus(_package.status),
|
||||||
|
),
|
||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsets.all(0),
|
padding: const EdgeInsets.all(0),
|
||||||
child: new Text(
|
child: new Text(
|
||||||
@@ -97,27 +101,27 @@ class _PackageListRowtate extends State<PackageListRow> {
|
|||||||
style: new TextStyle(fontSize: 15.0, color: Colors.grey),
|
style: new TextStyle(fontSize: 15.0, color: Colors.grey),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Padding(
|
// Padding(
|
||||||
padding: const EdgeInsets.only(left: 8.0, top: 5, bottom: 5),
|
// padding: const EdgeInsets.only(left: 8.0, top: 5, bottom: 5),
|
||||||
child: Row(
|
// child: Row(
|
||||||
children: <Widget>[
|
// children: <Widget>[
|
||||||
new Text(
|
// new Text(
|
||||||
_package.weight == null
|
// _package.weight == null
|
||||||
? ''
|
// ? ''
|
||||||
: _package.weight.toString() + 'lb - ',
|
// : _package.weight.toString() + 'lb - ',
|
||||||
style:
|
// style:
|
||||||
new TextStyle(fontSize: 15.0, color: Colors.grey),
|
// new TextStyle(fontSize: 15.0, color: Colors.grey),
|
||||||
),
|
// ),
|
||||||
new Text(
|
// new Text(
|
||||||
_package.price == null
|
// _package.price == null
|
||||||
? ""
|
// ? ""
|
||||||
: "\$ " + _package.price.toString(),
|
// : "\$ " + _package.price.toString(),
|
||||||
style:
|
// style:
|
||||||
new TextStyle(fontSize: 15.0, color: Colors.grey),
|
// new TextStyle(fontSize: 15.0, color: Colors.grey),
|
||||||
),
|
// ),
|
||||||
],
|
// ],
|
||||||
),
|
// ),
|
||||||
),
|
// ),
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
],
|
],
|
||||||
|
|||||||
@@ -11,6 +11,9 @@ class Invoice {
|
|||||||
String paymentAttachment;
|
String paymentAttachment;
|
||||||
|
|
||||||
List<Package> packages;
|
List<Package> packages;
|
||||||
|
List<Receipt> receipts;
|
||||||
|
List<String> receiptPhotos;
|
||||||
|
|
||||||
Invoice(
|
Invoice(
|
||||||
{this.invoiceNumber,
|
{this.invoiceNumber,
|
||||||
this.invoiceDate,
|
this.invoiceDate,
|
||||||
@@ -20,7 +23,16 @@ class Invoice {
|
|||||||
this.discount,
|
this.discount,
|
||||||
this.status,
|
this.status,
|
||||||
this.paymentAttachment,
|
this.paymentAttachment,
|
||||||
this.packages});
|
this.packages,
|
||||||
|
this.receiptPhotos,
|
||||||
|
this.receipts});
|
||||||
|
|
||||||
double get getAmount => packages.fold(0, (p, e) => (e.rate * e.weight) + p);
|
double get getAmount => packages.fold(0, (p, e) => (e.rate * e.weight) + p);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
class Receipt {
|
||||||
|
int amount;
|
||||||
|
DateTime date;
|
||||||
|
|
||||||
|
Receipt({this.amount, this.date});
|
||||||
|
}
|
||||||
|
|||||||
@@ -1,9 +1,4 @@
|
|||||||
// class Status {
|
import 'box.dart';
|
||||||
// String status;
|
|
||||||
// DateTime date;
|
|
||||||
// bool done;
|
|
||||||
// Status({this.status, this.date, this.done});
|
|
||||||
// }
|
|
||||||
|
|
||||||
class Package {
|
class Package {
|
||||||
String id;
|
String id;
|
||||||
@@ -34,7 +29,7 @@ class Package {
|
|||||||
shipmentNumber + "-" + receiverNumber + " #" + boxNumber;
|
shipmentNumber + "-" + receiverNumber + " #" + boxNumber;
|
||||||
double get price => rate.toDouble() * weight;
|
double get price => rate.toDouble() * weight;
|
||||||
|
|
||||||
// List<Status> statusHistory;
|
List<Status> statusHistory;
|
||||||
|
|
||||||
Package(
|
Package(
|
||||||
{this.id,
|
{this.id,
|
||||||
@@ -55,7 +50,6 @@ class Package {
|
|||||||
this.arrivedDate,
|
this.arrivedDate,
|
||||||
this.cargoDesc,
|
this.cargoDesc,
|
||||||
this.market,
|
this.market,
|
||||||
this.trackingID
|
this.trackingID,
|
||||||
// this.statusHistory
|
this.statusHistory});
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -540,7 +540,7 @@ packages:
|
|||||||
name: pin_input_text_field
|
name: pin_input_text_field
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "3.0.1"
|
version: "3.0.2"
|
||||||
platform:
|
platform:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ dependencies:
|
|||||||
uuid: ^2.0.4
|
uuid: ^2.0.4
|
||||||
zefyr:
|
zefyr:
|
||||||
flutter_signature_pad: ^2.0.0+1
|
flutter_signature_pad: ^2.0.0+1
|
||||||
path_provider: ^1.5.1
|
path_provider: ^1.6.11
|
||||||
flutter_ringtone_player: ^2.0.0
|
flutter_ringtone_player: ^2.0.0
|
||||||
http_server: ^0.9.8+3
|
http_server: ^0.9.8+3
|
||||||
archive: ^2.0.11
|
archive: ^2.0.11
|
||||||
@@ -67,6 +67,8 @@ dependencies:
|
|||||||
flutter_icons: ^1.1.0
|
flutter_icons: ^1.1.0
|
||||||
country_icons: ^1.1.1
|
country_icons: ^1.1.1
|
||||||
timeline_list: ^0.0.5
|
timeline_list: ^0.0.5
|
||||||
|
barcode_scan: ^3.0.1
|
||||||
|
flutter_pdfview: ^1.0.3
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -80,6 +82,7 @@ flutter:
|
|||||||
- assets/
|
- assets/
|
||||||
- assets/local/
|
- assets/local/
|
||||||
- assets/photos/
|
- assets/photos/
|
||||||
|
- assets/demo.pdf
|
||||||
|
|
||||||
|
|
||||||
fonts:
|
fonts:
|
||||||
|
|||||||
Reference in New Issue
Block a user