PhoneInfo.dart 546 B

12345678910111213141516171819202122
  1. import 'package:json_annotation/json_annotation.dart';
  2. part 'PhoneInfo.g.dart';
  3. @JsonSerializable()
  4. class PhoneInfo {
  5. PhoneInfo(this.id, this.phone, this.image,this.icon);
  6. int id;
  7. String phone;//手机型号
  8. String image;//图标
  9. String icon;//icon
  10. factory PhoneInfo.fromJson(Map<String, dynamic> json) =>
  11. _$PhoneInfoFromJson(json);
  12. Map<String, dynamic> toJson() => _$PhoneInfoToJson(this);
  13. // 命名构造函数
  14. PhoneInfo.empty();
  15. @override
  16. String toString() {
  17. return _$PhoneInfoToJson(this).toString();
  18. }
  19. }