user_info.dart 504 B

123456789101112131415161718192021222324252627
  1. import 'package:json_annotation/json_annotation.dart';
  2. part 'user_info.g.dart';
  3. // 在生成键盘出使用
  4. @JsonSerializable()
  5. class UserInfo {
  6. @JsonKey(name: "name")
  7. String? name;
  8. @JsonKey(name: "birthday")
  9. String? birthday;
  10. @JsonKey(name: "gender")
  11. int? gender;
  12. UserInfo({
  13. this.name,
  14. this.birthday,
  15. this.gender,
  16. });
  17. Map<String, dynamic> toJson() => _$UserInfoToJson(this);
  18. factory UserInfo.fromJson(Map<String, dynamic> json) =>
  19. _$UserInfoFromJson(json);
  20. }