Files
flutter_wisetronic/lib/models/located_address.dart
peima 4f9aa4f683 phase3(foundation): http_util dio5 migration + null-safe models
- http_util.dart: dio4->5 (DioException, nullable params, drop unused statusCode,
  null-safe e.response!.data), countryCode ?? ''
- models/* (39 files): make all instance fields nullable (fromJson initializer-list
  pattern forces nullable); fix internal method usages (cart_info/cart_line_item/
  order/shipping_rate) with !/??
- models/ now passes dart analyze with 0 errors

Widget-level null-safety + remaining utils/store continue in next batch.
2026-07-24 03:48:54 +08:00

47 lines
1.1 KiB
Dart

import 'dart:convert';
class LocatedAddress {
int? storeId;
double? latitude;
double? longitude;
String? streetNumber;
String? streetName;
String? city;
String? locality;
String? province;
String? country;
String? postalCode;
String? formattedAddress;
LocatedAddress.fromJson(Map<String, dynamic> json)
: storeId = json['store_id'],
latitude = json['latitude'],
longitude = json['longitude'],
streetNumber = json['street_number'],
streetName = json['street_name'],
city = json['city'],
locality = json['locality'],
province = json['province'],
country = json['country'],
postalCode = json['postal_code'],
formattedAddress = json['formatted_address'];
Map<String, dynamic> toJson() => {
'store_id': storeId,
'latitude': latitude,
'longitude': longitude,
'street_number': streetNumber,
'street_name': streetName,
'city': city,
'locality': locality,
'province': province,
'country': country,
'postal_code': postalCode,
'formatted_address': formattedAddress
};
@override
String toString() {
return json.encode(this);
}
}