import 'package:json_annotation/json_annotation.dart'; part 'HouseLevel.g.dart'; @JsonSerializable() class HouseLevel { HouseLevel(this.id, this.levelName, this.icon, this.entryCoin,this.firstRatio,this.secondRatio,this.thirdRatio,this.feeRatio,this.poolRatio,this.avgRatio); int id; String levelName;//名称 String icon;//图标 int entryCoin;//加入金额 num firstRatio;//第一名比率 num secondRatio;//第二名比率 num thirdRatio;//第三名比率 num feeRatio;//服务费 num poolRatio;//奖金池 num avgRatio;//平均分比例 factory HouseLevel.fromJson(Map json) => _$HouseLevelFromJson(json); Map toJson() => _$HouseLevelToJson(this); // 命名构造函数 HouseLevel.empty(); @override String toString() { return _$HouseLevelToJson(this).toString(); } }