contact_info.dart 514 B

12345678910111213141516171819202122232425
  1. import 'package:json_annotation/json_annotation.dart';
  2. part 'contact_info.g.dart';
  3. @JsonSerializable()
  4. class ContactInfo {
  5. @JsonKey(name: 'id')
  6. int? id;
  7. @JsonKey(name: 'phone')
  8. String phone;
  9. @JsonKey(name: 'remark')
  10. String? remark;
  11. @JsonKey(name: 'favor')
  12. bool? favor;
  13. ContactInfo(this.id, this.phone, this.remark, this.favor);
  14. factory ContactInfo.fromJson(Map<String, dynamic> json) =>
  15. _$ContactInfoFromJson(json);
  16. Map<String, dynamic> toJson() => _$ContactInfoToJson(this);
  17. }