ChannelInfo.dart 601 B

1234567891011121314151617181920212223
  1. import 'package:json_annotation/json_annotation.dart';
  2. part 'ChannelInfo.g.dart';
  3. @JsonSerializable()
  4. class ChannelInfo {
  5. ChannelInfo(this.id, this.name, this.versionNo, this.ratio,this.ratio2);
  6. int id;
  7. String name;//名称
  8. String versionNo;//版本号
  9. int ratio;//一级
  10. int ratio2;//二级
  11. factory ChannelInfo.fromJson(Map<String, dynamic> json) =>
  12. _$ChannelInfoFromJson(json);
  13. Map<String, dynamic> toJson() => _$ChannelInfoToJson(this);
  14. // 命名构造函数
  15. ChannelInfo.empty();
  16. @override
  17. String toString() {
  18. return _$ChannelInfoToJson(this).toString();
  19. }
  20. }