京东3首页实现

/// 配置请求地址

class Config{
  static String domain = "https://jdmall.itying.com/";
}

JSON TO DART

JSON to Dart null safety (autocode.icu)

class FocusModel {
  List result=[];
  FocusModel({required this.result});

  FocusModel.fromJson(Map json) {
    if (json['result'] != null) {
      result = [];
      json['result'].forEach((v) {
        result.add(new FocusItemModel.fromJson(v));
      });
    }
  }

  Map toJson() {
    final Map data = new Map();
    if (this.result != null) {
      data['result'] = this.result.map((v) => v.toJson()).toList();
    }
    return data;
  }
}

class FocusItemModel {
  String? sId;

你可能感兴趣的:(flutter,postman,json,测试工具)