refactor: 兼容后端返回数字类型波动,清理废弃代码
主要变更: 1. 全局修复类型转换问题,将多处`as int?`改为`(num?)?.toInt()`兼容浮点/字符串类型的数字字段 2. 移除废弃的nearby_p2p配对方式和对应的依赖包 3. 优化鸿蒙端快捷方式、引导页、路由导航的稳定性 4. 合并日志输出避免鸿蒙端IDE卡顿 5. 修复安卓端蓝牙权限冗余声明
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
/// ============================================================
|
||||
/// 闲言APP — 鸿蒙端专用布局壳
|
||||
/// 创建时间: 2026-05-18
|
||||
/// 更新时间: 2026-05-22
|
||||
/// 更新时间: 2026-06-06
|
||||
/// 作用: 鸿蒙端使用 Scaffold+GlassBottomBar 替代 GoRouter+StatefulShellRoute
|
||||
/// 上次更新: 修复引导页在鸿蒙端不显示的问题,initState检查onboarding状态
|
||||
/// 上次更新: 修复鸿蒙端杀后台重启时引导页重复弹出的问题(添加KvStorage.isReady检查)
|
||||
/// ============================================================
|
||||
///
|
||||
/// 根因: 鸿蒙端 Flutter 引擎中 MaterialApp.router + 额外包导入 = 白屏
|
||||
@@ -66,6 +66,17 @@ class _OhosAppShellState extends ConsumerState<OhosAppShell> {
|
||||
|
||||
void _checkOnboarding() {
|
||||
if (!mounted) return;
|
||||
|
||||
// 等待KvStorage初始化完成再检查引导页状态
|
||||
// 避免Hive未初始化时默认值导致引导页重复弹出
|
||||
if (!KvStorage.isReady) {
|
||||
Log.i('🟢 [OHOS] 引导页检查: KvStorage未就绪,延迟检查');
|
||||
Future.delayed(const Duration(milliseconds: 300), () {
|
||||
if (mounted) _checkOnboarding();
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
final shouldShow =
|
||||
KvStorage.isFirstLaunch || KvStorage.shouldShowOnboarding;
|
||||
if (shouldShow) {
|
||||
|
||||
Reference in New Issue
Block a user