add package

This commit is contained in:
2020-06-02 16:19:10 +06:30
parent 4864977588
commit d41d48b405
5 changed files with 191 additions and 91 deletions

View File

@@ -17,20 +17,34 @@ class MessageModel extends BaseModel {
receiverName: "Online Buyer",
date: DateTime(2020, 6, 1, 1, 1, 1),
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(
senderName: "FCS System",
receiverName: "Online Buyer",
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),
Message(
senderName: "FCS System",
receiverName: "Online Buyer",
date: DateTime(2020, 6, 1, 2, 1, 1),
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(
senderName: "FCS System",
@@ -44,14 +58,28 @@ class MessageModel extends BaseModel {
receiverName: "Shipper",
date: DateTime(2020, 6, 1, 1, 1, 1),
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(
senderName: "FCS System",
receiverName: "Shipper",
date: DateTime(2020, 6, 1, 2, 1, 1),
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(
senderName: "FCS System",
@@ -63,7 +91,7 @@ class MessageModel extends BaseModel {
];
List<Message> get lastMessage {
return [messages[2], messages[5]];
return [messages[2], messages[6]];
}
List<Message> getMessage(String receiver) {

View File

@@ -39,7 +39,7 @@ class PackageModel extends BaseModel {
rate: 7,
packageType: "General",
weight: 15,
status: "Received",
status: "Waiting for payment",
arrivedDate: DateTime(2020, 6, 1),
receiverAddress: '1 Bo Yar Nyunt St.\nDagon Tsp, Yangon'),
Package(

View File

@@ -306,8 +306,8 @@ class _HomePageState extends State<HomePage> {
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
_buildSmallButton(
"Policies", FontAwesomeIcons.fileContract),
// _buildSmallButton(
// "Policies", FontAwesomeIcons.fileContract),
_buildSmallButton("Support", SimpleLineIcons.support),
],
)

View File

@@ -1,5 +1,6 @@
import 'package:fcs/model/main_model.dart';
import 'package:fcs/model/pickup_model.dart';
import 'package:fcs/pages/util.dart';
import 'package:fcs/vo/package.dart';
import 'package:fcs/widget/localization/app_translations.dart';
import 'package:fcs/widget/progress.dart';
@@ -39,6 +40,8 @@ class _PackageEditorState extends State<PackageEditor> {
// _toTimeEditingController.text = _pickUp.toTime;
// _noOfPackageEditingController.text = _pickUp.numberOfPackage.toString();
// _weightEditingController.text = _pickUp.weight.toString();
} else {
_package = Package(rate: 0, weight: 0);
}
}
@@ -65,93 +68,162 @@ class _PackageEditorState extends State<PackageEditor> {
child: Column(
children: <Widget>[
Expanded(
child: Padding(
padding: const EdgeInsets.all(10.0),
child: ListView(children: <Widget>[
DropdownButtonFormField(
decoration: InputDecoration(
fillColor: Colors.white,
labelText: 'Shipment Number',
icon: Icon(Icons.pages)
// prefixIcon: Icon(Icons.play_arrow)
child: ListView(
children: [
widget.package == null
? Center(
child: Container(
padding: EdgeInsets.all(8),
child: Text("New Package")))
: Center(child: nameWidget(_package.packageNumber)),
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"]
.map((e) => DropdownMenuItem(child: Text(e), value: e))
.toList(),
onChanged: (map) => {},
),
TextFormField(
initialValue: "FCS383-283-1",
decoration: InputDecoration(
fillColor: Colors.white,
labelText: 'FCS_ID',
hintText: 'FCS_ID',
filled: true,
icon: Icon(
Icons.account_box,
Padding(
padding: const EdgeInsets.only(left: 20.0),
child: TextFormField(
initialValue: "FCS383-283-1",
decoration: InputDecoration(
fillColor: Colors.white,
labelText: 'FCS_ID',
hintText: 'FCS_ID',
filled: true,
icon: Icon(
Icons.account_box,
),
suffixIcon: IconButton(
icon: Icon(Icons.search),
onPressed: () {})),
),
),
suffixIcon: IconButton(
icon: Icon(Icons.search), onPressed: () {})),
),
DropdownButtonFormField(
decoration: InputDecoration(
fillColor: Colors.white,
labelText: 'Cargo Type',
icon: Icon(Icons.pages)
// prefixIcon: Icon(Icons.play_arrow)
Padding(
padding: const EdgeInsets.only(left: 20.0),
child: DropdownButtonFormField(
value: _package.packageType,
decoration: InputDecoration(
fillColor: Colors.white,
labelText: 'Cargo Type',
icon: Icon(Icons.pages)
// prefixIcon: Icon(Icons.play_arrow)
),
items: ["General", "Medicine", "Dangerous"]
.map((e) =>
DropdownMenuItem(child: Text(e), value: e))
.toList(),
onChanged: (map) => {},
),
),
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,
icon: Icon(
FontAwesomeIcons.weightHanging,
Padding(
padding: const EdgeInsets.only(left: 20.0),
child: TextFormField(
initialValue: _package.weight.toString(),
textAlign: TextAlign.end,
decoration: InputDecoration(
fillColor: Colors.white,
labelText: 'Weight',
filled: true,
icon: Icon(
FontAwesomeIcons.weightHanging,
),
)),
),
)),
TextFormField(
initialValue: "0",
textAlign: TextAlign.end,
decoration: InputDecoration(
fillColor: Colors.white,
labelText: 'Rate',
filled: true,
icon: Icon(
FontAwesomeIcons.tag,
Padding(
padding: const EdgeInsets.only(left: 20.0),
child: TextFormField(
initialValue: _package.rate.toString(),
textAlign: TextAlign.end,
decoration: InputDecoration(
fillColor: Colors.white,
labelText: 'Rate',
filled: true,
icon: Icon(
FontAwesomeIcons.tag,
),
)),
),
)),
TextFormField(
initialValue: "0",
textAlign: TextAlign.end,
decoration: InputDecoration(
fillColor: Colors.white,
labelText: 'Amount',
filled: true,
icon: Icon(
FontAwesomeIcons.moneyBill,
Padding(
padding: const EdgeInsets.only(left: 20.0),
child: TextFormField(
initialValue: _package.amount.toString(),
textAlign: TextAlign.end,
decoration: InputDecoration(
fillColor: Colors.white,
labelText: 'Amount',
filled: true,
icon: Icon(
FontAwesomeIcons.moneyBill,
),
)),
),
)),
TextFormField(
initialValue: "P0203",
decoration: InputDecoration(
fillColor: Colors.white,
labelText: 'Pickup ID',
filled: true,
icon: Icon(
Icons.account_box,
Padding(
padding: const EdgeInsets.only(left: 20.0),
child: TextFormField(
initialValue: "P0203",
decoration: InputDecoration(
fillColor: Colors.white,
labelText: 'Pickup ID',
filled: true,
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
? Align(
alignment: Alignment.bottomCenter,

View File

@@ -12,13 +12,14 @@ class Package {
int rate;
int weight;
int amount;
String packageType;
String pickUpID;
List<String> photos;
String remark;
DateTime arrivedDate;
int get amount => rate != null && weight != null ? rate * weight : 0;
String get packageNumber =>
shipmentNumber + "-" + receiverNumber + " #" + boxNumber;
double get price => rate.toDouble() * weight;
@@ -35,7 +36,6 @@ class Package {
this.boxNumber,
this.rate,
this.weight,
this.amount,
this.packageType,
this.pickUpID,
this.remark,