update shipment rate
This commit is contained in:
@@ -516,6 +516,10 @@
|
||||
|
||||
"rate.cal.title":"ESTIMATE SHIPPING COST",
|
||||
|
||||
"cargo.form.title":"CARGO",
|
||||
"cargo.type":"Cargo Type",
|
||||
"cargo.weight":"Weight",
|
||||
|
||||
"boxes.name":"Boxes",
|
||||
"boxes.title":"BOXES",
|
||||
"boxes.new":"New Box",
|
||||
|
||||
@@ -563,6 +563,10 @@
|
||||
|
||||
"rate.cal.title":"အဆင့်သတ်မှတ်ချက်များတွက်ချက်ရန်",
|
||||
|
||||
"cargo.form.title":"ကုန်ပစ္စည်းအမျိုးအစား",
|
||||
"cargo.type":"ကုန်ပစ္စည်းအမျိုးအစား",
|
||||
"cargo.weight":"အလေးချိန်",
|
||||
|
||||
"message.btn":"အသိပေးချက်များ",
|
||||
"message.title":"အသိပေးချက်များ",
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import 'dart:async';
|
||||
|
||||
import 'package:cloud_firestore/cloud_firestore.dart';
|
||||
import 'package:fcs/vo/cargo.dart';
|
||||
import 'package:fcs/vo/fcs_profile.dart';
|
||||
import 'package:fcs/vo/pickup.dart';
|
||||
import 'package:logging/logging.dart';
|
||||
@@ -33,7 +34,12 @@ class PickUpModel extends BaseModel {
|
||||
status: 'Pending',
|
||||
date: DateTime(2020, 5, 1),
|
||||
address: '154-19 64th Ave.\nFlushing, NY 11367',
|
||||
handlingFee: 5000),
|
||||
handlingFee: 5000,
|
||||
cargoTypes: [
|
||||
Cargo(type: 'General Cargo', weight: 25),
|
||||
Cargo(type: 'Medicine', weight: 20),
|
||||
Cargo(type: 'Dangerous Cargo', weight: 30)
|
||||
]),
|
||||
PickUp(
|
||||
id: "P200125 - 12 May 2020",
|
||||
userName: "Ko Kyaw Nyi",
|
||||
@@ -45,7 +51,12 @@ class PickUpModel extends BaseModel {
|
||||
status: 'Assigned',
|
||||
date: DateTime(2020, 5, 6),
|
||||
address: '154-19 64th Ave.\nFlushing, NY 11367',
|
||||
handlingFee: 5000),
|
||||
handlingFee: 5000,
|
||||
cargoTypes: [
|
||||
Cargo(type: 'General Cargo', weight: 25),
|
||||
Cargo(type: 'Medicine', weight: 20),
|
||||
Cargo(type: 'Dangerous Cargo', weight: 30)
|
||||
]),
|
||||
PickUp(
|
||||
id: "P200441 - 13 Apr 2020",
|
||||
userName: "Ko Kyaw Nyi",
|
||||
@@ -57,7 +68,12 @@ class PickUpModel extends BaseModel {
|
||||
status: "Pickuped",
|
||||
date: DateTime(2020, 5, 9),
|
||||
address: '154-19 64th Ave.\nFlushing, NY 11367',
|
||||
handlingFee: 5000),
|
||||
handlingFee: 5000,
|
||||
cargoTypes: [
|
||||
Cargo(type: 'General Cargo', weight: 25),
|
||||
Cargo(type: 'Medicine', weight: 20),
|
||||
Cargo(type: 'Dangerous Cargo', weight: 30)
|
||||
]),
|
||||
PickUp(
|
||||
id: "P200412 - 12 Apr 2020",
|
||||
userName: "Ko Kyaw Nyi",
|
||||
@@ -69,7 +85,12 @@ class PickUpModel extends BaseModel {
|
||||
status: 'Pickuped',
|
||||
date: DateTime(2020, 5, 15),
|
||||
address: '154-19 64th Ave.\nFlushing, NY 11367',
|
||||
handlingFee: 5000),
|
||||
handlingFee: 5000,
|
||||
cargoTypes: [
|
||||
Cargo(type: 'General Cargo', weight: 25),
|
||||
Cargo(type: 'Medicine', weight: 20),
|
||||
Cargo(type: 'Dangerous Cargo', weight: 30)
|
||||
]),
|
||||
PickUp(
|
||||
id: "P200125 - 12 May 2020",
|
||||
userName: "Ko Kyaw Nyi",
|
||||
@@ -81,7 +102,12 @@ class PickUpModel extends BaseModel {
|
||||
status: 'Pickuped',
|
||||
date: DateTime(2020, 5, 20),
|
||||
address: '154-19 64th Ave.\nFlushing, NY 11367',
|
||||
handlingFee: 5000),
|
||||
handlingFee: 5000,
|
||||
cargoTypes: [
|
||||
Cargo(type: 'General Cargo', weight: 25),
|
||||
Cargo(type: 'Medicine', weight: 20),
|
||||
Cargo(type: 'Dangerous Cargo', weight: 30)
|
||||
]),
|
||||
PickUp(
|
||||
id: "P200441 - 13 Apr 2020",
|
||||
userName: "Ko Kyaw Nyi",
|
||||
@@ -93,7 +119,12 @@ class PickUpModel extends BaseModel {
|
||||
status: "Pickuped",
|
||||
date: DateTime(2020, 5, 21),
|
||||
address: '154-19 64th Ave.\nFlushing, NY 11367',
|
||||
handlingFee: 5000),
|
||||
handlingFee: 5000,
|
||||
cargoTypes: [
|
||||
Cargo(type: 'General Cargo', weight: 25),
|
||||
Cargo(type: 'Medicine', weight: 20),
|
||||
Cargo(type: 'Dangerous Cargo', weight: 30)
|
||||
]),
|
||||
PickUp(
|
||||
id: "P200441 - 10 Apr 2020",
|
||||
userName: "Ko Kyaw Nyi",
|
||||
@@ -105,7 +136,12 @@ class PickUpModel extends BaseModel {
|
||||
status: "Canceled",
|
||||
date: DateTime(2020, 5, 25),
|
||||
address: '154-19 64th Ave.\nFlushing, NY 11367',
|
||||
handlingFee: 5000),
|
||||
handlingFee: 5000,
|
||||
cargoTypes: [
|
||||
Cargo(type: 'General Cargo', weight: 25),
|
||||
Cargo(type: 'Medicine', weight: 20),
|
||||
Cargo(type: 'Dangerous Cargo', weight: 30)
|
||||
]),
|
||||
PickUp(
|
||||
id: "P200441 - 6 Apr 2020",
|
||||
userName: "Ko Kyaw Nyi",
|
||||
@@ -117,7 +153,12 @@ class PickUpModel extends BaseModel {
|
||||
status: "Canceled",
|
||||
date: DateTime(2020, 5, 27),
|
||||
address: '154-19 64th Ave.\nFlushing, NY 11367',
|
||||
handlingFee: 5000),
|
||||
handlingFee: 5000,
|
||||
cargoTypes: [
|
||||
Cargo(type: 'General Cargo', weight: 25),
|
||||
Cargo(type: 'Medicine', weight: 20),
|
||||
Cargo(type: 'Dangerous Cargo', weight: 30)
|
||||
]),
|
||||
];
|
||||
|
||||
List<PickUp> get canceled {
|
||||
|
||||
@@ -77,14 +77,14 @@ class ShipmentModel extends BaseModel {
|
||||
|
||||
List<ShippingAddress> shippingAddresses = [
|
||||
ShippingAddress(
|
||||
fullName: 'FCS-0203-390-2',
|
||||
fullName: 'U Nyi Nyi',
|
||||
addressLine1: '154-19 64th Ave.',
|
||||
addressLine2: 'Flushing',
|
||||
city: 'NY',
|
||||
state: 'NY',
|
||||
phoneNumber: '+1 (292)215-2247'),
|
||||
ShippingAddress(
|
||||
fullName: 'FCS-0204-390-2',
|
||||
fullName: 'Mg Myo',
|
||||
addressLine1: '153-154 5th Thitsar.',
|
||||
addressLine2: 'Flushing',
|
||||
city: 'Yangon',
|
||||
|
||||
@@ -4,6 +4,7 @@ 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/cargo.dart';
|
||||
import 'package:fcs/vo/package.dart';
|
||||
import 'package:logging/logging.dart';
|
||||
|
||||
@@ -21,6 +22,7 @@ class BoxModel extends BaseModel {
|
||||
PackageModel.packages[1],
|
||||
PackageModel.packages[2]
|
||||
];
|
||||
|
||||
List<Box> boxes = [
|
||||
Box(
|
||||
shipmentNumber: "A202",
|
||||
@@ -29,13 +31,21 @@ class BoxModel extends BaseModel {
|
||||
boxNumber: "1",
|
||||
rate: 7,
|
||||
packageType: "General",
|
||||
weight: 25,
|
||||
weight: 75,
|
||||
status: "Packed",
|
||||
receiverAddress: '1 Bo Yar Nyunt St.\nDagon Tsp, Yangon',
|
||||
cargoDesc: "Clothes",
|
||||
arrivedDate: DateTime(2020, 6, 1),
|
||||
width: 10,
|
||||
height: 10,
|
||||
length: 10,
|
||||
packages: packages,
|
||||
statusHistory: statusHistory),
|
||||
statusHistory: statusHistory,
|
||||
cargoTypes: [
|
||||
Cargo(type: 'General Cargo', weight: 25),
|
||||
Cargo(type: 'Medicine', weight: 20),
|
||||
Cargo(type: 'Dangerous Cargo', weight: 30)
|
||||
]),
|
||||
Box(
|
||||
shipmentNumber: "A202",
|
||||
receiverNumber: "3",
|
||||
@@ -43,13 +53,21 @@ class BoxModel extends BaseModel {
|
||||
boxNumber: "2",
|
||||
rate: 7,
|
||||
packageType: "General",
|
||||
weight: 20,
|
||||
weight: 75,
|
||||
status: "Packed",
|
||||
cargoDesc: "Clothes",
|
||||
arrivedDate: DateTime(2020, 6, 1),
|
||||
width: 10,
|
||||
height: 10,
|
||||
length: 10,
|
||||
statusHistory: statusHistory,
|
||||
packages: packages,
|
||||
receiverAddress: '1 Bo Yar Nyunt St.\nDagon Tsp, Yangon'),
|
||||
receiverAddress: '1 Bo Yar Nyunt St.\nDagon Tsp, Yangon',
|
||||
cargoTypes: [
|
||||
Cargo(type: 'General Cargo', weight: 25),
|
||||
Cargo(type: 'Medicine', weight: 20),
|
||||
Cargo(type: 'Dangerous Cargo', weight: 30)
|
||||
]),
|
||||
Box(
|
||||
shipmentNumber: "A202",
|
||||
receiverNumber: "3",
|
||||
@@ -57,13 +75,21 @@ class BoxModel extends BaseModel {
|
||||
boxNumber: "3",
|
||||
rate: 7,
|
||||
packageType: "General",
|
||||
weight: 15,
|
||||
weight: 75,
|
||||
cargoDesc: "Shoes",
|
||||
status: "Packed",
|
||||
arrivedDate: DateTime(2020, 6, 1),
|
||||
width: 10,
|
||||
height: 10,
|
||||
length: 10,
|
||||
statusHistory: statusHistory,
|
||||
packages: packages,
|
||||
receiverAddress: '1 Bo Yar Nyunt St.\nDagon Tsp, Yangon'),
|
||||
receiverAddress: '1 Bo Yar Nyunt St.\nDagon Tsp, Yangon',
|
||||
cargoTypes: [
|
||||
Cargo(type: 'General Cargo', weight: 25),
|
||||
Cargo(type: 'Medicine', weight: 20),
|
||||
Cargo(type: 'Dangerous Cargo', weight: 30)
|
||||
]),
|
||||
Box(
|
||||
shipmentNumber: "A202",
|
||||
receiverNumber: "2",
|
||||
@@ -71,13 +97,21 @@ class BoxModel extends BaseModel {
|
||||
boxNumber: "1",
|
||||
rate: 8,
|
||||
packageType: "Medicine",
|
||||
weight: 15,
|
||||
weight: 75,
|
||||
status: "Packed",
|
||||
cargoDesc: "Dietary supplement",
|
||||
arrivedDate: DateTime(2020, 6, 1),
|
||||
width: 10,
|
||||
height: 10,
|
||||
length: 10,
|
||||
statusHistory: statusHistory,
|
||||
packages: packages,
|
||||
receiverAddress: '2 Shwe Taung Kyar St, Bahan Tsp, Yangon'),
|
||||
receiverAddress: '2 Shwe Taung Kyar St, Bahan Tsp, Yangon',
|
||||
cargoTypes: [
|
||||
Cargo(type: 'General Cargo', weight: 25),
|
||||
Cargo(type: 'Medicine', weight: 20),
|
||||
Cargo(type: 'Dangerous Cargo', weight: 30)
|
||||
]),
|
||||
Box(
|
||||
shipmentNumber: "A202",
|
||||
receiverNumber: "2",
|
||||
@@ -86,12 +120,20 @@ class BoxModel extends BaseModel {
|
||||
rate: 7,
|
||||
packageType: "General",
|
||||
cargoDesc: "Handbags",
|
||||
weight: 55,
|
||||
weight: 75,
|
||||
status: "Shipped",
|
||||
arrivedDate: DateTime(2020, 6, 1),
|
||||
width: 10,
|
||||
height: 10,
|
||||
length: 10,
|
||||
statusHistory: statusHistory,
|
||||
packages: packages,
|
||||
receiverAddress: '2 Shwe Taung Kyar St, Bahan Tsp, Yangon'),
|
||||
receiverAddress: '2 Shwe Taung Kyar St, Bahan Tsp, Yangon',
|
||||
cargoTypes: [
|
||||
Cargo(type: 'General Cargo', weight: 25),
|
||||
Cargo(type: 'Medicine', weight: 20),
|
||||
Cargo(type: 'Dangerous Cargo', weight: 30)
|
||||
]),
|
||||
Box(
|
||||
shipmentNumber: "A201",
|
||||
receiverNumber: "1",
|
||||
@@ -100,12 +142,20 @@ class BoxModel extends BaseModel {
|
||||
rate: 9,
|
||||
packageType: "Dangerous",
|
||||
cargoDesc: "Phones and Scooters",
|
||||
weight: 25,
|
||||
weight: 75,
|
||||
status: "Delivered",
|
||||
arrivedDate: DateTime(2020, 5, 21),
|
||||
width: 10,
|
||||
height: 10,
|
||||
length: 10,
|
||||
statusHistory: statusHistory,
|
||||
packages: packages,
|
||||
receiverAddress: '3 Kambzwza St, Bahan Tsp, Yangon'),
|
||||
receiverAddress: '3 Kambzwza St, Bahan Tsp, Yangon',
|
||||
cargoTypes: [
|
||||
Cargo(type: 'General Cargo', weight: 25),
|
||||
Cargo(type: 'Medicine', weight: 20),
|
||||
Cargo(type: 'Dangerous Cargo', weight: 30)
|
||||
]),
|
||||
Box(
|
||||
shipmentNumber: "A201",
|
||||
receiverNumber: "1",
|
||||
@@ -114,12 +164,20 @@ class BoxModel extends BaseModel {
|
||||
rate: 7,
|
||||
packageType: "General",
|
||||
cargoDesc: "Construction tools",
|
||||
weight: 5,
|
||||
weight: 75,
|
||||
status: "Delivered",
|
||||
arrivedDate: DateTime(2020, 5, 21),
|
||||
width: 10,
|
||||
height: 10,
|
||||
length: 10,
|
||||
statusHistory: statusHistory,
|
||||
packages: packages,
|
||||
receiverAddress: '3 Kambzwza St, Bahan Tsp, Yangon'),
|
||||
receiverAddress: '3 Kambzwza St, Bahan Tsp, Yangon',
|
||||
cargoTypes: [
|
||||
Cargo(type: 'General Cargo', weight: 25),
|
||||
Cargo(type: 'Medicine', weight: 20),
|
||||
Cargo(type: 'Dangerous Cargo', weight: 30)
|
||||
]),
|
||||
];
|
||||
|
||||
List<Box> get completed {
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import 'package:fcs/model/main_model.dart';
|
||||
import 'package:fcs/model/pickup_model.dart';
|
||||
import 'package:fcs/pages/util.dart';
|
||||
import 'package:fcs/vo/cargo.dart';
|
||||
import 'package:fcs/vo/pickup.dart';
|
||||
import 'package:fcs/widget/fcs_text_field.dart';
|
||||
import 'package:fcs/widget/fcs_text_field_readonly.dart';
|
||||
@@ -70,6 +71,12 @@ class _PickUpEditorState extends State<PickUpEditor> {
|
||||
mainModel.recipient.shippingAddress;
|
||||
} else {
|
||||
isNew = true;
|
||||
List<Cargo> _cargoTypes = [
|
||||
Cargo(type: 'General Cargo', weight: 25),
|
||||
Cargo(type: 'Medicine', weight: 20),
|
||||
Cargo(type: 'Dangerous Cargo', weight: 30)
|
||||
];
|
||||
_pickUp = PickUp(cargoTypes: _cargoTypes);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -319,50 +326,56 @@ class _PickUpEditorState extends State<PickUpEditor> {
|
||||
],
|
||||
),
|
||||
// ExpansionTile(
|
||||
// title: Text('Recipient Information'),
|
||||
// title: Text('Box Information'),
|
||||
// children: <Widget>[
|
||||
// Padding(
|
||||
// padding: const EdgeInsets.only(left: 20.0),
|
||||
// child: widget.pickUp == null
|
||||
// ? fcsInput("Name", FontAwesomeIcons.user,
|
||||
// controller: _recipientNameEditingController)
|
||||
// : widget.pickUp.status == 'Pending'
|
||||
// ? fcsInput("Name", FontAwesomeIcons.user,
|
||||
// controller:
|
||||
// _recipientNameEditingController)
|
||||
// : fcsInputReadOnly(
|
||||
// "Name", FontAwesomeIcons.user,
|
||||
// controller:
|
||||
// _recipientNameEditingController)),
|
||||
// Padding(
|
||||
// padding: const EdgeInsets.only(left: 20.0),
|
||||
// child: widget.pickUp == null
|
||||
// ? fcsInput("Phone Number", Icons.phone,
|
||||
// controller: _recipientPhoneEditingController)
|
||||
// : widget.pickUp.status == 'Pending'
|
||||
// ? fcsInput("Phone Number", Icons.phone,
|
||||
// controller:
|
||||
// _recipientPhoneEditingController)
|
||||
// : fcsInputReadOnly(
|
||||
// "Phone Number", Icons.phone,
|
||||
// controller:
|
||||
// _recipientPhoneEditingController)),
|
||||
// Padding(
|
||||
// padding: const EdgeInsets.only(left: 20.0),
|
||||
// child: widget.pickUp == null
|
||||
// ? fcsInput("Address", Icons.location_on,
|
||||
// controller:
|
||||
// _recipientAddressEditingController)
|
||||
// : widget.pickUp.status == 'Pending'
|
||||
// ? fcsInput("Address", Icons.location_on,
|
||||
// controller:
|
||||
// _recipientAddressEditingController)
|
||||
// : fcsInputReadOnly(
|
||||
// "Address", Icons.location_on,
|
||||
// controller:
|
||||
// _recipientAddressEditingController)),
|
||||
// SizedBox(height: 10.0),
|
||||
// ],
|
||||
// ),
|
||||
ExpansionTile(
|
||||
title: Text('Shipping Address'),
|
||||
children: <Widget>[
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(left: 20.0),
|
||||
child: widget.pickUp == null
|
||||
? fcsInput("Name", FontAwesomeIcons.user,
|
||||
controller: _recipientNameEditingController)
|
||||
: widget.pickUp.status == 'Pending'
|
||||
? fcsInput("Name", FontAwesomeIcons.user,
|
||||
controller:
|
||||
_recipientNameEditingController)
|
||||
: fcsInputReadOnly(
|
||||
"Name", FontAwesomeIcons.user,
|
||||
controller:
|
||||
_recipientNameEditingController)),
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(left: 20.0),
|
||||
child: widget.pickUp == null
|
||||
? fcsInput("Phone Number", Icons.phone,
|
||||
controller: _recipientPhoneEditingController)
|
||||
: widget.pickUp.status == 'Pending'
|
||||
? fcsInput("Phone Number", Icons.phone,
|
||||
controller:
|
||||
_recipientPhoneEditingController)
|
||||
: fcsInputReadOnly(
|
||||
"Phone Number", Icons.phone,
|
||||
controller:
|
||||
_recipientPhoneEditingController)),
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(left: 20.0),
|
||||
child: widget.pickUp == null
|
||||
? fcsInput("Address", Icons.location_on,
|
||||
controller:
|
||||
_recipientAddressEditingController)
|
||||
: widget.pickUp.status == 'Pending'
|
||||
? fcsInput("Address", Icons.location_on,
|
||||
controller:
|
||||
_recipientAddressEditingController)
|
||||
: fcsInputReadOnly(
|
||||
"Address", Icons.location_on,
|
||||
controller:
|
||||
_recipientAddressEditingController)),
|
||||
],
|
||||
),
|
||||
mainModel.isCustomer()
|
||||
? Container()
|
||||
: ExpansionTile(
|
||||
@@ -421,7 +434,21 @@ class _PickUpEditorState extends State<PickUpEditor> {
|
||||
child: Container(
|
||||
width: 250,
|
||||
child: FlatButton(
|
||||
child: Text('Update'),
|
||||
child: Text('Assign'),
|
||||
color: primaryColor,
|
||||
textColor: Colors.white,
|
||||
onPressed: () {
|
||||
Navigator.pop(context);
|
||||
},
|
||||
),
|
||||
))),
|
||||
Align(
|
||||
alignment: Alignment.bottomCenter,
|
||||
child: Center(
|
||||
child: Container(
|
||||
width: 250,
|
||||
child: FlatButton(
|
||||
child: Text('Complete Pickup '),
|
||||
color: primaryColor,
|
||||
textColor: Colors.white,
|
||||
onPressed: () {
|
||||
|
||||
@@ -4,6 +4,7 @@ import 'package:fcs/widget/bottom_up_page_route.dart';
|
||||
import 'package:fcs/widget/local_text.dart';
|
||||
import 'package:fcs/widget/my_data_table.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_icons/flutter_icons.dart';
|
||||
import 'package:package_info/package_info.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import 'package:fcs/model/language_model.dart';
|
||||
@@ -214,7 +215,9 @@ class _ProfileState extends State<Profile> {
|
||||
),
|
||||
));
|
||||
|
||||
final logoutbutton = Padding(
|
||||
final logoutbutton = Container(
|
||||
padding: EdgeInsets.only( left: 20.0, right: 24.0),
|
||||
child: Padding(
|
||||
padding: EdgeInsets.symmetric(vertical: 10.0),
|
||||
child: Card(
|
||||
elevation: 23,
|
||||
@@ -242,7 +245,8 @@ class _ProfileState extends State<Profile> {
|
||||
});
|
||||
});
|
||||
},
|
||||
label: Text(AppTranslations.of(context).text("profile.logout"),
|
||||
label: Text(
|
||||
AppTranslations.of(context).text("profile.logout"),
|
||||
style: languageModel.isEng
|
||||
? TextStyle(
|
||||
fontSize: 16.0,
|
||||
@@ -259,7 +263,7 @@ class _ProfileState extends State<Profile> {
|
||||
),
|
||||
),
|
||||
),
|
||||
));
|
||||
)));
|
||||
return LocalProgress(
|
||||
inAsyncCall: _isLoading,
|
||||
child: Scaffold(
|
||||
@@ -270,7 +274,10 @@ class _ProfileState extends State<Profile> {
|
||||
backgroundColor: primaryColor,
|
||||
actions: <Widget>[],
|
||||
),
|
||||
body: ListView(
|
||||
body: Column(
|
||||
children: <Widget>[
|
||||
Expanded(
|
||||
child: ListView(
|
||||
// padding: EdgeInsets.only(left: 25.0, right: 25.0),
|
||||
shrinkWrap: true,
|
||||
children: <Widget>[
|
||||
@@ -287,15 +294,17 @@ class _ProfileState extends State<Profile> {
|
||||
phonenumberbox,
|
||||
mainModel.user == null
|
||||
? Container()
|
||||
: mainModel.user.email == null || mainModel.user.email == ''
|
||||
: mainModel.user.email == null ||
|
||||
mainModel.user.email == ''
|
||||
? Container()
|
||||
: emailBox,
|
||||
languageBox,
|
||||
getShippingAddressList(context),
|
||||
SizedBox(
|
||||
height: 50,
|
||||
],
|
||||
),
|
||||
),
|
||||
logoutbutton,
|
||||
SizedBox(height: 25)
|
||||
],
|
||||
),
|
||||
),
|
||||
@@ -313,41 +322,8 @@ class _ProfileState extends State<Profile> {
|
||||
fontWeight: FontWeight.bold, fontStyle: FontStyle.normal),
|
||||
),
|
||||
children: <Widget>[
|
||||
Container(
|
||||
child: SingleChildScrollView(
|
||||
scrollDirection: Axis.horizontal,
|
||||
child: MyDataTable(
|
||||
headingRowHeight: 40,
|
||||
columnSpacing: 50,
|
||||
columns: [
|
||||
MyDataColumn(
|
||||
label: Text(
|
||||
"Full Name",
|
||||
style: TextStyle(
|
||||
fontSize: 15,
|
||||
color: Colors.grey[600],
|
||||
),
|
||||
)),
|
||||
MyDataColumn(
|
||||
label: Text(
|
||||
"Phone Number",
|
||||
style: TextStyle(
|
||||
fontSize: 15,
|
||||
color: Colors.grey[600],
|
||||
),
|
||||
)),
|
||||
MyDataColumn(
|
||||
label: Text(
|
||||
"Delete",
|
||||
style: TextStyle(
|
||||
fontSize: 15,
|
||||
color: Colors.grey[600],
|
||||
),
|
||||
)),
|
||||
],
|
||||
rows: getAddressRows(shipmentModel.shippingAddresses),
|
||||
),
|
||||
),
|
||||
Column(
|
||||
children: getAddressList(context, shipmentModel.shippingAddresses),
|
||||
),
|
||||
Container(
|
||||
padding: EdgeInsets.only(top: 20, bottom: 15, right: 15),
|
||||
@@ -378,30 +354,75 @@ class _ProfileState extends State<Profile> {
|
||||
);
|
||||
}
|
||||
|
||||
List<MyDataRow> getAddressRows(List<ShippingAddress> addresses) {
|
||||
return addresses.map((s) {
|
||||
return MyDataRow(
|
||||
onSelectChanged: (selected) {
|
||||
List<Widget> getAddressList(
|
||||
BuildContext context, List<ShippingAddress> addresses) {
|
||||
return addresses.asMap().entries.map((s) {
|
||||
return Container(
|
||||
padding: EdgeInsets.only(left: 10, right: 10),
|
||||
child: InkWell(
|
||||
onTap: () {
|
||||
Navigator.push(
|
||||
context,
|
||||
BottomUpPageRoute(ShippingAddressEditor(shippingAddress: s)),
|
||||
BottomUpPageRoute(
|
||||
ShippingAddressEditor(shippingAddress: s.value)),
|
||||
);
|
||||
},
|
||||
cells: [
|
||||
MyDataCell(
|
||||
new Text(
|
||||
s.fullName,
|
||||
style: textStyle,
|
||||
child: Column(
|
||||
children: <Widget>[
|
||||
Row(
|
||||
children: <Widget>[
|
||||
Expanded(
|
||||
child: new Padding(
|
||||
padding: const EdgeInsets.symmetric(vertical: 10.0),
|
||||
child: Row(
|
||||
children: <Widget>[
|
||||
Padding(
|
||||
padding: EdgeInsets.all(5.0),
|
||||
child: Icon(
|
||||
SimpleLineIcons.location_pin,
|
||||
color: primaryColor,
|
||||
)),
|
||||
new Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: <Widget>[
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(left: 8.0),
|
||||
child: new Text(
|
||||
s.value.fullName == null
|
||||
? ''
|
||||
: s.value.fullName,
|
||||
style: new TextStyle(
|
||||
fontSize: 15.0, color: Colors.black),
|
||||
),
|
||||
),
|
||||
MyDataCell(
|
||||
new Text(
|
||||
s.phoneNumber,
|
||||
style: textStyle,
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(left: 8.0),
|
||||
child: new Text(
|
||||
s.value.phoneNumber == null
|
||||
? ''
|
||||
: s.value.phoneNumber,
|
||||
style: new TextStyle(
|
||||
fontSize: 14.0, color: Colors.grey),
|
||||
),
|
||||
),
|
||||
MyDataCell(IconButton(icon: Icon(Icons.delete), onPressed: null)),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
IconButton(
|
||||
padding: EdgeInsets.only(right: 30),
|
||||
icon: Icon(Icons.delete, color: Colors.black45),
|
||||
onPressed: null)
|
||||
],
|
||||
),
|
||||
s.key == addresses.length - 1
|
||||
? Container()
|
||||
: Divider(color: Colors.black)
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}).toList();
|
||||
}
|
||||
|
||||
@@ -157,6 +157,24 @@ class _ShipmentEditorState extends State<ShipmentEditor> {
|
||||
var shipmentModel = Provider.of<ShipmentModel>(context);
|
||||
MainModel mainModel = Provider.of<MainModel>(context);
|
||||
|
||||
final cargoBtn = Container(
|
||||
padding: EdgeInsets.only(top: 5),
|
||||
child: Align(
|
||||
alignment: Alignment.bottomCenter,
|
||||
child: Center(
|
||||
child: Container(
|
||||
width: 250,
|
||||
child: FlatButton(
|
||||
child: Text('Download Cargo Manifest'),
|
||||
color: primaryColor,
|
||||
textColor: Colors.white,
|
||||
onPressed: () {
|
||||
Navigator.pop(context);
|
||||
},
|
||||
),
|
||||
))),
|
||||
);
|
||||
|
||||
final commercialBtn = Container(
|
||||
padding: EdgeInsets.only(top: 20),
|
||||
child: Align(
|
||||
@@ -296,7 +314,7 @@ class _ShipmentEditorState extends State<ShipmentEditor> {
|
||||
Container(
|
||||
padding:
|
||||
EdgeInsets.only(top: widget.shipment == null ? 5 : 0),
|
||||
child: fcsInput('Arrival Date', Icons.date_range,
|
||||
child: fcsInput('ETA', Icons.date_range,
|
||||
controller: _arrivalDateController),
|
||||
),
|
||||
Container(
|
||||
@@ -378,6 +396,7 @@ class _ShipmentEditorState extends State<ShipmentEditor> {
|
||||
widget.shipment == null ? Container() : commercialBtn,
|
||||
widget.shipment == null ? Container() : packingBtn,
|
||||
widget.shipment == null ? Container() : dmsBtn,
|
||||
widget.shipment == null ? Container() : cargoBtn,
|
||||
widget.shipment == null ? createBtn : updateBtn,
|
||||
SizedBox(height: 15)
|
||||
]),
|
||||
|
||||
@@ -105,6 +105,7 @@ class _ShipmentRatesState extends State<ShipmentRates> {
|
||||
_row("Free delivery within Yangon \nfor shipments over", "10",
|
||||
"pounds"),
|
||||
_row("Delivery fees", "\$ 5", "below 10 pounds"),
|
||||
_row("Volumetric Ratio", "\$ 166.36", "per pound"),
|
||||
fcsButton(context, "Terms & Conditions", callack: () {
|
||||
Navigator.of(context)
|
||||
.push(MaterialPageRoute(builder: (_) => Term()));
|
||||
|
||||
@@ -1,7 +1,4 @@
|
||||
import 'package:fcs/model/pickup_model.dart';
|
||||
import 'package:fcs/model/shipment_rate_model.dart';
|
||||
import 'package:fcs/pages/shipment_rates_calculate.dart';
|
||||
import 'package:fcs/pages/shipment_rates_edit.dart';
|
||||
import 'package:fcs/vo/pickup.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import 'package:fcs/widget/localization/app_translations.dart';
|
||||
@@ -10,7 +7,6 @@ import 'package:flutter/material.dart';
|
||||
import 'package:fcs/widget/progress.dart';
|
||||
|
||||
import '../theme/theme.dart';
|
||||
import 'util.dart';
|
||||
|
||||
class ShipmentRatesCal extends StatefulWidget {
|
||||
final PickUp pickUp;
|
||||
@@ -31,6 +27,7 @@ class _ShipmentRatesCalState extends State<ShipmentRatesCal> {
|
||||
|
||||
PickUp _pickUp;
|
||||
bool _isLoading = false;
|
||||
String cargoType;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
@@ -53,6 +50,7 @@ class _ShipmentRatesCalState extends State<ShipmentRatesCal> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
var shipmentRateModel = Provider.of<ShipmentRateModel>(context);
|
||||
|
||||
return LocalProgress(
|
||||
inAsyncCall: _isLoading,
|
||||
child: Scaffold(
|
||||
@@ -70,33 +68,74 @@ class _ShipmentRatesCalState extends State<ShipmentRatesCal> {
|
||||
body: Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: ListView(
|
||||
// crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: <Widget>[
|
||||
Container(
|
||||
height: 185,
|
||||
child: ListView.builder(
|
||||
itemCount: shipmentRateModel.rates.length,
|
||||
itemBuilder: (context, index) {
|
||||
return _row(
|
||||
shipmentRateModel.rates[index].description +
|
||||
"\n\$ " +
|
||||
shipmentRateModel.rates[index].price.toString() +
|
||||
" per pound",
|
||||
'',
|
||||
"",
|
||||
input: true);
|
||||
}),
|
||||
padding: EdgeInsets.only(top: 5, left: 25),
|
||||
child: Row(
|
||||
children: <Widget>[
|
||||
Expanded(
|
||||
child:
|
||||
Text('Cargo Type', style: TextStyle(fontSize: 15))),
|
||||
Container(
|
||||
width: 150.0,
|
||||
child: DropdownButtonFormField(
|
||||
decoration: InputDecoration(
|
||||
fillColor: Colors.white,
|
||||
hintText: shipmentRateModel.rates[0].description,
|
||||
hintStyle: TextStyle(color: Colors.black87)),
|
||||
items: shipmentRateModel.rates
|
||||
.map((e) => DropdownMenuItem(
|
||||
child: Text(e.description),
|
||||
value: e.description))
|
||||
.toList(),
|
||||
onChanged: (selected) => {
|
||||
setState(() {
|
||||
cargoType = selected;
|
||||
})
|
||||
},
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
_row('Width (inches)', "", "", "10", input: true),
|
||||
_row('Height', "", "", "10", input: true),
|
||||
_row('Length', "", "", "10", input: true),
|
||||
Container(
|
||||
padding: EdgeInsets.only(left: 25, top: 15, bottom: 5),
|
||||
child: Row(
|
||||
children: <Widget>[
|
||||
Text('Shipment Weight', style: TextStyle(fontSize: 15)),
|
||||
Spacer(),
|
||||
Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.end,
|
||||
children: <Widget>[
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(bottom: 3.0),
|
||||
child: Text(
|
||||
'6',
|
||||
style:
|
||||
TextStyle(color: primaryColor, fontSize: 16),
|
||||
),
|
||||
),
|
||||
Text(
|
||||
'pounds',
|
||||
style: TextStyle(color: Colors.grey, fontSize: 16),
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
)),
|
||||
SizedBox(height: 50),
|
||||
Center(
|
||||
child: Text(
|
||||
"Delivery fee:\$ 0",
|
||||
"Delivery fee:\$ 5",
|
||||
style: TextStyle(color: primaryColor, fontSize: 16),
|
||||
)),
|
||||
SizedBox(height: 20),
|
||||
Center(
|
||||
child: Text(
|
||||
"Total estimated amount:\$ 95",
|
||||
"Total estimated amount:\$ 41",
|
||||
style: TextStyle(color: primaryColor, fontSize: 20),
|
||||
))
|
||||
],
|
||||
@@ -106,7 +145,7 @@ class _ShipmentRatesCalState extends State<ShipmentRatesCal> {
|
||||
);
|
||||
}
|
||||
|
||||
_row(String desc, String price, String unit, {bool input}) {
|
||||
_row(String desc, String price, String unit, String value, {bool input}) {
|
||||
return Container(
|
||||
padding: EdgeInsets.only(left: 25, top: 5, bottom: 5),
|
||||
child: Row(
|
||||
@@ -134,8 +173,9 @@ class _ShipmentRatesCalState extends State<ShipmentRatesCal> {
|
||||
width: 50,
|
||||
),
|
||||
Container(
|
||||
width: 70,
|
||||
child: TextField(
|
||||
width: 150,
|
||||
child: TextFormField(
|
||||
initialValue: value,
|
||||
textAlign: TextAlign.end,
|
||||
)),
|
||||
],
|
||||
|
||||
@@ -1,6 +1,11 @@
|
||||
import 'package:fcs/model/pickup_model.dart';
|
||||
import 'package:fcs/model/shipment_rate_model.dart';
|
||||
import 'package:fcs/pages_fcs/cargo_editor.dart';
|
||||
import 'package:fcs/vo/pickup.dart';
|
||||
import 'package:fcs/vo/rate.dart';
|
||||
import 'package:fcs/widget/bottom_up_page_route.dart';
|
||||
import 'package:fcs/widget/local_text.dart';
|
||||
import 'package:fcs/widget/my_data_table.dart';
|
||||
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import 'package:fcs/widget/localization/app_translations.dart';
|
||||
@@ -69,26 +74,88 @@ class _ShipmentRatesEditState extends State<ShipmentRatesEdit> {
|
||||
),
|
||||
body: Container(
|
||||
padding: EdgeInsets.all(18),
|
||||
child: Column(
|
||||
children: <Widget>[
|
||||
Expanded(
|
||||
child: ListView(
|
||||
children: <Widget>[
|
||||
Container(
|
||||
height: 190,
|
||||
child: ListView.builder(
|
||||
itemCount: shipmentRateModel.rates.length,
|
||||
itemBuilder: (context, index) {
|
||||
return fcsInput(
|
||||
shipmentRateModel.rates[index].description,
|
||||
Icons.attach_money,
|
||||
value:
|
||||
shipmentRateModel.rates[index].price.toString());
|
||||
}),
|
||||
),
|
||||
fcsInput("Min Weight for Free delivery within Yangon",
|
||||
FontAwesomeIcons.weightHanging,
|
||||
value: "10"),
|
||||
fcsInput("Delivery fees", Icons.attach_money, value: "5"),
|
||||
SizedBox(height: 10),
|
||||
fcsButton(context, "Save", callack: () {}),
|
||||
fcsInput("Volumetric Ratio", Icons.attach_money,
|
||||
value: "166.36"),
|
||||
SizedBox(height: 10),
|
||||
ExpansionTile(
|
||||
title: Text(
|
||||
'Cargo Types',
|
||||
style: TextStyle(
|
||||
color: primaryColor, fontWeight: FontWeight.bold),
|
||||
),
|
||||
children: <Widget>[
|
||||
Container(
|
||||
child: SingleChildScrollView(
|
||||
scrollDirection: Axis.horizontal,
|
||||
child: MyDataTable(
|
||||
headingRowHeight: 40,
|
||||
columnSpacing: 50,
|
||||
columns: [
|
||||
MyDataColumn(
|
||||
label: Text("Cargo Type",
|
||||
style: TextStyle(
|
||||
fontSize: 15,
|
||||
color: Colors.grey[600]))),
|
||||
MyDataColumn(
|
||||
label: Text("Rate",
|
||||
style: TextStyle(
|
||||
fontSize: 15,
|
||||
color: Colors.grey[600]))),
|
||||
MyDataColumn(
|
||||
label: Text("Delete",
|
||||
style: TextStyle(
|
||||
fontSize: 15,
|
||||
color: Colors.grey[600]))),
|
||||
],
|
||||
rows: getCargoRows(shipmentRateModel.rates),
|
||||
),
|
||||
),
|
||||
),
|
||||
Container(
|
||||
padding:
|
||||
EdgeInsets.only(top: 20, bottom: 15, right: 15),
|
||||
child: Align(
|
||||
alignment: Alignment.bottomRight,
|
||||
child: Container(
|
||||
width: 120,
|
||||
height: 40,
|
||||
child: FloatingActionButton.extended(
|
||||
materialTapTargetSize:
|
||||
MaterialTapTargetSize.shrinkWrap,
|
||||
icon: Icon(Icons.add),
|
||||
onPressed: () {
|
||||
Navigator.push(
|
||||
context,
|
||||
BottomUpPageRoute(CargoEditor()),
|
||||
);
|
||||
},
|
||||
label: Text(
|
||||
'Add Cargo',
|
||||
style: TextStyle(fontSize: 12),
|
||||
),
|
||||
backgroundColor: primaryColor,
|
||||
),
|
||||
),
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
fcsButton(context, "Save", callack: () {
|
||||
Navigator.pop(context);
|
||||
}),
|
||||
SizedBox(height: 10)
|
||||
],
|
||||
),
|
||||
@@ -97,6 +164,34 @@ class _ShipmentRatesEditState extends State<ShipmentRatesEdit> {
|
||||
);
|
||||
}
|
||||
|
||||
List<MyDataRow> getCargoRows(List<Rate> rates) {
|
||||
return rates.map((r) {
|
||||
return MyDataRow(
|
||||
onSelectChanged: (selected) {
|
||||
Navigator.push(
|
||||
context,
|
||||
BottomUpPageRoute(CargoEditor(rate: r)),
|
||||
);
|
||||
},
|
||||
cells: [
|
||||
MyDataCell(
|
||||
new Text(
|
||||
r.description,
|
||||
style: textStyle,
|
||||
),
|
||||
),
|
||||
MyDataCell(
|
||||
new Text(
|
||||
r.price.toString(),
|
||||
style: textStyle,
|
||||
),
|
||||
),
|
||||
MyDataCell(IconButton(icon: Icon(Icons.delete), onPressed: null)),
|
||||
],
|
||||
);
|
||||
}).toList();
|
||||
}
|
||||
|
||||
_row(String desc, String price, String unit) {
|
||||
return Container(
|
||||
padding: EdgeInsets.only(left: 25, top: 5, bottom: 5),
|
||||
|
||||
@@ -85,7 +85,7 @@ class _ShippingAddressEditorState extends State<ShippingAddressEditor> {
|
||||
children: <Widget>[
|
||||
Expanded(
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.only(left: 20.0),
|
||||
padding: const EdgeInsets.only(left: 10.0,right: 10),
|
||||
child: ListView(children: <Widget>[
|
||||
usaAddress,
|
||||
SizedBox(height: 10),
|
||||
|
||||
@@ -50,8 +50,12 @@ class _SplashScreenState extends State<SplashScreen> {
|
||||
|
||||
if (_loaded) {
|
||||
timer.cancel();
|
||||
|
||||
if (this._isLogin) {
|
||||
Navigator.of(context).pushReplacementNamed('/homeLogin');
|
||||
} else {
|
||||
Navigator.of(context).pushReplacementNamed('/home');
|
||||
}
|
||||
|
||||
// if (_isSupport) {
|
||||
// if (_isLogin) {
|
||||
// if (!_isAgree) {
|
||||
|
||||
@@ -3,6 +3,7 @@ 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/cargo.dart';
|
||||
import 'package:fcs/vo/package.dart';
|
||||
import 'package:fcs/widget/bottom_up_page_route.dart';
|
||||
import 'package:fcs/widget/local_text.dart';
|
||||
@@ -45,6 +46,8 @@ class _BoxEditorState extends State<BoxEditor> {
|
||||
];
|
||||
bool isNew;
|
||||
|
||||
bool isMixBox = false;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
@@ -63,8 +66,22 @@ class _BoxEditorState extends State<BoxEditor> {
|
||||
PackageModel.packages[2]
|
||||
];
|
||||
|
||||
List<Cargo> _cargoTypes = [
|
||||
Cargo(type: 'General Cargo', weight: 25),
|
||||
Cargo(type: 'Medicine', weight: 20),
|
||||
Cargo(type: 'Dangerous Cargo', weight: 30)
|
||||
];
|
||||
|
||||
isNew = true;
|
||||
_box = Box(rate: 0, weight: 0, packages: packages);
|
||||
_box = Box(
|
||||
rate: 0,
|
||||
weight: 75,
|
||||
width: 0,
|
||||
height: 0,
|
||||
length: 0,
|
||||
packages: packages,
|
||||
cargoTypes: _cargoTypes,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -166,6 +183,33 @@ class _BoxEditorState extends State<BoxEditor> {
|
||||
onChanged: (map) => {},
|
||||
),
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(left: 8.0, right: 20),
|
||||
child: new Row(
|
||||
children: <Widget>[
|
||||
new Checkbox(
|
||||
value: isMixBox,
|
||||
activeColor: primaryColor,
|
||||
onChanged: (bool value) {
|
||||
setState(() {
|
||||
isMixBox = value;
|
||||
});
|
||||
}),
|
||||
SizedBox(
|
||||
width: 5,
|
||||
),
|
||||
Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: <Widget>[
|
||||
new Text(
|
||||
"Mix Box",
|
||||
style: TextStyle(fontSize: 15.0),
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(left: 20.0, right: 20),
|
||||
child: TextFormField(
|
||||
@@ -208,21 +252,21 @@ class _BoxEditorState extends State<BoxEditor> {
|
||||
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: 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(
|
||||
@@ -236,66 +280,60 @@ class _BoxEditorState extends State<BoxEditor> {
|
||||
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),
|
||||
)),
|
||||
),
|
||||
// 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,
|
||||
columnSpacing: 120,
|
||||
columns: [
|
||||
MyDataColumn(
|
||||
label: LocalText(
|
||||
context,
|
||||
"box.package.id",
|
||||
"cargo.type",
|
||||
color: Colors.grey,
|
||||
),
|
||||
),
|
||||
MyDataColumn(
|
||||
label: LocalText(
|
||||
context,
|
||||
"box.package.desc",
|
||||
color: Colors.grey,
|
||||
),
|
||||
),
|
||||
MyDataColumn(
|
||||
label: LocalText(
|
||||
context,
|
||||
"box.package.market",
|
||||
"cargo.weight",
|
||||
color: Colors.grey,
|
||||
),
|
||||
),
|
||||
],
|
||||
rows: getPackageRow(context),
|
||||
rows: getCargoRows(context),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
mainModel.isOwner()
|
||||
? Container(
|
||||
padding: EdgeInsets.only(top: 20),
|
||||
@@ -303,12 +341,11 @@ class _BoxEditorState extends State<BoxEditor> {
|
||||
alignment: Alignment.bottomRight,
|
||||
child: FloatingActionButton.extended(
|
||||
icon: Icon(Icons.add),
|
||||
label: Text(AppTranslations.of(context)
|
||||
.text("box.add_package")),
|
||||
label: Text("Add Cargo"),
|
||||
backgroundColor: primaryColor,
|
||||
onPressed: () {
|
||||
Navigator.of(context).push(
|
||||
BottomUpPageRoute(PackageAddition()));
|
||||
// Navigator.of(context).push(
|
||||
// BottomUpPageRoute(PackageAddition()));
|
||||
},
|
||||
),
|
||||
),
|
||||
@@ -317,6 +354,55 @@ class _BoxEditorState extends State<BoxEditor> {
|
||||
SizedBox(height: 25),
|
||||
],
|
||||
),
|
||||
ExpansionTile(
|
||||
title: Text(
|
||||
'Box Dimension',
|
||||
style: TextStyle(
|
||||
color: primaryColor, fontWeight: FontWeight.bold),
|
||||
),
|
||||
children: [
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(left: 20.0, right: 20),
|
||||
child: TextFormField(
|
||||
initialValue: _box.width.toString(),
|
||||
textAlign: TextAlign.end,
|
||||
decoration: InputDecoration(
|
||||
fillColor: Colors.white,
|
||||
labelText: 'Width',
|
||||
filled: true,
|
||||
icon: Icon(FontAwesomeIcons.arrowCircleRight,
|
||||
color: primaryColor),
|
||||
)),
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(left: 20.0, right: 20),
|
||||
child: TextFormField(
|
||||
initialValue: _box.height.toString(),
|
||||
textAlign: TextAlign.end,
|
||||
decoration: InputDecoration(
|
||||
fillColor: Colors.white,
|
||||
labelText: 'Height',
|
||||
filled: true,
|
||||
icon: Icon(FontAwesomeIcons.arrowAltCircleUp,
|
||||
color: primaryColor),
|
||||
)),
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(left: 20.0, right: 20),
|
||||
child: TextFormField(
|
||||
initialValue: _box.length.toString(),
|
||||
textAlign: TextAlign.end,
|
||||
decoration: InputDecoration(
|
||||
fillColor: Colors.white,
|
||||
labelText: 'Length',
|
||||
filled: true,
|
||||
icon: Icon(FontAwesomeIcons.arrowCircleUp,
|
||||
color: primaryColor),
|
||||
)),
|
||||
),
|
||||
SizedBox(height: 25),
|
||||
],
|
||||
),
|
||||
isNew
|
||||
? Container()
|
||||
: ExpansionTile(
|
||||
@@ -382,23 +468,21 @@ class _BoxEditorState extends State<BoxEditor> {
|
||||
);
|
||||
}
|
||||
|
||||
List<MyDataRow> getPackageRow(BuildContext context) {
|
||||
if (_box == null || _box.packages == null) {
|
||||
List<MyDataRow> getCargoRows(BuildContext context) {
|
||||
if (_box == null || _box.cargoTypes == null) {
|
||||
return [];
|
||||
}
|
||||
return _box.packages.map((p) {
|
||||
return _box.cargoTypes.map((c) {
|
||||
return MyDataRow(
|
||||
onSelectChanged: (bool selected) {},
|
||||
cells: [
|
||||
MyDataCell(new Text(
|
||||
p.id == null ? "" : p.id,
|
||||
c.type == null ? "" : c.type,
|
||||
style: textStyle,
|
||||
)),
|
||||
MyDataCell(
|
||||
new Text(p.cargoDesc, style: textStyle),
|
||||
),
|
||||
MyDataCell(
|
||||
new Text("${p.market}", style: textStyle),
|
||||
new Text(c.weight == null ? "0" : c.weight.toString(),
|
||||
style: textStyle),
|
||||
),
|
||||
],
|
||||
);
|
||||
|
||||
79
lib/pages_fcs/cargo_editor.dart
Normal file
79
lib/pages_fcs/cargo_editor.dart
Normal file
@@ -0,0 +1,79 @@
|
||||
import 'package:fcs/pages/util.dart';
|
||||
import 'package:fcs/vo/rate.dart';
|
||||
import 'package:fcs/widget/localization/app_translations.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:fcs/widget/progress.dart';
|
||||
import '../theme/theme.dart';
|
||||
|
||||
class CargoEditor extends StatefulWidget {
|
||||
final Rate rate;
|
||||
CargoEditor({this.rate});
|
||||
|
||||
@override
|
||||
_CargoEditorState createState() => _CargoEditorState();
|
||||
}
|
||||
|
||||
class _CargoEditorState extends State<CargoEditor> {
|
||||
TextEditingController _descController = new TextEditingController();
|
||||
TextEditingController _rateController = new TextEditingController();
|
||||
|
||||
bool _isLoading = false;
|
||||
Rate _rate = new Rate();
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
if (widget.rate != null) {
|
||||
_rate = widget.rate;
|
||||
_descController.text = _rate.description;
|
||||
_rateController.text = _rate.price.toString();
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
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("cargo.form.title")),
|
||||
),
|
||||
body: Container(
|
||||
padding: EdgeInsets.all(18),
|
||||
child: Column(
|
||||
children: <Widget>[
|
||||
Expanded(
|
||||
child: ListView(
|
||||
children: <Widget>[
|
||||
fcsInput("Cargo Type", Icons.text_format,
|
||||
controller: _descController),
|
||||
fcsInput("Rate", Icons.attach_money,
|
||||
controller: _rateController),
|
||||
SizedBox(height: 30),
|
||||
],
|
||||
),
|
||||
),
|
||||
widget.rate == null
|
||||
? fcsButton(context, "Create", callack: () {})
|
||||
: fcsButton(context, "Save", callack: () {}),
|
||||
SizedBox(height: 10)
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -1,3 +1,4 @@
|
||||
import 'package:fcs/vo/cargo.dart';
|
||||
import 'package.dart';
|
||||
|
||||
class Status {
|
||||
@@ -19,6 +20,9 @@ class Box {
|
||||
String boxNumber;
|
||||
String status;
|
||||
String cargoDesc;
|
||||
int width;
|
||||
int height;
|
||||
int length;
|
||||
|
||||
int rate;
|
||||
int weight;
|
||||
@@ -30,6 +34,8 @@ class Box {
|
||||
|
||||
List<Package> packages;
|
||||
|
||||
List<Cargo> cargoTypes;
|
||||
|
||||
int get amount => rate != null && weight != null ? rate * weight : 0;
|
||||
|
||||
String get packageNumber =>
|
||||
@@ -48,6 +54,9 @@ class Box {
|
||||
this.receiverNumber,
|
||||
this.receiverAddress,
|
||||
this.boxNumber,
|
||||
this.width,
|
||||
this.height,
|
||||
this.length,
|
||||
this.rate,
|
||||
this.weight,
|
||||
this.packageType,
|
||||
@@ -57,5 +66,6 @@ class Box {
|
||||
this.arrivedDate,
|
||||
this.cargoDesc,
|
||||
this.statusHistory,
|
||||
this.packages});
|
||||
this.packages,
|
||||
this.cargoTypes});
|
||||
}
|
||||
|
||||
6
lib/vo/cargo.dart
Normal file
6
lib/vo/cargo.dart
Normal file
@@ -0,0 +1,6 @@
|
||||
class Cargo {
|
||||
String type;
|
||||
int price;
|
||||
int weight;
|
||||
Cargo({this.type, this.price, this.weight});
|
||||
}
|
||||
@@ -1,3 +1,5 @@
|
||||
import 'cargo.dart';
|
||||
|
||||
class PickUp {
|
||||
String id;
|
||||
String userName;
|
||||
@@ -10,6 +12,7 @@ class PickUp {
|
||||
String address;
|
||||
String status;
|
||||
DateTime date;
|
||||
List<Cargo> cargoTypes;
|
||||
|
||||
PickUp(
|
||||
{this.id,
|
||||
@@ -22,7 +25,8 @@ class PickUp {
|
||||
this.handlingFee,
|
||||
this.address,
|
||||
this.status,
|
||||
this.date});
|
||||
this.date,
|
||||
this.cargoTypes});
|
||||
|
||||
int get last => DateTime.now().difference(date).inDays;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user