bug 修复
This commit is contained in:
parent
5f79a8b523
commit
23e538cd0c
@ -16,7 +16,7 @@ class SCVariant1Config implements AppConfig {
|
|||||||
@override
|
@override
|
||||||
String get apiHost => const String.fromEnvironment(
|
String get apiHost => const String.fromEnvironment(
|
||||||
'API_HOST',
|
'API_HOST',
|
||||||
defaultValue: 'http://192.168.110.64:1100/',
|
defaultValue: 'https://jvapi.haiyihy.com/',
|
||||||
); // 默认连线上环境,本地调试可通过 --dart-define=API_HOST 覆盖 本地“http://192.168.110.64:1100/”,线上“https://jvapi.haiyihy.com/”
|
); // 默认连线上环境,本地调试可通过 --dart-define=API_HOST 覆盖 本地“http://192.168.110.64:1100/”,线上“https://jvapi.haiyihy.com/”
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
|||||||
@ -715,6 +715,7 @@ class _SCEditProfilePageState extends State<SCEditProfilePage> {
|
|||||||
userProvider?.syncCurrentUserProfile(user.userProfile);
|
userProvider?.syncCurrentUserProfile(user.userProfile);
|
||||||
await DataPersistence.clearPendingRegisterRewardDialog();
|
await DataPersistence.clearPendingRegisterRewardDialog();
|
||||||
await DataPersistence.setAwaitRegisterRewardSocket(true);
|
await DataPersistence.setAwaitRegisterRewardSocket(true);
|
||||||
|
await DataPersistence.setPendingFirstRegisterRoomGameEvent(true);
|
||||||
if (!mounted) {
|
if (!mounted) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -8,6 +8,7 @@ import 'package:yumi/main.dart' show routeObserver;
|
|||||||
import 'package:yumi/shared/data_sources/sources/local/floating_screen_manager.dart';
|
import 'package:yumi/shared/data_sources/sources/local/floating_screen_manager.dart';
|
||||||
import 'package:yumi/modules/home/index_home_page.dart';
|
import 'package:yumi/modules/home/index_home_page.dart';
|
||||||
import 'package:yumi/modules/chat/message/sc_message_page.dart';
|
import 'package:yumi/modules/chat/message/sc_message_page.dart';
|
||||||
|
import 'package:yumi/modules/user/task/task_page.dart';
|
||||||
import 'package:yumi/services/audio/rtc_manager.dart';
|
import 'package:yumi/services/audio/rtc_manager.dart';
|
||||||
import 'package:yumi/services/audio/rtm_manager.dart';
|
import 'package:yumi/services/audio/rtm_manager.dart';
|
||||||
import 'package:provider/provider.dart';
|
import 'package:provider/provider.dart';
|
||||||
@ -25,7 +26,6 @@ import '../../shared/data_sources/models/enum/sc_heartbeat_status.dart';
|
|||||||
import '../../ui_kit/components/sc_float_ichart.dart';
|
import '../../ui_kit/components/sc_float_ichart.dart';
|
||||||
import '../../ui_kit/widgets/daily_sign_in/daily_sign_in_dialog.dart';
|
import '../../ui_kit/widgets/daily_sign_in/daily_sign_in_dialog.dart';
|
||||||
import '../../ui_kit/widgets/register_reward/register_reward_dialog.dart';
|
import '../../ui_kit/widgets/register_reward/register_reward_dialog.dart';
|
||||||
import '../home/popular/event/home_event_page.dart';
|
|
||||||
import '../user/me_page2.dart';
|
import '../user/me_page2.dart';
|
||||||
|
|
||||||
/// 首页
|
/// 首页
|
||||||
@ -50,6 +50,7 @@ class _SCIndexPageState extends State<SCIndexPage>
|
|||||||
bool _hasShownRegisterRewardDialog = false;
|
bool _hasShownRegisterRewardDialog = false;
|
||||||
bool _isShowingDailySignInDialog = false;
|
bool _isShowingDailySignInDialog = false;
|
||||||
bool _showRegisterRewardAfterDailySignIn = false;
|
bool _showRegisterRewardAfterDailySignIn = false;
|
||||||
|
bool _isOpeningFirstRegisterRoomGame = false;
|
||||||
StreamSubscription<RegisterRewardGrantedEvent>? _registerRewardSubscription;
|
StreamSubscription<RegisterRewardGrantedEvent>? _registerRewardSubscription;
|
||||||
Completer<void>? _registerRewardSocketCompleter;
|
Completer<void>? _registerRewardSocketCompleter;
|
||||||
PageRoute<dynamic>? _routeObserverRoute;
|
PageRoute<dynamic>? _routeObserverRoute;
|
||||||
@ -255,7 +256,7 @@ class _SCIndexPageState extends State<SCIndexPage>
|
|||||||
}
|
}
|
||||||
|
|
||||||
_pages.add(SCIndexHomePage());
|
_pages.add(SCIndexHomePage());
|
||||||
_pages.add(HomeEventPage());
|
_pages.add(const TaskPage(showBackButton: false));
|
||||||
_pages.add(SCMessagePage());
|
_pages.add(SCMessagePage());
|
||||||
_pages.add(MePage2());
|
_pages.add(MePage2());
|
||||||
}
|
}
|
||||||
@ -320,7 +321,7 @@ class _SCIndexPageState extends State<SCIndexPage>
|
|||||||
svgaPath: "sc_images/index/sc_icon_explore_anim.svga",
|
svgaPath: "sc_images/index/sc_icon_explore_anim.svga",
|
||||||
fallbackPath: "sc_images/index/sc_icon_explore_en.png",
|
fallbackPath: "sc_images/index/sc_icon_explore_en.png",
|
||||||
),
|
),
|
||||||
label: SCAppLocalizations.of(context)!.explore,
|
label: SCAppLocalizations.of(context)!.task,
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -427,6 +428,7 @@ class _SCIndexPageState extends State<SCIndexPage>
|
|||||||
debugPrint(
|
debugPrint(
|
||||||
'[SignInReward][Home] skip daily sign-in dialog reason=no-data',
|
'[SignInReward][Home] skip daily sign-in dialog reason=no-data',
|
||||||
);
|
);
|
||||||
|
await _openFirstRegisterRoomGameIfNeeded();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
debugPrint(
|
debugPrint(
|
||||||
@ -445,6 +447,10 @@ class _SCIndexPageState extends State<SCIndexPage>
|
|||||||
_showRegisterRewardAfterDailySignIn = false;
|
_showRegisterRewardAfterDailySignIn = false;
|
||||||
await _showRegisterRewardDialogIfNeeded();
|
await _showRegisterRewardDialogIfNeeded();
|
||||||
}
|
}
|
||||||
|
if (!mounted) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
await _openFirstRegisterRoomGameIfNeeded();
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> _showEntryPopupIfNeeded() async {
|
Future<void> _showEntryPopupIfNeeded() async {
|
||||||
@ -542,6 +548,30 @@ class _SCIndexPageState extends State<SCIndexPage>
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Future<void> _openFirstRegisterRoomGameIfNeeded() async {
|
||||||
|
if (_isOpeningFirstRegisterRoomGame ||
|
||||||
|
!DataPersistence.getPendingFirstRegisterRoomGameEvent()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (!mounted) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
_isOpeningFirstRegisterRoomGame = true;
|
||||||
|
try {
|
||||||
|
await DataPersistence.clearPendingFirstRegisterRoomGameEvent();
|
||||||
|
if (!mounted) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
debugPrint('[FirstRegisterGame] launch first party room random game');
|
||||||
|
await SCEntryPopupCoordinator.openFirstPartyRoomRandomGame(context);
|
||||||
|
} catch (error) {
|
||||||
|
debugPrint('[FirstRegisterGame] launch failed error=$error');
|
||||||
|
} finally {
|
||||||
|
_isOpeningFirstRegisterRoomGame = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Widget _buildBottomTabIcon({
|
Widget _buildBottomTabIcon({
|
||||||
required bool active,
|
required bool active,
|
||||||
required String svgaPath,
|
required String svgaPath,
|
||||||
|
|||||||
@ -7,7 +7,6 @@ import 'package:yumi/app_localizations.dart';
|
|||||||
import 'package:yumi/modules/index/main_route.dart';
|
import 'package:yumi/modules/index/main_route.dart';
|
||||||
import 'package:yumi/modules/store/store_route.dart';
|
import 'package:yumi/modules/store/store_route.dart';
|
||||||
import 'package:yumi/modules/user/settings/settings_route.dart';
|
import 'package:yumi/modules/user/settings/settings_route.dart';
|
||||||
import 'package:yumi/modules/user/task/task_route.dart';
|
|
||||||
import 'package:yumi/modules/user/vip/vip_route.dart';
|
import 'package:yumi/modules/user/vip/vip_route.dart';
|
||||||
import 'package:yumi/modules/wallet/wallet_route.dart';
|
import 'package:yumi/modules/wallet/wallet_route.dart';
|
||||||
import 'package:yumi/services/auth/user_profile_manager.dart';
|
import 'package:yumi/services/auth/user_profile_manager.dart';
|
||||||
@ -35,7 +34,6 @@ class _MePage2State extends State<MePage2> {
|
|||||||
|
|
||||||
Map<String, SCUserCounterRes> _counterMap = {};
|
Map<String, SCUserCounterRes> _counterMap = {};
|
||||||
SCVipStatusRes? _vipStatus;
|
SCVipStatusRes? _vipStatus;
|
||||||
int _taskClaimableCount = 0;
|
|
||||||
bool _isVipStatusLoading = false;
|
bool _isVipStatusLoading = false;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
@ -55,7 +53,6 @@ class _MePage2State extends State<MePage2> {
|
|||||||
profileManager.balance();
|
profileManager.balance();
|
||||||
_loadCounter();
|
_loadCounter();
|
||||||
_loadVipStatus();
|
_loadVipStatus();
|
||||||
_loadTaskClaimableCount();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> _loadCounter() async {
|
Future<void> _loadCounter() async {
|
||||||
@ -101,17 +98,6 @@ class _MePage2State extends State<MePage2> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> _loadTaskClaimableCount() async {
|
|
||||||
try {
|
|
||||||
final count = await SCAccountRepository().taskClaimableCount();
|
|
||||||
if (!mounted) return;
|
|
||||||
setState(() => _taskClaimableCount = count);
|
|
||||||
} catch (_) {
|
|
||||||
if (!mounted) return;
|
|
||||||
setState(() => _taskClaimableCount = 0);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Future<SCVipStatusRes> _loadVipEntryStatus() async {
|
Future<SCVipStatusRes> _loadVipEntryStatus() async {
|
||||||
final repository = SCVipRepositoryImp();
|
final repository = SCVipRepositoryImp();
|
||||||
try {
|
try {
|
||||||
@ -335,21 +321,6 @@ class _MePage2State extends State<MePage2> {
|
|||||||
onTap: () => SCNavigatorUtils.push(context, StoreRoute.list),
|
onTap: () => SCNavigatorUtils.push(context, StoreRoute.list),
|
||||||
),
|
),
|
||||||
SizedBox(width: 10.w),
|
SizedBox(width: 10.w),
|
||||||
_buildEntryItem(
|
|
||||||
title: SCAppLocalizations.of(context)!.task,
|
|
||||||
iconPath: 'sc_images/index/sc_icon_task.png',
|
|
||||||
badgeCount: _taskClaimableCount,
|
|
||||||
onTap: () async {
|
|
||||||
await SCNavigatorUtils.push(context, TaskRoute.task);
|
|
||||||
if (!mounted) return;
|
|
||||||
_loadTaskClaimableCount();
|
|
||||||
Provider.of<SocialChatUserProfileManager>(
|
|
||||||
context,
|
|
||||||
listen: false,
|
|
||||||
).balance();
|
|
||||||
},
|
|
||||||
),
|
|
||||||
SizedBox(width: 10.w),
|
|
||||||
_buildEntryItem(
|
_buildEntryItem(
|
||||||
title: SCAppLocalizations.of(context)!.level,
|
title: SCAppLocalizations.of(context)!.level,
|
||||||
iconPath: 'sc_images/index/sc_icon_level.png',
|
iconPath: 'sc_images/index/sc_icon_level.png',
|
||||||
|
|||||||
@ -12,7 +12,9 @@ import 'package:yumi/shared/data_sources/sources/repositories/sc_user_repository
|
|||||||
import 'package:yumi/shared/tools/sc_entry_popup_coordinator.dart';
|
import 'package:yumi/shared/tools/sc_entry_popup_coordinator.dart';
|
||||||
|
|
||||||
class TaskPage extends StatefulWidget {
|
class TaskPage extends StatefulWidget {
|
||||||
const TaskPage({super.key});
|
const TaskPage({super.key, this.showBackButton = true});
|
||||||
|
|
||||||
|
final bool showBackButton;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
State<TaskPage> createState() => _TaskPageState();
|
State<TaskPage> createState() => _TaskPageState();
|
||||||
@ -201,21 +203,24 @@ class _TaskPageState extends State<TaskPage>
|
|||||||
children: [
|
children: [
|
||||||
Align(
|
Align(
|
||||||
alignment: AlignmentDirectional.centerStart,
|
alignment: AlignmentDirectional.centerStart,
|
||||||
child: GestureDetector(
|
child:
|
||||||
behavior: HitTestBehavior.opaque,
|
widget.showBackButton
|
||||||
onTap: () => SCNavigatorUtils.goBack(context),
|
? GestureDetector(
|
||||||
child: SizedBox(
|
behavior: HitTestBehavior.opaque,
|
||||||
width: 44.w,
|
onTap: () => SCNavigatorUtils.goBack(context),
|
||||||
height: 44.w,
|
child: SizedBox(
|
||||||
child: Icon(
|
width: 44.w,
|
||||||
SCGlobalConfig.lang == 'ar'
|
height: 44.w,
|
||||||
? Icons.keyboard_arrow_right
|
child: Icon(
|
||||||
: Icons.keyboard_arrow_left,
|
SCGlobalConfig.lang == 'ar'
|
||||||
color: Colors.white,
|
? Icons.keyboard_arrow_right
|
||||||
size: 28.w,
|
: Icons.keyboard_arrow_left,
|
||||||
),
|
color: Colors.white,
|
||||||
),
|
size: 28.w,
|
||||||
),
|
),
|
||||||
|
),
|
||||||
|
)
|
||||||
|
: SizedBox(width: 44.w, height: 44.w),
|
||||||
),
|
),
|
||||||
Text(
|
Text(
|
||||||
SCAppLocalizations.of(context)!.task,
|
SCAppLocalizations.of(context)!.task,
|
||||||
|
|||||||
@ -297,6 +297,7 @@ class RealTimeCommunicationManager extends ChangeNotifier {
|
|||||||
);
|
);
|
||||||
static const Duration _agoraJoinTimeout = Duration(seconds: 8);
|
static const Duration _agoraJoinTimeout = Duration(seconds: 8);
|
||||||
static const Duration _agoraDisconnectedGracePeriod = Duration(seconds: 12);
|
static const Duration _agoraDisconnectedGracePeriod = Duration(seconds: 12);
|
||||||
|
static const Duration _roomMusicPublishingStateTtl = Duration(seconds: 15);
|
||||||
static const String _roomStartupSeatLoadingTag =
|
static const String _roomStartupSeatLoadingTag =
|
||||||
'roomStartupSeatInteractionLoading';
|
'roomStartupSeatInteractionLoading';
|
||||||
static const String _selfMicGoUpRetryLoadingTag = 'selfMicGoUpRetryLoading';
|
static const String _selfMicGoUpRetryLoadingTag = 'selfMicGoUpRetryLoading';
|
||||||
@ -366,6 +367,7 @@ class RealTimeCommunicationManager extends ChangeNotifier {
|
|||||||
final Map<num, int> _seatEmojiEventVersions = {};
|
final Map<num, int> _seatEmojiEventVersions = {};
|
||||||
int _emojiPlaybackEventVersion = 0;
|
int _emojiPlaybackEventVersion = 0;
|
||||||
final Set<String> _roomMusicPublishingUserIds = <String>{};
|
final Set<String> _roomMusicPublishingUserIds = <String>{};
|
||||||
|
final Map<String, Timer> _roomMusicPublishingClearTimers = <String, Timer>{};
|
||||||
|
|
||||||
RtcEngine? engine;
|
RtcEngine? engine;
|
||||||
RtcEngineEventHandler? _rtcEngineEventHandler;
|
RtcEngineEventHandler? _rtcEngineEventHandler;
|
||||||
@ -1313,11 +1315,15 @@ class RealTimeCommunicationManager extends ChangeNotifier {
|
|||||||
.map((seat) => (seat.user?.id ?? "").trim())
|
.map((seat) => (seat.user?.id ?? "").trim())
|
||||||
.where((userId) => userId.isNotEmpty)
|
.where((userId) => userId.isNotEmpty)
|
||||||
.toSet();
|
.toSet();
|
||||||
final beforeCount = _roomMusicPublishingUserIds.length;
|
final removedUserIds =
|
||||||
_roomMusicPublishingUserIds.removeWhere(
|
_roomMusicPublishingUserIds
|
||||||
(userId) => !seatedUserIds.contains(userId),
|
.where((userId) => !seatedUserIds.contains(userId))
|
||||||
);
|
.toList();
|
||||||
return beforeCount != _roomMusicPublishingUserIds.length;
|
for (final userId in removedUserIds) {
|
||||||
|
_roomMusicPublishingUserIds.remove(userId);
|
||||||
|
_roomMusicPublishingClearTimers.remove(userId)?.cancel();
|
||||||
|
}
|
||||||
|
return removedUserIds.isNotEmpty;
|
||||||
}
|
}
|
||||||
|
|
||||||
int? _tryParseAgoraUid(String? value) {
|
int? _tryParseAgoraUid(String? value) {
|
||||||
@ -3364,7 +3370,7 @@ class RealTimeCommunicationManager extends ChangeNotifier {
|
|||||||
_pendingMicListRefreshNotifyIfUnchanged = false;
|
_pendingMicListRefreshNotifyIfUnchanged = false;
|
||||||
_seatEmojiEventVersions.clear();
|
_seatEmojiEventVersions.clear();
|
||||||
_emojiPlaybackEventVersion = 0;
|
_emojiPlaybackEventVersion = 0;
|
||||||
_roomMusicPublishingUserIds.clear();
|
_clearRoomMusicPublishingStates();
|
||||||
roomRocketStatus = null;
|
roomRocketStatus = null;
|
||||||
rtmProvider
|
rtmProvider
|
||||||
?.onNewMessageListenerGroupMap["${currenRoom?.roomProfile?.roomProfile?.roomAccount}"] =
|
?.onNewMessageListenerGroupMap["${currenRoom?.roomProfile?.roomProfile?.roomAccount}"] =
|
||||||
@ -3405,6 +3411,7 @@ class RealTimeCommunicationManager extends ChangeNotifier {
|
|||||||
@override
|
@override
|
||||||
void dispose() {
|
void dispose() {
|
||||||
_stopRoomStatePolling();
|
_stopRoomStatePolling();
|
||||||
|
_clearRoomMusicPublishingStates();
|
||||||
unawaited(releaseRtcEngineForAppTermination());
|
unawaited(releaseRtcEngineForAppTermination());
|
||||||
super.dispose();
|
super.dispose();
|
||||||
}
|
}
|
||||||
@ -4123,15 +4130,36 @@ class RealTimeCommunicationManager extends ChangeNotifier {
|
|||||||
if (normalizedUserId.isEmpty) {
|
if (normalizedUserId.isEmpty) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
final changed =
|
bool changed = false;
|
||||||
publishing
|
if (publishing) {
|
||||||
? _roomMusicPublishingUserIds.add(normalizedUserId)
|
changed = _roomMusicPublishingUserIds.add(normalizedUserId);
|
||||||
: _roomMusicPublishingUserIds.remove(normalizedUserId);
|
_roomMusicPublishingClearTimers.remove(normalizedUserId)?.cancel();
|
||||||
|
_roomMusicPublishingClearTimers[normalizedUserId] = Timer(
|
||||||
|
_roomMusicPublishingStateTtl,
|
||||||
|
() {
|
||||||
|
_roomMusicPublishingClearTimers.remove(normalizedUserId);
|
||||||
|
if (_roomMusicPublishingUserIds.remove(normalizedUserId)) {
|
||||||
|
notifyListeners();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
_roomMusicPublishingClearTimers.remove(normalizedUserId)?.cancel();
|
||||||
|
changed = _roomMusicPublishingUserIds.remove(normalizedUserId);
|
||||||
|
}
|
||||||
if (changed && notifyIfChanged) {
|
if (changed && notifyIfChanged) {
|
||||||
notifyListeners();
|
notifyListeners();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void _clearRoomMusicPublishingStates() {
|
||||||
|
for (final timer in _roomMusicPublishingClearTimers.values) {
|
||||||
|
timer.cancel();
|
||||||
|
}
|
||||||
|
_roomMusicPublishingClearTimers.clear();
|
||||||
|
_roomMusicPublishingUserIds.clear();
|
||||||
|
}
|
||||||
|
|
||||||
void handleRoomMusicPublishingMessage(Msg msg) {
|
void handleRoomMusicPublishingMessage(Msg msg) {
|
||||||
final userId =
|
final userId =
|
||||||
(msg.role ?? "").trim().isNotEmpty ? msg.role : msg.user?.id ?? "";
|
(msg.role ?? "").trim().isNotEmpty ? msg.role : msg.user?.id ?? "";
|
||||||
@ -4148,9 +4176,10 @@ class RealTimeCommunicationManager extends ChangeNotifier {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
final effectivePublishing = publishing && isOnMai();
|
||||||
updateRoomMusicPublishingState(
|
updateRoomMusicPublishingState(
|
||||||
userId: currentUserId,
|
userId: currentUserId,
|
||||||
publishing: publishing && isOnMai(),
|
publishing: effectivePublishing,
|
||||||
);
|
);
|
||||||
|
|
||||||
final groupId =
|
final groupId =
|
||||||
@ -4158,14 +4187,18 @@ class RealTimeCommunicationManager extends ChangeNotifier {
|
|||||||
if (groupId.isEmpty) {
|
if (groupId.isEmpty) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if (rtmProvider == null && context != null && context!.mounted) {
|
||||||
|
rtmProvider = Provider.of<RtmProvider>(context!, listen: false);
|
||||||
|
}
|
||||||
|
final roomRtmProvider = rtmProvider;
|
||||||
unawaited(
|
unawaited(
|
||||||
rtmProvider?.dispatchMessage(
|
roomRtmProvider?.dispatchMessage(
|
||||||
Msg(
|
Msg(
|
||||||
groupId: groupId,
|
groupId: groupId,
|
||||||
msg: publishing && isOnMai() ? "1" : "0",
|
msg: effectivePublishing ? "1" : "0",
|
||||||
type: SCRoomMsgType.roomMusic,
|
type: SCRoomMsgType.roomMusic,
|
||||||
role: currentUserId,
|
role: currentUserId,
|
||||||
number: publishing && isOnMai() ? 1 : 0,
|
number: effectivePublishing ? 1 : 0,
|
||||||
user: currentUser,
|
user: currentUser,
|
||||||
),
|
),
|
||||||
addLocal: false,
|
addLocal: false,
|
||||||
|
|||||||
@ -13,6 +13,10 @@ import 'package:yumi/ui_kit/components/sc_tts.dart';
|
|||||||
enum RoomMusicPlayMode { list, shuffle, single }
|
enum RoomMusicPlayMode { list, shuffle, single }
|
||||||
|
|
||||||
class RoomMusicManager extends ChangeNotifier {
|
class RoomMusicManager extends ChangeNotifier {
|
||||||
|
static const Duration _publishingStateHeartbeatInterval = Duration(
|
||||||
|
seconds: 5,
|
||||||
|
);
|
||||||
|
|
||||||
RoomMusicManager({RoomMusicRepository? repository})
|
RoomMusicManager({RoomMusicRepository? repository})
|
||||||
: _repository = repository ?? RoomMusicRepository() {
|
: _repository = repository ?? RoomMusicRepository() {
|
||||||
_playlist = _repository.loadSongs();
|
_playlist = _repository.loadSongs();
|
||||||
@ -23,6 +27,7 @@ class RoomMusicManager extends ChangeNotifier {
|
|||||||
|
|
||||||
RtcProvider? _rtcProvider;
|
RtcProvider? _rtcProvider;
|
||||||
Timer? _positionTimer;
|
Timer? _positionTimer;
|
||||||
|
Timer? _publishingStateHeartbeatTimer;
|
||||||
List<SCMusicMode> _playlist = <SCMusicMode>[];
|
List<SCMusicMode> _playlist = <SCMusicMode>[];
|
||||||
SCMusicMode? _current;
|
SCMusicMode? _current;
|
||||||
RoomMusicPlayMode _playMode = RoomMusicPlayMode.list;
|
RoomMusicPlayMode _playMode = RoomMusicPlayMode.list;
|
||||||
@ -489,9 +494,11 @@ class RoomMusicManager extends ChangeNotifier {
|
|||||||
void _syncPublishingState({bool force = false}) {
|
void _syncPublishingState({bool force = false}) {
|
||||||
final rtcProvider = _rtcProvider;
|
final rtcProvider = _rtcProvider;
|
||||||
if (rtcProvider == null) {
|
if (rtcProvider == null) {
|
||||||
|
_updatePublishingStateHeartbeat(false);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
final publishing = isPublishingToRoom;
|
final publishing = isPublishingToRoom;
|
||||||
|
_updatePublishingStateHeartbeat(publishing);
|
||||||
if (!force && publishing == _lastPublishedRoomState) {
|
if (!force && publishing == _lastPublishedRoomState) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -499,6 +506,29 @@ class RoomMusicManager extends ChangeNotifier {
|
|||||||
rtcProvider.publishCurrentUserRoomMusicState(publishing);
|
rtcProvider.publishCurrentUserRoomMusicState(publishing);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void _updatePublishingStateHeartbeat(bool publishing) {
|
||||||
|
if (!publishing) {
|
||||||
|
_publishingStateHeartbeatTimer?.cancel();
|
||||||
|
_publishingStateHeartbeatTimer = null;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (_publishingStateHeartbeatTimer != null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
_publishingStateHeartbeatTimer = Timer.periodic(
|
||||||
|
_publishingStateHeartbeatInterval,
|
||||||
|
(_) {
|
||||||
|
if (!isPublishingToRoom) {
|
||||||
|
_publishingStateHeartbeatTimer?.cancel();
|
||||||
|
_publishingStateHeartbeatTimer = null;
|
||||||
|
_syncPublishingState(force: true);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
_rtcProvider?.publishCurrentUserRoomMusicState(true);
|
||||||
|
},
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
void _restoreCurrentAfterPlaylistChange() {
|
void _restoreCurrentAfterPlaylistChange() {
|
||||||
final currentId = _current?.id;
|
final currentId = _current?.id;
|
||||||
if (currentId == null) {
|
if (currentId == null) {
|
||||||
@ -522,6 +552,7 @@ class RoomMusicManager extends ChangeNotifier {
|
|||||||
@override
|
@override
|
||||||
void dispose() {
|
void dispose() {
|
||||||
_positionTimer?.cancel();
|
_positionTimer?.cancel();
|
||||||
|
_publishingStateHeartbeatTimer?.cancel();
|
||||||
_rtcProvider?.setRoomMusicMixingStateListener(null);
|
_rtcProvider?.setRoomMusicMixingStateListener(null);
|
||||||
_rtcProvider?.setRoomMusicMicRouteChangedListener(null);
|
_rtcProvider?.setRoomMusicMicRouteChangedListener(null);
|
||||||
super.dispose();
|
super.dispose();
|
||||||
|
|||||||
@ -10,6 +10,8 @@ class DataPersistence {
|
|||||||
"await_register_reward_socket";
|
"await_register_reward_socket";
|
||||||
static const String _pendingRegisterRewardDialogKey =
|
static const String _pendingRegisterRewardDialogKey =
|
||||||
"pending_register_reward_dialog";
|
"pending_register_reward_dialog";
|
||||||
|
static const String _pendingFirstRegisterRoomGameEventKey =
|
||||||
|
"pending_first_register_room_game_event";
|
||||||
static const String _pendingChannelAuthTypeKey = "pending_channel_auth_type";
|
static const String _pendingChannelAuthTypeKey = "pending_channel_auth_type";
|
||||||
static const String _pendingChannelAuthOpenIdKey =
|
static const String _pendingChannelAuthOpenIdKey =
|
||||||
"pending_channel_auth_open_id";
|
"pending_channel_auth_open_id";
|
||||||
@ -218,6 +220,18 @@ class DataPersistence {
|
|||||||
return await remove(_awaitRegisterRewardSocketKey);
|
return await remove(_awaitRegisterRewardSocketKey);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static Future<bool> setPendingFirstRegisterRoomGameEvent(bool value) async {
|
||||||
|
return await setBool(_pendingFirstRegisterRoomGameEventKey, value);
|
||||||
|
}
|
||||||
|
|
||||||
|
static bool getPendingFirstRegisterRoomGameEvent() {
|
||||||
|
return getBool(_pendingFirstRegisterRoomGameEventKey);
|
||||||
|
}
|
||||||
|
|
||||||
|
static Future<bool> clearPendingFirstRegisterRoomGameEvent() async {
|
||||||
|
return await remove(_pendingFirstRegisterRoomGameEventKey);
|
||||||
|
}
|
||||||
|
|
||||||
static Future<void> setPendingChannelAuth(
|
static Future<void> setPendingChannelAuth(
|
||||||
String authType,
|
String authType,
|
||||||
String openId,
|
String openId,
|
||||||
|
|||||||
@ -13,6 +13,8 @@ import 'package:yumi/modules/user/task/task_route.dart';
|
|||||||
import 'package:yumi/modules/user/vip/vip_route.dart';
|
import 'package:yumi/modules/user/vip/vip_route.dart';
|
||||||
import 'package:yumi/modules/wallet/wallet_route.dart';
|
import 'package:yumi/modules/wallet/wallet_route.dart';
|
||||||
import 'package:yumi/services/audio/rtc_manager.dart';
|
import 'package:yumi/services/audio/rtc_manager.dart';
|
||||||
|
import 'package:yumi/services/home/home_room_preload_manager.dart';
|
||||||
|
import 'package:yumi/shared/business_logic/models/res/room_res.dart';
|
||||||
import 'package:yumi/shared/business_logic/models/res/sc_entry_popup_res.dart';
|
import 'package:yumi/shared/business_logic/models/res/sc_entry_popup_res.dart';
|
||||||
import 'package:yumi/shared/data_sources/sources/local/data_persistence.dart';
|
import 'package:yumi/shared/data_sources/sources/local/data_persistence.dart';
|
||||||
import 'package:yumi/shared/data_sources/sources/local/user_manager.dart';
|
import 'package:yumi/shared/data_sources/sources/local/user_manager.dart';
|
||||||
@ -288,6 +290,7 @@ class SCEntryPopupCoordinator {
|
|||||||
onSelectRootTab?.call(0);
|
onSelectRootTab?.call(0);
|
||||||
return;
|
return;
|
||||||
case '/tab/explore':
|
case '/tab/explore':
|
||||||
|
case '/tab/task':
|
||||||
onSelectRootTab?.call(1);
|
onSelectRootTab?.call(1);
|
||||||
return;
|
return;
|
||||||
case '/tab/message':
|
case '/tab/message':
|
||||||
@ -402,12 +405,49 @@ class SCEntryPopupCoordinator {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
static Future<bool> _enterRoom(BuildContext context, String roomId) async {
|
static Future<void> openFirstPartyRoomRandomGame(BuildContext context) async {
|
||||||
|
if (!context.mounted) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
final rooms = await SCHomeRoomPreloadManager.instance.loadPartyRooms();
|
||||||
|
final room = _firstRoomWithId(rooms);
|
||||||
|
final roomId = room?.id?.trim() ?? '';
|
||||||
|
if (room == null || roomId.isEmpty || !context.mounted) {
|
||||||
|
_log('first-register-game skip reason=no-room');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
_log('first-register-game enter roomId=$roomId');
|
||||||
|
final ready = await _enterRoom(
|
||||||
|
context,
|
||||||
|
roomId,
|
||||||
|
previewData: RoomEntryPreviewData.fromSocialChatRoom(room),
|
||||||
|
);
|
||||||
|
if (!ready || !context.mounted) {
|
||||||
|
_log('first-register-game skip reason=room-not-ready roomId=$roomId');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
showBottomInBottomDialog(
|
||||||
|
context,
|
||||||
|
RoomGameBottomSheet(roomContext: context, initialGameId: '0'),
|
||||||
|
barrierColor: Colors.black54,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
static Future<bool> _enterRoom(
|
||||||
|
BuildContext context,
|
||||||
|
String roomId, {
|
||||||
|
RoomEntryPreviewData? previewData,
|
||||||
|
}) async {
|
||||||
final rtcProvider = Provider.of<RtcProvider>(context, listen: false);
|
final rtcProvider = Provider.of<RtcProvider>(context, listen: false);
|
||||||
RoomEntryPreviewData? previewData;
|
RoomEntryPreviewData? resolvedPreviewData = previewData;
|
||||||
try {
|
try {
|
||||||
final room = await SCChatRoomRepository().specific(roomId);
|
if (resolvedPreviewData == null) {
|
||||||
previewData = RoomEntryPreviewData.fromMyRoom(room);
|
final room = await SCChatRoomRepository().specific(roomId);
|
||||||
|
resolvedPreviewData = RoomEntryPreviewData.fromMyRoom(room);
|
||||||
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
debugPrint(
|
debugPrint(
|
||||||
'[EntryPopup] load room preview failed roomId=$roomId: $error',
|
'[EntryPopup] load room preview failed roomId=$roomId: $error',
|
||||||
@ -416,10 +456,25 @@ class SCEntryPopupCoordinator {
|
|||||||
if (!context.mounted) {
|
if (!context.mounted) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
rtcProvider.joinVoiceRoomSession(context, roomId, previewData: previewData);
|
rtcProvider.joinVoiceRoomSession(
|
||||||
|
context,
|
||||||
|
roomId,
|
||||||
|
previewData: resolvedPreviewData,
|
||||||
|
);
|
||||||
return _waitForRoomReady(rtcProvider, roomId);
|
return _waitForRoomReady(rtcProvider, roomId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static SocialChatRoomRes? _firstRoomWithId(
|
||||||
|
Iterable<SocialChatRoomRes> rooms,
|
||||||
|
) {
|
||||||
|
for (final room in rooms) {
|
||||||
|
if ((room.id ?? '').trim().isNotEmpty) {
|
||||||
|
return room;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
static Future<bool> _waitForRoomReady(
|
static Future<bool> _waitForRoomReady(
|
||||||
RtcProvider rtcProvider,
|
RtcProvider rtcProvider,
|
||||||
String roomId,
|
String roomId,
|
||||||
|
|||||||
@ -2,7 +2,6 @@ import 'package:flutter/material.dart';
|
|||||||
import 'package:flutter_debouncer/flutter_debouncer.dart';
|
import 'package:flutter_debouncer/flutter_debouncer.dart';
|
||||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||||
import 'package:provider/provider.dart';
|
import 'package:provider/provider.dart';
|
||||||
import 'package:yumi/shared/tools/sc_room_utils.dart';
|
|
||||||
import 'package:yumi/main.dart';
|
import 'package:yumi/main.dart';
|
||||||
import 'package:yumi/app_localizations.dart';
|
import 'package:yumi/app_localizations.dart';
|
||||||
import 'package:yumi/shared/data_sources/models/message/sc_floating_message.dart';
|
import 'package:yumi/shared/data_sources/models/message/sc_floating_message.dart';
|
||||||
@ -324,11 +323,7 @@ class _FloatingRoomRedenvelopeScreenWidgetState
|
|||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if ((currentRoomId ?? '').trim().isEmpty || currentRoomId == roomId) {
|
rtcProvider.joinVoiceRoomSession(currentContext, roomId);
|
||||||
rtcProvider.joinVoiceRoomSession(currentContext, roomId);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
SCRoomUtils.goRoom(roomId, currentContext, fromFloting: true);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
String _senderNameForFloating() {
|
String _senderNameForFloating() {
|
||||||
|
|||||||
@ -324,27 +324,10 @@ class _ClaimAvatar extends StatelessWidget {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return ClipOval(
|
return SizedBox(
|
||||||
child: Container(
|
width: 34.w,
|
||||||
width: 34.w,
|
height: 34.w,
|
||||||
height: 34.w,
|
child: head(url: url, width: 34.w, showDefault: true),
|
||||||
color: Colors.white.withValues(alpha: 0.08),
|
|
||||||
alignment: Alignment.center,
|
|
||||||
child:
|
|
||||||
url.trim().isNotEmpty
|
|
||||||
? netImage(
|
|
||||||
url: url,
|
|
||||||
width: 34.w,
|
|
||||||
height: 34.w,
|
|
||||||
fit: BoxFit.cover,
|
|
||||||
)
|
|
||||||
: Image.asset(
|
|
||||||
'sc_images/room/red_packet/small_packet_icon.png',
|
|
||||||
width: 24.w,
|
|
||||||
height: 24.w,
|
|
||||||
fit: BoxFit.contain,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -197,32 +197,56 @@ class _MsgItemState extends State<MsgItem> {
|
|||||||
Widget _buildTextMessageBubble() {
|
Widget _buildTextMessageBubble() {
|
||||||
final chatBubble = widget.msg.user?.getChatBox();
|
final chatBubble = widget.msg.user?.getChatBox();
|
||||||
final hasChatBubble = _resolveRoomChatBubbleImageUrl(chatBubble).isNotEmpty;
|
final hasChatBubble = _resolveRoomChatBubbleImageUrl(chatBubble).isNotEmpty;
|
||||||
if (hasChatBubble) {
|
final bubbleStartMargin = 54.w;
|
||||||
return _buildVipTextMessageBubble(chatBubble);
|
return LayoutBuilder(
|
||||||
}
|
builder: (context, constraints) {
|
||||||
|
final rowMaxWidth =
|
||||||
|
constraints.maxWidth.isFinite
|
||||||
|
? constraints.maxWidth
|
||||||
|
: ScreenUtil().screenWidth;
|
||||||
|
final availableBubbleWidth = math.max(
|
||||||
|
1.0,
|
||||||
|
rowMaxWidth - bubbleStartMargin,
|
||||||
|
);
|
||||||
|
if (hasChatBubble) {
|
||||||
|
return _buildVipTextMessageBubble(
|
||||||
|
chatBubble,
|
||||||
|
maxBubbleWidth: availableBubbleWidth,
|
||||||
|
startMargin: bubbleStartMargin,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
return Container(
|
return Container(
|
||||||
constraints: BoxConstraints(maxWidth: ScreenUtil().screenWidth * 0.7),
|
constraints: BoxConstraints(
|
||||||
decoration: BoxDecoration(
|
maxWidth: math.min(
|
||||||
color: Colors.black38,
|
ScreenUtil().screenWidth * 0.7,
|
||||||
borderRadius: BorderRadius.only(
|
availableBubbleWidth,
|
||||||
topRight: Radius.circular(15.w),
|
),
|
||||||
bottomLeft: Radius.circular(15.w),
|
),
|
||||||
bottomRight: Radius.circular(15.w),
|
decoration: BoxDecoration(
|
||||||
),
|
color: Colors.black38,
|
||||||
),
|
borderRadius: BorderRadius.only(
|
||||||
padding: EdgeInsets.symmetric(horizontal: 10.w, vertical: 4.w),
|
topRight: Radius.circular(15.w),
|
||||||
margin: EdgeInsetsDirectional.only(start: 54.w).copyWith(bottom: 8.w),
|
bottomLeft: Radius.circular(15.w),
|
||||||
child: ExtendedText(
|
bottomRight: Radius.circular(15.w),
|
||||||
widget.msg.msg ?? '',
|
),
|
||||||
style: TextStyle(
|
),
|
||||||
fontSize: sp(13),
|
padding: EdgeInsets.symmetric(horizontal: 10.w, vertical: 4.w),
|
||||||
color: Color(_msgColor(widget.msg.type ?? "")),
|
margin: EdgeInsetsDirectional.only(
|
||||||
fontWeight: FontWeight.w500,
|
start: bubbleStartMargin,
|
||||||
),
|
).copyWith(bottom: 8.w),
|
||||||
softWrap: true,
|
child: ExtendedText(
|
||||||
specialTextSpanBuilder: AtTextSpanBuilder(onTapCall: (userId) {}),
|
widget.msg.msg ?? '',
|
||||||
),
|
style: TextStyle(
|
||||||
|
fontSize: sp(13),
|
||||||
|
color: Color(_msgColor(widget.msg.type ?? "")),
|
||||||
|
fontWeight: FontWeight.w500,
|
||||||
|
),
|
||||||
|
softWrap: true,
|
||||||
|
specialTextSpanBuilder: AtTextSpanBuilder(onTapCall: (userId) {}),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
},
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -255,7 +279,11 @@ class _MsgItemState extends State<MsgItem> {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget _buildVipTextMessageBubble(PropsResources? resource) {
|
Widget _buildVipTextMessageBubble(
|
||||||
|
PropsResources? resource, {
|
||||||
|
required double maxBubbleWidth,
|
||||||
|
required double startMargin,
|
||||||
|
}) {
|
||||||
final messageText = widget.msg.msg ?? "";
|
final messageText = widget.msg.msg ?? "";
|
||||||
final textStyle = TextStyle(
|
final textStyle = TextStyle(
|
||||||
fontSize: sp(13),
|
fontSize: sp(13),
|
||||||
@ -263,10 +291,7 @@ class _MsgItemState extends State<MsgItem> {
|
|||||||
fontWeight: FontWeight.w500,
|
fontWeight: FontWeight.w500,
|
||||||
);
|
);
|
||||||
final imageUrl = _resolveRoomChatBubbleImageUrl(resource);
|
final imageUrl = _resolveRoomChatBubbleImageUrl(resource);
|
||||||
final multilineMaxBubbleWidth = math.min(
|
final multilineMaxBubbleWidth = math.min(maxBubbleWidth, 300.w);
|
||||||
ScreenUtil().screenWidth * 0.72,
|
|
||||||
300.w,
|
|
||||||
);
|
|
||||||
final multilineMaxTextWidth = math.max(
|
final multilineMaxTextWidth = math.max(
|
||||||
82.w,
|
82.w,
|
||||||
multilineMaxBubbleWidth - 64.w,
|
multilineMaxBubbleWidth - 64.w,
|
||||||
@ -282,6 +307,7 @@ class _MsgItemState extends State<MsgItem> {
|
|||||||
imageUrl: imageUrl,
|
imageUrl: imageUrl,
|
||||||
textSize: multilineTextPainter.size,
|
textSize: multilineTextPainter.size,
|
||||||
maxBubbleWidth: multilineMaxBubbleWidth,
|
maxBubbleWidth: multilineMaxBubbleWidth,
|
||||||
|
startMargin: startMargin,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -289,6 +315,8 @@ class _MsgItemState extends State<MsgItem> {
|
|||||||
messageText: messageText,
|
messageText: messageText,
|
||||||
textStyle: textStyle,
|
textStyle: textStyle,
|
||||||
imageUrl: imageUrl,
|
imageUrl: imageUrl,
|
||||||
|
maxBubbleWidth: maxBubbleWidth,
|
||||||
|
startMargin: startMargin,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -298,6 +326,7 @@ class _MsgItemState extends State<MsgItem> {
|
|||||||
required String imageUrl,
|
required String imageUrl,
|
||||||
required Size textSize,
|
required Size textSize,
|
||||||
required double maxBubbleWidth,
|
required double maxBubbleWidth,
|
||||||
|
required double startMargin,
|
||||||
}) {
|
}) {
|
||||||
final leftPadding = 22.w;
|
final leftPadding = 22.w;
|
||||||
final rightPadding = 42.w;
|
final rightPadding = 42.w;
|
||||||
@ -323,7 +352,9 @@ class _MsgItemState extends State<MsgItem> {
|
|||||||
return Container(
|
return Container(
|
||||||
width: bubbleWidth,
|
width: bubbleWidth,
|
||||||
height: bubbleHeight,
|
height: bubbleHeight,
|
||||||
margin: EdgeInsetsDirectional.only(start: 54.w).copyWith(bottom: 8.w),
|
margin: EdgeInsetsDirectional.only(
|
||||||
|
start: startMargin,
|
||||||
|
).copyWith(bottom: 8.w),
|
||||||
child: Stack(
|
child: Stack(
|
||||||
fit: StackFit.expand,
|
fit: StackFit.expand,
|
||||||
children: [
|
children: [
|
||||||
@ -353,6 +384,8 @@ class _MsgItemState extends State<MsgItem> {
|
|||||||
required String messageText,
|
required String messageText,
|
||||||
required TextStyle textStyle,
|
required TextStyle textStyle,
|
||||||
required String imageUrl,
|
required String imageUrl,
|
||||||
|
required double maxBubbleWidth,
|
||||||
|
required double startMargin,
|
||||||
}) {
|
}) {
|
||||||
final leftPadding = 22.w;
|
final leftPadding = 22.w;
|
||||||
final rightPadding = 24.w;
|
final rightPadding = 24.w;
|
||||||
@ -361,7 +394,6 @@ class _MsgItemState extends State<MsgItem> {
|
|||||||
final minSkinWidth = 96.w;
|
final minSkinWidth = 96.w;
|
||||||
final minSkinHeight = 58.w;
|
final minSkinHeight = 58.w;
|
||||||
final textWidthSafety = 10.w;
|
final textWidthSafety = 10.w;
|
||||||
final maxBubbleWidth = ScreenUtil().screenWidth * 0.7;
|
|
||||||
final maxTextWidth = math.max(
|
final maxTextWidth = math.max(
|
||||||
1.0,
|
1.0,
|
||||||
maxBubbleWidth - leftPadding - rightPadding,
|
maxBubbleWidth - leftPadding - rightPadding,
|
||||||
@ -390,7 +422,9 @@ class _MsgItemState extends State<MsgItem> {
|
|||||||
return Container(
|
return Container(
|
||||||
width: bubbleWidth,
|
width: bubbleWidth,
|
||||||
height: bubbleHeight,
|
height: bubbleHeight,
|
||||||
margin: EdgeInsetsDirectional.only(start: 54.w).copyWith(bottom: 8.w),
|
margin: EdgeInsetsDirectional.only(
|
||||||
|
start: startMargin,
|
||||||
|
).copyWith(bottom: 8.w),
|
||||||
child: Stack(
|
child: Stack(
|
||||||
clipBehavior: Clip.none,
|
clipBehavior: Clip.none,
|
||||||
fit: StackFit.expand,
|
fit: StackFit.expand,
|
||||||
|
|||||||
1
需求进度.md
1
需求进度.md
@ -556,6 +556,7 @@
|
|||||||
- 已修正两个红包联调问题:当前房间点击红包飘窗 `GO` 打开领取层时会合并房间缓存中的完整红包 payload,避免限时红包丢失 `claimStartTime/countdown`;领取成功后发送的房内 IM 文本会附带不展示的唯一业务 key,避免同一用户连续领取同一发包人的多个红包时公屏只保留一条领取记录。
|
- 已修正两个红包联调问题:当前房间点击红包飘窗 `GO` 打开领取层时会合并房间缓存中的完整红包 payload,避免限时红包丢失 `claimStartTime/countdown`;领取成功后发送的房内 IM 文本会附带不展示的唯一业务 key,避免同一用户连续领取同一发包人的多个红包时公屏只保留一条领取记录。
|
||||||
- 已收口红包发送记录页状态展示:不再显示 `Pending/等待中`,后端 `ACTIVE/PENDING` 等中间态统一展示为已发出;只保留已退回、已领完、已发出三类状态,并补齐多语言的“已领完”文案。
|
- 已收口红包发送记录页状态展示:不再显示 `Pending/等待中`,后端 `ACTIVE/PENDING` 等中间态统一展示为已发出;只保留已退回、已领完、已发出三类状态,并补齐多语言的“已领完”文案。
|
||||||
- 已收口房间外红包领取层触发:红包飘屏 `GO` 只有在目标房间页面当前可见时才直接打开领取层,否则先进房;同语区或房间 IM 收到即时红包时,也只有当前可见房间匹配目标 `roomId` 才自动弹领取层,避免首页、房间列表、我的页直接弹抢红包。
|
- 已收口房间外红包领取层触发:红包飘屏 `GO` 只有在目标房间页面当前可见时才直接打开领取层,否则先进房;同语区或房间 IM 收到即时红包时,也只有当前可见房间匹配目标 `roomId` 才自动弹领取层,避免首页、房间列表、我的页直接弹抢红包。
|
||||||
|
- 已按最新反馈修正领取记录头像和跨房进房:领取记录空头像不再回退成红包图标,统一走项目默认头像;红包飘窗 `GO` 跨房点击直接进目标房间,不再弹进入房间二次确认。
|
||||||
|
|
||||||
## 已知问题
|
## 已知问题
|
||||||
- 已接入语音房表情包素材第一版:桌面 `表情素材` 中的 `fluent_emoji` 与 `monkey` gif 已纳入项目资源,底部聊天入口改为图稿里的短白色胶囊并移除内部输入图标,右侧新增独立表情按钮;同一个房间输入弹层现在可从表情按钮直接打开表情包面板,原 unicode emoji 面板已替换为本地 gif 表情。发送逻辑同步按最新规则分流:用户在麦上发表情时只在自己麦位播放,不进入聊天列表;用户未上麦发表情时进入房间聊天框展示,不触发麦位动画。
|
- 已接入语音房表情包素材第一版:桌面 `表情素材` 中的 `fluent_emoji` 与 `monkey` gif 已纳入项目资源,底部聊天入口改为图稿里的短白色胶囊并移除内部输入图标,右侧新增独立表情按钮;同一个房间输入弹层现在可从表情按钮直接打开表情包面板,原 unicode emoji 面板已替换为本地 gif 表情。发送逻辑同步按最新规则分流:用户在麦上发表情时只在自己麦位播放,不进入聊天列表;用户未上麦发表情时进入房间聊天框展示,不触发麦位动画。
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user