ProductInfo.dart 605 B

1234567891011121314151617181920212223
  1. import 'package:json_annotation/json_annotation.dart';
  2. part 'ProductInfo.g.dart';
  3. @JsonSerializable()
  4. class ProductInfo {
  5. ProductInfo(this.id, this.productName, this.money, this.typeFlag,this.canUse);
  6. int id;
  7. String productName;//名称
  8. int money;//钱
  9. int typeFlag;//类型
  10. bool canUse;//可用
  11. factory ProductInfo.fromJson(Map<String, dynamic> json) =>
  12. _$ProductInfoFromJson(json);
  13. Map<String, dynamic> toJson() => _$ProductInfoToJson(this);
  14. // 命名构造函数
  15. ProductInfo.empty();
  16. @override
  17. String toString() {
  18. return _$ProductInfoToJson(this).toString();
  19. }
  20. }