Merge branch 'master' of phyothandar/fcs into master
This commit is contained in:
@@ -557,6 +557,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",
|
||||||
@@ -574,5 +575,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 : "
|
||||||
}
|
}
|
||||||
@@ -575,10 +575,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":"စည်းကမ်းချက်များ",
|
||||||
@@ -594,6 +595,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":"ပေးချေရန်ကျန်ရှိငွေ : "
|
||||||
}
|
}
|
||||||
@@ -14,6 +14,7 @@ class PackageModel extends BaseModel {
|
|||||||
Status(status: "Received", date: DateTime(2020, 6, 1), done: true),
|
Status(status: "Received", date: DateTime(2020, 6, 1), done: true),
|
||||||
Status(status: "Processed", date: DateTime(2020, 6, 1), done: true),
|
Status(status: "Processed", date: DateTime(2020, 6, 1), done: true),
|
||||||
Status(status: "Shipped", date: DateTime(2020, 6, 5), done: false),
|
Status(status: "Shipped", date: DateTime(2020, 6, 5), done: false),
|
||||||
|
Status(status: "Arrived", date: DateTime(2020, 6, 7), done: false),
|
||||||
Status(status: "Delivered", date: DateTime(2020, 6, 15), done: false)
|
Status(status: "Delivered", date: DateTime(2020, 6, 15), done: false)
|
||||||
];
|
];
|
||||||
static List<Package> packages = [
|
static List<Package> packages = [
|
||||||
@@ -88,7 +89,7 @@ class PackageModel extends BaseModel {
|
|||||||
weight: 55,
|
weight: 55,
|
||||||
market: "Macy",
|
market: "Macy",
|
||||||
trackingID: "234-sdflsdf-213",
|
trackingID: "234-sdflsdf-213",
|
||||||
status: "Processed",
|
status: "Shipped",
|
||||||
id: "PKG2043",
|
id: "PKG2043",
|
||||||
arrivedDate: DateTime(2020, 6, 1),
|
arrivedDate: DateTime(2020, 6, 1),
|
||||||
receiverAddress: '2 Shwe Taung Kyar St, Bahan Tsp, Yangon',statusHistory: statusHistory),
|
receiverAddress: '2 Shwe Taung Kyar St, Bahan Tsp, Yangon',statusHistory: statusHistory),
|
||||||
@@ -101,7 +102,7 @@ class PackageModel extends BaseModel {
|
|||||||
packageType: "Dangerous",
|
packageType: "Dangerous",
|
||||||
cargoDesc: "Phones and Scooters",
|
cargoDesc: "Phones and Scooters",
|
||||||
weight: 25,
|
weight: 25,
|
||||||
status: "Received",
|
status: "Arrived",
|
||||||
market: "Amazon",
|
market: "Amazon",
|
||||||
trackingID: "sdf-asdf-23489",
|
trackingID: "sdf-asdf-23489",
|
||||||
id: "PKG2044",
|
id: "PKG2044",
|
||||||
@@ -131,6 +132,27 @@ class PackageModel extends BaseModel {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
List<Package> get shipped {
|
||||||
|
return packages.where((e) => e.status == "Shipped").toList()
|
||||||
|
..sort((e1, e2) {
|
||||||
|
return e2.packageNumber.compareTo(e1.packageNumber);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
List<Package> get arrived {
|
||||||
|
return packages.where((e) => e.status == "Arrived").toList()
|
||||||
|
..sort((e1, e2) {
|
||||||
|
return e2.packageNumber.compareTo(e1.packageNumber);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
List<Package> get delivered {
|
||||||
|
return packages.where((e) => e.status == "Delivered").toList()
|
||||||
|
..sort((e1, e2) {
|
||||||
|
return e2.packageNumber.compareTo(e1.packageNumber);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
List<Package> get upcoming {
|
List<Package> get upcoming {
|
||||||
return packages.where((e) => e.status == "Received").toList()
|
return packages.where((e) => e.status == "Received").toList()
|
||||||
..sort((e1, e2) {
|
..sort((e1, e2) {
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
import 'package:barcode_scan/barcode_scan.dart';
|
import 'package:barcode_scan/barcode_scan.dart';
|
||||||
import 'package:barcode_scan/model/scan_result.dart';
|
import 'package:barcode_scan/model/scan_result.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.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:provider/provider.dart';
|
import 'package:provider/provider.dart';
|
||||||
import 'package:fcs/model/product_model.dart';
|
import 'package:fcs/model/product_model.dart';
|
||||||
@@ -26,49 +27,6 @@ class _BarcodeScreenPageState extends State<BarcodeScreenPage> {
|
|||||||
super.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
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return LocalProgress(
|
return LocalProgress(
|
||||||
@@ -82,9 +40,24 @@ class _BarcodeScreenPageState extends State<BarcodeScreenPage> {
|
|||||||
mainAxisAlignment: MainAxisAlignment.center,
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
RaisedButton(
|
InkWell(
|
||||||
child: Icon(Icons.scanner),
|
child: Row(
|
||||||
onPressed: () async {
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
|
children: <Widget>[
|
||||||
|
Text(
|
||||||
|
"Scan : ",
|
||||||
|
style: TextStyle(
|
||||||
|
color: primaryColor,
|
||||||
|
fontWeight: FontWeight.bold,
|
||||||
|
fontSize: 20),
|
||||||
|
),
|
||||||
|
Icon(
|
||||||
|
Ionicons.ios_qr_scanner,
|
||||||
|
size: 50,
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
onTap: () async {
|
||||||
await scan();
|
await scan();
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
@@ -98,15 +71,4 @@ class _BarcodeScreenPageState extends State<BarcodeScreenPage> {
|
|||||||
print("ScanResult => $result");
|
print("ScanResult => $result");
|
||||||
setState(() => 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);
|
|
||||||
// }
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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)
|
||||||
|
|||||||
@@ -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);
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -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),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -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),
|
||||||
|
|||||||
@@ -1,7 +1,12 @@
|
|||||||
import 'package:fcs/model/main_model.dart';
|
import 'package:fcs/model/main_model.dart';
|
||||||
|
import 'package:fcs/model/shipment_model.dart';
|
||||||
|
import 'package:fcs/pages/barcode_screen_page.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/vo/shipping_address.dart';
|
||||||
|
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/my_data_table.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:flutter_icons/flutter_icons.dart';
|
import 'package:flutter_icons/flutter_icons.dart';
|
||||||
@@ -141,6 +146,50 @@ class _PackageEditorState extends State<PackageEditor> {
|
|||||||
fontWeight: FontWeight.bold),
|
fontWeight: FontWeight.bold),
|
||||||
),
|
),
|
||||||
children: [
|
children: [
|
||||||
|
Padding(
|
||||||
|
padding: const EdgeInsets.only(
|
||||||
|
left: 20.0, right: 20),
|
||||||
|
child: TextFormField(
|
||||||
|
initialValue: isNew ? "" : "zdf-sdfl-37sdfks",
|
||||||
|
decoration: InputDecoration(
|
||||||
|
fillColor: Colors.white,
|
||||||
|
labelText: 'Tracking ID',
|
||||||
|
hintText: 'Tracking ID',
|
||||||
|
filled: true,
|
||||||
|
suffixIcon: IconButton(
|
||||||
|
icon: Icon(
|
||||||
|
Ionicons.ios_barcode,
|
||||||
|
color: primaryColor,
|
||||||
|
),
|
||||||
|
onPressed: () {
|
||||||
|
Navigator.push(
|
||||||
|
context,
|
||||||
|
BottomUpPageRoute(
|
||||||
|
BarcodeScreenPage()),
|
||||||
|
);
|
||||||
|
}),
|
||||||
|
icon: Icon(Octicons.package,
|
||||||
|
color: primaryColor),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Padding(
|
||||||
|
padding: const EdgeInsets.only(
|
||||||
|
left: 20.0, right: 20),
|
||||||
|
child: TextFormField(
|
||||||
|
initialValue: isNew ? "" : "FCS-0203-390-2",
|
||||||
|
decoration: InputDecoration(
|
||||||
|
fillColor: Colors.white,
|
||||||
|
labelText: 'FCS_ID',
|
||||||
|
hintText: 'FCS_ID',
|
||||||
|
filled: true,
|
||||||
|
icon: Icon(Feather.user,
|
||||||
|
color: primaryColor),
|
||||||
|
suffixIcon: IconButton(
|
||||||
|
icon: Icon(Icons.search),
|
||||||
|
onPressed: () {})),
|
||||||
|
),
|
||||||
|
),
|
||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsets.only(
|
padding: const EdgeInsets.only(
|
||||||
left: 20.0, right: 20),
|
left: 20.0, right: 20),
|
||||||
@@ -172,38 +221,6 @@ class _PackageEditorState extends State<PackageEditor> {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Padding(
|
|
||||||
padding: const EdgeInsets.only(
|
|
||||||
left: 20.0, right: 20),
|
|
||||||
child: TextFormField(
|
|
||||||
initialValue: isNew ? "" : "zdf-sdfl-37sdfks",
|
|
||||||
decoration: InputDecoration(
|
|
||||||
fillColor: Colors.white,
|
|
||||||
labelText: 'Tracking ID',
|
|
||||||
hintText: 'Tracking ID',
|
|
||||||
filled: true,
|
|
||||||
icon: Icon(Octicons.package,
|
|
||||||
color: primaryColor),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
Padding(
|
|
||||||
padding: const EdgeInsets.only(
|
|
||||||
left: 20.0, right: 20),
|
|
||||||
child: TextFormField(
|
|
||||||
initialValue: isNew ? "" : "FCS-0203-390-2",
|
|
||||||
decoration: InputDecoration(
|
|
||||||
fillColor: Colors.white,
|
|
||||||
labelText: 'FCS_ID',
|
|
||||||
hintText: 'FCS_ID',
|
|
||||||
filled: true,
|
|
||||||
icon: Icon(Feather.user,
|
|
||||||
color: primaryColor),
|
|
||||||
suffixIcon: IconButton(
|
|
||||||
icon: Icon(Icons.search),
|
|
||||||
onPressed: () {})),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsets.only(
|
padding: const EdgeInsets.only(
|
||||||
left: 20.0, right: 20),
|
left: 20.0, right: 20),
|
||||||
@@ -266,6 +283,15 @@ class _PackageEditorState extends State<PackageEditor> {
|
|||||||
color: primaryColor),
|
color: primaryColor),
|
||||||
)),
|
)),
|
||||||
),
|
),
|
||||||
|
Padding(
|
||||||
|
padding: const EdgeInsets.only(
|
||||||
|
left: 20.0, right: 20),
|
||||||
|
child: fcsInput(
|
||||||
|
"Remark",
|
||||||
|
MaterialCommunityIcons.note,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
SizedBox(height: 5),
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
: Container(),
|
: Container(),
|
||||||
@@ -346,7 +372,8 @@ class _PackageEditorState extends State<PackageEditor> {
|
|||||||
position: TimelinePosition.Left),
|
position: TimelinePosition.Left),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
)
|
),
|
||||||
|
getShippingAddressList(context),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@@ -392,4 +419,73 @@ class _PackageEditorState extends State<PackageEditor> {
|
|||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Widget getShippingAddressList(BuildContext context) {
|
||||||
|
var shipmentModel = Provider.of<ShipmentModel>(context);
|
||||||
|
return Container(
|
||||||
|
child: ExpansionTile(
|
||||||
|
title: Text(
|
||||||
|
"Shipping Addresses",
|
||||||
|
style: TextStyle(
|
||||||
|
fontWeight: FontWeight.bold,
|
||||||
|
fontStyle: FontStyle.normal,
|
||||||
|
color: primaryColor),
|
||||||
|
),
|
||||||
|
children: <Widget>[
|
||||||
|
Container(
|
||||||
|
child: SingleChildScrollView(
|
||||||
|
scrollDirection: Axis.horizontal,
|
||||||
|
child: MyDataTable(
|
||||||
|
headingRowHeight: 40,
|
||||||
|
columnSpacing: 50,
|
||||||
|
columns: [
|
||||||
|
MyDataColumn(
|
||||||
|
label: Text(
|
||||||
|
"Full Name",
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 15,
|
||||||
|
color: Colors.grey[600],
|
||||||
|
),
|
||||||
|
)),
|
||||||
|
MyDataColumn(
|
||||||
|
label: Text(
|
||||||
|
"Phone Number",
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 15,
|
||||||
|
color: Colors.grey[600],
|
||||||
|
),
|
||||||
|
)),
|
||||||
|
],
|
||||||
|
rows: getAddressRows(shipmentModel.shippingAddresses),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
List<MyDataRow> getAddressRows(List<ShippingAddress> addresses) {
|
||||||
|
return addresses.map((s) {
|
||||||
|
return MyDataRow(
|
||||||
|
onSelectChanged: (selected) {
|
||||||
|
|
||||||
|
},
|
||||||
|
cells: [
|
||||||
|
MyDataCell(
|
||||||
|
new Text(
|
||||||
|
s.fullName,
|
||||||
|
style: textStyle,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
MyDataCell(
|
||||||
|
new Text(
|
||||||
|
s.phoneNumber,
|
||||||
|
style: textStyle,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
);
|
||||||
|
}).toList();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,12 +9,12 @@ import 'package:fcs/vo/buyer.dart';
|
|||||||
import 'package:fcs/widget/bottom_up_page_route.dart';
|
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/gestures.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
|
import 'package:flutter_icons/flutter_icons.dart';
|
||||||
import 'package:provider/provider.dart';
|
import 'package:provider/provider.dart';
|
||||||
|
|
||||||
import '../theme/theme.dart';
|
import '../theme/theme.dart';
|
||||||
import 'pickup_editor.dart';
|
|
||||||
|
|
||||||
class PackageList extends StatefulWidget {
|
class PackageList extends StatefulWidget {
|
||||||
@override
|
@override
|
||||||
@@ -40,7 +40,7 @@ class _PackageListState extends State<PackageList> {
|
|||||||
return LocalProgress(
|
return LocalProgress(
|
||||||
inAsyncCall: _isLoading,
|
inAsyncCall: _isLoading,
|
||||||
child: DefaultTabController(
|
child: DefaultTabController(
|
||||||
length: 2,
|
length: 5,
|
||||||
child: Scaffold(
|
child: Scaffold(
|
||||||
appBar: AppBar(
|
appBar: AppBar(
|
||||||
centerTitle: true,
|
centerTitle: true,
|
||||||
@@ -51,19 +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(
|
// IconButton(
|
||||||
icon: Icon(
|
// icon: Icon(
|
||||||
FontAwesomeIcons.barcode,
|
// Ionicons.ios_barcode,
|
||||||
color: Colors.white,
|
// color: Colors.white,
|
||||||
),
|
// ),
|
||||||
iconSize: 30,
|
// iconSize: 30,
|
||||||
onPressed: () {
|
// onPressed: () {
|
||||||
Navigator.push(
|
// Navigator.push(
|
||||||
context,
|
// context,
|
||||||
BottomUpPageRoute(BarcodeScreenPage()),
|
// BottomUpPageRoute(BarcodeScreenPage()),
|
||||||
);
|
// );
|
||||||
},
|
// },
|
||||||
),
|
// ),
|
||||||
IconButton(
|
IconButton(
|
||||||
icon: Icon(
|
icon: Icon(
|
||||||
Icons.search,
|
Icons.search,
|
||||||
@@ -74,12 +74,20 @@ class _PackageListState extends State<PackageList> {
|
|||||||
),
|
),
|
||||||
],
|
],
|
||||||
bottom: TabBar(
|
bottom: TabBar(
|
||||||
|
dragStartBehavior: DragStartBehavior.start,
|
||||||
unselectedLabelColor: Colors.grey,
|
unselectedLabelColor: Colors.grey,
|
||||||
tabs: [
|
tabs: [
|
||||||
Tab(
|
Tab(
|
||||||
text: "Received",
|
text: "Received",
|
||||||
),
|
),
|
||||||
Tab(text: "Processed"),
|
Tab(text: "Processed"),
|
||||||
|
Tab(
|
||||||
|
text: "Shipped",
|
||||||
|
),
|
||||||
|
Tab(text: "Arrived"),
|
||||||
|
Tab(
|
||||||
|
text: "Delivered",
|
||||||
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@@ -95,6 +103,9 @@ class _PackageListState extends State<PackageList> {
|
|||||||
children: [
|
children: [
|
||||||
_upComing(),
|
_upComing(),
|
||||||
_completed(),
|
_completed(),
|
||||||
|
_shipped(),
|
||||||
|
_arrived(),
|
||||||
|
_delivered(),
|
||||||
],
|
],
|
||||||
)),
|
)),
|
||||||
),
|
),
|
||||||
@@ -155,4 +166,76 @@ class _PackageListState extends State<PackageList> {
|
|||||||
],
|
],
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Widget _shipped() {
|
||||||
|
var packageModel = Provider.of<PackageModel>(context);
|
||||||
|
return Column(
|
||||||
|
children: <Widget>[
|
||||||
|
Expanded(
|
||||||
|
child: new ListView.separated(
|
||||||
|
separatorBuilder: (context, index) => Divider(
|
||||||
|
color: Colors.black,
|
||||||
|
),
|
||||||
|
scrollDirection: Axis.vertical,
|
||||||
|
padding: EdgeInsets.only(top: 15),
|
||||||
|
shrinkWrap: true,
|
||||||
|
itemCount: packageModel.shipped.length,
|
||||||
|
itemBuilder: (BuildContext context, int index) {
|
||||||
|
return PackageListRow(
|
||||||
|
package: packageModel.shipped[index],
|
||||||
|
isReadOnly: false,
|
||||||
|
);
|
||||||
|
}),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
Widget _arrived() {
|
||||||
|
var packageModel = Provider.of<PackageModel>(context);
|
||||||
|
return Column(
|
||||||
|
children: <Widget>[
|
||||||
|
Expanded(
|
||||||
|
child: new ListView.separated(
|
||||||
|
separatorBuilder: (context, index) => Divider(
|
||||||
|
color: Colors.black,
|
||||||
|
),
|
||||||
|
scrollDirection: Axis.vertical,
|
||||||
|
padding: EdgeInsets.only(top: 15),
|
||||||
|
shrinkWrap: true,
|
||||||
|
itemCount: packageModel.arrived.length,
|
||||||
|
itemBuilder: (BuildContext context, int index) {
|
||||||
|
return PackageListRow(
|
||||||
|
package: packageModel.arrived[index],
|
||||||
|
isReadOnly: false,
|
||||||
|
);
|
||||||
|
}),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
Widget _delivered() {
|
||||||
|
var packageModel = Provider.of<PackageModel>(context);
|
||||||
|
return Column(
|
||||||
|
children: <Widget>[
|
||||||
|
Expanded(
|
||||||
|
child: new ListView.separated(
|
||||||
|
separatorBuilder: (context, index) => Divider(
|
||||||
|
color: Colors.black,
|
||||||
|
),
|
||||||
|
scrollDirection: Axis.vertical,
|
||||||
|
padding: EdgeInsets.only(top: 15),
|
||||||
|
shrinkWrap: true,
|
||||||
|
itemCount: packageModel.delivered.length,
|
||||||
|
itemBuilder: (BuildContext context, int index) {
|
||||||
|
return PackageListRow(
|
||||||
|
package: packageModel.delivered[index],
|
||||||
|
isReadOnly: false,
|
||||||
|
);
|
||||||
|
}),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user