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.
This commit is contained in:
2026-07-24 03:45:01 +08:00
parent 1a578c925d
commit 4f9aa4f683
40 changed files with 382 additions and 389 deletions

View File

@@ -4,10 +4,10 @@ import 'dart:convert';
import 'simple_business.dart';
class TicketFile {
int id;
String url;
String fileName;
String fileType;
int? id;
String? url;
String? fileName;
String? fileType;
TicketFile.fromJson(Map<String, dynamic> json)
: id = json['id'],
@@ -29,9 +29,9 @@ class TicketFile {
}
class Issue {
int id;
String msg;
List<TicketFile> files;
int? id;
String? msg;
List<TicketFile>? files;
Issue.fromJson(Map<String, dynamic> json)
: id = json['id'],
@@ -51,11 +51,11 @@ class Issue {
}
class FollowUp {
int id;
String msg;
String poster;
String createdAt;
List<TicketFile> files;
int? id;
String? msg;
String? poster;
String? createdAt;
List<TicketFile>? files;
FollowUp.fromJson(Map<String, dynamic> json)
: id = json['id'],
@@ -79,12 +79,12 @@ class FollowUp {
}
class Ticket {
int id;
Issue issue;
Store store;
List<FollowUp> followUps;
bool isClosed;
String createdAt;
int? id;
Issue? issue;
Store? store;
List<FollowUp>? followUps;
bool? isClosed;
String? createdAt;
Ticket.fromJson(Map<String, dynamic> json)
: id = json['id'],