- 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.
44 lines
1003 B
Dart
44 lines
1003 B
Dart
|
|
import 'dart:convert';
|
|
|
|
import 'product_image.dart';
|
|
|
|
class Comment {
|
|
int? id;
|
|
String? contact;
|
|
String? content;
|
|
int? rating;
|
|
List<ProductImage>? images;
|
|
String? createdAt;
|
|
int? thumbUp;
|
|
int? thumbDown;
|
|
String? replyFromStore;
|
|
|
|
Comment.fromJson(Map<String, dynamic> json) :
|
|
id = json['id'],
|
|
contact = json['contact'],
|
|
content = json['content'],
|
|
rating = json['rating'],
|
|
images = (json['images'] as List).map((e) => ProductImage.fromJson(e)).toList(),
|
|
createdAt = json['created_at'],
|
|
thumbUp = json['thumb_up'],
|
|
thumbDown = json['thumb_down'],
|
|
replyFromStore = json['reply_from_store'];
|
|
|
|
Map<String, dynamic> toJson() => {
|
|
'id': id,
|
|
'contact': contact,
|
|
'content': content,
|
|
'rating': rating,
|
|
'images': images,
|
|
'created_at': createdAt,
|
|
'thumb_up': thumbUp,
|
|
'thumb_down': thumbDown,
|
|
'reply_from_store': replyFromStore,
|
|
};
|
|
|
|
@override
|
|
String toString() {
|
|
return json.encode(this);
|
|
}
|
|
} |