mainItem 为什么不用 item1~item4 的写法?
来源:12-3 首页大接口相关模型实现【Model层设计】
 
			香饽饽0
2019-08-16
factory GridNavItem.fromJSON(Map<String, dynamic> json) {
    return GridNavItem(
      startColor: json['startColor'],
      endColor: json['endColor'],
      mainItem: json['mainItem'],
      item1: CommonModel.fromJSON(json['item1']),
      item2: CommonModel.fromJSON(json['item2']),
      item3: CommonModel.fromJSON(json['item3']),
      item4: CommonModel.fromJSON(json['item4'])
    );
  }
写回答
	1回答
- 
				
				CommonModel化后,是可以改成 item1~item4 的写法的。 012019-09-11
相似问题
