// 用户基础信息实体类 class UserBaseData { final bool matchmakerFlag; final bool matchmakingCornerFlag; final String nickName; final String phone; final String realName; final String userId; UserBaseData({ required this.matchmakerFlag, required this.matchmakingCornerFlag, required this.nickName, required this.phone, required this.realName, required this.userId, }); // 从JSON映射创建实例 factory UserBaseData.fromJson(Map json) { return UserBaseData( matchmakerFlag: json['matchmakerFlag'] ?? false, matchmakingCornerFlag: json['matchmakingCornerFlag'] ?? false, nickName: json['nickName'] ?? '', phone: json['phone'] ?? '', realName: json['realName'] ?? '', userId: json['userId'] ?? '', ); } // 转换为JSON映射 Map toJson() { return { 'matchmakerFlag': matchmakerFlag, 'matchmakingCornerFlag': matchmakingCornerFlag, 'nickName': nickName, 'phone': phone, 'realName': realName, 'userId': userId, }; } @override String toString() { return 'UserBaseData(matchmakerFlag: $matchmakerFlag, matchmakingCornerFlag: $matchmakingCornerFlag, nickName: $nickName, phone: $phone, realName: $realName, userId: $userId)'; } }