| 1234567891011121314151617181920212223 |
- import 'package:json_annotation/json_annotation.dart';
- part 'ProductInfo.g.dart';
- @JsonSerializable()
- class ProductInfo {
- ProductInfo(this.id, this.productName, this.money, this.typeFlag,this.canUse);
- int id;
- String productName;//名称
- int money;//钱
- int typeFlag;//类型
- bool canUse;//可用
- factory ProductInfo.fromJson(Map<String, dynamic> json) =>
- _$ProductInfoFromJson(json);
- Map<String, dynamic> toJson() => _$ProductInfoToJson(this);
- // 命名构造函数
- ProductInfo.empty();
- @override
- String toString() {
- return _$ProductInfoToJson(this).toString();
- }
- }
|