import 'package:json_annotation/json_annotation.dart'; part 'request_friend_info.g.dart'; @JsonSerializable() class RequestFriendInfo { @JsonKey(name: 'id') int id; @JsonKey(name: 'userId') String userId; @JsonKey(name: 'userPhone') String userPhone; @JsonKey(name: 'friendId') String friendId; @JsonKey(name: 'friendPhone') String friendPhone; @JsonKey(name: 'createTime') int createTime; @JsonKey(name: 'status') int status; RequestFriendInfo( {required this.id, required this.userId, required this.userPhone, required this.friendId, required this.friendPhone, required this.createTime, required this.status}); factory RequestFriendInfo.fromJson(Map json) => _$RequestFriendInfoFromJson(json); Map toJson() => _$RequestFriendInfoToJson(this); }