Merge remote-tracking branch 'upstream/master'
This commit is contained in:
@@ -104,7 +104,7 @@
|
|||||||
"reg.confirm":"Submit Registration?",
|
"reg.confirm":"Submit Registration?",
|
||||||
"reg.date":"Registeration Date",
|
"reg.date":"Registeration Date",
|
||||||
|
|
||||||
"profile.title": "FCS Profile",
|
"profile.title": "Profile",
|
||||||
"profile.edit_title": "Edit FCS Profile",
|
"profile.edit_title": "Edit FCS Profile",
|
||||||
"profile.name": "Name",
|
"profile.name": "Name",
|
||||||
"profile.phone": "Phone",
|
"profile.phone": "Phone",
|
||||||
@@ -513,14 +513,23 @@
|
|||||||
|
|
||||||
"rate.edit.title":"EDIT RATES",
|
"rate.edit.title":"EDIT RATES",
|
||||||
|
|
||||||
"rate.cal.title":"CALCULATE RATES",
|
"rate.cal.title":"ESTIMATE SHIPPING COST",
|
||||||
|
|
||||||
|
"boxes.name":"Boxes",
|
||||||
|
"boxes.title":"BOXES",
|
||||||
|
"boxes.new":"New Box",
|
||||||
|
"box.edit.title":"BOX",
|
||||||
|
"box.package.id":"Package ID",
|
||||||
|
"box.package.desc":"Description",
|
||||||
|
"box.package.market":"Market",
|
||||||
|
"box.add_package":"Add Package",
|
||||||
|
|
||||||
"package.name":"Packages",
|
"package.name":"Packages",
|
||||||
"package.title":"PACKAGES",
|
"package.title":"PACKAGES",
|
||||||
"package.new":"New Package",
|
"package.new":"New Package",
|
||||||
"package.edit.title":"PACKAGE",
|
"package.edit.title":"PACKAGE",
|
||||||
"package.arrival.date":"Arrival Date",
|
"package.arrival.date":"Arrival Date",
|
||||||
"package.number":"Package Number",
|
"package.number":"Box Number",
|
||||||
"package.rate":"Rate",
|
"package.rate":"Rate",
|
||||||
"package.weight":"Weight",
|
"package.weight":"Weight",
|
||||||
"package.amount":"Amount",
|
"package.amount":"Amount",
|
||||||
@@ -542,7 +551,7 @@
|
|||||||
"invoices.add":"New Invoice",
|
"invoices.add":"New Invoice",
|
||||||
"invoice.form.title":"INVOICE",
|
"invoice.form.title":"INVOICE",
|
||||||
"invoice.payment":"Payment Receipt",
|
"invoice.payment":"Payment Receipt",
|
||||||
"invoice.add_package":"Add Package",
|
"invoice.add_box":"Add Box",
|
||||||
|
|
||||||
"term":"TERMS",
|
"term":"TERMS",
|
||||||
"term.btn":"Terms",
|
"term.btn":"Terms",
|
||||||
@@ -552,7 +561,8 @@
|
|||||||
|
|
||||||
"contact": "CONTACTS",
|
"contact": "CONTACTS",
|
||||||
|
|
||||||
"fcs.profile": "PROFILE",
|
"fcs.btn": "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"
|
||||||
|
|||||||
BIN
assets/photos/1.jpg
Normal file
BIN
assets/photos/1.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 18 KiB |
BIN
assets/photos/2.jpg
Normal file
BIN
assets/photos/2.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 67 KiB |
BIN
assets/photos/3.jpg
Normal file
BIN
assets/photos/3.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 12 KiB |
@@ -33,6 +33,7 @@ import 'model/product_model.dart';
|
|||||||
import 'model/report_user_model.dart';
|
import 'model/report_user_model.dart';
|
||||||
import 'model/shipment_rate_model.dart';
|
import 'model/shipment_rate_model.dart';
|
||||||
import 'model/user_model.dart';
|
import 'model/user_model.dart';
|
||||||
|
import 'model_fcs/box_model.dart';
|
||||||
import 'pages/home_page.dart';
|
import 'pages/home_page.dart';
|
||||||
import 'pages/splash.dart';
|
import 'pages/splash.dart';
|
||||||
import 'pages/term.dart';
|
import 'pages/term.dart';
|
||||||
@@ -71,6 +72,7 @@ class _AppState extends State<App> {
|
|||||||
final ShipmentRateModel shipmentRateModel = new ShipmentRateModel();
|
final ShipmentRateModel shipmentRateModel = new ShipmentRateModel();
|
||||||
final ShipmentModel shipmentModel = new ShipmentModel();
|
final ShipmentModel shipmentModel = new ShipmentModel();
|
||||||
final PackageModel packageModel=new PackageModel();
|
final PackageModel packageModel=new PackageModel();
|
||||||
|
final BoxModel boxModel=new BoxModel();
|
||||||
final MessageModel messageModel=new MessageModel();
|
final MessageModel messageModel=new MessageModel();
|
||||||
final InvoiceModel invoiceModel = new InvoiceModel();
|
final InvoiceModel invoiceModel = new InvoiceModel();
|
||||||
final CustomerModel customerModel = new CustomerModel();
|
final CustomerModel customerModel = new CustomerModel();
|
||||||
@@ -108,6 +110,7 @@ class _AppState extends State<App> {
|
|||||||
..addModel(shipmentRateModel)
|
..addModel(shipmentRateModel)
|
||||||
..addModel(shipmentModel)
|
..addModel(shipmentModel)
|
||||||
..addModel(packageModel)
|
..addModel(packageModel)
|
||||||
|
..addModel(boxModel)
|
||||||
..addModel(messageModel)
|
..addModel(messageModel)
|
||||||
..addModel(shipmentRateModel)
|
..addModel(shipmentRateModel)
|
||||||
..addModel(invoiceModel)
|
..addModel(invoiceModel)
|
||||||
@@ -164,6 +167,7 @@ class _AppState extends State<App> {
|
|||||||
ChangeNotifierProvider(builder: (context) => shipmentRateModel),
|
ChangeNotifierProvider(builder: (context) => shipmentRateModel),
|
||||||
ChangeNotifierProvider(builder: (context) => shipmentModel),
|
ChangeNotifierProvider(builder: (context) => shipmentModel),
|
||||||
ChangeNotifierProvider(builder: (context) => packageModel),
|
ChangeNotifierProvider(builder: (context) => packageModel),
|
||||||
|
ChangeNotifierProvider(builder: (context) => boxModel),
|
||||||
ChangeNotifierProvider(builder: (context) => messageModel),
|
ChangeNotifierProvider(builder: (context) => messageModel),
|
||||||
ChangeNotifierProvider(builder: (context) => invoiceModel),
|
ChangeNotifierProvider(builder: (context) => invoiceModel),
|
||||||
ChangeNotifierProvider(builder: (context) => customerModel),
|
ChangeNotifierProvider(builder: (context) => customerModel),
|
||||||
|
|||||||
@@ -60,7 +60,9 @@ class MainModel extends ChangeNotifier {
|
|||||||
shippingAddress: '154-19 64th Ave.Flushing, \nNY 11367',
|
shippingAddress: '154-19 64th Ave.Flushing, \nNY 11367',
|
||||||
deliveryAddress: '39 42th St. Kyaut Ta Thar Township Yangon');
|
deliveryAddress: '39 42th St. Kyaut Ta Thar Township Yangon');
|
||||||
|
|
||||||
Setting setting = Setting(terms: '[{"insert":"* Minimum shipping weight is 1lbs.\n* Oversized goods, Light weight/Large volume items, laptops, phones, tablets may incur extra charges based on pecifications.Please contact us for pricing.\n* Goods with lithium battary needs extra packaging and declaration. Please inform us ahead of time so that we can process your package accordingly.\n* Loose Batteries, Drones, and Prescription medicines are not allowed on aircraft.\n* Payment: We accept money orders, any US bank transfers via Zelle, AYA, KBZ and CB. No COD except for pick-ups.\n*Payments made in Myanmar will incur 2% tranfer fee\n"}]');
|
Setting setting = Setting(
|
||||||
|
terms:
|
||||||
|
'[{"insert":"* Minimum shipping weight is 1lbs.\n* Oversized goods, Light weight/Large volume items, laptops, phones, tablets may incur extra charges based on pecifications.Please contact us for pricing.\n* Goods with lithium battary needs extra packaging and declaration. Please inform us ahead of time so that we can process your package accordingly.\n* Loose Batteries, Drones, and Prescription medicines are not allowed on aircraft.\n* Payment: We accept money orders, any US bank transfers via Zelle, AYA, KBZ and CB. No COD except for pick-ups.\n*Payments made in Myanmar will incur 2% tranfer fee\n"}]');
|
||||||
PackageInfo packageInfo;
|
PackageInfo packageInfo;
|
||||||
bool isLoaded = true;
|
bool isLoaded = true;
|
||||||
bool isOnline = true;
|
bool isOnline = true;
|
||||||
@@ -109,6 +111,14 @@ class MainModel extends ChangeNotifier {
|
|||||||
return this.user != null;
|
return this.user != null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool isCustomer() {
|
||||||
|
return user != null && user.name != "Owner";
|
||||||
|
}
|
||||||
|
|
||||||
|
bool isOwner() {
|
||||||
|
return user != null && user.name == "Owner";
|
||||||
|
}
|
||||||
|
|
||||||
bool hasEmail() {
|
bool hasEmail() {
|
||||||
return this.user != null && this.user.isEmail();
|
return this.user != null && this.user.isEmail();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,19 +8,19 @@ class ShipmentModel extends BaseModel {
|
|||||||
Shipment(
|
Shipment(
|
||||||
shipDate: DateTime(2020, 4, 23),
|
shipDate: DateTime(2020, 4, 23),
|
||||||
shipmentNumber: 'A103B',
|
shipmentNumber: 'A103B',
|
||||||
status: 'Pending',
|
status: 'In Progress',
|
||||||
arrivalDate: DateTime(2020, 4, 30),
|
arrivalDate: DateTime(2020, 4, 30),
|
||||||
departureDate: DateTime(2020, 4, 23)),
|
departureDate: DateTime(2020, 4, 23)),
|
||||||
Shipment(
|
Shipment(
|
||||||
shipDate: DateTime(2020, 4, 2),
|
shipDate: DateTime(2020, 4, 2),
|
||||||
shipmentNumber: 'A100A',
|
shipmentNumber: 'A100A',
|
||||||
status: 'Delivered',
|
status: 'Ready to ship',
|
||||||
arrivalDate: DateTime(2020, 4, 28),
|
arrivalDate: DateTime(2020, 4, 28),
|
||||||
departureDate: DateTime(2020, 4, 15)),
|
departureDate: DateTime(2020, 4, 15)),
|
||||||
Shipment(
|
Shipment(
|
||||||
shipDate: DateTime(2020, 4, 2),
|
shipDate: DateTime(2020, 4, 2),
|
||||||
shipmentNumber: 'A100B',
|
shipmentNumber: 'A100B',
|
||||||
status: 'Delivered',
|
status: 'Arrived',
|
||||||
arrivalDate: DateTime(2020, 4, 28),
|
arrivalDate: DateTime(2020, 4, 28),
|
||||||
departureDate: DateTime(2020, 4, 15)),
|
departureDate: DateTime(2020, 4, 15)),
|
||||||
Shipment(
|
Shipment(
|
||||||
@@ -38,7 +38,7 @@ class ShipmentModel extends BaseModel {
|
|||||||
Shipment(
|
Shipment(
|
||||||
shipDate: DateTime(2020, 4, 10),
|
shipDate: DateTime(2020, 4, 10),
|
||||||
shipmentNumber: 'A102B',
|
shipmentNumber: 'A102B',
|
||||||
status: 'Assigned',
|
status: 'Arrived',
|
||||||
arrivalDate: DateTime(2020, 4, 30),
|
arrivalDate: DateTime(2020, 4, 30),
|
||||||
departureDate: DateTime(2020, 4, 20),
|
departureDate: DateTime(2020, 4, 20),
|
||||||
)
|
)
|
||||||
@@ -47,29 +47,31 @@ class ShipmentModel extends BaseModel {
|
|||||||
List<Shipment> get canceled {
|
List<Shipment> get canceled {
|
||||||
List<Shipment> _p = shipments.where((e) => e.status == "Canceled").toList()
|
List<Shipment> _p = shipments.where((e) => e.status == "Canceled").toList()
|
||||||
..sort((e1, e2) {
|
..sort((e1, e2) {
|
||||||
return e2.shipDate.compareTo(e1.shipDate);
|
return e1.shipDate.compareTo(e2.shipDate);
|
||||||
});
|
});
|
||||||
return _p;
|
return _p;
|
||||||
}
|
}
|
||||||
|
|
||||||
List<Shipment> get completed {
|
List<Shipment> get completed {
|
||||||
return shipments.where((e) => e.status == "Delivered").toList()
|
return shipments.where((e) => e.status == "Arrived").toList()
|
||||||
..sort((e1, e2) {
|
..sort((e1, e2) {
|
||||||
return e2.shipDate.compareTo(e1.shipDate);
|
return e1.shipDate.compareTo(e2.shipDate);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
List<Shipment> get upcoming {
|
List<Shipment> get upcoming {
|
||||||
return shipments
|
List<Shipment> _shipments = shipments
|
||||||
.where((e) =>
|
.where((e) =>
|
||||||
e.status == "Pending" ||
|
e.status == "In Progress" ||
|
||||||
e.status == "Assigned" ||
|
e.status == "Ready to ship" ||
|
||||||
e.status == "Processed" ||
|
e.status == "Processed" ||
|
||||||
e.status == "Rescheduled")
|
e.status == "Rescheduled")
|
||||||
.toList()
|
.toList();
|
||||||
..sort((e1, e2) {
|
|
||||||
return e2.shipDate.compareTo(e1.shipDate);
|
_shipments.sort((e1, e2) {
|
||||||
|
return e1.shipDate.compareTo(e2.shipDate);
|
||||||
});
|
});
|
||||||
|
return _shipments;
|
||||||
}
|
}
|
||||||
|
|
||||||
void initUser(user) {
|
void initUser(user) {
|
||||||
|
|||||||
153
lib/model_fcs/box_model.dart
Normal file
153
lib/model_fcs/box_model.dart
Normal file
@@ -0,0 +1,153 @@
|
|||||||
|
import 'dart:async';
|
||||||
|
|
||||||
|
import 'package:cloud_firestore/cloud_firestore.dart';
|
||||||
|
import 'package:fcs/model/base_model.dart';
|
||||||
|
import 'package:fcs/model_fcs/package_model.dart';
|
||||||
|
import 'package:fcs/vo/box.dart';
|
||||||
|
import 'package:fcs/vo/package.dart';
|
||||||
|
import 'package:logging/logging.dart';
|
||||||
|
|
||||||
|
class BoxModel extends BaseModel {
|
||||||
|
final log = Logger('BoxModel');
|
||||||
|
|
||||||
|
StreamSubscription<QuerySnapshot> listener;
|
||||||
|
static List<Status> statusHistory = [
|
||||||
|
Status(status: "Packed", date: DateTime(2020, 6, 1), done: true),
|
||||||
|
Status(status: "Shipped", date: DateTime(2020, 6, 5), done: false),
|
||||||
|
Status(status: "Delivered", date: DateTime(2020, 6, 15), done: false)
|
||||||
|
];
|
||||||
|
static List<Package> packages = [
|
||||||
|
PackageModel.packages[0],
|
||||||
|
PackageModel.packages[1],
|
||||||
|
PackageModel.packages[2]
|
||||||
|
];
|
||||||
|
List<Box> boxes = [
|
||||||
|
Box(
|
||||||
|
shipmentNumber: "A202",
|
||||||
|
receiverNumber: "3",
|
||||||
|
receiverName: "Ko Myo Min",
|
||||||
|
boxNumber: "1",
|
||||||
|
rate: 7,
|
||||||
|
packageType: "General",
|
||||||
|
weight: 25,
|
||||||
|
status: "Packed",
|
||||||
|
receiverAddress: '1 Bo Yar Nyunt St.\nDagon Tsp, Yangon',
|
||||||
|
cargoDesc: "Clothes",
|
||||||
|
arrivedDate: DateTime(2020, 6, 1),
|
||||||
|
packages: packages,
|
||||||
|
statusHistory: statusHistory),
|
||||||
|
Box(
|
||||||
|
shipmentNumber: "A202",
|
||||||
|
receiverNumber: "3",
|
||||||
|
receiverName: "Ko Myo Min",
|
||||||
|
boxNumber: "2",
|
||||||
|
rate: 7,
|
||||||
|
packageType: "General",
|
||||||
|
weight: 20,
|
||||||
|
status: "Packed",
|
||||||
|
cargoDesc: "Clothes",
|
||||||
|
arrivedDate: DateTime(2020, 6, 1),
|
||||||
|
statusHistory: statusHistory,
|
||||||
|
packages: packages,
|
||||||
|
receiverAddress: '1 Bo Yar Nyunt St.\nDagon Tsp, Yangon'),
|
||||||
|
Box(
|
||||||
|
shipmentNumber: "A202",
|
||||||
|
receiverNumber: "3",
|
||||||
|
receiverName: "Ko Myo Min",
|
||||||
|
boxNumber: "3",
|
||||||
|
rate: 7,
|
||||||
|
packageType: "General",
|
||||||
|
weight: 15,
|
||||||
|
cargoDesc: "Shoes",
|
||||||
|
status: "Packed",
|
||||||
|
arrivedDate: DateTime(2020, 6, 1),
|
||||||
|
statusHistory: statusHistory,
|
||||||
|
packages: packages,
|
||||||
|
receiverAddress: '1 Bo Yar Nyunt St.\nDagon Tsp, Yangon'),
|
||||||
|
Box(
|
||||||
|
shipmentNumber: "A202",
|
||||||
|
receiverNumber: "2",
|
||||||
|
receiverName: "Ma Aye",
|
||||||
|
boxNumber: "1",
|
||||||
|
rate: 8,
|
||||||
|
packageType: "Medicine",
|
||||||
|
weight: 15,
|
||||||
|
status: "Packed",
|
||||||
|
cargoDesc: "Dietary supplement",
|
||||||
|
arrivedDate: DateTime(2020, 6, 1),
|
||||||
|
statusHistory: statusHistory,
|
||||||
|
packages: packages,
|
||||||
|
receiverAddress: '2 Shwe Taung Kyar St, Bahan Tsp, Yangon'),
|
||||||
|
Box(
|
||||||
|
shipmentNumber: "A202",
|
||||||
|
receiverNumber: "2",
|
||||||
|
receiverName: "Ma Aye",
|
||||||
|
boxNumber: "2",
|
||||||
|
rate: 7,
|
||||||
|
packageType: "General",
|
||||||
|
cargoDesc: "Handbags",
|
||||||
|
weight: 55,
|
||||||
|
status: "Shipped",
|
||||||
|
arrivedDate: DateTime(2020, 6, 1),
|
||||||
|
statusHistory: statusHistory,
|
||||||
|
packages: packages,
|
||||||
|
receiverAddress: '2 Shwe Taung Kyar St, Bahan Tsp, Yangon'),
|
||||||
|
Box(
|
||||||
|
shipmentNumber: "A201",
|
||||||
|
receiverNumber: "1",
|
||||||
|
receiverName: "Ko Wai",
|
||||||
|
boxNumber: "1",
|
||||||
|
rate: 9,
|
||||||
|
packageType: "Dangerous",
|
||||||
|
cargoDesc: "Phones and Scooters",
|
||||||
|
weight: 25,
|
||||||
|
status: "Delivered",
|
||||||
|
arrivedDate: DateTime(2020, 5, 21),
|
||||||
|
statusHistory: statusHistory,
|
||||||
|
packages: packages,
|
||||||
|
receiverAddress: '3 Kambzwza St, Bahan Tsp, Yangon'),
|
||||||
|
Box(
|
||||||
|
shipmentNumber: "A201",
|
||||||
|
receiverNumber: "1",
|
||||||
|
receiverName: "Ko Wai",
|
||||||
|
boxNumber: "2",
|
||||||
|
rate: 7,
|
||||||
|
packageType: "General",
|
||||||
|
cargoDesc: "Construction tools",
|
||||||
|
weight: 5,
|
||||||
|
status: "Delivered",
|
||||||
|
arrivedDate: DateTime(2020, 5, 21),
|
||||||
|
statusHistory: statusHistory,
|
||||||
|
packages: packages,
|
||||||
|
receiverAddress: '3 Kambzwza St, Bahan Tsp, Yangon'),
|
||||||
|
];
|
||||||
|
|
||||||
|
List<Box> get completed {
|
||||||
|
return boxes.where((e) => e.status == "Delivered").toList()
|
||||||
|
..sort((e1, e2) {
|
||||||
|
return e2.packageNumber.compareTo(e1.packageNumber);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
List<Box> get upcoming {
|
||||||
|
return boxes
|
||||||
|
.where((e) =>
|
||||||
|
e.status == "Packed" ||
|
||||||
|
e.status == "Received" ||
|
||||||
|
e.status == "Shipped")
|
||||||
|
.toList()
|
||||||
|
..sort((e1, e2) {
|
||||||
|
return e2.packageNumber.compareTo(e1.packageNumber);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
void initUser(user) {
|
||||||
|
super.initUser(user);
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
logout() async {
|
||||||
|
if (listener != null) await listener.cancel();
|
||||||
|
boxes = [];
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -14,56 +14,91 @@ class MessageModel extends BaseModel {
|
|||||||
List<Message> messages = [
|
List<Message> messages = [
|
||||||
Message(
|
Message(
|
||||||
senderName: "FCS System",
|
senderName: "FCS System",
|
||||||
receiverName: "Online Buyer",
|
receiverName: "Ko Myo Min",
|
||||||
date: DateTime(2020, 6, 1, 1, 1, 1),
|
date: DateTime(2020, 6, 1, 1, 1, 1),
|
||||||
message:
|
message:
|
||||||
"Hi Online Buyer, we received your goods. Please see in 'A202-3 #1'",
|
"Hi Ko Myo Min, we received your goods. Please see the following link",
|
||||||
),
|
),
|
||||||
Message(
|
Message(
|
||||||
senderName: "FCS System",
|
senderName: "FCS System",
|
||||||
receiverName: "Online Buyer",
|
receiverName: "Ko Myo Min",
|
||||||
|
date: DateTime(2020, 6, 1, 1, 1, 1),
|
||||||
|
message:
|
||||||
|
"'A202-3 #1'",
|
||||||
|
),
|
||||||
|
Message(
|
||||||
|
senderName: "FCS System",
|
||||||
|
receiverName: "Ko Myo Min",
|
||||||
date: DateTime(2020, 6, 1, 1, 5, 1),
|
date: DateTime(2020, 6, 1, 1, 5, 1),
|
||||||
message: "Thank you. Will see the photos and check.",
|
message: "Thank you. Will check the photos.",
|
||||||
isMe: false),
|
isMe: false),
|
||||||
Message(
|
Message(
|
||||||
senderName: "FCS System",
|
senderName: "FCS System",
|
||||||
receiverName: "Online Buyer",
|
receiverName: "Ko Myo Min",
|
||||||
date: DateTime(2020, 6, 1, 2, 1, 1),
|
date: DateTime(2020, 6, 1, 2, 1, 1),
|
||||||
message:
|
message:
|
||||||
"Hi Online Buyer, we successfully processed your goods and ready for payment. Please see in 'INV202005010387'",
|
"Hi Ko Myo Min, we successfully processed your goods and ready for payment. Please see in the following link.",
|
||||||
),
|
),
|
||||||
Message(
|
Message(
|
||||||
senderName: "FCS System",
|
senderName: "FCS System",
|
||||||
receiverName: "Online Buyer",
|
receiverName: "Ko Myo Min",
|
||||||
|
date: DateTime(2020, 6, 1, 2, 1, 1),
|
||||||
|
message:
|
||||||
|
"'INV202005010387'",
|
||||||
|
),
|
||||||
|
Message(
|
||||||
|
senderName: "FCS System",
|
||||||
|
receiverName: "Ko Myo Min",
|
||||||
date: DateTime(2020, 6, 1, 2, 10, 1),
|
date: DateTime(2020, 6, 1, 2, 10, 1),
|
||||||
message:
|
message:
|
||||||
"Hi Online Buyer, we have confirmed your payment and ready to ship your packages.",
|
"Hi Ko Myo Min, we have confirmed your payment and ready to ship your packages.",
|
||||||
),
|
),
|
||||||
Message(
|
Message(
|
||||||
senderName: "FCS System",
|
senderName: "FCS System",
|
||||||
receiverName: "Shipper",
|
receiverName: "Shipper",
|
||||||
date: DateTime(2020, 6, 1, 1, 1, 1),
|
date: DateTime(2020, 6, 1, 1, 1, 1),
|
||||||
message:
|
message:
|
||||||
"Hi Online Buyer, we received your goods. Please see in 'A202-3 #1'",
|
"Hi Ko Myo Min, we received your goods. Please see in the following link.",
|
||||||
|
),
|
||||||
|
Message(
|
||||||
|
senderName: "FCS System",
|
||||||
|
receiverName: "Shipper",
|
||||||
|
date: DateTime(2020, 6, 1, 1, 1, 1),
|
||||||
|
message:
|
||||||
|
"'A202-3 #1'",
|
||||||
),
|
),
|
||||||
Message(
|
Message(
|
||||||
senderName: "FCS System",
|
senderName: "FCS System",
|
||||||
receiverName: "Shipper",
|
receiverName: "Shipper",
|
||||||
date: DateTime(2020, 6, 1, 2, 1, 1),
|
date: DateTime(2020, 6, 1, 2, 1, 1),
|
||||||
message:
|
message:
|
||||||
"Hi Online Buyer, we successfully processed your goods and ready for payment. Please see in 'INV202005010387'",
|
"Hi FCS Team, we successfully processed your goods and ready for payment. Please see in the following link.",
|
||||||
|
),
|
||||||
|
Message(
|
||||||
|
senderName: "FCS System",
|
||||||
|
receiverName: "Shipper",
|
||||||
|
date: DateTime(2020, 6, 1, 2, 1, 1),
|
||||||
|
message:
|
||||||
|
"'INV202005010387'",
|
||||||
),
|
),
|
||||||
Message(
|
Message(
|
||||||
senderName: "FCS System",
|
senderName: "FCS System",
|
||||||
receiverName: "Shipper",
|
receiverName: "Shipper",
|
||||||
date: DateTime(2020, 6, 1, 2, 10, 1),
|
date: DateTime(2020, 6, 1, 2, 10, 1),
|
||||||
message:
|
message:
|
||||||
"Hi Online Buyer, we have confirmed your payment and ready to ship your packages.",
|
"Hi FCS Team, we have confirmed your payment and ready to ship your packages.",
|
||||||
|
),
|
||||||
|
Message(
|
||||||
|
senderName: "Ko Myo Min",
|
||||||
|
receiverName: "FCS Team",
|
||||||
|
date: DateTime(2020, 6, 1, 2, 10, 1),
|
||||||
|
message:
|
||||||
|
"Hi Ko Myo Min, we have recevied your pickup request. We will arrange the pickup soon. Thank you.",
|
||||||
),
|
),
|
||||||
];
|
];
|
||||||
|
|
||||||
List<Message> get lastMessage {
|
List<Message> get lastMessage {
|
||||||
return [messages[2], messages[5]];
|
return [messages[2], messages[6]];
|
||||||
}
|
}
|
||||||
|
|
||||||
List<Message> getMessage(String receiver) {
|
List<Message> getMessage(String receiver) {
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ import 'dart:async';
|
|||||||
|
|
||||||
import 'package:cloud_firestore/cloud_firestore.dart';
|
import 'package:cloud_firestore/cloud_firestore.dart';
|
||||||
import 'package:fcs/model/base_model.dart';
|
import 'package:fcs/model/base_model.dart';
|
||||||
|
import 'package:fcs/vo/box.dart';
|
||||||
import 'package:fcs/vo/package.dart';
|
import 'package:fcs/vo/package.dart';
|
||||||
import 'package:logging/logging.dart';
|
import 'package:logging/logging.dart';
|
||||||
|
|
||||||
@@ -9,95 +10,129 @@ class PackageModel extends BaseModel {
|
|||||||
final log = Logger('PackageModel');
|
final log = Logger('PackageModel');
|
||||||
|
|
||||||
StreamSubscription<QuerySnapshot> listener;
|
StreamSubscription<QuerySnapshot> listener;
|
||||||
|
static List<Status> statusHistory = [
|
||||||
List<Package> packages = [
|
Status(status: "Received", 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: "Delivered", date: DateTime(2020, 6, 15), done: false)
|
||||||
|
];
|
||||||
|
static List<Package> packages = [
|
||||||
Package(
|
Package(
|
||||||
shipmentNumber: "A202",
|
shipmentNumber: "A202",
|
||||||
receiverNumber: "3",
|
receiverNumber: "3",
|
||||||
|
receiverName: "Ko Myo Min",
|
||||||
boxNumber: "1",
|
boxNumber: "1",
|
||||||
rate: 7,
|
rate: 7,
|
||||||
packageType: "General",
|
packageType: "General",
|
||||||
weight: 25,
|
weight: 25,
|
||||||
status: "Received",
|
status: "Received",
|
||||||
receiverAddress: '1 Bo Yar Nyunt St.\nDagon Tsp, Yangon',
|
receiverAddress: '1 Bo Yar Nyunt St.\nDagon Tsp, Yangon',
|
||||||
|
cargoDesc: "Computers",
|
||||||
arrivedDate: DateTime(2020, 6, 1),
|
arrivedDate: DateTime(2020, 6, 1),
|
||||||
),
|
market: "Amazon",
|
||||||
|
id: "PKG2039",
|
||||||
|
trackingID: "23-234s-asdfl"),
|
||||||
Package(
|
Package(
|
||||||
shipmentNumber: "A202",
|
shipmentNumber: "A202",
|
||||||
receiverNumber: "3",
|
receiverNumber: "3",
|
||||||
|
receiverName: "Ko Myo Min",
|
||||||
boxNumber: "2",
|
boxNumber: "2",
|
||||||
rate: 7,
|
rate: 7,
|
||||||
packageType: "General",
|
packageType: "General",
|
||||||
weight: 20,
|
weight: 20,
|
||||||
status: "Received",
|
status: "Received",
|
||||||
|
cargoDesc: "Clothes",
|
||||||
arrivedDate: DateTime(2020, 6, 1),
|
arrivedDate: DateTime(2020, 6, 1),
|
||||||
|
market: "Macy",
|
||||||
|
trackingID: "asd-sdf-23498",
|
||||||
|
id: "PKG2040",
|
||||||
receiverAddress: '1 Bo Yar Nyunt St.\nDagon Tsp, Yangon'),
|
receiverAddress: '1 Bo Yar Nyunt St.\nDagon Tsp, Yangon'),
|
||||||
Package(
|
Package(
|
||||||
shipmentNumber: "A202",
|
shipmentNumber: "A202",
|
||||||
receiverNumber: "3",
|
receiverNumber: "3",
|
||||||
|
receiverName: "Ko Myo Min",
|
||||||
boxNumber: "3",
|
boxNumber: "3",
|
||||||
rate: 7,
|
rate: 7,
|
||||||
packageType: "General",
|
packageType: "General",
|
||||||
weight: 15,
|
weight: 15,
|
||||||
status: "Received",
|
cargoDesc: "Shoes",
|
||||||
|
status: "Processed",
|
||||||
|
market: "Macy",
|
||||||
|
trackingID: "8923-234-sd",
|
||||||
|
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'),
|
||||||
Package(
|
Package(
|
||||||
shipmentNumber: "A202",
|
shipmentNumber: "A202",
|
||||||
receiverNumber: "2",
|
receiverNumber: "2",
|
||||||
|
receiverName: "Ma Aye",
|
||||||
boxNumber: "1",
|
boxNumber: "1",
|
||||||
rate: 8,
|
rate: 8,
|
||||||
packageType: "Medicine",
|
packageType: "Medicine",
|
||||||
weight: 15,
|
weight: 15,
|
||||||
status: "Processing",
|
status: "Processed",
|
||||||
|
market: "Macy",
|
||||||
|
trackingID: "lsdf-sd09sdf",
|
||||||
|
cargoDesc: "Dietary supplement",
|
||||||
|
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'),
|
||||||
Package(
|
Package(
|
||||||
shipmentNumber: "A202",
|
shipmentNumber: "A202",
|
||||||
receiverNumber: "2",
|
receiverNumber: "2",
|
||||||
|
receiverName: "Ma Aye",
|
||||||
boxNumber: "2",
|
boxNumber: "2",
|
||||||
rate: 7,
|
rate: 7,
|
||||||
packageType: "General",
|
packageType: "General",
|
||||||
|
cargoDesc: "Handbags",
|
||||||
weight: 55,
|
weight: 55,
|
||||||
status: "Ready to ship",
|
market: "Macy",
|
||||||
|
trackingID: "234-sdflsdf-213",
|
||||||
|
status: "Processed",
|
||||||
|
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'),
|
||||||
Package(
|
Package(
|
||||||
shipmentNumber: "A201",
|
shipmentNumber: "A201",
|
||||||
receiverNumber: "1",
|
receiverNumber: "1",
|
||||||
|
receiverName: "Ko Wai",
|
||||||
boxNumber: "1",
|
boxNumber: "1",
|
||||||
rate: 9,
|
rate: 9,
|
||||||
packageType: "Dangerous",
|
packageType: "Dangerous",
|
||||||
|
cargoDesc: "Phones and Scooters",
|
||||||
weight: 25,
|
weight: 25,
|
||||||
status: "Delivered",
|
status: "Received",
|
||||||
|
market: "Amazon",
|
||||||
|
trackingID: "sdf-asdf-23489",
|
||||||
|
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'),
|
||||||
Package(
|
Package(
|
||||||
shipmentNumber: "A201",
|
shipmentNumber: "A201",
|
||||||
receiverNumber: "1",
|
receiverNumber: "1",
|
||||||
|
receiverName: "Ko Wai",
|
||||||
boxNumber: "2",
|
boxNumber: "2",
|
||||||
rate: 7,
|
rate: 7,
|
||||||
packageType: "General",
|
packageType: "General",
|
||||||
|
cargoDesc: "Construction tools",
|
||||||
weight: 5,
|
weight: 5,
|
||||||
status: "Delivered",
|
status: "Processed",
|
||||||
|
market: "Amazon",
|
||||||
|
id: "PKG2045",
|
||||||
|
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'),
|
||||||
];
|
];
|
||||||
|
|
||||||
List<Package> get completed {
|
List<Package> get completed {
|
||||||
return packages.where((e) => e.status == "Delivered").toList()
|
return packages.where((e) => e.status == "Processed").toList()
|
||||||
..sort((e1, e2) {
|
..sort((e1, e2) {
|
||||||
return e2.packageNumber.compareTo(e1.packageNumber);
|
return e2.packageNumber.compareTo(e1.packageNumber);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
List<Package> get upcoming {
|
List<Package> get upcoming {
|
||||||
return packages
|
return packages.where((e) => e.status == "Received").toList()
|
||||||
.where((e) =>
|
|
||||||
e.status == "Processing" ||
|
|
||||||
e.status == "Received" ||
|
|
||||||
e.status == "Ready to ship")
|
|
||||||
.toList()
|
|
||||||
..sort((e1, e2) {
|
..sort((e1, e2) {
|
||||||
return e2.packageNumber.compareTo(e1.packageNumber);
|
return e2.packageNumber.compareTo(e1.packageNumber);
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -83,7 +83,7 @@ class _CustomerListState extends State<CustomerList> {
|
|||||||
padding: new EdgeInsets.symmetric(
|
padding: new EdgeInsets.symmetric(
|
||||||
horizontal: 32.0 - dotSize / 2),
|
horizontal: 32.0 - dotSize / 2),
|
||||||
child: Icon(
|
child: Icon(
|
||||||
Feather.users,
|
Feather.user,
|
||||||
color: primaryColor,
|
color: primaryColor,
|
||||||
size: 40,
|
size: 40,
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
import 'package:country_code_picker/country_code.dart';
|
import 'package:country_code_picker/country_code.dart';
|
||||||
import 'package:fcs/model/main_model.dart';
|
import 'package:fcs/model/main_model.dart';
|
||||||
import 'package:fcs/pages/shipment_list.dart';
|
import 'package:fcs/pages/shipment_list.dart';
|
||||||
|
import 'package:fcs/pages_fcs/box_list.dart';
|
||||||
import 'package:fcs/pages_fcs/package_list.dart';
|
import 'package:fcs/pages_fcs/package_list.dart';
|
||||||
import 'package:fcs/widget/bottom_up_page_route.dart';
|
import 'package:fcs/widget/bottom_up_page_route.dart';
|
||||||
import 'package:fcs/widget/localization/transalation.dart';
|
import 'package:fcs/widget/localization/transalation.dart';
|
||||||
@@ -103,13 +104,21 @@ class _HomePageState extends State<HomePage> {
|
|||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
login = Provider.of<MainModel>(context).isLogin();
|
login = Provider.of<MainModel>(context).isLogin();
|
||||||
|
var owner = Provider.of<MainModel>(context).isOwner();
|
||||||
|
var customer = Provider.of<MainModel>(context).isCustomer();
|
||||||
|
|
||||||
final packagesBtn = _buildBtn2("package.name",
|
final packagesBtn = _buildBtn2("package.name",
|
||||||
icon: Octicons.package,
|
icon: Octicons.package,
|
||||||
btnCallback: () =>
|
btnCallback: () =>
|
||||||
Navigator.of(context).push(BottomUpPageRoute(PackageList())));
|
Navigator.of(context).push(BottomUpPageRoute(PackageList())));
|
||||||
|
|
||||||
|
final boxesBtn = _buildBtn2("boxes.name",
|
||||||
|
icon: MaterialCommunityIcons.package,
|
||||||
|
btnCallback: () =>
|
||||||
|
Navigator.of(context).push(BottomUpPageRoute(BoxList())));
|
||||||
|
|
||||||
final pickUpBtn = _buildBtn2("pickup",
|
final pickUpBtn = _buildBtn2("pickup",
|
||||||
icon: MaterialCommunityIcons.directions,
|
icon: SimpleLineIcons.direction,
|
||||||
btnCallback: () =>
|
btnCallback: () =>
|
||||||
Navigator.of(context).push(BottomUpPageRoute(PickUpList())));
|
Navigator.of(context).push(BottomUpPageRoute(PickUpList())));
|
||||||
|
|
||||||
@@ -118,7 +127,7 @@ class _HomePageState extends State<HomePage> {
|
|||||||
btnCallback: () =>
|
btnCallback: () =>
|
||||||
Navigator.of(context).push(BottomUpPageRoute(ShipmentRates())));
|
Navigator.of(context).push(BottomUpPageRoute(ShipmentRates())));
|
||||||
|
|
||||||
final fcsProfileBtn = _buildBtn2("profile.title",
|
final fcsProfileBtn = _buildBtn2("fcs.btn",
|
||||||
// imgIcon: Image.asset("assets/logo_btn.png", height: 25,color:Colors.white),
|
// imgIcon: Image.asset("assets/logo_btn.png", height: 25,color:Colors.white),
|
||||||
icon: MaterialCommunityIcons.home_city,
|
icon: MaterialCommunityIcons.home_city,
|
||||||
btnCallback: () =>
|
btnCallback: () =>
|
||||||
@@ -171,16 +180,17 @@ class _HomePageState extends State<HomePage> {
|
|||||||
Navigator.of(context).push(BottomUpPageRoute(Term())));
|
Navigator.of(context).push(BottomUpPageRoute(Term())));
|
||||||
|
|
||||||
List<Widget> widgets = [];
|
List<Widget> widgets = [];
|
||||||
widgets.add(buyingBtn);
|
customer ? widgets.add(buyingBtn) : "";
|
||||||
widgets.add(pickUpBtn);
|
customer || owner ? widgets.add(pickUpBtn) : "";
|
||||||
widgets.add(shipmentBtn);
|
owner ? widgets.add(shipmentBtn) : "";
|
||||||
widgets.add(notiBtn);
|
customer || owner ? widgets.add(notiBtn) : "";
|
||||||
widgets.add(staffBtn);
|
owner ? widgets.add(staffBtn) : "";
|
||||||
widgets.add(fcsProfileBtn);
|
owner ? widgets.add(fcsProfileBtn) : "";
|
||||||
widgets.add(shipmentCostBtn);
|
widgets.add(shipmentCostBtn);
|
||||||
widgets.add(packagesBtn);
|
customer || owner ? widgets.add(packagesBtn) : "";
|
||||||
widgets.add(customersBtn);
|
customer || owner ? widgets.add(boxesBtn) : "";
|
||||||
widgets.add(invoicesBtn);
|
owner ? widgets.add(customersBtn) : "";
|
||||||
|
customer || owner ? widgets.add(invoicesBtn) : "";
|
||||||
widgets.add(termBtn);
|
widgets.add(termBtn);
|
||||||
|
|
||||||
return OfflineRedirect(
|
return OfflineRedirect(
|
||||||
@@ -306,8 +316,8 @@ class _HomePageState extends State<HomePage> {
|
|||||||
Row(
|
Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
_buildSmallButton(
|
// _buildSmallButton(
|
||||||
"Policies", FontAwesomeIcons.fileContract),
|
// "Policies", FontAwesomeIcons.fileContract),
|
||||||
_buildSmallButton("Support", SimpleLineIcons.support),
|
_buildSmallButton("Support", SimpleLineIcons.support),
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -65,7 +65,7 @@ class _InvoiceListState extends State<InvoiceList> {
|
|||||||
bottom: TabBar(
|
bottom: TabBar(
|
||||||
unselectedLabelColor: Colors.grey,
|
unselectedLabelColor: Colors.grey,
|
||||||
tabs: [
|
tabs: [
|
||||||
Tab(text: "Packages"),
|
Tab(text: "Boxes"),
|
||||||
Tab(text: "Pending"),
|
Tab(text: "Pending"),
|
||||||
Tab(text: "Paid"),
|
Tab(text: "Paid"),
|
||||||
],
|
],
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
import 'package:fcs/model/main_model.dart';
|
||||||
import 'package:fcs/pages/invoice/package_addition.dart';
|
import 'package:fcs/pages/invoice/package_addition.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';
|
||||||
@@ -10,6 +11,7 @@ import 'package:fcs/widget/multi_img_file.dart';
|
|||||||
import 'package:fcs/widget/my_data_table.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: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:provider/provider.dart';
|
||||||
@@ -48,7 +50,7 @@ class _InvoiceEditorState extends State<InvoiceEditor> {
|
|||||||
_dateController.text = dateFormatter.format(_invoice.invoiceDate);
|
_dateController.text = dateFormatter.format(_invoice.invoiceDate);
|
||||||
_nameController.text = _invoice.customerName;
|
_nameController.text = _invoice.customerName;
|
||||||
_phoneController.text = _invoice.customerPhoneNumber;
|
_phoneController.text = _invoice.customerPhoneNumber;
|
||||||
_amountController.text = _invoice.amount.toString();
|
_amountController.text = _invoice.getAmount.toString();
|
||||||
_statusController.text = _invoice.status.toString();
|
_statusController.text = _invoice.status.toString();
|
||||||
_packages = _invoice.packages;
|
_packages = _invoice.packages;
|
||||||
} else {
|
} else {
|
||||||
@@ -85,6 +87,8 @@ class _InvoiceEditorState extends State<InvoiceEditor> {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
|
var mainModel = Provider.of<MainModel>(context);
|
||||||
|
|
||||||
return LocalProgress(
|
return LocalProgress(
|
||||||
inAsyncCall: _isLoading,
|
inAsyncCall: _isLoading,
|
||||||
child: Scaffold(
|
child: Scaffold(
|
||||||
@@ -123,8 +127,8 @@ class _InvoiceEditorState extends State<InvoiceEditor> {
|
|||||||
enabledBorder: InputBorder.none,
|
enabledBorder: InputBorder.none,
|
||||||
focusedBorder: InputBorder.none,
|
focusedBorder: InputBorder.none,
|
||||||
icon: Icon(
|
icon: Icon(
|
||||||
Icons.pages,
|
FontAwesomeIcons.fileInvoice,
|
||||||
color: Colors.grey,
|
color: primaryColor,
|
||||||
),
|
),
|
||||||
)),
|
)),
|
||||||
),
|
),
|
||||||
@@ -132,7 +136,7 @@ class _InvoiceEditorState extends State<InvoiceEditor> {
|
|||||||
? Container(
|
? Container(
|
||||||
padding: EdgeInsets.only(top: 5),
|
padding: EdgeInsets.only(top: 5),
|
||||||
child: TextFormField(
|
child: TextFormField(
|
||||||
initialValue: "U Nyi",
|
initialValue: "Ko Myo Min",
|
||||||
cursorColor: primaryColor,
|
cursorColor: primaryColor,
|
||||||
decoration: InputDecoration(
|
decoration: InputDecoration(
|
||||||
fillColor: Colors.white,
|
fillColor: Colors.white,
|
||||||
@@ -144,8 +148,8 @@ class _InvoiceEditorState extends State<InvoiceEditor> {
|
|||||||
borderSide: BorderSide(
|
borderSide: BorderSide(
|
||||||
color: Colors.grey, width: 1.0)),
|
color: Colors.grey, width: 1.0)),
|
||||||
icon: Icon(
|
icon: Icon(
|
||||||
Icons.account_box,
|
FontAwesomeIcons.fileInvoice,
|
||||||
color: Colors.grey,
|
color: primaryColor,
|
||||||
),
|
),
|
||||||
suffixIcon: IconButton(
|
suffixIcon: IconButton(
|
||||||
icon: Icon(
|
icon: Icon(
|
||||||
@@ -167,34 +171,34 @@ class _InvoiceEditorState extends State<InvoiceEditor> {
|
|||||||
fillColor: Colors.white,
|
fillColor: Colors.white,
|
||||||
labelText: 'Customer Name',
|
labelText: 'Customer Name',
|
||||||
labelStyle:
|
labelStyle:
|
||||||
TextStyle(fontSize: 16, color: Colors.grey),
|
TextStyle(fontSize: 16, color: primaryColor),
|
||||||
filled: true,
|
filled: true,
|
||||||
enabledBorder: InputBorder.none,
|
enabledBorder: InputBorder.none,
|
||||||
focusedBorder: InputBorder.none,
|
focusedBorder: InputBorder.none,
|
||||||
icon: Icon(
|
icon: Icon(
|
||||||
Icons.account_box,
|
Feather.user,
|
||||||
color: Colors.grey,
|
color: primaryColor,
|
||||||
),
|
),
|
||||||
)),
|
)),
|
||||||
),
|
),
|
||||||
widget.invoice == null
|
// widget.invoice == null
|
||||||
? Container()
|
// ? Container()
|
||||||
: TextFormField(
|
// : TextFormField(
|
||||||
controller: _phoneController,
|
// controller: _phoneController,
|
||||||
readOnly: true,
|
// readOnly: true,
|
||||||
decoration: InputDecoration(
|
// decoration: InputDecoration(
|
||||||
fillColor: Colors.white,
|
// fillColor: Colors.white,
|
||||||
labelText: 'Customer Phone Number',
|
// labelText: 'Customer Phone Number',
|
||||||
labelStyle:
|
// labelStyle:
|
||||||
TextStyle(fontSize: 16, color: Colors.grey),
|
// TextStyle(fontSize: 16, color: Colors.grey),
|
||||||
filled: true,
|
// filled: true,
|
||||||
enabledBorder: InputBorder.none,
|
// enabledBorder: InputBorder.none,
|
||||||
focusedBorder: InputBorder.none,
|
// focusedBorder: InputBorder.none,
|
||||||
icon: Icon(
|
// icon: Icon(
|
||||||
Icons.phone,
|
// Icons.phone,
|
||||||
color: Colors.grey,
|
// color: Colors.grey,
|
||||||
),
|
// ),
|
||||||
)),
|
// )),
|
||||||
Container(
|
Container(
|
||||||
padding: EdgeInsets.only(top: 0),
|
padding: EdgeInsets.only(top: 0),
|
||||||
child: fcsInput('Amount', FontAwesomeIcons.moneyBill,
|
child: fcsInput('Amount', FontAwesomeIcons.moneyBill,
|
||||||
@@ -215,12 +219,7 @@ class _InvoiceEditorState extends State<InvoiceEditor> {
|
|||||||
fillColor: Colors.white,
|
fillColor: Colors.white,
|
||||||
labelText: 'Status',
|
labelText: 'Status',
|
||||||
filled: true,
|
filled: true,
|
||||||
icon: Image.asset(
|
icon: Icon(Icons.av_timer,color: primaryColor,),
|
||||||
'assets/status.png',
|
|
||||||
width: 24,
|
|
||||||
height: 24,
|
|
||||||
color: Colors.grey[700],
|
|
||||||
),
|
|
||||||
)),
|
)),
|
||||||
),
|
),
|
||||||
SizedBox(
|
SizedBox(
|
||||||
@@ -250,7 +249,7 @@ class _InvoiceEditorState extends State<InvoiceEditor> {
|
|||||||
],
|
],
|
||||||
),
|
),
|
||||||
ExpansionTile(
|
ExpansionTile(
|
||||||
title: Text('Package Informations'),
|
title: Text('Box Information'),
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
Container(
|
Container(
|
||||||
child: SingleChildScrollView(
|
child: SingleChildScrollView(
|
||||||
@@ -292,14 +291,14 @@ class _InvoiceEditorState extends State<InvoiceEditor> {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Container(
|
mainModel.isOwner()?Container(
|
||||||
padding: EdgeInsets.only(top: 20),
|
padding: EdgeInsets.only(top: 20),
|
||||||
child: Align(
|
child: Align(
|
||||||
alignment: Alignment.bottomRight,
|
alignment: Alignment.bottomRight,
|
||||||
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_package")),
|
.text("invoice.add_box")),
|
||||||
backgroundColor: primaryColor,
|
backgroundColor: primaryColor,
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
Navigator.of(context)
|
Navigator.of(context)
|
||||||
@@ -307,7 +306,7 @@ class _InvoiceEditorState extends State<InvoiceEditor> {
|
|||||||
},
|
},
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
):Container(),
|
||||||
SizedBox(height: 25),
|
SizedBox(height: 25),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
@@ -328,7 +327,7 @@ class _InvoiceEditorState extends State<InvoiceEditor> {
|
|||||||
},
|
},
|
||||||
),
|
),
|
||||||
)))
|
)))
|
||||||
: Container(
|
:mainModel.isCustomer()?Container():Container(
|
||||||
child: Column(
|
child: Column(
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
Align(
|
Align(
|
||||||
@@ -355,7 +354,7 @@ class _InvoiceEditorState extends State<InvoiceEditor> {
|
|||||||
child: Container(
|
child: Container(
|
||||||
width: 250,
|
width: 250,
|
||||||
child: FlatButton(
|
child: FlatButton(
|
||||||
child: Text('Confirm Payment'),
|
child: Text('Attach Payment Receipt'),
|
||||||
color: primaryColor,
|
color: primaryColor,
|
||||||
textColor: Colors.white,
|
textColor: Colors.white,
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
|
|||||||
@@ -90,7 +90,7 @@ class MessageDetail extends StatelessWidget {
|
|||||||
message: e.message,
|
message: e.message,
|
||||||
time: dateFormat.format(e.date),
|
time: dateFormat.format(e.date),
|
||||||
delivered: true,
|
delivered: true,
|
||||||
isMe: e.isMe != null ? e.isMe : true))
|
isMe: !(e.isMe != null ? e.isMe : true)))
|
||||||
.toList();
|
.toList();
|
||||||
|
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
|
|||||||
@@ -45,11 +45,13 @@ class _PickUpEditorState extends State<PickUpEditor> {
|
|||||||
PickUp _pickUp;
|
PickUp _pickUp;
|
||||||
bool _isLoading = false;
|
bool _isLoading = false;
|
||||||
var now = new DateTime.now();
|
var now = new DateTime.now();
|
||||||
|
bool isNew;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void initState() {
|
void initState() {
|
||||||
super.initState();
|
super.initState();
|
||||||
if (widget.pickUp != null) {
|
if (widget.pickUp != null) {
|
||||||
|
isNew = false;
|
||||||
_pickUp = widget.pickUp;
|
_pickUp = widget.pickUp;
|
||||||
_addressEditingController.text = _pickUp.address;
|
_addressEditingController.text = _pickUp.address;
|
||||||
_fromTimeEditingController.text = _pickUp.fromTime;
|
_fromTimeEditingController.text = _pickUp.fromTime;
|
||||||
@@ -63,6 +65,8 @@ class _PickUpEditorState extends State<PickUpEditor> {
|
|||||||
_recipientPhoneEditingController.text = mainModel.recipient.phoneNumber;
|
_recipientPhoneEditingController.text = mainModel.recipient.phoneNumber;
|
||||||
_recipientAddressEditingController.text =
|
_recipientAddressEditingController.text =
|
||||||
mainModel.recipient.shippingAddress;
|
mainModel.recipient.shippingAddress;
|
||||||
|
} else {
|
||||||
|
isNew = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -190,7 +194,7 @@ class _PickUpEditorState extends State<PickUpEditor> {
|
|||||||
EdgeInsets.symmetric(vertical: 10.0, horizontal: 0.0),
|
EdgeInsets.symmetric(vertical: 10.0, horizontal: 0.0),
|
||||||
icon: Icon(
|
icon: Icon(
|
||||||
Icons.date_range,
|
Icons.date_range,
|
||||||
color: Colors.grey,
|
color: primaryColor,
|
||||||
)),
|
)),
|
||||||
validator: (value) {
|
validator: (value) {
|
||||||
if (value.isEmpty) {
|
if (value.isEmpty) {
|
||||||
@@ -224,7 +228,9 @@ class _PickUpEditorState extends State<PickUpEditor> {
|
|||||||
child: ListView(children: <Widget>[
|
child: ListView(children: <Widget>[
|
||||||
Center(child: nameWidget(mainModel.customer.name)),
|
Center(child: nameWidget(mainModel.customer.name)),
|
||||||
Center(child: nameWidget(mainModel.customer.phoneNumber)),
|
Center(child: nameWidget(mainModel.customer.phoneNumber)),
|
||||||
Center(
|
isNew
|
||||||
|
? Container()
|
||||||
|
: Center(
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding: const EdgeInsets.only(left: 10.0, top: 8),
|
padding: const EdgeInsets.only(left: 10.0, top: 8),
|
||||||
child: Text(
|
child: Text(
|
||||||
@@ -264,7 +270,7 @@ class _PickUpEditorState extends State<PickUpEditor> {
|
|||||||
],
|
],
|
||||||
),
|
),
|
||||||
ExpansionTile(
|
ExpansionTile(
|
||||||
title: Text('Package Informations'),
|
title: Text('Package Information'),
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsets.only(left: 20.0),
|
padding: const EdgeInsets.only(left: 20.0),
|
||||||
@@ -296,7 +302,7 @@ class _PickUpEditorState extends State<PickUpEditor> {
|
|||||||
],
|
],
|
||||||
),
|
),
|
||||||
ExpansionTile(
|
ExpansionTile(
|
||||||
title: Text('Recipient Informations'),
|
title: Text('Recipient Information'),
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsets.only(left: 20.0),
|
padding: const EdgeInsets.only(left: 20.0),
|
||||||
@@ -340,6 +346,7 @@ class _PickUpEditorState extends State<PickUpEditor> {
|
|||||||
_recipientAddressEditingController)),
|
_recipientAddressEditingController)),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
mainModel.isCustomer()?Container():
|
||||||
ExpansionTile(
|
ExpansionTile(
|
||||||
title: Text('For FCS'),
|
title: Text('For FCS'),
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
|
|||||||
@@ -58,7 +58,7 @@ class _PickupListRowState extends State<PickupListRow> {
|
|||||||
Padding(
|
Padding(
|
||||||
padding: EdgeInsets.all(5.0),
|
padding: EdgeInsets.all(5.0),
|
||||||
child: Icon(
|
child: Icon(
|
||||||
MaterialCommunityIcons.directions,
|
SimpleLineIcons.direction,
|
||||||
color: primaryColor,
|
color: primaryColor,
|
||||||
)),
|
)),
|
||||||
new Expanded(
|
new Expanded(
|
||||||
|
|||||||
@@ -254,27 +254,6 @@ class _ProfileState extends State<Profile> {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
));
|
));
|
||||||
Future<String> getVersionNumber() async {
|
|
||||||
PackageInfo packageInfo = await PackageInfo.fromPlatform();
|
|
||||||
String version = packageInfo.version + "+" + packageInfo.buildNumber;
|
|
||||||
|
|
||||||
return version;
|
|
||||||
}
|
|
||||||
|
|
||||||
final versionbox = Container(
|
|
||||||
padding: EdgeInsets.only(top: 15),
|
|
||||||
child: Container(
|
|
||||||
child: Center(
|
|
||||||
child: FutureBuilder(
|
|
||||||
future: getVersionNumber(),
|
|
||||||
builder: (BuildContext context, AsyncSnapshot<String> snapshot) =>
|
|
||||||
Text(
|
|
||||||
snapshot.hasData ? "v${snapshot.data}" : "Loading ...",
|
|
||||||
style: TextStyle(fontSize: 16.0, fontStyle: FontStyle.normal),
|
|
||||||
),
|
|
||||||
)),
|
|
||||||
));
|
|
||||||
|
|
||||||
return LocalProgress(
|
return LocalProgress(
|
||||||
inAsyncCall: _isLoading,
|
inAsyncCall: _isLoading,
|
||||||
child: Scaffold(
|
child: Scaffold(
|
||||||
|
|||||||
@@ -266,7 +266,7 @@ class _ShipmentEditorState extends State<ShipmentEditor> {
|
|||||||
child: ListView(children: <Widget>[
|
child: ListView(children: <Widget>[
|
||||||
// _showCustomerData(mainModel.customer),
|
// _showCustomerData(mainModel.customer),
|
||||||
widget.shipment == null
|
widget.shipment == null
|
||||||
? fcsInput('Shipment Number', Icons.text_rotation_none,
|
? fcsInput('Shipment Number', Ionicons.ios_airplane,
|
||||||
controller: _shipmentNumberController)
|
controller: _shipmentNumberController)
|
||||||
: Container(
|
: Container(
|
||||||
child: TextFormField(
|
child: TextFormField(
|
||||||
@@ -281,8 +281,8 @@ class _ShipmentEditorState extends State<ShipmentEditor> {
|
|||||||
enabledBorder: InputBorder.none,
|
enabledBorder: InputBorder.none,
|
||||||
focusedBorder: InputBorder.none,
|
focusedBorder: InputBorder.none,
|
||||||
icon: Icon(
|
icon: Icon(
|
||||||
Icons.text_rotation_none,
|
Ionicons.ios_airplane,
|
||||||
color: Colors.grey,
|
color: primaryColor,
|
||||||
),
|
),
|
||||||
)),
|
)),
|
||||||
),
|
),
|
||||||
@@ -293,26 +293,6 @@ class _ShipmentEditorState extends State<ShipmentEditor> {
|
|||||||
controller: _cutoffDateController),
|
controller: _cutoffDateController),
|
||||||
)
|
)
|
||||||
: Container(),
|
: Container(),
|
||||||
widget.shipment == null
|
|
||||||
? Container(
|
|
||||||
padding: EdgeInsets.only(top: 5),
|
|
||||||
child: DropdownButtonFormField(
|
|
||||||
decoration: InputDecoration(
|
|
||||||
fillColor: Colors.white,
|
|
||||||
labelText: 'Shipment Type',
|
|
||||||
icon: Icon(Icons.pages)),
|
|
||||||
items: shipmentModel.shipmentType
|
|
||||||
.map((e) =>
|
|
||||||
DropdownMenuItem(child: Text(e), value: e))
|
|
||||||
.toList(),
|
|
||||||
onChanged: (selected) => {
|
|
||||||
setState(() {
|
|
||||||
_currentShipment = selected;
|
|
||||||
})
|
|
||||||
},
|
|
||||||
),
|
|
||||||
)
|
|
||||||
: Container(),
|
|
||||||
Container(
|
Container(
|
||||||
padding:
|
padding:
|
||||||
EdgeInsets.only(top: widget.shipment == null ? 5 : 0),
|
EdgeInsets.only(top: widget.shipment == null ? 5 : 0),
|
||||||
@@ -324,6 +304,28 @@ class _ShipmentEditorState extends State<ShipmentEditor> {
|
|||||||
child: fcsInput('Departure Date', Icons.date_range,
|
child: fcsInput('Departure Date', Icons.date_range,
|
||||||
controller: _departureDateControler),
|
controller: _departureDateControler),
|
||||||
),
|
),
|
||||||
|
widget.shipment == null
|
||||||
|
? Container(
|
||||||
|
padding: EdgeInsets.only(top: 5),
|
||||||
|
child: DropdownButtonFormField(
|
||||||
|
decoration: InputDecoration(
|
||||||
|
fillColor: Colors.white,
|
||||||
|
labelText: 'Shipment Type',
|
||||||
|
icon: Icon(Ionicons.ios_airplane,
|
||||||
|
color: primaryColor)),
|
||||||
|
items: shipmentModel.shipmentType
|
||||||
|
.map((e) =>
|
||||||
|
DropdownMenuItem(child: Text(e), value: e))
|
||||||
|
.toList(),
|
||||||
|
onChanged: (selected) => {
|
||||||
|
setState(() {
|
||||||
|
_currentShipment = selected;
|
||||||
|
})
|
||||||
|
},
|
||||||
|
),
|
||||||
|
)
|
||||||
|
: Container(),
|
||||||
|
|
||||||
widget.shipment == null
|
widget.shipment == null
|
||||||
? Container(
|
? Container(
|
||||||
padding: EdgeInsets.only(top: 5),
|
padding: EdgeInsets.only(top: 5),
|
||||||
@@ -358,18 +360,13 @@ class _ShipmentEditorState extends State<ShipmentEditor> {
|
|||||||
fillColor: Colors.white,
|
fillColor: Colors.white,
|
||||||
labelText: 'Status',
|
labelText: 'Status',
|
||||||
filled: true,
|
filled: true,
|
||||||
labelStyle:
|
labelStyle: TextStyle(
|
||||||
TextStyle(fontSize: 16, color: Colors.grey),
|
fontSize: 16, color: Colors.grey),
|
||||||
focusedBorder: UnderlineInputBorder(
|
focusedBorder: UnderlineInputBorder(
|
||||||
borderSide: BorderSide(
|
borderSide: BorderSide(
|
||||||
color: Colors.grey, width: 1.0)),
|
color: Colors.grey, width: 1.0)),
|
||||||
icon: Image.asset(
|
icon: Icon(Icons.av_timer,
|
||||||
'assets/status.png',
|
color: primaryColor))),
|
||||||
width: 24,
|
|
||||||
height: 24,
|
|
||||||
color: Colors.grey[700],
|
|
||||||
),
|
|
||||||
)),
|
|
||||||
),
|
),
|
||||||
widget.shipment == null
|
widget.shipment == null
|
||||||
? Container()
|
? Container()
|
||||||
|
|||||||
@@ -109,7 +109,7 @@ class _ShipmentRatesState extends State<ShipmentRates> {
|
|||||||
Navigator.of(context)
|
Navigator.of(context)
|
||||||
.push(MaterialPageRoute(builder: (_) => Term()));
|
.push(MaterialPageRoute(builder: (_) => Term()));
|
||||||
}),
|
}),
|
||||||
fcsButton(context, "Calculate", callack: () {
|
fcsButton(context, "Estimate shipping cost", callack: () {
|
||||||
Navigator.of(context)
|
Navigator.of(context)
|
||||||
.push(BottomUpPageRoute(ShipmentRatesCal()));
|
.push(BottomUpPageRoute(ShipmentRatesCal()));
|
||||||
}),
|
}),
|
||||||
|
|||||||
@@ -417,7 +417,7 @@ Widget fcsInput(String label, IconData iconData,
|
|||||||
filled: true,
|
filled: true,
|
||||||
icon: Icon(
|
icon: Icon(
|
||||||
iconData,
|
iconData,
|
||||||
color: Colors.grey,
|
color: primaryColor,
|
||||||
),
|
),
|
||||||
focusedBorder: UnderlineInputBorder(
|
focusedBorder: UnderlineInputBorder(
|
||||||
borderSide: BorderSide(color: Colors.grey, width: 1.0)),
|
borderSide: BorderSide(color: Colors.grey, width: 1.0)),
|
||||||
|
|||||||
407
lib/pages_fcs/box_editor.dart
Normal file
407
lib/pages_fcs/box_editor.dart
Normal file
@@ -0,0 +1,407 @@
|
|||||||
|
import 'package:fcs/model/main_model.dart';
|
||||||
|
import 'package:fcs/model_fcs/package_model.dart';
|
||||||
|
import 'package:fcs/pages/invoice/package_addition.dart';
|
||||||
|
import 'package:fcs/pages/util.dart';
|
||||||
|
import 'package:fcs/vo/box.dart';
|
||||||
|
import 'package:fcs/vo/package.dart';
|
||||||
|
import 'package:fcs/widget/bottom_up_page_route.dart';
|
||||||
|
import 'package:fcs/widget/local_text.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: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';
|
||||||
|
|
||||||
|
import '../theme/theme.dart';
|
||||||
|
|
||||||
|
class BoxEditor extends StatefulWidget {
|
||||||
|
final Box box;
|
||||||
|
BoxEditor({this.box});
|
||||||
|
|
||||||
|
@override
|
||||||
|
_BoxEditorState createState() => _BoxEditorState();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _BoxEditorState extends State<BoxEditor> {
|
||||||
|
TextEditingController _addressEditingController = new TextEditingController();
|
||||||
|
TextEditingController _fromTimeEditingController =
|
||||||
|
new TextEditingController();
|
||||||
|
TextEditingController _toTimeEditingController = new TextEditingController();
|
||||||
|
TextEditingController _noOfPackageEditingController =
|
||||||
|
new TextEditingController();
|
||||||
|
TextEditingController _weightEditingController = new TextEditingController();
|
||||||
|
|
||||||
|
Box _box;
|
||||||
|
bool _isLoading = false;
|
||||||
|
List<String> _images = [
|
||||||
|
"assets/photos/1.jpg",
|
||||||
|
"assets/photos/2.jpg",
|
||||||
|
"assets/photos/3.jpg"
|
||||||
|
];
|
||||||
|
bool isNew;
|
||||||
|
|
||||||
|
@override
|
||||||
|
void initState() {
|
||||||
|
super.initState();
|
||||||
|
if (widget.box != null) {
|
||||||
|
_box = widget.box;
|
||||||
|
isNew = false;
|
||||||
|
// _addressEditingController.text = _pickUp.address;
|
||||||
|
// _fromTimeEditingController.text = _pickUp.fromTime;
|
||||||
|
// _toTimeEditingController.text = _pickUp.toTime;
|
||||||
|
// _noOfPackageEditingController.text = _pickUp.numberOfPackage.toString();
|
||||||
|
// _weightEditingController.text = _pickUp.weight.toString();
|
||||||
|
} else {
|
||||||
|
List<Package> packages = [
|
||||||
|
PackageModel.packages[0],
|
||||||
|
PackageModel.packages[1],
|
||||||
|
PackageModel.packages[2]
|
||||||
|
];
|
||||||
|
|
||||||
|
isNew = true;
|
||||||
|
_box = Box(rate: 0, weight: 0, packages: packages);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
void dispose() {
|
||||||
|
super.dispose();
|
||||||
|
}
|
||||||
|
|
||||||
|
final DateFormat dateFormat = DateFormat("d MMM yyyy");
|
||||||
|
List<TimelineModel> _models() {
|
||||||
|
// return [];
|
||||||
|
return _box.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
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
var mainModel = Provider.of<MainModel>(context);
|
||||||
|
|
||||||
|
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("box.edit.title")),
|
||||||
|
),
|
||||||
|
body: Card(
|
||||||
|
child: Column(
|
||||||
|
children: <Widget>[
|
||||||
|
widget.box == null
|
||||||
|
? Center(
|
||||||
|
child: Container(
|
||||||
|
padding: EdgeInsets.all(8), child: Text("New Box")))
|
||||||
|
: Center(child: nameWidget(_box.packageNumber)),
|
||||||
|
Expanded(
|
||||||
|
child: ListView(
|
||||||
|
children: [
|
||||||
|
ExpansionTile(
|
||||||
|
title: Text(
|
||||||
|
'Shipment Information',
|
||||||
|
style: TextStyle(
|
||||||
|
color: primaryColor, fontWeight: FontWeight.bold),
|
||||||
|
),
|
||||||
|
children: [
|
||||||
|
Padding(
|
||||||
|
padding: const EdgeInsets.only(left: 20.0, right: 20),
|
||||||
|
child: DropdownButtonFormField(
|
||||||
|
value: _box.shipmentNumber,
|
||||||
|
decoration: InputDecoration(
|
||||||
|
fillColor: Colors.white,
|
||||||
|
labelText: 'Shipment Number',
|
||||||
|
icon: Icon(Ionicons.ios_airplane,
|
||||||
|
color: primaryColor)
|
||||||
|
// prefixIcon: Icon(Icons.play_arrow)
|
||||||
|
),
|
||||||
|
items: ["A102", "A103", "A201", "A202"]
|
||||||
|
.map((e) =>
|
||||||
|
DropdownMenuItem(child: Text(e), value: e))
|
||||||
|
.toList(),
|
||||||
|
onChanged: (map) => {},
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Padding(
|
||||||
|
padding: const EdgeInsets.only(left: 20.0, right: 20),
|
||||||
|
child: TextFormField(
|
||||||
|
initialValue:
|
||||||
|
isNew ? "FCS-0203-390-2" : "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: const EdgeInsets.only(left: 20.0, right: 20),
|
||||||
|
child: TextFormField(
|
||||||
|
initialValue: _box.receiverName,
|
||||||
|
decoration: InputDecoration(
|
||||||
|
fillColor: Colors.white,
|
||||||
|
labelText: 'Customer Name',
|
||||||
|
filled: true,
|
||||||
|
icon: Icon(Feather.user, color: Colors.white),
|
||||||
|
suffixIcon: IconButton(
|
||||||
|
icon: Icon(Icons.search),
|
||||||
|
onPressed: () {})),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
SizedBox(
|
||||||
|
height: 30,
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
ExpansionTile(
|
||||||
|
title: Text(
|
||||||
|
'Packages',
|
||||||
|
style: TextStyle(
|
||||||
|
color: primaryColor, fontWeight: FontWeight.bold),
|
||||||
|
),
|
||||||
|
children: [
|
||||||
|
Padding(
|
||||||
|
padding: const EdgeInsets.only(left: 20.0, right: 20),
|
||||||
|
child: DropdownButtonFormField(
|
||||||
|
value: _box.packageType,
|
||||||
|
decoration: InputDecoration(
|
||||||
|
fillColor: Colors.white,
|
||||||
|
labelText: 'Cargo Type',
|
||||||
|
icon: Icon(Entypo.box, color: primaryColor)),
|
||||||
|
items: ["General", "Medicine", "Dangerous"]
|
||||||
|
.map((e) =>
|
||||||
|
DropdownMenuItem(child: Text(e), value: e))
|
||||||
|
.toList(),
|
||||||
|
onChanged: (map) => {},
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Padding(
|
||||||
|
padding: const EdgeInsets.only(left: 20.0, right: 20),
|
||||||
|
child: TextFormField(
|
||||||
|
initialValue: _box.weight.toString(),
|
||||||
|
textAlign: TextAlign.end,
|
||||||
|
decoration: InputDecoration(
|
||||||
|
fillColor: Colors.white,
|
||||||
|
labelText: 'Total Weight',
|
||||||
|
filled: true,
|
||||||
|
icon: Icon(FontAwesomeIcons.weightHanging,
|
||||||
|
color: primaryColor),
|
||||||
|
)),
|
||||||
|
),
|
||||||
|
Padding(
|
||||||
|
padding: const EdgeInsets.only(left: 20.0, right: 20),
|
||||||
|
child: TextFormField(
|
||||||
|
initialValue: _box.rate.toString(),
|
||||||
|
textAlign: TextAlign.end,
|
||||||
|
decoration: InputDecoration(
|
||||||
|
fillColor: Colors.white,
|
||||||
|
labelText: 'Rate',
|
||||||
|
filled: true,
|
||||||
|
icon: Icon(FontAwesomeIcons.tag,
|
||||||
|
color: primaryColor),
|
||||||
|
)),
|
||||||
|
),
|
||||||
|
Padding(
|
||||||
|
padding: const EdgeInsets.only(left: 20.0, right: 20),
|
||||||
|
child: TextFormField(
|
||||||
|
initialValue: _box.amount.toString(),
|
||||||
|
textAlign: TextAlign.end,
|
||||||
|
decoration: InputDecoration(
|
||||||
|
fillColor: Colors.white,
|
||||||
|
labelText: 'Total Amount',
|
||||||
|
filled: true,
|
||||||
|
icon: Icon(FontAwesomeIcons.moneyBill,
|
||||||
|
color: primaryColor),
|
||||||
|
)),
|
||||||
|
),
|
||||||
|
Container(
|
||||||
|
padding: EdgeInsets.only(top: 10),
|
||||||
|
child: SingleChildScrollView(
|
||||||
|
scrollDirection: Axis.horizontal,
|
||||||
|
child: MyDataTable(
|
||||||
|
headingRowHeight: 40,
|
||||||
|
columnSpacing: 20,
|
||||||
|
columns: [
|
||||||
|
MyDataColumn(
|
||||||
|
label: LocalText(
|
||||||
|
context,
|
||||||
|
"box.package.id",
|
||||||
|
color: Colors.grey,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
MyDataColumn(
|
||||||
|
label: LocalText(
|
||||||
|
context,
|
||||||
|
"box.package.desc",
|
||||||
|
color: Colors.grey,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
MyDataColumn(
|
||||||
|
label: LocalText(
|
||||||
|
context,
|
||||||
|
"box.package.market",
|
||||||
|
color: Colors.grey,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
rows: getPackageRow(context),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
mainModel.isOwner()
|
||||||
|
? Container(
|
||||||
|
padding: EdgeInsets.only(top: 20),
|
||||||
|
child: Align(
|
||||||
|
alignment: Alignment.bottomRight,
|
||||||
|
child: FloatingActionButton.extended(
|
||||||
|
icon: Icon(Icons.add),
|
||||||
|
label: Text(AppTranslations.of(context)
|
||||||
|
.text("box.add_package")),
|
||||||
|
backgroundColor: primaryColor,
|
||||||
|
onPressed: () {
|
||||||
|
Navigator.of(context).push(
|
||||||
|
BottomUpPageRoute(PackageAddition()));
|
||||||
|
},
|
||||||
|
),
|
||||||
|
),
|
||||||
|
)
|
||||||
|
: Container(),
|
||||||
|
SizedBox(height: 25),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
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.box == null
|
||||||
|
? Align(
|
||||||
|
alignment: Alignment.bottomCenter,
|
||||||
|
child: Center(
|
||||||
|
child: Container(
|
||||||
|
width: 250,
|
||||||
|
child: FlatButton(
|
||||||
|
child: Text('Create New Box'),
|
||||||
|
color: primaryColor,
|
||||||
|
textColor: Colors.white,
|
||||||
|
onPressed: () {
|
||||||
|
Navigator.pop(context);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
)))
|
||||||
|
: Container(
|
||||||
|
child: Column(
|
||||||
|
children: <Widget>[
|
||||||
|
Align(
|
||||||
|
alignment: Alignment.bottomCenter,
|
||||||
|
child: Center(
|
||||||
|
child: Container(
|
||||||
|
width: 250,
|
||||||
|
child: FlatButton(
|
||||||
|
child: Text('Complete packing'),
|
||||||
|
color: primaryColor,
|
||||||
|
textColor: Colors.white,
|
||||||
|
onPressed: () {
|
||||||
|
Navigator.pop(context);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
))),
|
||||||
|
],
|
||||||
|
))
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
List<MyDataRow> getPackageRow(BuildContext context) {
|
||||||
|
if (_box == null || _box.packages == null) {
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
return _box.packages.map((p) {
|
||||||
|
return MyDataRow(
|
||||||
|
onSelectChanged: (bool selected) {},
|
||||||
|
cells: [
|
||||||
|
MyDataCell(new Text(
|
||||||
|
p.id == null ? "" : p.id,
|
||||||
|
style: textStyle,
|
||||||
|
)),
|
||||||
|
MyDataCell(
|
||||||
|
new Text(p.cargoDesc, style: textStyle),
|
||||||
|
),
|
||||||
|
MyDataCell(
|
||||||
|
new Text("${p.market}", style: textStyle),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
);
|
||||||
|
}).toList();
|
||||||
|
}
|
||||||
|
}
|
||||||
146
lib/pages_fcs/box_list.dart
Normal file
146
lib/pages_fcs/box_list.dart
Normal file
@@ -0,0 +1,146 @@
|
|||||||
|
import 'package:fcs/model/pickup_model.dart';
|
||||||
|
import 'package:fcs/model_fcs/box_model.dart';
|
||||||
|
import 'package:fcs/model_fcs/package_model.dart';
|
||||||
|
import 'package:fcs/pages/pickup_list_row.dart';
|
||||||
|
import 'package:fcs/pages/search_page.dart';
|
||||||
|
import 'package:fcs/pages_fcs/box_editor.dart';
|
||||||
|
import 'package:fcs/pages_fcs/box_list_row.dart';
|
||||||
|
import 'package:fcs/pages_fcs/package_editor.dart';
|
||||||
|
import 'package:fcs/pages_fcs/package_list_row.dart';
|
||||||
|
import 'package:fcs/vo/buyer.dart';
|
||||||
|
import 'package:fcs/widget/bottom_up_page_route.dart';
|
||||||
|
import 'package:fcs/widget/localization/app_translations.dart';
|
||||||
|
import 'package:fcs/widget/progress.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:provider/provider.dart';
|
||||||
|
|
||||||
|
import '../theme/theme.dart';
|
||||||
|
import 'pickup_editor.dart';
|
||||||
|
|
||||||
|
class BoxList extends StatefulWidget {
|
||||||
|
@override
|
||||||
|
_BoxListState createState() => _BoxListState();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _BoxListState extends State<BoxList> {
|
||||||
|
Buyer buyer;
|
||||||
|
bool _isLoading = false;
|
||||||
|
|
||||||
|
@override
|
||||||
|
void initState() {
|
||||||
|
super.initState();
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
void dispose() {
|
||||||
|
super.dispose();
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return LocalProgress(
|
||||||
|
inAsyncCall: _isLoading,
|
||||||
|
child: DefaultTabController(
|
||||||
|
length: 2,
|
||||||
|
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("boxes.title")),
|
||||||
|
actions: <Widget>[
|
||||||
|
IconButton(
|
||||||
|
icon: Icon(
|
||||||
|
Icons.search,
|
||||||
|
color: Colors.white,
|
||||||
|
),
|
||||||
|
iconSize: 30,
|
||||||
|
onPressed: () => showPlacesSearch(context),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
bottom: TabBar(
|
||||||
|
unselectedLabelColor: Colors.grey,
|
||||||
|
tabs: [
|
||||||
|
Tab(
|
||||||
|
text: "Upcoming",
|
||||||
|
),
|
||||||
|
Tab(text: "Delivered"),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
floatingActionButton: FloatingActionButton.extended(
|
||||||
|
onPressed: () {
|
||||||
|
_newPickup();
|
||||||
|
},
|
||||||
|
icon: Icon(Icons.add),
|
||||||
|
label: Text(AppTranslations.of(context).text("boxes.new")),
|
||||||
|
backgroundColor: primaryColor,
|
||||||
|
),
|
||||||
|
body: TabBarView(
|
||||||
|
children: [
|
||||||
|
_upComing(),
|
||||||
|
_completed(),
|
||||||
|
],
|
||||||
|
)),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
_newPickup() {
|
||||||
|
Navigator.push(
|
||||||
|
context,
|
||||||
|
BottomUpPageRoute(BoxEditor()),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
Widget _upComing() {
|
||||||
|
var boxModel = Provider.of<BoxModel>(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: boxModel.upcoming.length,
|
||||||
|
itemBuilder: (BuildContext context, int index) {
|
||||||
|
return BoxListRow(
|
||||||
|
box: boxModel.upcoming[index],
|
||||||
|
isReadOnly: false,
|
||||||
|
);
|
||||||
|
}),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
Widget _completed() {
|
||||||
|
var boxModel = Provider.of<BoxModel>(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: boxModel.completed.length,
|
||||||
|
itemBuilder: (BuildContext context, int index) {
|
||||||
|
return BoxListRow(
|
||||||
|
box: boxModel.completed[index],
|
||||||
|
isReadOnly: false,
|
||||||
|
);
|
||||||
|
}),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
119
lib/pages_fcs/box_list_row.dart
Normal file
119
lib/pages_fcs/box_list_row.dart
Normal file
@@ -0,0 +1,119 @@
|
|||||||
|
import 'package:fcs/pages/invoice/package_info.dart';
|
||||||
|
import 'package:fcs/pages/util.dart';
|
||||||
|
import 'package:fcs/pages_fcs/box_editor.dart';
|
||||||
|
import 'package:fcs/pages_fcs/package_editor.dart';
|
||||||
|
import 'package:fcs/vo/box.dart';
|
||||||
|
import 'package:fcs/vo/package.dart';
|
||||||
|
import 'package:fcs/widget/bottom_up_page_route.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:intl/intl.dart';
|
||||||
|
|
||||||
|
class BoxListRow extends StatefulWidget {
|
||||||
|
final bool isReadOnly;
|
||||||
|
final Box box;
|
||||||
|
const BoxListRow({this.box, this.isReadOnly});
|
||||||
|
|
||||||
|
@override
|
||||||
|
_BoxListRowState createState() => _BoxListRowState();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _BoxListRowState extends State<BoxListRow> {
|
||||||
|
final double dotSize = 15.0;
|
||||||
|
Box _box = new Box();
|
||||||
|
final DateFormat dateFormat = new DateFormat("dd MMM yyyy");
|
||||||
|
|
||||||
|
@override
|
||||||
|
void initState() {
|
||||||
|
super.initState();
|
||||||
|
_box = widget.box;
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return Container(
|
||||||
|
padding: EdgeInsets.only(left: 15, right: 15),
|
||||||
|
child: InkWell(
|
||||||
|
onTap: () {
|
||||||
|
if (widget.isReadOnly) {
|
||||||
|
// Navigator.push(
|
||||||
|
// context,
|
||||||
|
// BottomUpPageRoute(PackageInfo(package: _box)),
|
||||||
|
// );
|
||||||
|
} else {
|
||||||
|
Navigator.push(
|
||||||
|
context,
|
||||||
|
BottomUpPageRoute(BoxEditor(box: _box)),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
child: Row(
|
||||||
|
children: <Widget>[
|
||||||
|
Expanded(
|
||||||
|
child: new Padding(
|
||||||
|
padding: const EdgeInsets.symmetric(vertical: 16.0),
|
||||||
|
child: new Row(
|
||||||
|
children: <Widget>[
|
||||||
|
new Expanded(
|
||||||
|
child: new Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: <Widget>[
|
||||||
|
Padding(
|
||||||
|
padding: const EdgeInsets.only(left: 8.0),
|
||||||
|
child: new Text(
|
||||||
|
_box.packageNumber == null
|
||||||
|
? ''
|
||||||
|
: _box.packageNumber,
|
||||||
|
style: new TextStyle(
|
||||||
|
fontSize: 15.0, color: Colors.black),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Padding(
|
||||||
|
padding: const EdgeInsets.only(left: 10.0, top: 10),
|
||||||
|
child: new Text(
|
||||||
|
dateFormat.format(_box.arrivedDate),
|
||||||
|
style: new TextStyle(
|
||||||
|
fontSize: 15.0, color: Colors.grey),
|
||||||
|
),
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Column(
|
||||||
|
children: <Widget>[
|
||||||
|
Padding(
|
||||||
|
padding: const EdgeInsets.all(0),
|
||||||
|
child: getStatus(_box.status),
|
||||||
|
),
|
||||||
|
Padding(
|
||||||
|
padding: const EdgeInsets.only(left: 8.0, top: 5, bottom: 5),
|
||||||
|
child: Row(
|
||||||
|
children: <Widget>[
|
||||||
|
new Text(
|
||||||
|
_box.weight == null
|
||||||
|
? ''
|
||||||
|
: _box.weight.toString() + 'lb - ',
|
||||||
|
style:
|
||||||
|
new TextStyle(fontSize: 15.0, color: Colors.grey),
|
||||||
|
),
|
||||||
|
new Text(
|
||||||
|
_box.price == null
|
||||||
|
? ""
|
||||||
|
: "\$ " + _box.price.toString(),
|
||||||
|
style:
|
||||||
|
new TextStyle(fontSize: 15.0, color: Colors.grey),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,11 +1,13 @@
|
|||||||
import 'package:fcs/model/main_model.dart';
|
import 'package:fcs/pages/util.dart';
|
||||||
import 'package:fcs/model/pickup_model.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';
|
||||||
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:font_awesome_flutter/font_awesome_flutter.dart';
|
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
|
||||||
import 'package:provider/provider.dart';
|
import 'package:intl/intl.dart';
|
||||||
|
import 'package:timeline_list/timeline.dart';
|
||||||
|
import 'package:timeline_list/timeline_model.dart';
|
||||||
|
|
||||||
import '../theme/theme.dart';
|
import '../theme/theme.dart';
|
||||||
|
|
||||||
@@ -28,17 +30,27 @@ class _PackageEditorState extends State<PackageEditor> {
|
|||||||
|
|
||||||
Package _package;
|
Package _package;
|
||||||
bool _isLoading = false;
|
bool _isLoading = false;
|
||||||
|
List<String> _images = [
|
||||||
|
"assets/photos/1.jpg",
|
||||||
|
"assets/photos/2.jpg",
|
||||||
|
"assets/photos/3.jpg"
|
||||||
|
];
|
||||||
|
bool isNew;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void initState() {
|
void initState() {
|
||||||
super.initState();
|
super.initState();
|
||||||
if (widget.package != null) {
|
if (widget.package != null) {
|
||||||
_package = widget.package;
|
_package = widget.package;
|
||||||
|
isNew = false;
|
||||||
// _addressEditingController.text = _pickUp.address;
|
// _addressEditingController.text = _pickUp.address;
|
||||||
// _fromTimeEditingController.text = _pickUp.fromTime;
|
// _fromTimeEditingController.text = _pickUp.fromTime;
|
||||||
// _toTimeEditingController.text = _pickUp.toTime;
|
// _toTimeEditingController.text = _pickUp.toTime;
|
||||||
// _noOfPackageEditingController.text = _pickUp.numberOfPackage.toString();
|
// _noOfPackageEditingController.text = _pickUp.numberOfPackage.toString();
|
||||||
// _weightEditingController.text = _pickUp.weight.toString();
|
// _weightEditingController.text = _pickUp.weight.toString();
|
||||||
|
} else {
|
||||||
|
isNew = true;
|
||||||
|
_package = Package(rate: 0, weight: 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -47,8 +59,11 @@ class _PackageEditorState extends State<PackageEditor> {
|
|||||||
super.dispose();
|
super.dispose();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
final DateFormat dateFormat = DateFormat("d MMM yyyy");
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
|
var images = isNew ? [] : _images;
|
||||||
return LocalProgress(
|
return LocalProgress(
|
||||||
inAsyncCall: _isLoading,
|
inAsyncCall: _isLoading,
|
||||||
child: Scaffold(
|
child: Scaffold(
|
||||||
@@ -64,94 +79,197 @@ class _PackageEditorState extends State<PackageEditor> {
|
|||||||
body: Card(
|
body: Card(
|
||||||
child: Column(
|
child: Column(
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
|
isNew ? Container() : Center(child: nameWidget(_package.market)),
|
||||||
|
isNew
|
||||||
|
? Center(
|
||||||
|
child: Container(
|
||||||
|
padding: EdgeInsets.all(8),
|
||||||
|
child: Text("New Package")))
|
||||||
|
: Center(child: nameWidget(_package.trackingID)),
|
||||||
Expanded(
|
Expanded(
|
||||||
child: Padding(
|
child: ListView(
|
||||||
padding: const EdgeInsets.all(10.0),
|
children: [
|
||||||
child: ListView(children: <Widget>[
|
ExpansionTile(
|
||||||
DropdownButtonFormField(
|
title: Text(
|
||||||
|
'Receiving',
|
||||||
|
style: TextStyle(
|
||||||
|
color: primaryColor, fontWeight: FontWeight.bold),
|
||||||
|
),
|
||||||
|
children: [
|
||||||
|
Padding(
|
||||||
|
padding: const EdgeInsets.only(left: 20.0, right: 20),
|
||||||
|
child: TextFormField(
|
||||||
|
initialValue: isNew ? "" : "PKG2039",
|
||||||
decoration: InputDecoration(
|
decoration: InputDecoration(
|
||||||
fillColor: Colors.white,
|
fillColor: Colors.white,
|
||||||
labelText: 'Shipment Number',
|
labelText: 'Package ID',
|
||||||
icon: Icon(Icons.pages)
|
hintText: 'Package ID',
|
||||||
// prefixIcon: Icon(Icons.play_arrow)
|
filled: true,
|
||||||
|
icon: Icon(MaterialCommunityIcons.id_card,
|
||||||
|
color: primaryColor),
|
||||||
),
|
),
|
||||||
items: ["A102", "A103"]
|
|
||||||
.map((e) => DropdownMenuItem(child: Text(e), value: e))
|
|
||||||
.toList(),
|
|
||||||
onChanged: (map) => {},
|
|
||||||
),
|
),
|
||||||
TextFormField(
|
),
|
||||||
initialValue: "FCS383-283-1",
|
Padding(
|
||||||
|
padding: const EdgeInsets.only(left: 20.0, right: 20),
|
||||||
|
child: TextFormField(
|
||||||
|
initialValue: isNew ? "" : "Amazon",
|
||||||
|
decoration: InputDecoration(
|
||||||
|
fillColor: Colors.white,
|
||||||
|
labelText: 'Market',
|
||||||
|
hintText: 'FCS_ID',
|
||||||
|
filled: true,
|
||||||
|
icon: Icon(MaterialCommunityIcons.cart_outline,
|
||||||
|
color: primaryColor),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
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(
|
decoration: InputDecoration(
|
||||||
fillColor: Colors.white,
|
fillColor: Colors.white,
|
||||||
labelText: 'FCS_ID',
|
labelText: 'FCS_ID',
|
||||||
hintText: 'FCS_ID',
|
hintText: 'FCS_ID',
|
||||||
filled: true,
|
filled: true,
|
||||||
icon: Icon(
|
icon: Icon(Feather.user, color: primaryColor),
|
||||||
Icons.account_box,
|
|
||||||
),
|
|
||||||
suffixIcon: IconButton(
|
suffixIcon: IconButton(
|
||||||
icon: Icon(Icons.search), onPressed: () {})),
|
icon: Icon(Icons.search),
|
||||||
|
onPressed: () {})),
|
||||||
),
|
),
|
||||||
DropdownButtonFormField(
|
),
|
||||||
|
Padding(
|
||||||
|
padding: const EdgeInsets.only(left: 20.0, right: 20),
|
||||||
|
child: TextFormField(
|
||||||
|
initialValue: _package.receiverName,
|
||||||
decoration: InputDecoration(
|
decoration: InputDecoration(
|
||||||
fillColor: Colors.white,
|
fillColor: Colors.white,
|
||||||
labelText: 'Cargo Type',
|
labelText: 'Customer Name',
|
||||||
icon: Icon(Icons.pages)
|
|
||||||
// prefixIcon: Icon(Icons.play_arrow)
|
|
||||||
),
|
|
||||||
items: ["General", "Medicine", "Dangerous"]
|
|
||||||
.map((e) => DropdownMenuItem(child: Text(e), value: e))
|
|
||||||
.toList(),
|
|
||||||
onChanged: (map) => {},
|
|
||||||
),
|
|
||||||
TextFormField(
|
|
||||||
initialValue: "0",
|
|
||||||
textAlign: TextAlign.end,
|
|
||||||
decoration: InputDecoration(
|
|
||||||
fillColor: Colors.white,
|
|
||||||
labelText: 'Weight',
|
|
||||||
filled: true,
|
filled: true,
|
||||||
icon: Icon(
|
icon: Icon(Feather.user, color: Colors.white),
|
||||||
FontAwesomeIcons.weightHanging,
|
suffixIcon: IconButton(
|
||||||
|
icon: Icon(Icons.search),
|
||||||
|
onPressed: () {})),
|
||||||
),
|
),
|
||||||
)),
|
|
||||||
TextFormField(
|
|
||||||
initialValue: "0",
|
|
||||||
textAlign: TextAlign.end,
|
|
||||||
decoration: InputDecoration(
|
|
||||||
fillColor: Colors.white,
|
|
||||||
labelText: 'Rate',
|
|
||||||
filled: true,
|
|
||||||
icon: Icon(
|
|
||||||
FontAwesomeIcons.tag,
|
|
||||||
),
|
),
|
||||||
)),
|
Padding(
|
||||||
TextFormField(
|
padding: const EdgeInsets.only(left: 20.0, right: 20),
|
||||||
initialValue: "0",
|
child: TextFormField(
|
||||||
textAlign: TextAlign.end,
|
initialValue: isNew ? "" : "",
|
||||||
decoration: InputDecoration(
|
|
||||||
fillColor: Colors.white,
|
|
||||||
labelText: 'Amount',
|
|
||||||
filled: true,
|
|
||||||
icon: Icon(
|
|
||||||
FontAwesomeIcons.moneyBill,
|
|
||||||
),
|
|
||||||
)),
|
|
||||||
TextFormField(
|
|
||||||
initialValue: "P0203",
|
|
||||||
decoration: InputDecoration(
|
decoration: InputDecoration(
|
||||||
fillColor: Colors.white,
|
fillColor: Colors.white,
|
||||||
labelText: 'Pickup ID',
|
labelText: 'Pickup ID',
|
||||||
filled: true,
|
filled: true,
|
||||||
icon: Icon(
|
icon: Icon(MaterialCommunityIcons.directions,
|
||||||
Icons.account_box,
|
color: primaryColor),
|
||||||
),
|
|
||||||
suffixIcon: IconButton(
|
suffixIcon: IconButton(
|
||||||
icon: Icon(Icons.search), onPressed: () {})),
|
icon: Icon(Icons.search),
|
||||||
|
onPressed: () {})),
|
||||||
),
|
),
|
||||||
]),
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
isNew
|
||||||
|
? Container()
|
||||||
|
: ExpansionTile(
|
||||||
|
title: Text(
|
||||||
|
'Processing',
|
||||||
|
style: TextStyle(
|
||||||
|
color: primaryColor,
|
||||||
|
fontWeight: FontWeight.bold),
|
||||||
|
),
|
||||||
|
children: [
|
||||||
|
Padding(
|
||||||
|
padding: const EdgeInsets.only(
|
||||||
|
left: 20.0, right: 20),
|
||||||
|
child: TextFormField(
|
||||||
|
initialValue: isNew
|
||||||
|
? ""
|
||||||
|
: _package.cargoDesc.toString(),
|
||||||
|
decoration: InputDecoration(
|
||||||
|
fillColor: Colors.white,
|
||||||
|
labelText: 'Description',
|
||||||
|
filled: true,
|
||||||
|
icon: Icon(MaterialIcons.description,
|
||||||
|
color: primaryColor),
|
||||||
)),
|
)),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
isNew
|
||||||
|
? Container()
|
||||||
|
: ExpansionTile(
|
||||||
|
title: Text(
|
||||||
|
'Photos',
|
||||||
|
style: TextStyle(
|
||||||
|
color: primaryColor,
|
||||||
|
fontWeight: FontWeight.bold),
|
||||||
|
),
|
||||||
|
children: <Widget>[
|
||||||
|
Container(
|
||||||
|
height: 130,
|
||||||
|
width: 500,
|
||||||
|
child: ListView.separated(
|
||||||
|
separatorBuilder: (context, index) => Divider(
|
||||||
|
color: Colors.black,
|
||||||
|
),
|
||||||
|
itemCount: images.length + 1,
|
||||||
|
scrollDirection: Axis.horizontal,
|
||||||
|
itemBuilder: (context, index) {
|
||||||
|
if (index == images.length) {
|
||||||
|
return Padding(
|
||||||
|
padding: const EdgeInsets.all(8.0),
|
||||||
|
child: Container(
|
||||||
|
width: 200,
|
||||||
|
height: 70,
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
border: Border.all(
|
||||||
|
color: primaryColor,
|
||||||
|
width: 2.0,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
child: Icon(SimpleLineIcons.plus),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
return Padding(
|
||||||
|
padding: const EdgeInsets.all(8.0),
|
||||||
|
child: Container(
|
||||||
|
width: 200,
|
||||||
|
height: 70,
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
border: Border.all(
|
||||||
|
color: primaryColor,
|
||||||
|
width: 2.0,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
child: Image.asset(images[index],
|
||||||
|
width: 50, height: 50),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
widget.package == null
|
widget.package == null
|
||||||
? Align(
|
? Align(
|
||||||
alignment: Alignment.bottomCenter,
|
alignment: Alignment.bottomCenter,
|
||||||
@@ -159,7 +277,7 @@ class _PackageEditorState extends State<PackageEditor> {
|
|||||||
child: Container(
|
child: Container(
|
||||||
width: 250,
|
width: 250,
|
||||||
child: FlatButton(
|
child: FlatButton(
|
||||||
child: Text('Create package'),
|
child: Text('Complete receiving'),
|
||||||
color: primaryColor,
|
color: primaryColor,
|
||||||
textColor: Colors.white,
|
textColor: Colors.white,
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
@@ -176,7 +294,7 @@ class _PackageEditorState extends State<PackageEditor> {
|
|||||||
child: Container(
|
child: Container(
|
||||||
width: 250,
|
width: 250,
|
||||||
child: FlatButton(
|
child: FlatButton(
|
||||||
child: Text('Save package'),
|
child: Text('Complete processing'),
|
||||||
color: primaryColor,
|
color: primaryColor,
|
||||||
textColor: Colors.white,
|
textColor: Colors.white,
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
|
|||||||
@@ -62,9 +62,9 @@ class _PackageListState extends State<PackageList> {
|
|||||||
unselectedLabelColor: Colors.grey,
|
unselectedLabelColor: Colors.grey,
|
||||||
tabs: [
|
tabs: [
|
||||||
Tab(
|
Tab(
|
||||||
text: "Upcoming",
|
text: "Received",
|
||||||
),
|
),
|
||||||
Tab(text: "Completed"),
|
Tab(text: "Processed"),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -58,21 +58,29 @@ class _PackageListRowtate extends State<PackageListRow> {
|
|||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsets.only(left: 8.0),
|
padding: const EdgeInsets.only(left: 8.0),
|
||||||
child: new Text(
|
child: new Text(
|
||||||
_package.packageNumber == null
|
_package.id == null ? '' : _package.id,
|
||||||
? ''
|
|
||||||
: _package.packageNumber,
|
|
||||||
style: new TextStyle(
|
style: new TextStyle(
|
||||||
fontSize: 15.0, color: Colors.black),
|
fontSize: 15.0, color: Colors.black),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsets.only(left: 10.0, top: 10),
|
padding: const EdgeInsets.only(left: 8.0),
|
||||||
child: new Text(
|
child: new Text(
|
||||||
dateFormat.format(_package.arrivedDate),
|
_package.market == null ? '' : _package.market,
|
||||||
|
style: new TextStyle(
|
||||||
|
fontSize: 15.0, color: Colors.black),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Padding(
|
||||||
|
padding: const EdgeInsets.only(left: 8.0),
|
||||||
|
child: new Text(
|
||||||
|
_package.trackingID == null
|
||||||
|
? ''
|
||||||
|
: _package.trackingID,
|
||||||
style: new TextStyle(
|
style: new TextStyle(
|
||||||
fontSize: 15.0, color: Colors.grey),
|
fontSize: 15.0, color: Colors.grey),
|
||||||
),
|
),
|
||||||
)
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@@ -84,7 +92,10 @@ class _PackageListRowtate extends State<PackageListRow> {
|
|||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsets.all(0),
|
padding: const EdgeInsets.all(0),
|
||||||
child: getStatus(_package.status),
|
child: new Text(
|
||||||
|
dateFormat.format(_package.arrivedDate),
|
||||||
|
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),
|
||||||
|
|||||||
61
lib/vo/box.dart
Normal file
61
lib/vo/box.dart
Normal file
@@ -0,0 +1,61 @@
|
|||||||
|
import 'package.dart';
|
||||||
|
|
||||||
|
class Status {
|
||||||
|
String status;
|
||||||
|
DateTime date;
|
||||||
|
bool done;
|
||||||
|
Status({this.status, this.date, this.done});
|
||||||
|
}
|
||||||
|
|
||||||
|
class Box {
|
||||||
|
String id;
|
||||||
|
String shipmentNumber;
|
||||||
|
String senderFCSID;
|
||||||
|
String senderName;
|
||||||
|
String receiverFCSID;
|
||||||
|
String receiverName;
|
||||||
|
String receiverAddress;
|
||||||
|
String receiverNumber;
|
||||||
|
String boxNumber;
|
||||||
|
String status;
|
||||||
|
String cargoDesc;
|
||||||
|
|
||||||
|
int rate;
|
||||||
|
int weight;
|
||||||
|
String packageType;
|
||||||
|
String pickUpID;
|
||||||
|
List<String> photos;
|
||||||
|
String remark;
|
||||||
|
DateTime arrivedDate;
|
||||||
|
|
||||||
|
List<Package> packages;
|
||||||
|
|
||||||
|
int get amount => rate != null && weight != null ? rate * weight : 0;
|
||||||
|
|
||||||
|
String get packageNumber =>
|
||||||
|
shipmentNumber + "-" + receiverNumber + " #" + boxNumber;
|
||||||
|
double get price => rate.toDouble() * weight;
|
||||||
|
|
||||||
|
List<Status> statusHistory;
|
||||||
|
|
||||||
|
Box(
|
||||||
|
{this.id,
|
||||||
|
this.shipmentNumber,
|
||||||
|
this.senderFCSID,
|
||||||
|
this.senderName,
|
||||||
|
this.receiverFCSID,
|
||||||
|
this.receiverName,
|
||||||
|
this.receiverNumber,
|
||||||
|
this.receiverAddress,
|
||||||
|
this.boxNumber,
|
||||||
|
this.rate,
|
||||||
|
this.weight,
|
||||||
|
this.packageType,
|
||||||
|
this.pickUpID,
|
||||||
|
this.remark,
|
||||||
|
this.status,
|
||||||
|
this.arrivedDate,
|
||||||
|
this.cargoDesc,
|
||||||
|
this.statusHistory,
|
||||||
|
this.packages});
|
||||||
|
}
|
||||||
@@ -21,4 +21,6 @@ class Invoice {
|
|||||||
this.status,
|
this.status,
|
||||||
this.paymentAttachment,
|
this.paymentAttachment,
|
||||||
this.packages});
|
this.packages});
|
||||||
|
|
||||||
|
double get getAmount => packages.fold(0, (p, e) => (e.rate * e.weight) + p);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,3 +1,10 @@
|
|||||||
|
// class Status {
|
||||||
|
// String status;
|
||||||
|
// DateTime date;
|
||||||
|
// bool done;
|
||||||
|
// Status({this.status, this.date, this.done});
|
||||||
|
// }
|
||||||
|
|
||||||
class Package {
|
class Package {
|
||||||
String id;
|
String id;
|
||||||
String shipmentNumber;
|
String shipmentNumber;
|
||||||
@@ -9,20 +16,26 @@ class Package {
|
|||||||
String receiverNumber;
|
String receiverNumber;
|
||||||
String boxNumber;
|
String boxNumber;
|
||||||
String status;
|
String status;
|
||||||
|
String cargoDesc;
|
||||||
|
String market;
|
||||||
|
String trackingID;
|
||||||
|
|
||||||
int rate;
|
int rate;
|
||||||
int weight;
|
int weight;
|
||||||
int amount;
|
|
||||||
String packageType;
|
String packageType;
|
||||||
String pickUpID;
|
String pickUpID;
|
||||||
List<String> photos;
|
List<String> photos;
|
||||||
String remark;
|
String remark;
|
||||||
DateTime arrivedDate;
|
DateTime arrivedDate;
|
||||||
|
|
||||||
|
int get amount => rate != null && weight != null ? rate * weight : 0;
|
||||||
|
|
||||||
String get packageNumber =>
|
String get packageNumber =>
|
||||||
shipmentNumber + "-" + receiverNumber + " #" + boxNumber;
|
shipmentNumber + "-" + receiverNumber + " #" + boxNumber;
|
||||||
double get price => rate.toDouble() * weight;
|
double get price => rate.toDouble() * weight;
|
||||||
|
|
||||||
|
// List<Status> statusHistory;
|
||||||
|
|
||||||
Package(
|
Package(
|
||||||
{this.id,
|
{this.id,
|
||||||
this.shipmentNumber,
|
this.shipmentNumber,
|
||||||
@@ -35,10 +48,14 @@ class Package {
|
|||||||
this.boxNumber,
|
this.boxNumber,
|
||||||
this.rate,
|
this.rate,
|
||||||
this.weight,
|
this.weight,
|
||||||
this.amount,
|
|
||||||
this.packageType,
|
this.packageType,
|
||||||
this.pickUpID,
|
this.pickUpID,
|
||||||
this.remark,
|
this.remark,
|
||||||
this.status,
|
this.status,
|
||||||
this.arrivedDate});
|
this.arrivedDate,
|
||||||
|
this.cargoDesc,
|
||||||
|
this.market,
|
||||||
|
this.trackingID
|
||||||
|
// this.statusHistory
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -693,6 +693,13 @@ packages:
|
|||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "0.2.15"
|
version: "0.2.15"
|
||||||
|
timeline_list:
|
||||||
|
dependency: "direct main"
|
||||||
|
description:
|
||||||
|
name: timeline_list
|
||||||
|
url: "https://pub.dartlang.org"
|
||||||
|
source: hosted
|
||||||
|
version: "0.0.5"
|
||||||
typed_data:
|
typed_data:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
|||||||
@@ -66,6 +66,9 @@ dependencies:
|
|||||||
pin_input_text_field:
|
pin_input_text_field:
|
||||||
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
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
dev_dependencies:
|
dev_dependencies:
|
||||||
flutter_test:
|
flutter_test:
|
||||||
@@ -76,6 +79,7 @@ flutter:
|
|||||||
assets:
|
assets:
|
||||||
- assets/
|
- assets/
|
||||||
- assets/local/
|
- assets/local/
|
||||||
|
- assets/photos/
|
||||||
|
|
||||||
|
|
||||||
fonts:
|
fonts:
|
||||||
|
|||||||
Reference in New Issue
Block a user