Merge branch 'main' of gitea.haiyihy.com:hy/chatapp3-flutter

This commit is contained in:
ZuoZuo 2026-04-14 14:50:37 +08:00
commit 905e48592e
9 changed files with 719 additions and 559 deletions

View File

@ -29,6 +29,14 @@
"certificate_hash": "9ab21924bfbe2c56555860ebabf23c4099fd7412" "certificate_hash": "9ab21924bfbe2c56555860ebabf23c4099fd7412"
} }
}, },
{
"client_id": "980005024266-vrrp2us89svbqgc93oe7q4ad7uoh8fl6.apps.googleusercontent.com",
"client_type": 1,
"android_info": {
"package_name": "com.org.yumi",
"certificate_hash": "c180afbf6e1ff2f449587287a2bc5407e7d2d9a3"
}
},
{ {
"client_id": "980005024266-dgtthe3q98k8tk873rfdrsnu5ot61p09.apps.googleusercontent.com", "client_id": "980005024266-dgtthe3q98k8tk873rfdrsnu5ot61p09.apps.googleusercontent.com",
"client_type": 3 "client_type": 3
@ -52,4 +60,4 @@
} }
], ],
"configuration_version": "1" "configuration_version": "1"
} }

View File

@ -8,6 +8,7 @@ import 'package:yumi/shared/business_logic/models/res/sc_edit_room_info_res.dart
import 'package:yumi/shared/business_logic/models/res/my_room_res.dart'; import 'package:yumi/shared/business_logic/models/res/my_room_res.dart';
import 'package:yumi/shared/business_logic/models/res/sc_room_contribute_level_res.dart'; import 'package:yumi/shared/business_logic/models/res/sc_room_contribute_level_res.dart';
class SocialChatRoomManager extends ChangeNotifier { class SocialChatRoomManager extends ChangeNotifier {
MyRoomRes? myRoom; MyRoomRes? myRoom;
SCRoomContributeLevelRes? roomContributeLevelRes; SCRoomContributeLevelRes? roomContributeLevelRes;
@ -20,8 +21,15 @@ class SocialChatRoomManager extends ChangeNotifier {
void updateMyRoomInfo(SCEditRoomInfoRes roomInfo) { void updateMyRoomInfo(SCEditRoomInfoRes roomInfo) {
if (myRoom != null && myRoom!.id == roomInfo.id) { if (myRoom != null && myRoom!.id == roomInfo.id) {
myRoom?.setRoomName = roomInfo.roomName ?? ""; if (roomInfo.roomCover != null) {
myRoom?.setRoomDesc = roomInfo.roomDesc ?? ""; myRoom?.setRoomCover = roomInfo.roomCover!;
}
if (roomInfo.roomName != null) {
myRoom?.setRoomName = roomInfo.roomName!;
}
if (roomInfo.roomDesc != null) {
myRoom?.setRoomDesc = roomInfo.roomDesc!;
}
notifyListeners(); notifyListeners();
} }
} }
@ -31,10 +39,15 @@ class SocialChatRoomManager extends ChangeNotifier {
// 使 // 使
if (customName != null) { if (customName != null) {
// TODO: // TODO:
print('创建房间使用自定义名称: $customName'); debugPrint('创建房间使用自定义名称: $customName');
} }
await SCAccountRepository().createRoom(); await SCAccountRepository().createRoom();
myRoom = await SCAccountRepository().myProfile(); myRoom = await SCAccountRepository().myProfile();
if (!context.mounted) {
notifyListeners();
SCLoadingManager.hide();
return;
}
SCTts.show(SCAppLocalizations.of(context)!.createRoomSuccsess); SCTts.show(SCAppLocalizations.of(context)!.createRoomSuccsess);
notifyListeners(); notifyListeners();
SCLoadingManager.hide(); SCLoadingManager.hide();
@ -44,7 +57,7 @@ class SocialChatRoomManager extends ChangeNotifier {
if (forceRefresh) { if (forceRefresh) {
roomContributeLevelRes = null; roomContributeLevelRes = null;
} }
SCChatRoomRepository().roomContributionActivity(roomId).then((value){ SCChatRoomRepository().roomContributionActivity(roomId).then((value) {
roomContributeLevelRes = value; roomContributeLevelRes = value;
notifyListeners(); notifyListeners();
}); });

View File

@ -6,24 +6,22 @@ import 'package:yumi/shared/business_logic/models/res/login_res.dart';
/// roomProfile : {"countryCode":"","countryName":"","event":"","hotRoom":false,"id":"0","layoutKey":"","nationalFlag":"","roomAccount":"","roomBadgeIcons":[""],"roomCover":"","roomDesc":"","roomGameIcon":"","roomName":"","sysOrigin":"","userId":"0","userProfile":{"account":"","accountStatus":"","age":0,"bornDay":0,"bornMonth":0,"bornYear":0,"countryCode":"","countryId":0,"countryName":"","createTime":0,"del":false,"freezingTime":0,"id":"s","originSys":"","ownSpecialId":{"account":"","expiredTime":0},"sameRegion":false,"sysOriginChild":"","useProps":[{"expireTime":0,"propsResources":{"amount":0.0,"code":"","cover":"","expand":"","id":0,"name":"","sourceUrl":"","type":""},"userId":0}],"userAvatar":"","userNickname":"","userSex":0,"wearBadge":[{"animationUrl":"","badgeKey":"","badgeLevel":0,"badgeName":"","expireTime":0,"id":0,"milestone":0,"notSelectUrl":"","selectUrl":"","type":"","userId":0}]},"userSVipLevel":""} /// roomProfile : {"countryCode":"","countryName":"","event":"","hotRoom":false,"id":"0","layoutKey":"","nationalFlag":"","roomAccount":"","roomBadgeIcons":[""],"roomCover":"","roomDesc":"","roomGameIcon":"","roomName":"","sysOrigin":"","userId":"0","userProfile":{"account":"","accountStatus":"","age":0,"bornDay":0,"bornMonth":0,"bornYear":0,"countryCode":"","countryId":0,"countryName":"","createTime":0,"del":false,"freezingTime":0,"id":"s","originSys":"","ownSpecialId":{"account":"","expiredTime":0},"sameRegion":false,"sysOriginChild":"","useProps":[{"expireTime":0,"propsResources":{"amount":0.0,"code":"","cover":"","expand":"","id":0,"name":"","sourceUrl":"","type":""},"userId":0}],"userAvatar":"","userNickname":"","userSex":0,"wearBadge":[{"animationUrl":"","badgeKey":"","badgeLevel":0,"badgeName":"","expireTime":0,"id":0,"milestone":0,"notSelectUrl":"","selectUrl":"","type":"","userId":0}]},"userSVipLevel":""}
class FollowRoomRes { class FollowRoomRes {
FollowRoomRes({ FollowRoomRes({String? id, RoomProfile? roomProfile}) {
String? id,
RoomProfile? roomProfile,}){
_id = id; _id = id;
_roomProfile = roomProfile; _roomProfile = roomProfile;
} }
FollowRoomRes.fromJson(dynamic json) { FollowRoomRes.fromJson(dynamic json) {
_id = json['id']; _id = json['id'];
_roomProfile = json['roomProfile'] != null ? RoomProfile.fromJson(json['roomProfile']) : null; _roomProfile =
json['roomProfile'] != null
? RoomProfile.fromJson(json['roomProfile'])
: null;
} }
String? _id; String? _id;
RoomProfile? _roomProfile; RoomProfile? _roomProfile;
FollowRoomRes copyWith({ String? id, FollowRoomRes copyWith({String? id, RoomProfile? roomProfile}) =>
RoomProfile? roomProfile, FollowRoomRes(id: id ?? _id, roomProfile: roomProfile ?? _roomProfile);
}) => FollowRoomRes( id: id ?? _id,
roomProfile: roomProfile ?? _roomProfile,
);
String? get id => _id; String? get id => _id;
RoomProfile? get roomProfile => _roomProfile; RoomProfile? get roomProfile => _roomProfile;
@ -35,7 +33,6 @@ FollowRoomRes copyWith({ String? id,
} }
return map; return map;
} }
} }
/// countryCode : "" /// countryCode : ""
@ -58,23 +55,25 @@ FollowRoomRes copyWith({ String? id,
class RoomProfile { class RoomProfile {
RoomProfile({ RoomProfile({
String? countryCode, String? countryCode,
String? countryName, String? countryName,
String? event, String? event,
bool? hotRoom, bool? hotRoom,
String? id, String? id,
String? layoutKey, String? layoutKey,
String? nationalFlag, String? nationalFlag,
String? roomAccount, String? roomAccount,
List<String>? roomBadgeIcons, List<String>? roomBadgeIcons,
String? roomCover, String? roomCover,
String? roomDesc, String? roomDesc,
String? roomGameIcon, String? roomGameIcon,
String? roomName, String? roomName,
String? sysOrigin, String? sysOrigin,
String? userId, String? userId,
SocialChatUserProfile? userProfile, SocialChatUserProfile? userProfile,
String? userSVipLevel,ExtValues? extValues,}){ String? userSVipLevel,
ExtValues? extValues,
}) {
_countryCode = countryCode; _countryCode = countryCode;
_countryName = countryName; _countryName = countryName;
_event = event; _event = event;
@ -93,7 +92,7 @@ class RoomProfile {
_userProfile = userProfile; _userProfile = userProfile;
_userSVipLevel = userSVipLevel; _userSVipLevel = userSVipLevel;
_extValues = extValues; _extValues = extValues;
} }
RoomProfile.fromJson(dynamic json) { RoomProfile.fromJson(dynamic json) {
_countryCode = json['countryCode']; _countryCode = json['countryCode'];
@ -104,19 +103,25 @@ class RoomProfile {
_layoutKey = json['layoutKey']; _layoutKey = json['layoutKey'];
_nationalFlag = json['nationalFlag']; _nationalFlag = json['nationalFlag'];
_roomAccount = json['roomAccount']; _roomAccount = json['roomAccount'];
_roomBadgeIcons = json['roomBadgeIcons'] != null ? json['roomBadgeIcons'].cast<String>() : []; _roomBadgeIcons =
_roomCover = json['roomCover']; json['roomBadgeIcons'] != null
? json['roomBadgeIcons'].cast<String>()
: [];
_roomCover = json['roomCover'] ?? json['cover'];
_roomDesc = json['roomDesc']; _roomDesc = json['roomDesc'];
_roomGameIcon = json['roomGameIcon']; _roomGameIcon = json['roomGameIcon'];
_roomName = json['roomName']; _roomName = json['roomName'];
_sysOrigin = json['sysOrigin']; _sysOrigin = json['sysOrigin'];
_userId = json['userId']; _userId = json['userId'];
_userProfile = json['userProfile'] != null ? SocialChatUserProfile.fromJson(json['userProfile']) : null; _userProfile =
json['userProfile'] != null
? SocialChatUserProfile.fromJson(json['userProfile'])
: null;
_userSVipLevel = json['userSVipLevel']; _userSVipLevel = json['userSVipLevel'];
_extValues = _extValues =
json['extValues'] != null json['extValues'] != null
? ExtValues.fromJson(json['extValues']) ? ExtValues.fromJson(json['extValues'])
: null; : null;
} }
String? _countryCode; String? _countryCode;
String? _countryName; String? _countryName;
@ -136,43 +141,45 @@ class RoomProfile {
SocialChatUserProfile? _userProfile; SocialChatUserProfile? _userProfile;
String? _userSVipLevel; String? _userSVipLevel;
ExtValues? _extValues; ExtValues? _extValues;
RoomProfile copyWith({ String? countryCode, RoomProfile copyWith({
String? countryName, String? countryCode,
String? event, String? countryName,
bool? hotRoom, String? event,
String? id, bool? hotRoom,
String? layoutKey, String? id,
String? nationalFlag, String? layoutKey,
String? roomAccount, String? nationalFlag,
List<String>? roomBadgeIcons, String? roomAccount,
String? roomCover, List<String>? roomBadgeIcons,
String? roomDesc, String? roomCover,
String? roomGameIcon, String? roomDesc,
String? roomName, String? roomGameIcon,
String? sysOrigin, String? roomName,
String? userId, String? sysOrigin,
SocialChatUserProfile? userProfile, String? userId,
String? userSVipLevel, SocialChatUserProfile? userProfile,
ExtValues? extValues, String? userSVipLevel,
}) => RoomProfile( countryCode: countryCode ?? _countryCode, ExtValues? extValues,
countryName: countryName ?? _countryName, }) => RoomProfile(
event: event ?? _event, countryCode: countryCode ?? _countryCode,
hotRoom: hotRoom ?? _hotRoom, countryName: countryName ?? _countryName,
id: id ?? _id, event: event ?? _event,
layoutKey: layoutKey ?? _layoutKey, hotRoom: hotRoom ?? _hotRoom,
nationalFlag: nationalFlag ?? _nationalFlag, id: id ?? _id,
roomAccount: roomAccount ?? _roomAccount, layoutKey: layoutKey ?? _layoutKey,
roomBadgeIcons: roomBadgeIcons ?? _roomBadgeIcons, nationalFlag: nationalFlag ?? _nationalFlag,
roomCover: roomCover ?? _roomCover, roomAccount: roomAccount ?? _roomAccount,
roomDesc: roomDesc ?? _roomDesc, roomBadgeIcons: roomBadgeIcons ?? _roomBadgeIcons,
roomGameIcon: roomGameIcon ?? _roomGameIcon, roomCover: roomCover ?? _roomCover,
roomName: roomName ?? _roomName, roomDesc: roomDesc ?? _roomDesc,
sysOrigin: sysOrigin ?? _sysOrigin, roomGameIcon: roomGameIcon ?? _roomGameIcon,
userId: userId ?? _userId, roomName: roomName ?? _roomName,
userProfile: userProfile ?? _userProfile, sysOrigin: sysOrigin ?? _sysOrigin,
userSVipLevel: userSVipLevel ?? _userSVipLevel, userId: userId ?? _userId,
extValues: extValues ?? _extValues, userProfile: userProfile ?? _userProfile,
); userSVipLevel: userSVipLevel ?? _userSVipLevel,
extValues: extValues ?? _extValues,
);
String? get countryCode => _countryCode; String? get countryCode => _countryCode;
String? get countryName => _countryName; String? get countryName => _countryName;
String? get event => _event; String? get event => _event;
@ -218,7 +225,6 @@ RoomProfile copyWith({ String? countryCode,
} }
return map; return map;
} }
} }
/// account : "" /// account : ""
@ -246,17 +252,18 @@ RoomProfile copyWith({ String? countryCode,
class WearBadge { class WearBadge {
WearBadge({ WearBadge({
String? animationUrl, String? animationUrl,
String? badgeKey, String? badgeKey,
num? badgeLevel, num? badgeLevel,
String? badgeName, String? badgeName,
num? expireTime, num? expireTime,
num? id, num? id,
num? milestone, num? milestone,
String? notSelectUrl, String? notSelectUrl,
String? selectUrl, String? selectUrl,
String? type, String? type,
num? userId,}){ num? userId,
}) {
_animationUrl = animationUrl; _animationUrl = animationUrl;
_badgeKey = badgeKey; _badgeKey = badgeKey;
_badgeLevel = badgeLevel; _badgeLevel = badgeLevel;
@ -268,7 +275,7 @@ class WearBadge {
_selectUrl = selectUrl; _selectUrl = selectUrl;
_type = type; _type = type;
_userId = userId; _userId = userId;
} }
WearBadge.fromJson(dynamic json) { WearBadge.fromJson(dynamic json) {
_animationUrl = json['animationUrl']; _animationUrl = json['animationUrl'];
@ -294,29 +301,31 @@ class WearBadge {
String? _selectUrl; String? _selectUrl;
String? _type; String? _type;
num? _userId; num? _userId;
WearBadge copyWith({ String? animationUrl, WearBadge copyWith({
String? badgeKey, String? animationUrl,
num? badgeLevel, String? badgeKey,
String? badgeName, num? badgeLevel,
num? expireTime, String? badgeName,
num? id, num? expireTime,
num? milestone, num? id,
String? notSelectUrl, num? milestone,
String? selectUrl, String? notSelectUrl,
String? type, String? selectUrl,
num? userId, String? type,
}) => WearBadge( animationUrl: animationUrl ?? _animationUrl, num? userId,
badgeKey: badgeKey ?? _badgeKey, }) => WearBadge(
badgeLevel: badgeLevel ?? _badgeLevel, animationUrl: animationUrl ?? _animationUrl,
badgeName: badgeName ?? _badgeName, badgeKey: badgeKey ?? _badgeKey,
expireTime: expireTime ?? _expireTime, badgeLevel: badgeLevel ?? _badgeLevel,
id: id ?? _id, badgeName: badgeName ?? _badgeName,
milestone: milestone ?? _milestone, expireTime: expireTime ?? _expireTime,
notSelectUrl: notSelectUrl ?? _notSelectUrl, id: id ?? _id,
selectUrl: selectUrl ?? _selectUrl, milestone: milestone ?? _milestone,
type: type ?? _type, notSelectUrl: notSelectUrl ?? _notSelectUrl,
userId: userId ?? _userId, selectUrl: selectUrl ?? _selectUrl,
); type: type ?? _type,
userId: userId ?? _userId,
);
String? get animationUrl => _animationUrl; String? get animationUrl => _animationUrl;
String? get badgeKey => _badgeKey; String? get badgeKey => _badgeKey;
num? get badgeLevel => _badgeLevel; num? get badgeLevel => _badgeLevel;
@ -344,7 +353,6 @@ WearBadge copyWith({ String? animationUrl,
map['userId'] = _userId; map['userId'] = _userId;
return map; return map;
} }
} }
/// expireTime : 0 /// expireTime : 0
@ -352,30 +360,32 @@ WearBadge copyWith({ String? animationUrl,
/// userId : 0 /// userId : 0
class UseProps { class UseProps {
UseProps({ UseProps({num? expireTime, PropsResources? propsResources, num? userId}) {
num? expireTime,
PropsResources? propsResources,
num? userId,}){
_expireTime = expireTime; _expireTime = expireTime;
_propsResources = propsResources; _propsResources = propsResources;
_userId = userId; _userId = userId;
} }
UseProps.fromJson(dynamic json) { UseProps.fromJson(dynamic json) {
_expireTime = json['expireTime']; _expireTime = json['expireTime'];
_propsResources = json['propsResources'] != null ? PropsResources.fromJson(json['propsResources']) : null; _propsResources =
json['propsResources'] != null
? PropsResources.fromJson(json['propsResources'])
: null;
_userId = json['userId']; _userId = json['userId'];
} }
num? _expireTime; num? _expireTime;
PropsResources? _propsResources; PropsResources? _propsResources;
num? _userId; num? _userId;
UseProps copyWith({ num? expireTime, UseProps copyWith({
PropsResources? propsResources, num? expireTime,
num? userId, PropsResources? propsResources,
}) => UseProps( expireTime: expireTime ?? _expireTime, num? userId,
propsResources: propsResources ?? _propsResources, }) => UseProps(
userId: userId ?? _userId, expireTime: expireTime ?? _expireTime,
); propsResources: propsResources ?? _propsResources,
userId: userId ?? _userId,
);
num? get expireTime => _expireTime; num? get expireTime => _expireTime;
PropsResources? get propsResources => _propsResources; PropsResources? get propsResources => _propsResources;
num? get userId => _userId; num? get userId => _userId;
@ -389,7 +399,6 @@ UseProps copyWith({ num? expireTime,
map['userId'] = _userId; map['userId'] = _userId;
return map; return map;
} }
} }
/// amount : 0.0 /// amount : 0.0
@ -403,14 +412,15 @@ UseProps copyWith({ num? expireTime,
class PropsResources { class PropsResources {
PropsResources({ PropsResources({
num? amount, num? amount,
String? code, String? code,
String? cover, String? cover,
String? expand, String? expand,
num? id, num? id,
String? name, String? name,
String? sourceUrl, String? sourceUrl,
String? type,}){ String? type,
}) {
_amount = amount; _amount = amount;
_code = code; _code = code;
_cover = cover; _cover = cover;
@ -419,7 +429,7 @@ class PropsResources {
_name = name; _name = name;
_sourceUrl = sourceUrl; _sourceUrl = sourceUrl;
_type = type; _type = type;
} }
PropsResources.fromJson(dynamic json) { PropsResources.fromJson(dynamic json) {
_amount = json['amount']; _amount = json['amount'];
@ -439,23 +449,25 @@ class PropsResources {
String? _name; String? _name;
String? _sourceUrl; String? _sourceUrl;
String? _type; String? _type;
PropsResources copyWith({ num? amount, PropsResources copyWith({
String? code, num? amount,
String? cover, String? code,
String? expand, String? cover,
num? id, String? expand,
String? name, num? id,
String? sourceUrl, String? name,
String? type, String? sourceUrl,
}) => PropsResources( amount: amount ?? _amount, String? type,
code: code ?? _code, }) => PropsResources(
cover: cover ?? _cover, amount: amount ?? _amount,
expand: expand ?? _expand, code: code ?? _code,
id: id ?? _id, cover: cover ?? _cover,
name: name ?? _name, expand: expand ?? _expand,
sourceUrl: sourceUrl ?? _sourceUrl, id: id ?? _id,
type: type ?? _type, name: name ?? _name,
); sourceUrl: sourceUrl ?? _sourceUrl,
type: type ?? _type,
);
num? get amount => _amount; num? get amount => _amount;
String? get code => _code; String? get code => _code;
String? get cover => _cover; String? get cover => _cover;
@ -477,19 +489,16 @@ PropsResources copyWith({ num? amount,
map['type'] = _type; map['type'] = _type;
return map; return map;
} }
} }
/// account : "" /// account : ""
/// expiredTime : 0 /// expiredTime : 0
class OwnSpecialId { class OwnSpecialId {
OwnSpecialId({ OwnSpecialId({String? account, num? expiredTime}) {
String? account,
num? expiredTime,}){
_account = account; _account = account;
_expiredTime = expiredTime; _expiredTime = expiredTime;
} }
OwnSpecialId.fromJson(dynamic json) { OwnSpecialId.fromJson(dynamic json) {
_account = json['account']; _account = json['account'];
@ -497,11 +506,10 @@ class OwnSpecialId {
} }
String? _account; String? _account;
num? _expiredTime; num? _expiredTime;
OwnSpecialId copyWith({ String? account, OwnSpecialId copyWith({String? account, num? expiredTime}) => OwnSpecialId(
num? expiredTime, account: account ?? _account,
}) => OwnSpecialId( account: account ?? _account, expiredTime: expiredTime ?? _expiredTime,
expiredTime: expiredTime ?? _expiredTime, );
);
String? get account => _account; String? get account => _account;
num? get expiredTime => _expiredTime; num? get expiredTime => _expiredTime;
@ -511,5 +519,4 @@ OwnSpecialId copyWith({ String? account,
map['expiredTime'] = _expiredTime; map['expiredTime'] = _expiredTime;
return map; return map;
} }
}
}

View File

@ -696,7 +696,7 @@ class RoomProfile2 {
_langCode = json['langCode']; _langCode = json['langCode'];
_nationalFlag = json['nationalFlag']; _nationalFlag = json['nationalFlag'];
_roomAccount = json['roomAccount']; _roomAccount = json['roomAccount'];
_roomCover = json['roomCover']; _roomCover = json['roomCover'] ?? json['cover'];
_roomDesc = json['roomDesc']; _roomDesc = json['roomDesc'];
_roomName = json['roomName']; _roomName = json['roomName'];
_sysOrigin = json['sysOrigin']; _sysOrigin = json['sysOrigin'];

View File

@ -43,7 +43,8 @@ class MyRoomRes {
num? activeTime, num? activeTime,
RoomSetting? setting, RoomSetting? setting,
RoomCounter? counter, RoomCounter? counter,
List<UseBadges>? useBadges,}){ List<UseBadges>? useBadges,
}) {
_id = id; _id = id;
_roomAccount = roomAccount; _roomAccount = roomAccount;
_userId = userId; _userId = userId;
@ -69,7 +70,7 @@ class MyRoomRes {
_id = json['id']; _id = json['id'];
_roomAccount = json['roomAccount']; _roomAccount = json['roomAccount'];
_userId = json['userId']; _userId = json['userId'];
_roomCover = json['roomCover']; _roomCover = json['roomCover'] ?? json['cover'];
_roomName = json['roomName']; _roomName = json['roomName'];
_roomDesc = json['roomDesc']; _roomDesc = json['roomDesc'];
_event = json['event']; _event = json['event'];
@ -82,8 +83,10 @@ class MyRoomRes {
_createTime = json['createTime']; _createTime = json['createTime'];
_updateTime = json['updateTime']; _updateTime = json['updateTime'];
_activeTime = json['activeTime']; _activeTime = json['activeTime'];
_setting = json['setting'] != null ? RoomSetting.fromJson(json['setting']) : null; _setting =
_counter = json['counter'] != null ? RoomCounter.fromJson(json['counter']) : null; json['setting'] != null ? RoomSetting.fromJson(json['setting']) : null;
_counter =
json['counter'] != null ? RoomCounter.fromJson(json['counter']) : null;
if (json['useBadges'] != null) { if (json['useBadges'] != null) {
_useBadges = []; _useBadges = [];
json['useBadges'].forEach((v) { json['useBadges'].forEach((v) {
@ -110,7 +113,8 @@ class MyRoomRes {
RoomSetting? _setting; RoomSetting? _setting;
RoomCounter? _counter; RoomCounter? _counter;
List<UseBadges>? _useBadges; List<UseBadges>? _useBadges;
MyRoomRes copyWith({ String? id, MyRoomRes copyWith({
String? id,
String? roomAccount, String? roomAccount,
String? userId, String? userId,
String? roomCover, String? roomCover,
@ -129,7 +133,8 @@ class MyRoomRes {
RoomSetting? setting, RoomSetting? setting,
RoomCounter? counter, RoomCounter? counter,
List<UseBadges>? useBadges, List<UseBadges>? useBadges,
}) => MyRoomRes( id: id ?? _id, }) => MyRoomRes(
id: id ?? _id,
roomAccount: roomAccount ?? _roomAccount, roomAccount: roomAccount ?? _roomAccount,
userId: userId ?? _userId, userId: userId ?? _userId,
roomCover: roomCover ?? _roomCover, roomCover: roomCover ?? _roomCover,
@ -201,7 +206,6 @@ class MyRoomRes {
} }
return map; return map;
} }
} }
/// id : 0 /// id : 0
@ -228,7 +232,8 @@ class UseBadges {
String? selectUrl, String? selectUrl,
String? notSelectUrl, String? notSelectUrl,
String? animationUrl, String? animationUrl,
String? expireTime,}){ String? expireTime,
}) {
_id = id; _id = id;
_userId = userId; _userId = userId;
_badgeLevel = badgeLevel; _badgeLevel = badgeLevel;
@ -266,7 +271,8 @@ class UseBadges {
String? _notSelectUrl; String? _notSelectUrl;
String? _animationUrl; String? _animationUrl;
String? _expireTime; String? _expireTime;
UseBadges copyWith({ num? id, UseBadges copyWith({
num? id,
num? userId, num? userId,
num? badgeLevel, num? badgeLevel,
num? milestone, num? milestone,
@ -277,7 +283,8 @@ class UseBadges {
String? notSelectUrl, String? notSelectUrl,
String? animationUrl, String? animationUrl,
String? expireTime, String? expireTime,
}) => UseBadges( id: id ?? _id, }) => UseBadges(
id: id ?? _id,
userId: userId ?? _userId, userId: userId ?? _userId,
badgeLevel: badgeLevel ?? _badgeLevel, badgeLevel: badgeLevel ?? _badgeLevel,
milestone: milestone ?? _milestone, milestone: milestone ?? _milestone,
@ -316,5 +323,4 @@ class UseBadges {
map['expireTime'] = _expireTime; map['expireTime'] = _expireTime;
return map; return map;
} }
} }

View File

@ -74,7 +74,7 @@ class SocialChatRoomRes {
.map((item) => item as String) .map((item) => item as String)
.toList() .toList()
: null; : null;
_roomCover = json['roomCover']; _roomCover = json['roomCover'] ?? json['cover'];
_roomDesc = json['roomDesc']; _roomDesc = json['roomDesc'];
_roomGameIcon = json['roomGameIcon']; _roomGameIcon = json['roomGameIcon'];
_roomName = json['roomName']; _roomName = json['roomName'];
@ -86,9 +86,9 @@ class SocialChatRoomRes {
: null; : null;
_userSVipLevel = json['userSVipLevel']; _userSVipLevel = json['userSVipLevel'];
_extValues = _extValues =
json['extValues'] != null json['extValues'] != null
? ExtValues.fromJson(json['extValues']) ? ExtValues.fromJson(json['extValues'])
: null; : null;
} }
String? _countryCode; String? _countryCode;
@ -441,7 +441,8 @@ class RoomSetting {
bool? showHeartbeat, bool? showHeartbeat,
String? roomSpecialMikeType, String? roomSpecialMikeType,
num? roomSpecialMikeExpireTime, num? roomSpecialMikeExpireTime,
String? roomSpecialMikeExpireType,}){ String? roomSpecialMikeExpireType,
}) {
_password = password; _password = password;
_takeMicRole = takeMicRole; _takeMicRole = takeMicRole;
_touristMike = touristMike; _touristMike = touristMike;
@ -488,7 +489,8 @@ class RoomSetting {
String? _roomSpecialMikeType; String? _roomSpecialMikeType;
num? _roomSpecialMikeExpireTime; num? _roomSpecialMikeExpireTime;
String? _roomSpecialMikeExpireType; String? _roomSpecialMikeExpireType;
RoomSetting copyWith({ String? password, RoomSetting copyWith({
String? password,
String? takeMicRole, String? takeMicRole,
bool? touristMike, bool? touristMike,
bool? touristMsg, bool? touristMsg,
@ -502,7 +504,8 @@ class RoomSetting {
String? roomSpecialMikeType, String? roomSpecialMikeType,
num? roomSpecialMikeExpireTime, num? roomSpecialMikeExpireTime,
String? roomSpecialMikeExpireType, String? roomSpecialMikeExpireType,
}) => RoomSetting( password: password ?? _password, }) => RoomSetting(
password: password ?? _password,
takeMicRole: takeMicRole ?? _takeMicRole, takeMicRole: takeMicRole ?? _takeMicRole,
touristMike: touristMike ?? _touristMike, touristMike: touristMike ?? _touristMike,
touristMsg: touristMsg ?? _touristMsg, touristMsg: touristMsg ?? _touristMsg,
@ -514,8 +517,10 @@ class RoomSetting {
adminLockSeat: adminLockSeat ?? _adminLockSeat, adminLockSeat: adminLockSeat ?? _adminLockSeat,
showHeartbeat: showHeartbeat ?? _showHeartbeat, showHeartbeat: showHeartbeat ?? _showHeartbeat,
roomSpecialMikeType: roomSpecialMikeType ?? _roomSpecialMikeType, roomSpecialMikeType: roomSpecialMikeType ?? _roomSpecialMikeType,
roomSpecialMikeExpireTime: roomSpecialMikeExpireTime ?? _roomSpecialMikeExpireTime, roomSpecialMikeExpireTime:
roomSpecialMikeExpireType: roomSpecialMikeExpireType ?? _roomSpecialMikeExpireType, roomSpecialMikeExpireTime ?? _roomSpecialMikeExpireTime,
roomSpecialMikeExpireType:
roomSpecialMikeExpireType ?? _roomSpecialMikeExpireType,
); );
String? get password => _password; String? get password => _password;
String? get takeMicRole => _takeMicRole; String? get takeMicRole => _takeMicRole;
@ -550,8 +555,8 @@ class RoomSetting {
map['roomSpecialMikeExpireType'] = _roomSpecialMikeExpireType; map['roomSpecialMikeExpireType'] = _roomSpecialMikeExpireType;
return map; return map;
} }
} }
/// expireTime : 0 /// expireTime : 0
/// propsResources : {"amount":0.0,"code":"","cover":"","expand":"","id":0,"name":"","sourceUrl":"","type":""} /// propsResources : {"amount":0.0,"code":"","cover":"","expand":"","id":0,"name":"","sourceUrl":"","type":""}
/// userId : 0 /// userId : 0

View File

@ -1,159 +1,161 @@
/// id : 0 // id : 0
/// roomAccount : "" // roomAccount : ""
/// userId : 0 // userId : 0
/// roomCover : "" // roomCover : ""
/// roomName : "" // roomName : ""
/// roomDesc : "" // roomDesc : ""
/// event : "" // event : ""
/// sysOrigin : "" // sysOrigin : ""
/// countryCode : "" // countryCode : ""
/// countryName : "" // countryName : ""
/// nationalFlag : "" // nationalFlag : ""
/// langCode : "" // langCode : ""
/// del : false // del : false
/// createTime : 0 // createTime : 0
/// updateTime : 0 // updateTime : 0
/// activeTime : 0 // activeTime : 0
class SCEditRoomInfoRes { class SCEditRoomInfoRes {
SCEditRoomInfoRes({ SCEditRoomInfoRes({
String? id, String? id,
String? roomAccount, String? roomAccount,
String? userId, String? userId,
String? roomCover, String? roomCover,
String? roomName, String? roomName,
String? roomDesc, String? roomDesc,
String? event, String? event,
String? sysOrigin, String? sysOrigin,
String? countryCode, String? countryCode,
String? countryName, String? countryName,
String? nationalFlag, String? nationalFlag,
String? langCode, String? langCode,
bool? del, bool? del,
num? createTime, num? createTime,
num? updateTime, num? updateTime,
num? activeTime,}){ num? activeTime,
_id = id; }) {
_roomAccount = roomAccount; _id = id;
_userId = userId; _roomAccount = roomAccount;
_roomCover = roomCover; _userId = userId;
_roomName = roomName; _roomCover = roomCover;
_roomDesc = roomDesc; _roomName = roomName;
_event = event; _roomDesc = roomDesc;
_sysOrigin = sysOrigin; _event = event;
_countryCode = countryCode; _sysOrigin = sysOrigin;
_countryName = countryName; _countryCode = countryCode;
_nationalFlag = nationalFlag; _countryName = countryName;
_langCode = langCode; _nationalFlag = nationalFlag;
_del = del; _langCode = langCode;
_createTime = createTime; _del = del;
_updateTime = updateTime; _createTime = createTime;
_activeTime = activeTime; _updateTime = updateTime;
} _activeTime = activeTime;
}
SCEditRoomInfoRes.fromJson(dynamic json) {
_id = json['id']; SCEditRoomInfoRes.fromJson(dynamic json) {
_roomAccount = json['roomAccount']; _id = json['id'];
_userId = json['userId']; _roomAccount = json['roomAccount'];
_roomCover = json['roomCover']; _userId = json['userId'];
_roomName = json['roomName']; _roomCover = json['roomCover'] ?? json['cover'];
_roomDesc = json['roomDesc']; _roomName = json['roomName'];
_event = json['event']; _roomDesc = json['roomDesc'];
_sysOrigin = json['sysOrigin']; _event = json['event'];
_countryCode = json['countryCode']; _sysOrigin = json['sysOrigin'];
_countryName = json['countryName']; _countryCode = json['countryCode'];
_nationalFlag = json['nationalFlag']; _countryName = json['countryName'];
_langCode = json['langCode']; _nationalFlag = json['nationalFlag'];
_del = json['del']; _langCode = json['langCode'];
_createTime = json['createTime']; _del = json['del'];
_updateTime = json['updateTime']; _createTime = json['createTime'];
_activeTime = json['activeTime']; _updateTime = json['updateTime'];
} _activeTime = json['activeTime'];
String? _id; }
String? _roomAccount; String? _id;
String? _userId; String? _roomAccount;
String? _roomCover; String? _userId;
String? _roomName; String? _roomCover;
String? _roomDesc; String? _roomName;
String? _event; String? _roomDesc;
String? _sysOrigin; String? _event;
String? _countryCode; String? _sysOrigin;
String? _countryName; String? _countryCode;
String? _nationalFlag; String? _countryName;
String? _langCode; String? _nationalFlag;
bool? _del; String? _langCode;
num? _createTime; bool? _del;
num? _updateTime; num? _createTime;
num? _activeTime; num? _updateTime;
SCEditRoomInfoRes copyWith({ String? id, num? _activeTime;
String? roomAccount, SCEditRoomInfoRes copyWith({
String? userId, String? id,
String? roomCover, String? roomAccount,
String? roomName, String? userId,
String? roomDesc, String? roomCover,
String? event, String? roomName,
String? sysOrigin, String? roomDesc,
String? countryCode, String? event,
String? countryName, String? sysOrigin,
String? nationalFlag, String? countryCode,
String? langCode, String? countryName,
bool? del, String? nationalFlag,
num? createTime, String? langCode,
num? updateTime, bool? del,
num? activeTime, num? createTime,
}) => SCEditRoomInfoRes( id: id ?? _id, num? updateTime,
roomAccount: roomAccount ?? _roomAccount, num? activeTime,
userId: userId ?? _userId, }) => SCEditRoomInfoRes(
roomCover: roomCover ?? _roomCover, id: id ?? _id,
roomName: roomName ?? _roomName, roomAccount: roomAccount ?? _roomAccount,
roomDesc: roomDesc ?? _roomDesc, userId: userId ?? _userId,
event: event ?? _event, roomCover: roomCover ?? _roomCover,
sysOrigin: sysOrigin ?? _sysOrigin, roomName: roomName ?? _roomName,
countryCode: countryCode ?? _countryCode, roomDesc: roomDesc ?? _roomDesc,
countryName: countryName ?? _countryName, event: event ?? _event,
nationalFlag: nationalFlag ?? _nationalFlag, sysOrigin: sysOrigin ?? _sysOrigin,
langCode: langCode ?? _langCode, countryCode: countryCode ?? _countryCode,
del: del ?? _del, countryName: countryName ?? _countryName,
createTime: createTime ?? _createTime, nationalFlag: nationalFlag ?? _nationalFlag,
updateTime: updateTime ?? _updateTime, langCode: langCode ?? _langCode,
activeTime: activeTime ?? _activeTime, del: del ?? _del,
); createTime: createTime ?? _createTime,
String? get id => _id; updateTime: updateTime ?? _updateTime,
String? get roomAccount => _roomAccount; activeTime: activeTime ?? _activeTime,
String? get userId => _userId; );
String? get roomCover => _roomCover; String? get id => _id;
String? get roomName => _roomName; String? get roomAccount => _roomAccount;
String? get roomDesc => _roomDesc; String? get userId => _userId;
String? get event => _event; String? get roomCover => _roomCover;
String? get sysOrigin => _sysOrigin; String? get roomName => _roomName;
String? get countryCode => _countryCode; String? get roomDesc => _roomDesc;
String? get countryName => _countryName; String? get event => _event;
String? get nationalFlag => _nationalFlag; String? get sysOrigin => _sysOrigin;
String? get langCode => _langCode; String? get countryCode => _countryCode;
bool? get del => _del; String? get countryName => _countryName;
num? get createTime => _createTime; String? get nationalFlag => _nationalFlag;
num? get updateTime => _updateTime; String? get langCode => _langCode;
num? get activeTime => _activeTime; bool? get del => _del;
num? get createTime => _createTime;
Map<String, dynamic> toJson() { num? get updateTime => _updateTime;
final map = <String, dynamic>{}; num? get activeTime => _activeTime;
map['id'] = _id;
map['roomAccount'] = _roomAccount; Map<String, dynamic> toJson() {
map['userId'] = _userId; final map = <String, dynamic>{};
map['roomCover'] = _roomCover; map['id'] = _id;
map['roomName'] = _roomName; map['roomAccount'] = _roomAccount;
map['roomDesc'] = _roomDesc; map['userId'] = _userId;
map['event'] = _event; map['roomCover'] = _roomCover;
map['sysOrigin'] = _sysOrigin; map['roomName'] = _roomName;
map['countryCode'] = _countryCode; map['roomDesc'] = _roomDesc;
map['countryName'] = _countryName; map['event'] = _event;
map['nationalFlag'] = _nationalFlag; map['sysOrigin'] = _sysOrigin;
map['langCode'] = _langCode; map['countryCode'] = _countryCode;
map['del'] = _del; map['countryName'] = _countryName;
map['createTime'] = _createTime; map['nationalFlag'] = _nationalFlag;
map['updateTime'] = _updateTime; map['langCode'] = _langCode;
map['activeTime'] = _activeTime; map['del'] = _del;
return map; map['createTime'] = _createTime;
} map['updateTime'] = _updateTime;
map['activeTime'] = _activeTime;
} return map;
}
}

View File

@ -1,212 +1,316 @@
import 'dart:ui' as ui; import 'package:extended_text/extended_text.dart';
import 'package:extended_text_field/extended_text_field.dart';
import 'package:extended_text_field/extended_text_field.dart'; import 'package:flutter/material.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:flutter/material.dart'; import 'package:provider/provider.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:yumi/app/config/business_logic_strategy.dart';
import 'package:yumi/app_localizations.dart'; import 'package:yumi/app/constants/sc_emoji_datas.dart';
import 'package:yumi/app/constants/sc_room_msg_type.dart'; import 'package:yumi/app/constants/sc_global_config.dart';
import 'package:yumi/shared/data_sources/sources/local/user_manager.dart'; import 'package:yumi/app/constants/sc_room_msg_type.dart';
import 'package:yumi/shared/business_logic/usecases/sc_case.dart'; import 'package:yumi/app/constants/sc_screen.dart';
import 'package:provider/provider.dart'; import 'package:yumi/app_localizations.dart';
import 'package:yumi/app/constants/sc_screen.dart'; import 'package:yumi/services/audio/rtc_manager.dart';
import 'package:yumi/ui_kit/widgets/room/room_msg_item.dart'; import 'package:yumi/services/audio/rtm_manager.dart';
import 'package:yumi/services/audio/rtc_manager.dart'; import 'package:yumi/shared/business_logic/usecases/sc_case.dart';
import 'package:yumi/services/audio/rtm_manager.dart'; import 'package:yumi/shared/data_sources/sources/local/user_manager.dart';
import 'package:yumi/shared/tools/sc_keybord_util.dart';
/// import 'package:yumi/ui_kit/widgets/room/room_msg_item.dart';
class RoomMsgInput extends StatefulWidget {
String? atTextContent; ///
class RoomMsgInput extends StatefulWidget {
RoomMsgInput({this.atTextContent}); final String? atTextContent;
@override const RoomMsgInput({super.key, this.atTextContent});
_RoomMsgInputState createState() => _RoomMsgInputState();
} @override
State<RoomMsgInput> createState() => _RoomMsgInputState();
class _RoomMsgInputState extends State<RoomMsgInput> { }
bool showSend = false;
class _RoomMsgInputState extends State<RoomMsgInput> {
FocusNode msgNode = FocusNode(); bool showSend = false;
bool showEmoji = false;
TextEditingController controller = TextEditingController();
final FocusNode msgNode = FocusNode();
@override final TextEditingController controller = TextEditingController();
void initState() {
super.initState(); BusinessLogicStrategy get _strategy => SCGlobalConfig.businessLogicStrategy;
if (widget.atTextContent != null) { Color get _panelBackgroundColor => Colors.white24;
controller.value = TextEditingValue(text: widget.atTextContent ?? "");
} @override
} void initState() {
super.initState();
@override if (widget.atTextContent != null) {
Widget build(BuildContext context) { controller.value = TextEditingValue(text: widget.atTextContent ?? "");
// FocusScope.of(context).requestFocus(msgNode); showSend = controller.text.trim().isNotEmpty;
return Scaffold( }
backgroundColor: Colors.transparent, }
body: Column(
children: <Widget>[ @override
Expanded( void dispose() {
child: GestureDetector( controller.dispose();
onTap: () { msgNode.dispose();
Navigator.pop(context); super.dispose();
}, }
),
), @override
float(context), Widget build(BuildContext context) {
], final keyboardHeight = MediaQuery.of(context).viewInsets.bottom;
), return Scaffold(
); backgroundColor: Colors.transparent,
} resizeToAvoidBottomInset: false,
body: Column(
Widget float(BuildContext context) { children: <Widget>[
return Container( Expanded(
decoration: BoxDecoration(color: Colors.black), child: GestureDetector(
padding: EdgeInsets.symmetric(horizontal: 25.w, vertical: 12.w), behavior: HitTestBehavior.opaque,
height: 56.0, onTap: () {
child: Container( Navigator.pop(context);
decoration: BoxDecoration( },
color: Colors.white24, ),
borderRadius: BorderRadius.circular(height(5)), ),
), AnimatedPadding(
child: Row( duration: const Duration(milliseconds: 220),
children: [ curve: Curves.easeOut,
Expanded( padding: EdgeInsets.only(bottom: keyboardHeight),
child: ExtendedTextField( child: _buildBottomPanel(context),
controller: controller, ),
textDirection: ],
widget.atTextContent != null ? TextDirection.ltr : null, ),
specialTextSpanBuilder: AtTextSpanBuilder(), );
focusNode: msgNode, }
autofocus: true,
onSubmitted: (s) { Widget _buildBottomPanel(BuildContext context) {
Navigator.pop(context); return Container(
if (controller.text.isNotEmpty) { color: Colors.black,
var currenRoom = child: SafeArea(
Provider.of<RtcProvider>( top: false,
context, child: Padding(
listen: false, padding: EdgeInsets.fromLTRB(25.w, 12.w, 25.w, 12.w),
).currenRoom; child: Column(
if (currenRoom != null) { mainAxisSize: MainAxisSize.min,
Provider.of<RtmProvider>(context, listen: false).dispatchMessage( children: [
Msg( Row(
groupId: crossAxisAlignment: CrossAxisAlignment.center,
currenRoom children: [
.roomProfile GestureDetector(
?.roomProfile behavior: HitTestBehavior.opaque,
?.roomAccount ?? onTap: _toggleEmojiPanel,
"", child: SizedBox(
role: width: 24.w,
Provider.of<RtcProvider>( height: 24.w,
context, child: Image.asset(
listen: false, showEmoji
).currenRoom?.entrants?.roles ?? ? _strategy.getSCMessageChatPageChatKeyboardIcon()
"", : _strategy.getSCMessageChatPageEmojiIcon(),
msg: controller.text, color: Colors.white,
type: SCRoomMsgType.text, fit: BoxFit.contain,
user: AccountStorage().getCurrentUser()?.userProfile, ),
), ),
); ),
} SizedBox(width: 15.w),
} Expanded(child: _buildInputBar(context)),
}, ],
onChanged: (s) { ),
setState(() { if (showEmoji) SizedBox(height: 12.w),
showSend = controller.text.isNotEmpty; if (showEmoji) _buildEmojiPanel(),
}); ],
}, ),
decoration: InputDecoration( ),
hintText: SCAppLocalizations.of(context)!.pleaseChatFfriendly, ),
fillColor: Colors.transparent, );
hintStyle: TextStyle(color: Colors.white60, fontSize: sp(14)), }
contentPadding: const EdgeInsets.symmetric(horizontal: 15),
counterText: '', Widget _buildInputBar(BuildContext context) {
isDense: true, return Container(
filled: false, decoration: BoxDecoration(
focusColor: Colors.transparent, color: _panelBackgroundColor,
hoverColor: Colors.transparent, borderRadius: BorderRadius.circular(height(5)),
border: InputBorder.none, ),
enabledBorder: InputBorder.none, child: Row(
focusedBorder: InputBorder.none, children: [
disabledBorder: InputBorder.none, Expanded(
errorBorder: InputBorder.none, child: ExtendedTextField(
focusedErrorBorder: InputBorder.none, controller: controller,
), textDirection:
style: TextStyle( widget.atTextContent != null ? TextDirection.ltr : null,
fontSize: ScreenUtil().setSp(14), specialTextSpanBuilder: AtTextSpanBuilder(),
color: Colors.white, focusNode: msgNode,
), autofocus: true,
), textInputAction: TextInputAction.send,
), onTap: () {
GestureDetector( if (showEmoji) {
onTap: () { setState(() {
Navigator.pop(context); showEmoji = false;
if (controller.text.isNotEmpty) { });
var currenRoom = }
Provider.of<RtcProvider>( },
context, onSubmitted: (_) {
listen: false, _sendMessage();
).currenRoom; },
if (currenRoom != null) { onChanged: (s) {
Provider.of<RtmProvider>(context, listen: false).dispatchMessage( setState(() {
Msg( showSend = controller.text.trim().isNotEmpty;
groupId: });
currenRoom.roomProfile?.roomProfile?.roomAccount ?? },
"", decoration: InputDecoration(
role: hintText: SCAppLocalizations.of(context)!.pleaseChatFfriendly,
Provider.of<RtcProvider>( fillColor: Colors.transparent,
context, hintStyle: TextStyle(color: Colors.white60, fontSize: sp(14)),
listen: false, contentPadding: EdgeInsets.symmetric(horizontal: 15.w),
).currenRoom?.entrants?.roles ?? counterText: '',
"", isDense: true,
msg: controller.text, filled: false,
type: SCRoomMsgType.text, focusColor: Colors.transparent,
user: AccountStorage().getCurrentUser()?.userProfile, hoverColor: Colors.transparent,
), border: InputBorder.none,
addLocal: true, enabledBorder: InputBorder.none,
); focusedBorder: InputBorder.none,
} disabledBorder: InputBorder.none,
} errorBorder: InputBorder.none,
}, focusedErrorBorder: InputBorder.none,
child: Container( ),
padding: EdgeInsets.all(4.w), style: TextStyle(
width: 30.w, fontSize: ScreenUtil().setSp(14),
height: 30.w, color: Colors.white,
child: Image.asset("sc_images/room/sc_icon_room_message_send.png"), ),
), ),
), ),
SizedBox(width: 3.w), GestureDetector(
], behavior: HitTestBehavior.opaque,
), onTap: _sendMessage,
), child: Opacity(
); opacity: showSend ? 1 : 0.5,
} child: Container(
} padding: EdgeInsets.all(4.w),
width: 30.w,
class PopRoute extends PopupRoute { height: 30.w,
final Duration _duration = Duration(milliseconds: 350); child: Image.asset(
Widget child; "sc_images/room/sc_icon_room_message_send.png",
),
PopRoute({required this.child}); ),
),
@override ),
Color? get barrierColor => null; SizedBox(width: 3.w),
],
@override ),
bool get barrierDismissible => true; );
}
@override
String? get barrierLabel => null; Widget _buildEmojiPanel() {
return Container(
@override height: 150.w,
Widget buildPage( decoration: BoxDecoration(
BuildContext context, color: _panelBackgroundColor,
Animation<double> animation, borderRadius: BorderRadius.circular(height(5)),
Animation<double> secondaryAnimation, ),
) { child: GridView.builder(
return child; padding: EdgeInsets.symmetric(horizontal: 15.w, vertical: 10.w),
} gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
crossAxisCount: 8,
@override crossAxisSpacing: 8.w,
Duration get transitionDuration => _duration; mainAxisSpacing: 8.w,
} ),
itemCount: SCEmojiDatas.smileys.length,
itemBuilder: (context, index) {
final emoji = SCEmojiDatas.smileys[index];
return GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: () {
_insertEmoji(emoji);
},
child: Center(
child: ExtendedText(emoji, style: TextStyle(fontSize: sp(15))),
),
);
},
),
);
}
void _toggleEmojiPanel() {
if (showEmoji) {
setState(() {
showEmoji = false;
});
FocusScope.of(context).requestFocus(msgNode);
return;
}
SCKeybordUtil.hide(context);
setState(() {
showEmoji = true;
});
}
void _insertEmoji(String emoji) {
final value = controller.value;
final selection = value.selection;
final fallbackOffset = value.text.length;
final start = selection.isValid ? selection.start : fallbackOffset;
final end = selection.isValid ? selection.end : fallbackOffset;
final safeStart = start < 0 ? fallbackOffset : start;
final safeEnd = end < 0 ? fallbackOffset : end;
final nextText = value.text.replaceRange(safeStart, safeEnd, emoji);
controller.value = value.copyWith(
text: nextText,
selection: TextSelection.collapsed(offset: safeStart + emoji.length),
composing: TextRange.empty,
);
setState(() {
showSend = controller.text.trim().isNotEmpty;
});
}
void _sendMessage() {
if (controller.text.trim().isEmpty) {
return;
}
final rtcProvider = Provider.of<RtcProvider>(context, listen: false);
final currenRoom = rtcProvider.currenRoom;
if (currenRoom == null) {
return;
}
Provider.of<RtmProvider>(context, listen: false).dispatchMessage(
Msg(
groupId: currenRoom.roomProfile?.roomProfile?.roomAccount ?? "",
role: rtcProvider.currenRoom?.entrants?.roles ?? "",
msg: controller.text,
type: SCRoomMsgType.text,
user: AccountStorage().getCurrentUser()?.userProfile,
),
);
Navigator.pop(context);
}
}
class PopRoute extends PopupRoute {
final Duration _duration = Duration(milliseconds: 350);
Widget child;
PopRoute({required this.child});
@override
Color? get barrierColor => null;
@override
bool get barrierDismissible => true;
@override
String? get barrierLabel => null;
@override
Widget buildPage(
BuildContext context,
Animation<double> animation,
Animation<double> secondaryAnimation,
) {
return child;
}
@override
Duration get transitionDuration => _duration;
}

View File

@ -5,6 +5,7 @@
## 已完成模块 ## 已完成模块
- 创建并持续维护进度跟踪文件。 - 创建并持续维护进度跟踪文件。
- 已修复首页房间封面显示链路:兼容接口 `roomCover/cover` 双字段,并补齐编辑房间成功后的封面内存回写。
- 完成仓库结构、依赖引用、资源体积和 APK 组成的第一轮排查。 - 完成仓库结构、依赖引用、资源体积和 APK 组成的第一轮排查。
- 移除 4 个当前未在业务层直接使用的插件依赖:`loading_indicator_view_plus``social_sharing_plus``flutter_foreground_task``on_audio_query`,并清理相关平台声明。 - 移除 4 个当前未在业务层直接使用的插件依赖:`loading_indicator_view_plus``social_sharing_plus``flutter_foreground_task``on_audio_query`,并清理相关平台声明。
- 修补 `image_cropper 5.0.1` Android 兼容问题,切换到本地 path 依赖以恢复构建。 - 修补 `image_cropper 5.0.1` Android 兼容问题,切换到本地 path 依赖以恢复构建。
@ -30,6 +31,7 @@
- 已定位 `FOREGROUND_SERVICE_MEDIA_PROJECTION` 的来源为 Agora `full-screen-sharing` 依赖,并开始从主 Manifest 覆盖移除。 - 已定位 `FOREGROUND_SERVICE_MEDIA_PROJECTION` 的来源为 Agora `full-screen-sharing` 依赖,并开始从主 Manifest 覆盖移除。
- 已移除 `FOREGROUND_SERVICE_MEDIA_PROJECTION` 相关声明并重新打出正式 `AAB` - 已移除 `FOREGROUND_SERVICE_MEDIA_PROJECTION` 相关声明并重新打出正式 `AAB`
- 已按当前需求打出正式 `arm64-v8a` 单架构 `APK` - 已按当前需求打出正式 `arm64-v8a` 单架构 `APK`
- 已将新的 `google-services.json` 替换进工程,准备重新打包验证。
## 进行中模块 ## 进行中模块
- 评估 iOS 正式签名参数接入后导出 `.ipa` 的流程。 - 评估 iOS 正式签名参数接入后导出 `.ipa` 的流程。
@ -48,12 +50,19 @@
## 已改动文件 ## 已改动文件
- `需求进度.md` - `需求进度.md`
- `lib/services/room/rc_room_manager.dart`
- `lib/shared/business_logic/models/res/room_res.dart`
- `lib/shared/business_logic/models/res/follow_room_res.dart`
- `lib/shared/business_logic/models/res/my_room_res.dart`
- `lib/shared/business_logic/models/res/sc_edit_room_info_res.dart`
- `lib/shared/business_logic/models/res/join_room_res.dart`
- `.gitignore` - `.gitignore`
- `android/key.properties` - `android/key.properties`
- `pubspec.yaml` - `pubspec.yaml`
- `pubspec.lock` - `pubspec.lock`
- `lib/ui_kit/components/dialog/dialog.dart` - `lib/ui_kit/components/dialog/dialog.dart`
- `android/app/src/main/AndroidManifest.xml` - `android/app/src/main/AndroidManifest.xml`
- `android/app/google-services.json`
- `ios/Runner/Info.plist` - `ios/Runner/Info.plist`
- `scripts/tinypng_batch.rb` - `scripts/tinypng_batch.rb`
- `scripts/build_release.py` - `scripts/build_release.py`
@ -73,6 +82,7 @@
## 已验证结果 ## 已验证结果
- 当前工作区存在用户已有未提交改动,后续处理均避开覆盖。 - 当前工作区存在用户已有未提交改动,后续处理均避开覆盖。
- 首页 `party/follow/history/mine` 以及房间详情使用的房间封面模型已兼容 `roomCover``cover` 两种返回字段,上传封面后不会再因为字段名不一致掉回空占位。
- 目录体积排查显示:`build/``4.7G``.dart_tool/``347M``ios/``250M``sc_images/``48M``local_packages/``6.1M` - 目录体积排查显示:`build/``4.7G``.dart_tool/``347M``ios/``250M``sc_images/``48M``local_packages/``6.1M`
- 当前包体过大的主要原因已经确认: - 当前包体过大的主要原因已经确认:
- universal APK 带入了 `arm64-v8a``armeabi-v7a``x86_64` 三套 ABI。 - universal APK 带入了 `arm64-v8a``armeabi-v7a``x86_64` 三套 ABI。
@ -160,6 +170,11 @@
- 本轮按需执行 `flutter build apk --release --split-per-abi --target-platform android-arm64 --split-debug-info=build/symbols/android` 已成功,产物为: - 本轮按需执行 `flutter build apk --release --split-per-abi --target-platform android-arm64 --split-debug-info=build/symbols/android` 已成功,产物为:
- `build/app/outputs/flutter-apk/app-arm64-v8a-release.apk` - `build/app/outputs/flutter-apk/app-arm64-v8a-release.apk`
- 当前 `arm64-v8a` APK 体积约 `128.7MB` - 当前 `arm64-v8a` APK 体积约 `128.7MB`
- 已核对新旧 `google-services.json`
- 原文件与新文件都匹配包名 `com.org.yumi`
- 下载文件已成功覆盖到 `android/app/google-services.json`
- 当前工程内文件 `SHA256` 为:
- `a1706496a01f74d27e6c60598144cecc978934b02a87567e1ced887b5b0185d5`
## 已知问题 ## 已知问题
- `ios/Podfile.lock` 还保留旧插件记录,因为本轮未执行 `pod install`;但 Flutter 当前依赖链路已经不再包含已移除插件。 - `ios/Podfile.lock` 还保留旧插件记录,因为本轮未执行 `pod install`;但 Flutter 当前依赖链路已经不再包含已移除插件。