brand theme, allot of features, allot of bug fixes
This commit is contained in:
@@ -36,6 +36,39 @@ class Delivery implements Serializable {
|
||||
required this.name,
|
||||
});
|
||||
|
||||
// Special warehouse ID constant
|
||||
static const int warehouseDeliveryId = -1;
|
||||
|
||||
// Check if this is the warehouse delivery
|
||||
bool get isWarehouseDelivery => id == warehouseDeliveryId;
|
||||
|
||||
// Create a static warehouse delivery item
|
||||
static Delivery createWarehouseDelivery() {
|
||||
return Delivery(
|
||||
id: warehouseDeliveryId,
|
||||
routeFragmentId: -1,
|
||||
deliveryIndex: 999,
|
||||
orders: const [],
|
||||
deliveryAddress: const DeliveryAddress(
|
||||
id: -1,
|
||||
line1: '3550 Rue de Cherbourg Suite 108',
|
||||
line2: '',
|
||||
postalCode: 'G8Y 6S6',
|
||||
city: 'Trois-Rivières',
|
||||
subdivision: 'QC',
|
||||
countryCode: 'CA',
|
||||
latitude: 46.3384605,
|
||||
longitude: -72.6080797,
|
||||
formattedAddress: '3550 Rue de Cherbourg Suite 108, Trois-Rivières, QC G8Y 6S6',
|
||||
),
|
||||
createdAt: DateTime.now().toIso8601String(),
|
||||
delivered: false,
|
||||
hasBeenSkipped: false,
|
||||
isSkipped: false,
|
||||
name: 'Return to Warehouse',
|
||||
);
|
||||
}
|
||||
|
||||
factory Delivery.fromJson(Map<String, dynamic> json) {
|
||||
return Delivery(
|
||||
id: json['id'] as int,
|
||||
|
||||
@@ -2,41 +2,41 @@ import '../api/types.dart';
|
||||
|
||||
class DeliveryAddress implements Serializable {
|
||||
final int id;
|
||||
final String line1;
|
||||
final String line2;
|
||||
final String postalCode;
|
||||
final String city;
|
||||
final String subdivision;
|
||||
final String countryCode;
|
||||
final String? line1;
|
||||
final String? line2;
|
||||
final String? postalCode;
|
||||
final String? city;
|
||||
final String? subdivision;
|
||||
final String? countryCode;
|
||||
final double? latitude;
|
||||
final double? longitude;
|
||||
final String formattedAddress;
|
||||
final String? formattedAddress;
|
||||
|
||||
const DeliveryAddress({
|
||||
required this.id,
|
||||
required this.line1,
|
||||
required this.line2,
|
||||
required this.postalCode,
|
||||
required this.city,
|
||||
required this.subdivision,
|
||||
required this.countryCode,
|
||||
this.line1,
|
||||
this.line2,
|
||||
this.postalCode,
|
||||
this.city,
|
||||
this.subdivision,
|
||||
this.countryCode,
|
||||
this.latitude,
|
||||
this.longitude,
|
||||
required this.formattedAddress,
|
||||
this.formattedAddress,
|
||||
});
|
||||
|
||||
factory DeliveryAddress.fromJson(Map<String, dynamic> json) {
|
||||
return DeliveryAddress(
|
||||
id: json['id'] as int,
|
||||
line1: json['line1'] as String,
|
||||
line2: json['line2'] as String,
|
||||
postalCode: json['postalCode'] as String,
|
||||
city: json['city'] as String,
|
||||
subdivision: json['subdivision'] as String,
|
||||
countryCode: json['countryCode'] as String,
|
||||
line1: json['line1'] as String?,
|
||||
line2: json['line2'] as String?,
|
||||
postalCode: json['postalCode'] as String?,
|
||||
city: json['city'] as String?,
|
||||
subdivision: json['subdivision'] as String?,
|
||||
countryCode: json['countryCode'] as String?,
|
||||
latitude: json['latitude'] as double?,
|
||||
longitude: json['longitude'] as double?,
|
||||
formattedAddress: json['formattedAddress'] as String,
|
||||
formattedAddress: json['formattedAddress'] as String?,
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user