修复一些已知bug
This commit is contained in:
parent
5086cdd97c
commit
20106df6f0
@ -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.43:1100/',
|
defaultValue: 'https://jvapi.haiyihy.com/',
|
||||||
); // 默认连线上环境,本地调试可通过 --dart-define=API_HOST 覆盖
|
); // 默认连线上环境,本地调试可通过 --dart-define=API_HOST 覆盖
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
|||||||
@ -31,6 +31,31 @@ SlideTransition kOpenRoomTransitionBuilder( BuildContext context,
|
|||||||
class SCNavigatorUtils {
|
class SCNavigatorUtils {
|
||||||
static bool inChatPage = false;
|
static bool inChatPage = false;
|
||||||
static bool inLoginPage = false;
|
static bool inLoginPage = false;
|
||||||
|
|
||||||
|
/// 登录态失效时,多个入口可能同时尝试跳登录页。
|
||||||
|
/// 统一在这里做一次幂等保护,避免堆叠多个登录页。
|
||||||
|
static Future<void> pushLoginIfNeeded(
|
||||||
|
BuildContext context, {
|
||||||
|
bool replace = false,
|
||||||
|
bool clearStack = false,
|
||||||
|
TransitionType? transition,
|
||||||
|
Duration? transitionDuration,
|
||||||
|
RouteTransitionsBuilder? transitionBuilder,
|
||||||
|
}) async {
|
||||||
|
if (inLoginPage) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
await push(
|
||||||
|
context,
|
||||||
|
LoginRouter.login,
|
||||||
|
replace: replace,
|
||||||
|
clearStack: clearStack,
|
||||||
|
transition: transition,
|
||||||
|
transitionDuration: transitionDuration,
|
||||||
|
transitionBuilder: transitionBuilder,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
//不需要页面返回值的跳转
|
//不需要页面返回值的跳转
|
||||||
static Future push(BuildContext context, String path,
|
static Future push(BuildContext context, String path,
|
||||||
{bool replace = false,
|
{bool replace = false,
|
||||||
@ -39,8 +64,8 @@ class SCNavigatorUtils {
|
|||||||
Duration? transitionDuration,
|
Duration? transitionDuration,
|
||||||
RouteTransitionsBuilder? transitionBuilder}) async {
|
RouteTransitionsBuilder? transitionBuilder}) async {
|
||||||
FocusScope.of(context).unfocus();
|
FocusScope.of(context).unfocus();
|
||||||
inLoginPage = path.startsWith("${LoginRouter.login}");
|
inLoginPage = path.startsWith(LoginRouter.login);
|
||||||
inChatPage = path.startsWith("${SCChatRouter.chat}");
|
inChatPage = path.startsWith(SCChatRouter.chat);
|
||||||
final result = await SCLkApplication.router.navigateTo(context, path,
|
final result = await SCLkApplication.router.navigateTo(context, path,
|
||||||
replace: replace,
|
replace: replace,
|
||||||
clearStack: clearStack,
|
clearStack: clearStack,
|
||||||
@ -76,7 +101,7 @@ class SCNavigatorUtils {
|
|||||||
TransitionType? transition}) {
|
TransitionType? transition}) {
|
||||||
FocusScope.of(context).unfocus();
|
FocusScope.of(context).unfocus();
|
||||||
inLoginPage = path == LoginRouter.login;
|
inLoginPage = path == LoginRouter.login;
|
||||||
inChatPage = path.startsWith("${SCChatRouter.chat}");
|
inChatPage = path.startsWith(SCChatRouter.chat);
|
||||||
SCLkApplication.router
|
SCLkApplication.router
|
||||||
.navigateTo(context, path,
|
.navigateTo(context, path,
|
||||||
replace: replace,
|
replace: replace,
|
||||||
@ -108,7 +133,7 @@ class SCNavigatorUtils {
|
|||||||
}
|
}
|
||||||
function(result);
|
function(result);
|
||||||
}).catchError((error) {
|
}).catchError((error) {
|
||||||
print('$error');
|
debugPrint('$error');
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -1,6 +1,5 @@
|
|||||||
import 'dart:ui' as ui;
|
import 'dart:ui' as ui;
|
||||||
|
|
||||||
import 'package:flutter/cupertino.dart';
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter/services.dart';
|
import 'package:flutter/services.dart';
|
||||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||||
@ -22,7 +21,6 @@ import '../../../ui_kit/components/sc_tts.dart';
|
|||||||
import '../../../ui_kit/components/dialog/dialog_base.dart';
|
import '../../../ui_kit/components/dialog/dialog_base.dart';
|
||||||
import '../../../ui_kit/components/text/sc_text.dart';
|
import '../../../ui_kit/components/text/sc_text.dart';
|
||||||
import '../../../ui_kit/widgets/id/sc_special_id_badge.dart';
|
import '../../../ui_kit/widgets/id/sc_special_id_badge.dart';
|
||||||
import '../../../main.dart';
|
|
||||||
import '../../index/main_route.dart';
|
import '../../index/main_route.dart';
|
||||||
|
|
||||||
///房间详情
|
///房间详情
|
||||||
@ -33,7 +31,7 @@ class RoomDetailPage extends StatefulWidget {
|
|||||||
const RoomDetailPage(this.isHomeowner, {super.key});
|
const RoomDetailPage(this.isHomeowner, {super.key});
|
||||||
|
|
||||||
@override
|
@override
|
||||||
_RoomDetailPageState createState() => _RoomDetailPageState();
|
State<RoomDetailPage> createState() => _RoomDetailPageState();
|
||||||
}
|
}
|
||||||
|
|
||||||
class _RoomDetailPageState extends State<RoomDetailPage> {
|
class _RoomDetailPageState extends State<RoomDetailPage> {
|
||||||
@ -64,7 +62,7 @@ class _RoomDetailPageState extends State<RoomDetailPage> {
|
|||||||
child: Container(
|
child: Container(
|
||||||
height: widget.isHomeowner ? 300.w : 400.w,
|
height: widget.isHomeowner ? 300.w : 400.w,
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: Color(0xff09372E).withOpacity(0.5),
|
color: const Color(0xff09372E).withValues(alpha: 0.5),
|
||||||
borderRadius: BorderRadius.only(
|
borderRadius: BorderRadius.only(
|
||||||
topLeft: Radius.circular(12.w),
|
topLeft: Radius.circular(12.w),
|
||||||
topRight: Radius.circular(12.w),
|
topRight: Radius.circular(12.w),
|
||||||
@ -475,34 +473,11 @@ class _RoomDetailPageState extends State<RoomDetailPage> {
|
|||||||
SizedBox(width: 15.w),
|
SizedBox(width: 15.w),
|
||||||
Expanded(
|
Expanded(
|
||||||
child: SCDebounceWidget(
|
child: SCDebounceWidget(
|
||||||
child: Container(
|
child: _buildHomeownerActionButton(
|
||||||
height: 45.w,
|
context,
|
||||||
decoration: BoxDecoration(
|
SCAppLocalizations.of(
|
||||||
borderRadius: BorderRadius.circular(
|
context,
|
||||||
10.w,
|
)!.roomMember,
|
||||||
),
|
|
||||||
color: SocialChatTheme.primaryLight,
|
|
||||||
),
|
|
||||||
child: Row(
|
|
||||||
children: [
|
|
||||||
SizedBox(width: 20.w),
|
|
||||||
text(
|
|
||||||
SCAppLocalizations.of(
|
|
||||||
context,
|
|
||||||
)!.roomMember,
|
|
||||||
textColor: Colors.white,
|
|
||||||
fontSize: 14.sp,
|
|
||||||
),
|
|
||||||
Spacer(),
|
|
||||||
Icon(
|
|
||||||
Icons
|
|
||||||
.keyboard_arrow_right_sharp,
|
|
||||||
color: Colors.white,
|
|
||||||
size: 20.w,
|
|
||||||
),
|
|
||||||
SizedBox(width: 15.w),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
onTap: () {
|
onTap: () {
|
||||||
Navigator.of(context).pop();
|
Navigator.of(context).pop();
|
||||||
@ -511,7 +486,7 @@ class _RoomDetailPageState extends State<RoomDetailPage> {
|
|||||||
RoomMemberPage(
|
RoomMemberPage(
|
||||||
roomId:
|
roomId:
|
||||||
Provider.of<RtcProvider>(
|
Provider.of<RtcProvider>(
|
||||||
context!,
|
context,
|
||||||
listen: false,
|
listen: false,
|
||||||
)
|
)
|
||||||
.currenRoom
|
.currenRoom
|
||||||
@ -528,34 +503,11 @@ class _RoomDetailPageState extends State<RoomDetailPage> {
|
|||||||
SizedBox(width: 10.w),
|
SizedBox(width: 10.w),
|
||||||
Expanded(
|
Expanded(
|
||||||
child: SCDebounceWidget(
|
child: SCDebounceWidget(
|
||||||
child: Container(
|
child: _buildHomeownerActionButton(
|
||||||
height: 45.w,
|
context,
|
||||||
decoration: BoxDecoration(
|
SCAppLocalizations.of(
|
||||||
borderRadius: BorderRadius.circular(
|
context,
|
||||||
10.w,
|
)!.roomEdit,
|
||||||
),
|
|
||||||
color: SocialChatTheme.primaryLight,
|
|
||||||
),
|
|
||||||
child: Row(
|
|
||||||
children: [
|
|
||||||
SizedBox(width: 20.w),
|
|
||||||
text(
|
|
||||||
SCAppLocalizations.of(
|
|
||||||
context,
|
|
||||||
)!.roomEdit,
|
|
||||||
textColor: Colors.white,
|
|
||||||
fontSize: 14.sp,
|
|
||||||
),
|
|
||||||
Spacer(),
|
|
||||||
Icon(
|
|
||||||
Icons
|
|
||||||
.keyboard_arrow_right_sharp,
|
|
||||||
color: Colors.white,
|
|
||||||
size: 20.w,
|
|
||||||
),
|
|
||||||
SizedBox(width: 15.w),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
onTap: () {
|
onTap: () {
|
||||||
VoiceRoomRoute.openRoomEdit(
|
VoiceRoomRoute.openRoomEdit(
|
||||||
@ -642,6 +594,10 @@ class _RoomDetailPageState extends State<RoomDetailPage> {
|
|||||||
context,
|
context,
|
||||||
)!.confirm,
|
)!.confirm,
|
||||||
onEnsure: () {
|
onEnsure: () {
|
||||||
|
final successMessage =
|
||||||
|
SCAppLocalizations.of(
|
||||||
|
context,
|
||||||
|
)!.operationSuccessful;
|
||||||
SCChatRoomRepository()
|
SCChatRoomRepository()
|
||||||
.changeRoomRole(
|
.changeRoomRole(
|
||||||
ref
|
ref
|
||||||
@ -685,11 +641,7 @@ class _RoomDetailPageState extends State<RoomDetailPage> {
|
|||||||
);
|
);
|
||||||
setState(() {});
|
setState(() {});
|
||||||
SCTts.show(
|
SCTts.show(
|
||||||
SCAppLocalizations.of(
|
successMessage,
|
||||||
navigatorKey
|
|
||||||
.currentState!
|
|
||||||
.context,
|
|
||||||
)!.operationSuccessful,
|
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
@ -933,4 +885,33 @@ class _RoomDetailPageState extends State<RoomDetailPage> {
|
|||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Widget _buildHomeownerActionButton(BuildContext context, String label) {
|
||||||
|
return Container(
|
||||||
|
height: 45.w,
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
borderRadius: BorderRadius.circular(10.w),
|
||||||
|
color: SocialChatTheme.primaryLight,
|
||||||
|
),
|
||||||
|
padding: EdgeInsets.symmetric(horizontal: 16.w),
|
||||||
|
child: Row(
|
||||||
|
children: [
|
||||||
|
Expanded(
|
||||||
|
child: text(
|
||||||
|
label,
|
||||||
|
textColor: Colors.white,
|
||||||
|
fontSize: 14.sp,
|
||||||
|
maxLines: 1,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
SizedBox(width: 8.w),
|
||||||
|
Icon(
|
||||||
|
Icons.keyboard_arrow_right_sharp,
|
||||||
|
color: Colors.white,
|
||||||
|
size: 20.w,
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -10,7 +10,6 @@ import 'package:yumi/shared/data_sources/sources/local/user_manager.dart';
|
|||||||
import 'package:yumi/app/routes/sc_routes.dart';
|
import 'package:yumi/app/routes/sc_routes.dart';
|
||||||
import 'package:yumi/app/routes/sc_fluro_navigator.dart';
|
import 'package:yumi/app/routes/sc_fluro_navigator.dart';
|
||||||
import 'package:yumi/shared/data_sources/sources/local/file_cache_manager.dart';
|
import 'package:yumi/shared/data_sources/sources/local/file_cache_manager.dart';
|
||||||
import 'package:yumi/modules/auth/login_route.dart';
|
|
||||||
import 'package:yumi/ui_kit/components/sc_compontent.dart';
|
import 'package:yumi/ui_kit/components/sc_compontent.dart';
|
||||||
|
|
||||||
import 'last_weekly_cp_splash_cache.dart';
|
import 'last_weekly_cp_splash_cache.dart';
|
||||||
@ -450,13 +449,13 @@ class _SplashPageState extends State<SplashPage> {
|
|||||||
if (user != null && token.isNotEmpty) {
|
if (user != null && token.isNotEmpty) {
|
||||||
SCNavigatorUtils.push(context, SCRoutes.home, replace: true);
|
SCNavigatorUtils.push(context, SCRoutes.home, replace: true);
|
||||||
} else {
|
} else {
|
||||||
SCNavigatorUtils.push(context, LoginRouter.login, replace: true);
|
SCNavigatorUtils.pushLoginIfNeeded(context, replace: true);
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
if (!mounted) {
|
if (!mounted) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
SCNavigatorUtils.push(context, LoginRouter.login, replace: true);
|
SCNavigatorUtils.pushLoginIfNeeded(context, replace: true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -313,7 +313,7 @@ class _MePage2State extends State<MePage2> {
|
|||||||
items.add(
|
items.add(
|
||||||
_MenuRowData(
|
_MenuRowData(
|
||||||
title: SCAppLocalizations.of(context)!.agentCenter,
|
title: SCAppLocalizations.of(context)!.agentCenter,
|
||||||
assetIcon: 'sc_images/index/at_icon_agent_center.png',
|
assetIcon: 'sc_images/index/sc_icon_agent_center.png',
|
||||||
onTap: () {
|
onTap: () {
|
||||||
SCNavigatorUtils.push(
|
SCNavigatorUtils.push(
|
||||||
context,
|
context,
|
||||||
@ -326,7 +326,7 @@ class _MePage2State extends State<MePage2> {
|
|||||||
items.add(
|
items.add(
|
||||||
_MenuRowData(
|
_MenuRowData(
|
||||||
title: SCAppLocalizations.of(context)!.hostCenter,
|
title: SCAppLocalizations.of(context)!.hostCenter,
|
||||||
assetIcon: 'sc_images/index/at_icon_host_center.png',
|
assetIcon: 'sc_images/index/sc_icon_host_center.png',
|
||||||
onTap: () {
|
onTap: () {
|
||||||
SCNavigatorUtils.push(
|
SCNavigatorUtils.push(
|
||||||
context,
|
context,
|
||||||
@ -344,7 +344,7 @@ class _MePage2State extends State<MePage2> {
|
|||||||
items.add(
|
items.add(
|
||||||
_MenuRowData(
|
_MenuRowData(
|
||||||
title: SCAppLocalizations.of(context)!.bdLeader,
|
title: SCAppLocalizations.of(context)!.bdLeader,
|
||||||
assetIcon: 'sc_images/index/at_icon_bd_leader.png',
|
assetIcon: 'sc_images/index/sc_icon_bd_leader.png',
|
||||||
onTap: () {
|
onTap: () {
|
||||||
SCNavigatorUtils.push(
|
SCNavigatorUtils.push(
|
||||||
context,
|
context,
|
||||||
@ -357,7 +357,7 @@ class _MePage2State extends State<MePage2> {
|
|||||||
items.add(
|
items.add(
|
||||||
_MenuRowData(
|
_MenuRowData(
|
||||||
title: SCAppLocalizations.of(context)!.bdCenter,
|
title: SCAppLocalizations.of(context)!.bdCenter,
|
||||||
assetIcon: 'sc_images/index/at_icon_bd_center.png',
|
assetIcon: 'sc_images/index/sc_icon_bd_center.png',
|
||||||
onTap: () {
|
onTap: () {
|
||||||
SCNavigatorUtils.push(
|
SCNavigatorUtils.push(
|
||||||
context,
|
context,
|
||||||
@ -374,7 +374,7 @@ class _MePage2State extends State<MePage2> {
|
|||||||
items.add(
|
items.add(
|
||||||
_MenuRowData(
|
_MenuRowData(
|
||||||
title: SCAppLocalizations.of(context)!.rechargeAgency,
|
title: SCAppLocalizations.of(context)!.rechargeAgency,
|
||||||
assetIcon: 'sc_images/index/at_icon_recharge_agency.png',
|
assetIcon: 'sc_images/index/sc_icon_recharge_agency.png',
|
||||||
onTap: () {
|
onTap: () {
|
||||||
SCNavigatorUtils.push(
|
SCNavigatorUtils.push(
|
||||||
context,
|
context,
|
||||||
@ -390,7 +390,7 @@ class _MePage2State extends State<MePage2> {
|
|||||||
items.add(
|
items.add(
|
||||||
_MenuRowData(
|
_MenuRowData(
|
||||||
title: SCAppLocalizations.of(context)!.adminCenter,
|
title: SCAppLocalizations.of(context)!.adminCenter,
|
||||||
assetIcon: 'sc_images/index/at_icon_admin_center.png',
|
assetIcon: 'sc_images/index/sc_icon_admin_center.png',
|
||||||
onTap: () {
|
onTap: () {
|
||||||
SCNavigatorUtils.push(
|
SCNavigatorUtils.push(
|
||||||
context,
|
context,
|
||||||
|
|||||||
@ -8,7 +8,6 @@ import 'package:yumi/shared/data_sources/sources/local/data_persistence.dart';
|
|||||||
import 'package:provider/provider.dart';
|
import 'package:provider/provider.dart';
|
||||||
import 'package:yumi/app/routes/sc_fluro_navigator.dart';
|
import 'package:yumi/app/routes/sc_fluro_navigator.dart';
|
||||||
import 'package:yumi/shared/business_logic/models/res/login_res.dart';
|
import 'package:yumi/shared/business_logic/models/res/login_res.dart';
|
||||||
import 'package:yumi/modules/auth/login_route.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:yumi/shared/data_sources/sources/local/floating_screen_manager.dart';
|
import 'package:yumi/shared/data_sources/sources/local/floating_screen_manager.dart';
|
||||||
@ -141,7 +140,7 @@ class AccountStorage {
|
|||||||
listen: false,
|
listen: false,
|
||||||
).exitCurrentVoiceRoomSession(true);
|
).exitCurrentVoiceRoomSession(true);
|
||||||
Provider.of<RtmProvider>(context, listen: false).logout();
|
Provider.of<RtmProvider>(context, listen: false).logout();
|
||||||
SCNavigatorUtils.push(context, LoginRouter.login, clearStack: true);
|
SCNavigatorUtils.pushLoginIfNeeded(context, clearStack: true);
|
||||||
SCRoomUtils.closeAllDialogs();
|
SCRoomUtils.closeAllDialogs();
|
||||||
SCMessageUtils.redPacketFutureCache.clear();
|
SCMessageUtils.redPacketFutureCache.clear();
|
||||||
SCGlobalConfig.resetVisualEffectSwitchesToRecommendedDefaults();
|
SCGlobalConfig.resetVisualEffectSwitchesToRecommendedDefaults();
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user