fix(mobile-app): 使用 appRouterProvider 获取全局路由状态

改用 ref.read(appRouterProvider) 替代 GoRouter.of(context),
确保能正确获取到当前的全局路由路径。

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
hailin 2025-12-26 00:06:17 -08:00
parent ce75e68d5e
commit b40cd40eae
1 changed files with 4 additions and 5 deletions

View File

@ -8,6 +8,7 @@ import '../../../../core/di/injection_container.dart';
import '../../../../core/services/contract_check_service.dart';
import '../../../../core/updater/update_service.dart';
import '../../../../routes/route_paths.dart';
import '../../../../routes/app_router.dart';
import '../../../../bootstrap.dart';
import '../widgets/bottom_nav_bar.dart';
@ -109,13 +110,11 @@ class _HomeShellPageState extends ConsumerState<HomeShellPage>
}
// 2. /KYC页面
// 使 GoRouter.of(context) GoRouterState.of(context)
// GoRouterState.of(context) ShellRoute
// /contract-signing/:orderNo
// 使 appRouterProvider
try {
final router = GoRouter.of(context);
final router = ref.read(appRouterProvider);
final location = router.routerDelegate.currentConfiguration.uri.path;
debugPrint('[HomeShellPage] 当前路由: $location');
debugPrint('[HomeShellPage] 当前路由(provider): $location');
//
if (location.startsWith('/contract-signing')) return true;
// KYC