login_info.dart 611 B

12345678910111213141516171819202122232425262728293031323334
  1. import 'package:json_annotation/json_annotation.dart';
  2. part 'login_info.g.dart';
  3. ///登录信息
  4. @JsonSerializable()
  5. class LoginInfo {
  6. @JsonKey(name: "phoneNumber")
  7. final String? phoneNumber;
  8. @JsonKey(name: "id")
  9. final String? id;
  10. @JsonKey(name: "avatar")
  11. final String? avatar;
  12. @JsonKey(name: "token")
  13. final String? token;
  14. LoginInfo ({
  15. this.phoneNumber,
  16. this.id,
  17. this.avatar,
  18. this.token,
  19. });
  20. factory LoginInfo.fromJson(Map<String, dynamic> json) {
  21. return _$LoginInfoFromJson(json);
  22. }
  23. Map<String, dynamic> toJson() {
  24. return _$LoginInfoToJson(this);
  25. }
  26. }