add delivery address vo

This commit is contained in:
Sai Naw Wun
2020-10-08 11:38:05 +06:30
parent 6105b45cb8
commit 7ae74275cd
22 changed files with 202 additions and 101 deletions

View File

@@ -7,6 +7,7 @@ const markets_collection = "markets";
const packages_collection = "packages";
const messages_collection = "messages";
const fcs_shipment_collection = "fcs_shipments";
const delivery_address_collection = "delivery_addresses";
const user_requested_status = "requested";
const user_invited_status = "invited";

View File

@@ -1,5 +1,5 @@
import 'package:fcs/domain/vo/shipment_status.dart';
import 'package:fcs/domain/vo/shipping_address.dart';
import 'package:fcs/domain/vo/delivery_address.dart';
import 'cargo.dart';
import 'package.dart';
@@ -33,7 +33,7 @@ class Box {
List<Cargo> cargoTypes;
ShippingAddress shippingAddress;
DeliveryAddress shippingAddress;
int get amount => rate != null && weight != null ? rate * weight : 0;

View File

@@ -0,0 +1,31 @@
class DeliveryAddress {
String id;
String fullName;
String addressLine1;
String addressLine2;
String city;
String state;
String country;
String phoneNumber;
DeliveryAddress(
{this.fullName,
this.addressLine1,
this.addressLine2,
this.city,
this.state,
this.country,
this.phoneNumber});
Map<String, dynamic> toMap() {
return {
"id": id,
'full_name': fullName,
'address_line1': addressLine1,
'address_line2': addressLine2,
'city': city,
'state': state,
'phone_number': phoneNumber,
'contry': country,
};
}
}

View File

@@ -1,15 +0,0 @@
class ShippingAddress {
String fullName;
String addressLine1;
String addressLine2;
String city;
String state;
String phoneNumber;
ShippingAddress(
{this.fullName,
this.addressLine1,
this.addressLine2,
this.city,
this.state,
this.phoneNumber});
}