Implements complete refactor of Ionic Angular logistics app to Flutter/Dart with: - Svrnty dark mode console theme (Material Design 3) - Responsive layouts (mobile, tablet, desktop) following FRONTEND standards - CQRS API integration with Result<T> error handling - OAuth2/OIDC authentication support (mocked for initial testing) - Delivery route and delivery management features - Multi-language support (EN/FR) with i18n - Native integrations (camera, phone calls, maps) - Strict typing throughout codebase - Mock data for UI testing without backend Follows all FRONTEND style guides, design patterns, and conventions. App is running in dark mode and fully responsive across all device sizes. Co-Authored-By: Claude <noreply@anthropic.com>
57 lines
1.5 KiB
Dart
57 lines
1.5 KiB
Dart
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 double? latitude;
|
|
final double? longitude;
|
|
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.latitude,
|
|
this.longitude,
|
|
required 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,
|
|
latitude: json['latitude'] as double?,
|
|
longitude: json['longitude'] as double?,
|
|
formattedAddress: json['formattedAddress'] as String,
|
|
);
|
|
}
|
|
|
|
@override
|
|
Map<String, Object?> toJson() => {
|
|
'id': id,
|
|
'line1': line1,
|
|
'line2': line2,
|
|
'postalCode': postalCode,
|
|
'city': city,
|
|
'subdivision': subdivision,
|
|
'countryCode': countryCode,
|
|
'latitude': latitude,
|
|
'longitude': longitude,
|
|
'formattedAddress': formattedAddress,
|
|
};
|
|
}
|