import 'package:json_annotation/json_annotation.dart'; part 'login_info.g.dart'; ///登录信息 @JsonSerializable() class LoginInfo { @JsonKey(name: "phoneNumber") final String? phoneNumber; @JsonKey(name: "id") final String? id; @JsonKey(name: "avatar") final String? avatar; @JsonKey(name: "token") final String? token; LoginInfo ({ this.phoneNumber, this.id, this.avatar, this.token, }); factory LoginInfo.fromJson(Map json) { return _$LoginInfoFromJson(json); } Map toJson() { return _$LoginInfoToJson(this); } }