京东3首页实现

/// 配置请求地址

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

JSON TO DART

JSON to Dart null safety (autocode.icu)

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

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

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

class FocusItemModel {
  String? sId;

版权声明:本文为weixin_38107457原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。