update boxes
This commit is contained in:
@@ -7,17 +7,22 @@ import 'package:fcs/helpers/theme.dart';
|
|||||||
import 'package:fcs/localization/app_translations.dart';
|
import 'package:fcs/localization/app_translations.dart';
|
||||||
import 'package:fcs/pages/delivery_address/delivery_address_list.dart';
|
import 'package:fcs/pages/delivery_address/delivery_address_list.dart';
|
||||||
import 'package:fcs/pages/delivery_address/delivery_address_row.dart';
|
import 'package:fcs/pages/delivery_address/delivery_address_row.dart';
|
||||||
|
import 'package:fcs/pages/delivery_address/model/delivery_address_model.dart';
|
||||||
import 'package:fcs/pages/main/model/language_model.dart';
|
import 'package:fcs/pages/main/model/language_model.dart';
|
||||||
|
import 'package:fcs/pages/main/model/main_model.dart';
|
||||||
import 'package:fcs/pages/main/util.dart';
|
import 'package:fcs/pages/main/util.dart';
|
||||||
import 'package:fcs/pages/package/model/package_model.dart';
|
import 'package:fcs/pages/package/model/package_model.dart';
|
||||||
import 'package:fcs/pages/user_search/user_serach.dart';
|
import 'package:fcs/pages/user_search/user_serach.dart';
|
||||||
import 'package:fcs/pages/widgets/bottom_up_page_route.dart';
|
import 'package:fcs/pages/widgets/bottom_up_page_route.dart';
|
||||||
|
import 'package:fcs/pages/widgets/defalut_delivery_address.dart';
|
||||||
|
import 'package:fcs/pages/widgets/delivery_address_selection.dart';
|
||||||
import 'package:fcs/pages/widgets/display_text.dart';
|
import 'package:fcs/pages/widgets/display_text.dart';
|
||||||
import 'package:fcs/pages/widgets/fcs_id_icon.dart';
|
import 'package:fcs/pages/widgets/fcs_id_icon.dart';
|
||||||
import 'package:fcs/pages/widgets/input_text.dart';
|
import 'package:fcs/pages/widgets/input_text.dart';
|
||||||
import 'package:fcs/pages/widgets/local_text.dart';
|
import 'package:fcs/pages/widgets/local_text.dart';
|
||||||
import 'package:fcs/pages/widgets/my_data_table.dart';
|
import 'package:fcs/pages/widgets/my_data_table.dart';
|
||||||
import 'package:fcs/pages/widgets/progress.dart';
|
import 'package:fcs/pages/widgets/progress.dart';
|
||||||
|
import 'package:fcs/pages/widgets/title_with_add_button.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_icons/flutter_icons.dart';
|
import 'package:flutter_icons/flutter_icons.dart';
|
||||||
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
|
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
|
||||||
@@ -49,6 +54,9 @@ class _BoxEditorState extends State<BoxEditor> {
|
|||||||
User user;
|
User user;
|
||||||
String selectShipmentNumber;
|
String selectShipmentNumber;
|
||||||
List<Package> _packages = [];
|
List<Package> _packages = [];
|
||||||
|
List<Cargo> _cargoTypes = [];
|
||||||
|
double volumetricRatio = 0;
|
||||||
|
double shipmentWeight = 0;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void initState() {
|
void initState() {
|
||||||
@@ -57,47 +65,48 @@ class _BoxEditorState extends State<BoxEditor> {
|
|||||||
_packages = [
|
_packages = [
|
||||||
packageModel.packages[0],
|
packageModel.packages[0],
|
||||||
packageModel.packages[1],
|
packageModel.packages[1],
|
||||||
packageModel.packages[2],
|
|
||||||
packageModel.packages[8]
|
|
||||||
];
|
];
|
||||||
_packages.forEach((p) {
|
_packages.forEach((p) {
|
||||||
p.isChecked = false;
|
p.isChecked = false;
|
||||||
});
|
});
|
||||||
|
volumetricRatio =
|
||||||
|
Provider.of<MainModel>(context, listen: false).setting.volumetricRatio;
|
||||||
|
_lengthController.addListener(_calShipmentWeight);
|
||||||
|
_widthController.addListener(_calShipmentWeight);
|
||||||
|
_heightController.addListener(_calShipmentWeight);
|
||||||
|
|
||||||
if (widget.box != null) {
|
if (widget.box != null) {
|
||||||
_box = widget.box;
|
_box = widget.box;
|
||||||
_deliveryAddress = _box.shippingAddress;
|
_deliveryAddress = _box.shippingAddress;
|
||||||
isNew = false;
|
_cargoTypes = _box.cargoTypes;
|
||||||
selectShipmentNumber = _box.shipmentNumber;
|
selectShipmentNumber = _box.shipmentNumber;
|
||||||
_widthController.text = _box.width.toString();
|
_widthController.text = _box.width.toString();
|
||||||
_heightController.text = _box.height.toString();
|
_heightController.text = _box.height.toString();
|
||||||
_lengthController.text = _box.length.toString();
|
_lengthController.text = _box.length.toString();
|
||||||
|
isNew = false;
|
||||||
} else {
|
} else {
|
||||||
List<Cargo> _cargoTypes = [
|
_cargoTypes = [
|
||||||
Cargo(type: 'General Cargo', weight: 25),
|
Cargo(type: 'General', weight: 25),
|
||||||
Cargo(type: 'Medicine', weight: 20),
|
Cargo(type: 'Medicine', weight: 20),
|
||||||
Cargo(type: 'Dangerous Cargo', weight: 30)
|
Cargo(type: 'Dangerous', weight: 30)
|
||||||
];
|
];
|
||||||
|
|
||||||
_deliveryAddress = DeliveryAddress(
|
var shipmentModel =
|
||||||
fullName: 'U Nyi Nyi',
|
Provider.of<DeliveryAddressModel>(context, listen: false);
|
||||||
addressLine1: '154-19 64th Ave.',
|
_deliveryAddress = shipmentModel.defalutAddress;
|
||||||
addressLine2: 'Flushing',
|
|
||||||
city: 'NY',
|
|
||||||
state: 'NY',
|
|
||||||
phoneNumber: '+1 (292)215-2247');
|
|
||||||
|
|
||||||
isNew = true;
|
isNew = true;
|
||||||
_box = Box(
|
|
||||||
rate: 0,
|
|
||||||
weight: 75,
|
|
||||||
width: 0,
|
|
||||||
height: 0,
|
|
||||||
length: 0,
|
|
||||||
cargoTypes: _cargoTypes,
|
|
||||||
shipmentWeight: 0);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_calShipmentWeight() {
|
||||||
|
double l = double.parse(_lengthController.text, (s) => 0);
|
||||||
|
double w = double.parse(_widthController.text, (s) => 0);
|
||||||
|
double h = double.parse(_heightController.text, (s) => 0);
|
||||||
|
setState(() {
|
||||||
|
shipmentWeight = l * w * h / volumetricRatio;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void dispose() {
|
void dispose() {
|
||||||
super.dispose();
|
super.dispose();
|
||||||
@@ -149,7 +158,7 @@ class _BoxEditorState extends State<BoxEditor> {
|
|||||||
|
|
||||||
var shipmentBox = Container(
|
var shipmentBox = Container(
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding: const EdgeInsets.only(left: 10.0),
|
padding: const EdgeInsets.only(left: 10.0, right: 10),
|
||||||
child: DropdownButtonFormField(
|
child: DropdownButtonFormField(
|
||||||
value: selectShipmentNumber,
|
value: selectShipmentNumber,
|
||||||
decoration: InputDecoration(
|
decoration: InputDecoration(
|
||||||
@@ -247,7 +256,7 @@ class _BoxEditorState extends State<BoxEditor> {
|
|||||||
child: Row(
|
child: Row(
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
Container(
|
Container(
|
||||||
width: 50,
|
width: 40,
|
||||||
),
|
),
|
||||||
Expanded(
|
Expanded(
|
||||||
child: LocalText(context, 'box.tracking.id', color: Colors.grey),
|
child: LocalText(context, 'box.tracking.id', color: Colors.grey),
|
||||||
@@ -301,14 +310,6 @@ class _BoxEditorState extends State<BoxEditor> {
|
|||||||
}).toList();
|
}).toList();
|
||||||
}
|
}
|
||||||
|
|
||||||
final actualWeightBox = Container(
|
|
||||||
padding: EdgeInsets.only(left: 10),
|
|
||||||
child: DisplayText(
|
|
||||||
text: _box.weight != null ? _box.weight.toString() : "",
|
|
||||||
labelTextKey: "box.actual_weight",
|
|
||||||
iconData: FontAwesomeIcons.weightHanging,
|
|
||||||
));
|
|
||||||
|
|
||||||
final cargoTitle = Container(
|
final cargoTitle = Container(
|
||||||
padding: EdgeInsets.only(left: 15, right: 0.0, top: 20),
|
padding: EdgeInsets.only(left: 15, right: 0.0, top: 20),
|
||||||
child: Row(
|
child: Row(
|
||||||
@@ -316,13 +317,21 @@ class _BoxEditorState extends State<BoxEditor> {
|
|||||||
Expanded(
|
Expanded(
|
||||||
child: LocalText(context, 'cargo.type', color: Colors.grey),
|
child: LocalText(context, 'cargo.type', color: Colors.grey),
|
||||||
),
|
),
|
||||||
LocalText(context, 'cargo.weight', color: Colors.grey),
|
Container(
|
||||||
|
padding: EdgeInsets.only(right: 20),
|
||||||
|
child: LocalText(context, 'cargo.weight', color: Colors.grey)),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|
||||||
List<Widget> getCargoRowList() {
|
List<Widget> getCargoRowList() {
|
||||||
return _box.cargoTypes.asMap().entries.map((c) {
|
if (_cargoTypes == null) {
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
int total = 0;
|
||||||
|
|
||||||
|
var rows = _cargoTypes.asMap().entries.map((c) {
|
||||||
|
total += c.value.weight;
|
||||||
return InkWell(
|
return InkWell(
|
||||||
onTap: () {
|
onTap: () {
|
||||||
Navigator.push(
|
Navigator.push(
|
||||||
@@ -334,7 +343,7 @@ class _BoxEditorState extends State<BoxEditor> {
|
|||||||
color: Colors.grey[50].withOpacity(0.2),
|
color: Colors.grey[50].withOpacity(0.2),
|
||||||
child: Container(
|
child: Container(
|
||||||
padding: EdgeInsets.only(
|
padding: EdgeInsets.only(
|
||||||
left: 15.0, right: 10.0, top: 15.0, bottom: 15.0),
|
left: 15.0, right: 0.0, top: 0.0, bottom: 0.0),
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
border: Border(
|
border: Border(
|
||||||
bottom: BorderSide(color: Colors.grey[350], width: 1),
|
bottom: BorderSide(color: Colors.grey[350], width: 1),
|
||||||
@@ -347,9 +356,26 @@ class _BoxEditorState extends State<BoxEditor> {
|
|||||||
c.value.type,
|
c.value.type,
|
||||||
style: textStyle,
|
style: textStyle,
|
||||||
)),
|
)),
|
||||||
new Text(
|
Row(
|
||||||
c.value.weight == null ? "0" : c.value.weight.toString(),
|
children: [
|
||||||
style: textStyle,
|
new Text(
|
||||||
|
c.value.weight == null
|
||||||
|
? "0"
|
||||||
|
: c.value.weight.toString(),
|
||||||
|
style: textStyle,
|
||||||
|
),
|
||||||
|
IconButton(
|
||||||
|
icon: Icon(
|
||||||
|
Icons.remove_circle,
|
||||||
|
color: primaryColor,
|
||||||
|
),
|
||||||
|
onPressed: () {
|
||||||
|
setState(() {
|
||||||
|
_cargoTypes.remove(c.value);
|
||||||
|
});
|
||||||
|
},
|
||||||
|
)
|
||||||
|
],
|
||||||
)
|
)
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
@@ -357,49 +383,91 @@ class _BoxEditorState extends State<BoxEditor> {
|
|||||||
),
|
),
|
||||||
);
|
);
|
||||||
}).toList();
|
}).toList();
|
||||||
|
|
||||||
|
var totalRow = InkWell(
|
||||||
|
child: Container(
|
||||||
|
color: Colors.grey[50].withOpacity(0.2),
|
||||||
|
child: Container(
|
||||||
|
padding:
|
||||||
|
EdgeInsets.only(left: 15.0, right: 10.0, top: 15.0, bottom: 15.0),
|
||||||
|
child: Row(
|
||||||
|
children: <Widget>[
|
||||||
|
Expanded(
|
||||||
|
child: new Text(
|
||||||
|
"Total Weight",
|
||||||
|
style: TextStyle(fontWeight: FontWeight.bold),
|
||||||
|
)),
|
||||||
|
Padding(
|
||||||
|
padding: const EdgeInsets.only(right: 40.0),
|
||||||
|
child: Align(
|
||||||
|
alignment: Alignment.centerRight,
|
||||||
|
child: new Text(
|
||||||
|
total.toString(),
|
||||||
|
style: TextStyle(fontWeight: FontWeight.bold),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
));
|
||||||
|
|
||||||
|
rows.add(totalRow);
|
||||||
|
return rows;
|
||||||
}
|
}
|
||||||
|
|
||||||
final shipmentWeightBox = Container(
|
final shipmentWeightBox = Container(
|
||||||
padding: EdgeInsets.only(left: 10),
|
padding: EdgeInsets.only(left: 10),
|
||||||
child: DisplayText(
|
child: DisplayText(
|
||||||
text:
|
text: shipmentWeight != null ? shipmentWeight.toStringAsFixed(0) : "",
|
||||||
_box.shipmentWeight != null ? _box.shipmentWeight.toString() : "",
|
|
||||||
labelTextKey: "box.shipment_weight",
|
labelTextKey: "box.shipment_weight",
|
||||||
iconData: FontAwesomeIcons.weightHanging,
|
iconData: MaterialCommunityIcons.weight,
|
||||||
));
|
));
|
||||||
|
|
||||||
final widthBox = InputText(
|
final widthBox = Container(
|
||||||
labelTextKey: 'box.width',
|
padding: EdgeInsets.only(left: 10, right: 10),
|
||||||
iconData: FontAwesomeIcons.arrowCircleRight,
|
child: InputText(
|
||||||
controller: _widthController);
|
labelTextKey: 'box.width',
|
||||||
|
iconData: FontAwesomeIcons.arrowCircleRight,
|
||||||
|
controller: _widthController));
|
||||||
|
|
||||||
final heightBox = InputText(
|
final heightBox = Container(
|
||||||
labelTextKey: 'box.height',
|
padding: EdgeInsets.only(left: 10, right: 10),
|
||||||
iconData: FontAwesomeIcons.arrowAltCircleUp,
|
child: InputText(
|
||||||
controller: _heightController);
|
labelTextKey: 'box.height',
|
||||||
|
iconData: FontAwesomeIcons.arrowAltCircleUp,
|
||||||
|
controller: _heightController));
|
||||||
|
|
||||||
final lengthBox = InputText(
|
final lengthBox = Container(
|
||||||
labelTextKey: 'box.length',
|
padding: EdgeInsets.only(left: 10, right: 10),
|
||||||
iconData: FontAwesomeIcons.arrowCircleUp,
|
child: InputText(
|
||||||
controller: _lengthController);
|
labelTextKey: 'box.length',
|
||||||
|
iconData: FontAwesomeIcons.arrowCircleUp,
|
||||||
|
controller: _lengthController));
|
||||||
|
|
||||||
final createBtn = fcsButton(
|
final createBtn = Container(
|
||||||
context,
|
padding: EdgeInsets.only(left: 10, right: 10),
|
||||||
getLocalString(context, 'box.create.btn'),
|
child: fcsButton(
|
||||||
callack: () {},
|
context,
|
||||||
);
|
getLocalString(context, 'box.create.btn'),
|
||||||
|
callack: () {},
|
||||||
|
));
|
||||||
|
|
||||||
final completeBtn = fcsButton(
|
final completeBtn = Container(
|
||||||
context,
|
padding: EdgeInsets.only(left: 10, right: 10),
|
||||||
getLocalString(context, 'box.complete.btn'),
|
child: fcsButton(
|
||||||
callack: () {},
|
context,
|
||||||
);
|
getLocalString(context, 'box.complete.btn'),
|
||||||
|
callack: () {},
|
||||||
|
));
|
||||||
|
|
||||||
final deliveryBtn = fcsButton(
|
final deliveryBtn = Container(
|
||||||
context,
|
padding: EdgeInsets.only(left: 10, right: 10),
|
||||||
getLocalString(context, 'box.deliver.btn'),
|
child: fcsButton(
|
||||||
callack: () {},
|
context,
|
||||||
);
|
getLocalString(context, 'box.deliver.btn'),
|
||||||
|
callack: () {},
|
||||||
|
));
|
||||||
|
|
||||||
return LocalProgress(
|
return LocalProgress(
|
||||||
inAsyncCall: _isLoading,
|
inAsyncCall: _isLoading,
|
||||||
@@ -426,52 +494,44 @@ class _BoxEditorState extends State<BoxEditor> {
|
|||||||
color: primaryColor,
|
color: primaryColor,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
body: Padding(
|
body: ListView(
|
||||||
padding: const EdgeInsets.only(left: 12.0, right: 12),
|
shrinkWrap: true,
|
||||||
child: ListView(
|
children: [
|
||||||
shrinkWrap: true,
|
widget.box == null
|
||||||
children: [
|
? Container()
|
||||||
widget.box == null
|
: Center(child: nameWidget(_box.packageNumber)),
|
||||||
? Container()
|
Container(
|
||||||
: Center(child: nameWidget(_box.packageNumber)),
|
padding: EdgeInsets.only(top: 10),
|
||||||
Center(
|
child: TitleWithAddButton(
|
||||||
child: Padding(
|
titleKey: "box.shipment_info",
|
||||||
padding: const EdgeInsets.all(8.0),
|
),
|
||||||
child: LocalText(
|
),
|
||||||
context,
|
Column(
|
||||||
"box.shipment_info",
|
children: [
|
||||||
color: primaryColor,
|
shipmentBox,
|
||||||
fontSize: 16,
|
SizedBox(
|
||||||
fontWeight: FontWeight.w700,
|
height: 10,
|
||||||
),
|
|
||||||
),
|
),
|
||||||
),
|
fcsIDBox,
|
||||||
Column(
|
phoneNumberBox,
|
||||||
children: [
|
namebox,
|
||||||
shipmentBox,
|
mixBox,
|
||||||
SizedBox(
|
SizedBox(
|
||||||
height: 10,
|
height: 10,
|
||||||
),
|
|
||||||
fcsIDBox,
|
|
||||||
phoneNumberBox,
|
|
||||||
namebox,
|
|
||||||
mixBox,
|
|
||||||
],
|
|
||||||
),
|
|
||||||
Divider(),
|
|
||||||
Center(
|
|
||||||
child: Padding(
|
|
||||||
padding: const EdgeInsets.all(8.0),
|
|
||||||
child: LocalText(
|
|
||||||
context,
|
|
||||||
"box.packages",
|
|
||||||
color: primaryColor,
|
|
||||||
fontSize: 16,
|
|
||||||
fontWeight: FontWeight.w700,
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
Divider(),
|
||||||
|
Container(
|
||||||
|
padding: EdgeInsets.only(top: 10, left: 10),
|
||||||
|
child: TitleWithAddButton(
|
||||||
|
iconData: Octicons.package,
|
||||||
|
titleKey: "box.packages",
|
||||||
),
|
),
|
||||||
Column(
|
),
|
||||||
|
Container(
|
||||||
|
padding: EdgeInsets.only(left: 10, right: 10),
|
||||||
|
child: Column(
|
||||||
children: [
|
children: [
|
||||||
packageTitle,
|
packageTitle,
|
||||||
Divider(
|
Divider(
|
||||||
@@ -480,174 +540,117 @@ class _BoxEditorState extends State<BoxEditor> {
|
|||||||
Column(
|
Column(
|
||||||
children: getPackageRowList(),
|
children: getPackageRowList(),
|
||||||
),
|
),
|
||||||
SizedBox(height: 15),
|
SizedBox(height: 10),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
Divider(),
|
),
|
||||||
Center(
|
Divider(),
|
||||||
child: Padding(
|
Container(
|
||||||
padding: const EdgeInsets.all(8.0),
|
padding: EdgeInsets.only(left: 10),
|
||||||
child: LocalText(
|
child: TitleWithAddButton(
|
||||||
context,
|
iconData: MaterialCommunityIcons.briefcase_check,
|
||||||
"box.cargo_type",
|
titleKey: "box.cargo_type",
|
||||||
color: primaryColor,
|
onTap: () async {
|
||||||
fontSize: 16,
|
Cargo cargo = await Navigator.push<Cargo>(
|
||||||
fontWeight: FontWeight.w700,
|
context, BottomUpPageRoute(CargoTypeEditor()));
|
||||||
),
|
if (cargo != null) {
|
||||||
),
|
setState(() {
|
||||||
),
|
_box.cargoTypes.add(cargo);
|
||||||
Column(
|
});
|
||||||
|
}
|
||||||
|
}),
|
||||||
|
),
|
||||||
|
Container(
|
||||||
|
padding: EdgeInsets.only(left: 10, right: 10),
|
||||||
|
child: Column(
|
||||||
children: [
|
children: [
|
||||||
actualWeightBox,
|
|
||||||
cargoTitle,
|
cargoTitle,
|
||||||
Divider(
|
Divider(
|
||||||
color: Colors.grey[400],
|
color: Colors.grey[400],
|
||||||
),
|
),
|
||||||
Column(
|
Column(
|
||||||
children: _box == null || _box.cargoTypes == null
|
children: getCargoRowList(),
|
||||||
? []
|
|
||||||
: getCargoRowList(),
|
|
||||||
),
|
|
||||||
Container(
|
|
||||||
padding: EdgeInsets.only(top: 25),
|
|
||||||
child: Align(
|
|
||||||
alignment: Alignment.bottomRight,
|
|
||||||
child: FloatingActionButton.extended(
|
|
||||||
icon: Icon(Icons.add),
|
|
||||||
heroTag: "add cargo",
|
|
||||||
label: LocalText(
|
|
||||||
context,
|
|
||||||
"box.add_cargo",
|
|
||||||
color: Colors.white,
|
|
||||||
),
|
|
||||||
backgroundColor: primaryColor,
|
|
||||||
onPressed: () {
|
|
||||||
Navigator.push(
|
|
||||||
context,
|
|
||||||
BottomUpPageRoute(CargoTypeEditor()),
|
|
||||||
);
|
|
||||||
},
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
SizedBox(height: 25),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
Divider(),
|
|
||||||
Center(
|
|
||||||
child: Padding(
|
|
||||||
padding: const EdgeInsets.all(8.0),
|
|
||||||
child: LocalText(
|
|
||||||
context,
|
|
||||||
"box.dimension",
|
|
||||||
color: primaryColor,
|
|
||||||
fontSize: 16,
|
|
||||||
fontWeight: FontWeight.w700,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
Column(
|
|
||||||
children: [
|
|
||||||
shipmentWeightBox,
|
|
||||||
widthBox,
|
|
||||||
heightBox,
|
|
||||||
lengthBox,
|
|
||||||
SizedBox(height: 25),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
Divider(),
|
|
||||||
Center(
|
|
||||||
child: Padding(
|
|
||||||
padding: const EdgeInsets.all(8.0),
|
|
||||||
child: LocalText(
|
|
||||||
context,
|
|
||||||
"box.delivery_address",
|
|
||||||
color: primaryColor,
|
|
||||||
fontSize: 16,
|
|
||||||
fontWeight: FontWeight.w700,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
Column(
|
|
||||||
children: [
|
|
||||||
DeliveryAddressRow(deliveryAddress: _deliveryAddress),
|
|
||||||
Container(
|
|
||||||
padding: EdgeInsets.only(top: 20, bottom: 15, right: 15),
|
|
||||||
child: Align(
|
|
||||||
alignment: Alignment.bottomRight,
|
|
||||||
child: Container(
|
|
||||||
width: 130,
|
|
||||||
height: 40,
|
|
||||||
child: FloatingActionButton.extended(
|
|
||||||
materialTapTargetSize:
|
|
||||||
MaterialTapTargetSize.shrinkWrap,
|
|
||||||
onPressed: () async {
|
|
||||||
DeliveryAddress deliveryAddress =
|
|
||||||
await Navigator.push(
|
|
||||||
context,
|
|
||||||
BottomUpPageRoute(DeliveryAddressList()),
|
|
||||||
);
|
|
||||||
setState(() {
|
|
||||||
_deliveryAddress = deliveryAddress;
|
|
||||||
});
|
|
||||||
},
|
|
||||||
icon: Icon(Icons.add),
|
|
||||||
label: LocalText(context, "box.change_address",
|
|
||||||
color: Colors.white),
|
|
||||||
backgroundColor: primaryColor,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
SizedBox(height: 10),
|
SizedBox(height: 10),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
Divider(),
|
),
|
||||||
isNew
|
Divider(),
|
||||||
? Container()
|
SizedBox(
|
||||||
: Column(
|
height: 10,
|
||||||
children: [
|
),
|
||||||
Padding(
|
TitleWithAddButton(
|
||||||
padding: const EdgeInsets.all(8.0),
|
titleKey: "box.dimension",
|
||||||
child: LocalText(
|
),
|
||||||
context,
|
Column(
|
||||||
"box.status",
|
children: [
|
||||||
color: primaryColor,
|
shipmentWeightBox,
|
||||||
fontSize: 16,
|
widthBox,
|
||||||
fontWeight: FontWeight.w700,
|
heightBox,
|
||||||
),
|
lengthBox,
|
||||||
|
SizedBox(height: 25),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
Divider(),
|
||||||
|
Container(
|
||||||
|
padding: EdgeInsets.only(left: 10, right: 10),
|
||||||
|
child: DefaultDeliveryAddress(
|
||||||
|
deliveryAddress: _deliveryAddress,
|
||||||
|
onTap: () async {
|
||||||
|
DeliveryAddress d = await Navigator.push<DeliveryAddress>(
|
||||||
|
context,
|
||||||
|
BottomUpPageRoute(DeliveryAddressSelection(
|
||||||
|
deliveryAddress: _deliveryAddress,
|
||||||
|
)),
|
||||||
|
);
|
||||||
|
if (d == null) return;
|
||||||
|
setState(() {
|
||||||
|
this._deliveryAddress = d;
|
||||||
|
});
|
||||||
|
}),
|
||||||
|
),
|
||||||
|
SizedBox(height: 15),
|
||||||
|
Divider(),
|
||||||
|
isNew
|
||||||
|
? Container()
|
||||||
|
: Column(
|
||||||
|
children: [
|
||||||
|
Padding(
|
||||||
|
padding: EdgeInsets.only(top: 10),
|
||||||
|
child: TitleWithAddButton(
|
||||||
|
titleKey: "box.status",
|
||||||
),
|
),
|
||||||
Container(
|
),
|
||||||
height: 230,
|
Container(
|
||||||
padding: EdgeInsets.only(left: 10),
|
height: 230,
|
||||||
child: isNew
|
padding: EdgeInsets.only(left: 10),
|
||||||
? Container()
|
child: isNew
|
||||||
: Timeline(
|
? Container()
|
||||||
children: _models(),
|
: Timeline(
|
||||||
position: TimelinePosition.Left),
|
children: _models(),
|
||||||
),
|
position: TimelinePosition.Left),
|
||||||
],
|
),
|
||||||
),
|
],
|
||||||
isNew ? Container() : Divider(),
|
),
|
||||||
SizedBox(
|
isNew ? Container() : Divider(),
|
||||||
height: 10,
|
SizedBox(
|
||||||
),
|
height: 10,
|
||||||
widget.box == null
|
),
|
||||||
? createBtn
|
widget.box == null
|
||||||
: Container(
|
? createBtn
|
||||||
child: Column(
|
: Container(
|
||||||
children: <Widget>[
|
child: Column(
|
||||||
completeBtn,
|
children: <Widget>[
|
||||||
widget.box.status == 'Arrived'
|
completeBtn,
|
||||||
? deliveryBtn
|
widget.box.status == 'Arrived'
|
||||||
: Container(),
|
? deliveryBtn
|
||||||
],
|
: Container(),
|
||||||
)),
|
],
|
||||||
SizedBox(
|
)),
|
||||||
height: 20,
|
SizedBox(
|
||||||
),
|
height: 20,
|
||||||
],
|
),
|
||||||
),
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -52,9 +52,9 @@ class BoxModel extends BaseModel {
|
|||||||
state: 'NY',
|
state: 'NY',
|
||||||
phoneNumber: '+1 (292)215-2247'),
|
phoneNumber: '+1 (292)215-2247'),
|
||||||
cargoTypes: [
|
cargoTypes: [
|
||||||
Cargo(type: 'General Cargo', weight: 25),
|
Cargo(type: 'General', weight: 25),
|
||||||
Cargo(type: 'Medicine', weight: 20),
|
Cargo(type: 'Medicine', weight: 20),
|
||||||
Cargo(type: 'Dangerous Cargo', weight: 30)
|
Cargo(type: 'Dangerous', weight: 30)
|
||||||
]),
|
]),
|
||||||
Box(
|
Box(
|
||||||
shipmentNumber: "A202",
|
shipmentNumber: "A202",
|
||||||
@@ -82,9 +82,9 @@ class BoxModel extends BaseModel {
|
|||||||
state: 'Myanmar',
|
state: 'Myanmar',
|
||||||
phoneNumber: '+09 95724 8750'),
|
phoneNumber: '+09 95724 8750'),
|
||||||
cargoTypes: [
|
cargoTypes: [
|
||||||
Cargo(type: 'General Cargo', weight: 25),
|
Cargo(type: 'General', weight: 25),
|
||||||
Cargo(type: 'Medicine', weight: 20),
|
Cargo(type: 'Medicine', weight: 20),
|
||||||
Cargo(type: 'Dangerous Cargo', weight: 30)
|
Cargo(type: 'Dangerous', weight: 30)
|
||||||
]),
|
]),
|
||||||
Box(
|
Box(
|
||||||
shipmentNumber: "A202",
|
shipmentNumber: "A202",
|
||||||
@@ -112,9 +112,9 @@ class BoxModel extends BaseModel {
|
|||||||
state: 'Myanmar',
|
state: 'Myanmar',
|
||||||
phoneNumber: '+09 95724 8750'),
|
phoneNumber: '+09 95724 8750'),
|
||||||
cargoTypes: [
|
cargoTypes: [
|
||||||
Cargo(type: 'General Cargo', weight: 25),
|
Cargo(type: 'General', weight: 25),
|
||||||
Cargo(type: 'Medicine', weight: 20),
|
Cargo(type: 'Medicine', weight: 20),
|
||||||
Cargo(type: 'Dangerous Cargo', weight: 30)
|
Cargo(type: 'Dangerous', weight: 30)
|
||||||
]),
|
]),
|
||||||
Box(
|
Box(
|
||||||
shipmentNumber: "A202",
|
shipmentNumber: "A202",
|
||||||
@@ -142,9 +142,9 @@ class BoxModel extends BaseModel {
|
|||||||
state: 'NY',
|
state: 'NY',
|
||||||
phoneNumber: '+1 (292)215-2247'),
|
phoneNumber: '+1 (292)215-2247'),
|
||||||
cargoTypes: [
|
cargoTypes: [
|
||||||
Cargo(type: 'General Cargo', weight: 25),
|
Cargo(type: 'General', weight: 25),
|
||||||
Cargo(type: 'Medicine', weight: 20),
|
Cargo(type: 'Medicine', weight: 20),
|
||||||
Cargo(type: 'Dangerous Cargo', weight: 30)
|
Cargo(type: 'Dangerous', weight: 30)
|
||||||
]),
|
]),
|
||||||
Box(
|
Box(
|
||||||
shipmentNumber: "A202",
|
shipmentNumber: "A202",
|
||||||
@@ -172,9 +172,9 @@ class BoxModel extends BaseModel {
|
|||||||
state: 'NY',
|
state: 'NY',
|
||||||
phoneNumber: '+1 (292)215-2247'),
|
phoneNumber: '+1 (292)215-2247'),
|
||||||
cargoTypes: [
|
cargoTypes: [
|
||||||
Cargo(type: 'General Cargo', weight: 25),
|
Cargo(type: 'General', weight: 25),
|
||||||
Cargo(type: 'Medicine', weight: 20),
|
Cargo(type: 'Medicine', weight: 20),
|
||||||
Cargo(type: 'Dangerous Cargo', weight: 30)
|
Cargo(type: 'Dangerous', weight: 30)
|
||||||
]),
|
]),
|
||||||
Box(
|
Box(
|
||||||
shipmentNumber: "A202",
|
shipmentNumber: "A202",
|
||||||
@@ -202,9 +202,9 @@ class BoxModel extends BaseModel {
|
|||||||
state: 'NY',
|
state: 'NY',
|
||||||
phoneNumber: '+1 (292)215-2247'),
|
phoneNumber: '+1 (292)215-2247'),
|
||||||
cargoTypes: [
|
cargoTypes: [
|
||||||
Cargo(type: 'General Cargo', weight: 25),
|
Cargo(type: 'General', weight: 25),
|
||||||
Cargo(type: 'Medicine', weight: 20),
|
Cargo(type: 'Medicine', weight: 20),
|
||||||
Cargo(type: 'Dangerous Cargo', weight: 30)
|
Cargo(type: 'Dangerous', weight: 30)
|
||||||
]),
|
]),
|
||||||
Box(
|
Box(
|
||||||
shipmentNumber: "A201",
|
shipmentNumber: "A201",
|
||||||
@@ -232,9 +232,9 @@ class BoxModel extends BaseModel {
|
|||||||
state: 'NY',
|
state: 'NY',
|
||||||
phoneNumber: '+1 (292)215-2247'),
|
phoneNumber: '+1 (292)215-2247'),
|
||||||
cargoTypes: [
|
cargoTypes: [
|
||||||
Cargo(type: 'General Cargo', weight: 25),
|
Cargo(type: 'General', weight: 25),
|
||||||
Cargo(type: 'Medicine', weight: 20),
|
Cargo(type: 'Medicine', weight: 20),
|
||||||
Cargo(type: 'Dangerous Cargo', weight: 30)
|
Cargo(type: 'Dangerous', weight: 30)
|
||||||
]),
|
]),
|
||||||
Box(
|
Box(
|
||||||
shipmentNumber: "A201",
|
shipmentNumber: "A201",
|
||||||
@@ -262,9 +262,9 @@ class BoxModel extends BaseModel {
|
|||||||
state: 'NY',
|
state: 'NY',
|
||||||
phoneNumber: '+1 (292)215-2247'),
|
phoneNumber: '+1 (292)215-2247'),
|
||||||
cargoTypes: [
|
cargoTypes: [
|
||||||
Cargo(type: 'General Cargo', weight: 25),
|
Cargo(type: 'General', weight: 25),
|
||||||
Cargo(type: 'Medicine', weight: 20),
|
Cargo(type: 'Medicine', weight: 20),
|
||||||
Cargo(type: 'Dangerous Cargo', weight: 30)
|
Cargo(type: 'Dangerous', weight: 30)
|
||||||
]),
|
]),
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user