- 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.
31 lines
586 B
Dart
31 lines
586 B
Dart
|
|
|
|
import 'dart:convert';
|
|
|
|
class ExtraFee {
|
|
int? id;
|
|
String? name;
|
|
String? description;
|
|
double? rate;
|
|
double? price;
|
|
|
|
ExtraFee.fromJson(Map<String, dynamic> json)
|
|
: id = json['id'],
|
|
name = json['name'],
|
|
description = json['description'],
|
|
rate = double.parse(json['rate'].toString()),
|
|
price = double.parse(json['price'].toString());
|
|
|
|
Map<String, dynamic> toJson() => {
|
|
'id': id,
|
|
'name': name,
|
|
'description': description,
|
|
'rate': rate,
|
|
'price': price,
|
|
};
|
|
|
|
@override
|
|
String toString() {
|
|
return json.encode(this);
|
|
}
|
|
} |