- 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.
34 lines
723 B
Dart
34 lines
723 B
Dart
|
|
class Position {
|
|
final double? latitude;
|
|
final double? longitude;
|
|
|
|
Position({this.latitude, this.longitude});
|
|
|
|
@override
|
|
bool operator ==(other) {
|
|
var areEqual = other is Position &&
|
|
other.latitude == latitude &&
|
|
other.longitude == longitude;
|
|
|
|
return areEqual;
|
|
}
|
|
|
|
@override
|
|
int get hashCode => latitude.hashCode ^
|
|
longitude.hashCode;
|
|
|
|
@override
|
|
String toString() {
|
|
return 'Lat $latitude, Lng $longitude';
|
|
}
|
|
|
|
Position.fromJson(Map<String, dynamic> json) :
|
|
latitude = double.parse(json['latitude'].toString()),
|
|
longitude = double.parse(json['longitude'].toString());
|
|
|
|
Map<String, dynamic> toJson() => {
|
|
'latitude': latitude,
|
|
'longitude': longitude
|
|
};
|
|
} |