add package
This commit is contained in:
@@ -17,20 +17,34 @@ class MessageModel extends BaseModel {
|
|||||||
receiverName: "Online Buyer",
|
receiverName: "Online Buyer",
|
||||||
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 Online Buyer, we received your goods. Please see the following link",
|
||||||
|
),
|
||||||
|
Message(
|
||||||
|
senderName: "FCS System",
|
||||||
|
receiverName: "Online Buyer",
|
||||||
|
date: DateTime(2020, 6, 1, 1, 1, 1),
|
||||||
|
message:
|
||||||
|
"'A202-3 #1'",
|
||||||
),
|
),
|
||||||
Message(
|
Message(
|
||||||
senderName: "FCS System",
|
senderName: "FCS System",
|
||||||
receiverName: "Online Buyer",
|
receiverName: "Online Buyer",
|
||||||
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: "Online Buyer",
|
||||||
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 Online Buyer, we successfully processed your goods and ready for payment. Please see in the following link.",
|
||||||
|
),
|
||||||
|
Message(
|
||||||
|
senderName: "FCS System",
|
||||||
|
receiverName: "Online Buyer",
|
||||||
|
date: DateTime(2020, 6, 1, 2, 1, 1),
|
||||||
|
message:
|
||||||
|
"'INV202005010387'",
|
||||||
),
|
),
|
||||||
Message(
|
Message(
|
||||||
senderName: "FCS System",
|
senderName: "FCS System",
|
||||||
@@ -44,14 +58,28 @@ class MessageModel extends BaseModel {
|
|||||||
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 Online Buyer, 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 Online Buyer, 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",
|
||||||
@@ -63,7 +91,7 @@ class MessageModel extends BaseModel {
|
|||||||
];
|
];
|
||||||
|
|
||||||
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) {
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ class PackageModel extends BaseModel {
|
|||||||
rate: 7,
|
rate: 7,
|
||||||
packageType: "General",
|
packageType: "General",
|
||||||
weight: 15,
|
weight: 15,
|
||||||
status: "Received",
|
status: "Waiting for payment",
|
||||||
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(
|
||||||
|
|||||||
@@ -306,8 +306,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),
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
import 'package:fcs/model/main_model.dart';
|
import 'package:fcs/model/main_model.dart';
|
||||||
import 'package:fcs/model/pickup_model.dart';
|
import 'package:fcs/model/pickup_model.dart';
|
||||||
|
import 'package:fcs/pages/util.dart';
|
||||||
import 'package:fcs/vo/package.dart';
|
import 'package:fcs/vo/package.dart';
|
||||||
import 'package:fcs/widget/localization/app_translations.dart';
|
import 'package:fcs/widget/localization/app_translations.dart';
|
||||||
import 'package:fcs/widget/progress.dart';
|
import 'package:fcs/widget/progress.dart';
|
||||||
@@ -39,6 +40,8 @@ class _PackageEditorState extends State<PackageEditor> {
|
|||||||
// _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 {
|
||||||
|
_package = Package(rate: 0, weight: 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -65,93 +68,162 @@ class _PackageEditorState extends State<PackageEditor> {
|
|||||||
child: Column(
|
child: Column(
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
Expanded(
|
Expanded(
|
||||||
child: Padding(
|
child: ListView(
|
||||||
padding: const EdgeInsets.all(10.0),
|
children: [
|
||||||
child: ListView(children: <Widget>[
|
widget.package == null
|
||||||
DropdownButtonFormField(
|
? Center(
|
||||||
decoration: InputDecoration(
|
child: Container(
|
||||||
fillColor: Colors.white,
|
padding: EdgeInsets.all(8),
|
||||||
labelText: 'Shipment Number',
|
child: Text("New Package")))
|
||||||
icon: Icon(Icons.pages)
|
: Center(child: nameWidget(_package.packageNumber)),
|
||||||
// prefixIcon: Icon(Icons.play_arrow)
|
ExpansionTile(
|
||||||
|
title: Text('Package Information'),
|
||||||
|
children: [
|
||||||
|
Padding(
|
||||||
|
padding: const EdgeInsets.only(left: 20.0),
|
||||||
|
child: DropdownButtonFormField(
|
||||||
|
value: _package.shipmentNumber,
|
||||||
|
decoration: InputDecoration(
|
||||||
|
fillColor: Colors.white,
|
||||||
|
labelText: 'Shipment Number',
|
||||||
|
icon: Icon(Icons.pages)
|
||||||
|
// prefixIcon: Icon(Icons.play_arrow)
|
||||||
|
),
|
||||||
|
items: ["A102", "A103", "A201", "A202"]
|
||||||
|
.map((e) =>
|
||||||
|
DropdownMenuItem(child: Text(e), value: e))
|
||||||
|
.toList(),
|
||||||
|
onChanged: (map) => {},
|
||||||
|
),
|
||||||
),
|
),
|
||||||
items: ["A102", "A103"]
|
Padding(
|
||||||
.map((e) => DropdownMenuItem(child: Text(e), value: e))
|
padding: const EdgeInsets.only(left: 20.0),
|
||||||
.toList(),
|
child: TextFormField(
|
||||||
onChanged: (map) => {},
|
initialValue: "FCS383-283-1",
|
||||||
),
|
decoration: InputDecoration(
|
||||||
TextFormField(
|
fillColor: Colors.white,
|
||||||
initialValue: "FCS383-283-1",
|
labelText: 'FCS_ID',
|
||||||
decoration: InputDecoration(
|
hintText: 'FCS_ID',
|
||||||
fillColor: Colors.white,
|
filled: true,
|
||||||
labelText: 'FCS_ID',
|
icon: Icon(
|
||||||
hintText: 'FCS_ID',
|
Icons.account_box,
|
||||||
filled: true,
|
),
|
||||||
icon: Icon(
|
suffixIcon: IconButton(
|
||||||
Icons.account_box,
|
icon: Icon(Icons.search),
|
||||||
|
onPressed: () {})),
|
||||||
|
),
|
||||||
),
|
),
|
||||||
suffixIcon: IconButton(
|
Padding(
|
||||||
icon: Icon(Icons.search), onPressed: () {})),
|
padding: const EdgeInsets.only(left: 20.0),
|
||||||
),
|
child: DropdownButtonFormField(
|
||||||
DropdownButtonFormField(
|
value: _package.packageType,
|
||||||
decoration: InputDecoration(
|
decoration: InputDecoration(
|
||||||
fillColor: Colors.white,
|
fillColor: Colors.white,
|
||||||
labelText: 'Cargo Type',
|
labelText: 'Cargo Type',
|
||||||
icon: Icon(Icons.pages)
|
icon: Icon(Icons.pages)
|
||||||
// prefixIcon: Icon(Icons.play_arrow)
|
// prefixIcon: Icon(Icons.play_arrow)
|
||||||
|
),
|
||||||
|
items: ["General", "Medicine", "Dangerous"]
|
||||||
|
.map((e) =>
|
||||||
|
DropdownMenuItem(child: Text(e), value: e))
|
||||||
|
.toList(),
|
||||||
|
onChanged: (map) => {},
|
||||||
|
),
|
||||||
),
|
),
|
||||||
items: ["General", "Medicine", "Dangerous"]
|
Padding(
|
||||||
.map((e) => DropdownMenuItem(child: Text(e), value: e))
|
padding: const EdgeInsets.only(left: 20.0),
|
||||||
.toList(),
|
child: TextFormField(
|
||||||
onChanged: (map) => {},
|
initialValue: _package.weight.toString(),
|
||||||
),
|
textAlign: TextAlign.end,
|
||||||
TextFormField(
|
decoration: InputDecoration(
|
||||||
initialValue: "0",
|
fillColor: Colors.white,
|
||||||
textAlign: TextAlign.end,
|
labelText: 'Weight',
|
||||||
decoration: InputDecoration(
|
filled: true,
|
||||||
fillColor: Colors.white,
|
icon: Icon(
|
||||||
labelText: 'Weight',
|
FontAwesomeIcons.weightHanging,
|
||||||
filled: true,
|
),
|
||||||
icon: Icon(
|
)),
|
||||||
FontAwesomeIcons.weightHanging,
|
|
||||||
),
|
),
|
||||||
)),
|
Padding(
|
||||||
TextFormField(
|
padding: const EdgeInsets.only(left: 20.0),
|
||||||
initialValue: "0",
|
child: TextFormField(
|
||||||
textAlign: TextAlign.end,
|
initialValue: _package.rate.toString(),
|
||||||
decoration: InputDecoration(
|
textAlign: TextAlign.end,
|
||||||
fillColor: Colors.white,
|
decoration: InputDecoration(
|
||||||
labelText: 'Rate',
|
fillColor: Colors.white,
|
||||||
filled: true,
|
labelText: 'Rate',
|
||||||
icon: Icon(
|
filled: true,
|
||||||
FontAwesomeIcons.tag,
|
icon: Icon(
|
||||||
|
FontAwesomeIcons.tag,
|
||||||
|
),
|
||||||
|
)),
|
||||||
),
|
),
|
||||||
)),
|
Padding(
|
||||||
TextFormField(
|
padding: const EdgeInsets.only(left: 20.0),
|
||||||
initialValue: "0",
|
child: TextFormField(
|
||||||
textAlign: TextAlign.end,
|
initialValue: _package.amount.toString(),
|
||||||
decoration: InputDecoration(
|
textAlign: TextAlign.end,
|
||||||
fillColor: Colors.white,
|
decoration: InputDecoration(
|
||||||
labelText: 'Amount',
|
fillColor: Colors.white,
|
||||||
filled: true,
|
labelText: 'Amount',
|
||||||
icon: Icon(
|
filled: true,
|
||||||
FontAwesomeIcons.moneyBill,
|
icon: Icon(
|
||||||
|
FontAwesomeIcons.moneyBill,
|
||||||
|
),
|
||||||
|
)),
|
||||||
),
|
),
|
||||||
)),
|
Padding(
|
||||||
TextFormField(
|
padding: const EdgeInsets.only(left: 20.0),
|
||||||
initialValue: "P0203",
|
child: TextFormField(
|
||||||
decoration: InputDecoration(
|
initialValue: "P0203",
|
||||||
fillColor: Colors.white,
|
decoration: InputDecoration(
|
||||||
labelText: 'Pickup ID',
|
fillColor: Colors.white,
|
||||||
filled: true,
|
labelText: 'Pickup ID',
|
||||||
icon: Icon(
|
filled: true,
|
||||||
Icons.account_box,
|
icon: Icon(
|
||||||
|
Icons.account_box,
|
||||||
|
),
|
||||||
|
suffixIcon: IconButton(
|
||||||
|
icon: Icon(Icons.search),
|
||||||
|
onPressed: () {})),
|
||||||
|
),
|
||||||
),
|
),
|
||||||
suffixIcon: IconButton(
|
],
|
||||||
icon: Icon(Icons.search), onPressed: () {})),
|
),
|
||||||
),
|
ExpansionTile(
|
||||||
]),
|
title: Text('Photos'),
|
||||||
)),
|
children: <Widget>[
|
||||||
|
Container(
|
||||||
|
height: 130,
|
||||||
|
width: 500,
|
||||||
|
child: ListView(
|
||||||
|
// scrollDirection: Axis.horizontal,
|
||||||
|
children: <Widget>[
|
||||||
|
Padding(
|
||||||
|
padding: const EdgeInsets.only(left: 20.0),
|
||||||
|
child: DropdownButtonFormField(
|
||||||
|
value: _package.shipmentNumber,
|
||||||
|
decoration: InputDecoration(
|
||||||
|
fillColor: Colors.white,
|
||||||
|
labelText: 'Shipment Number',
|
||||||
|
icon: Icon(Icons.pages)
|
||||||
|
// prefixIcon: Icon(Icons.play_arrow)
|
||||||
|
),
|
||||||
|
items: ["A102", "A103", "A201", "A202"]
|
||||||
|
.map((e) => DropdownMenuItem(
|
||||||
|
child: Text(e), value: e))
|
||||||
|
.toList(),
|
||||||
|
onChanged: (map) => {},
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
widget.package == null
|
widget.package == null
|
||||||
? Align(
|
? Align(
|
||||||
alignment: Alignment.bottomCenter,
|
alignment: Alignment.bottomCenter,
|
||||||
|
|||||||
@@ -12,13 +12,14 @@ class Package {
|
|||||||
|
|
||||||
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;
|
||||||
@@ -35,7 +36,6 @@ 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,
|
||||||
|
|||||||
Reference in New Issue
Block a user