chore: 完成多模块迭代优化与依赖更新
本次提交包含多项更新: 1. 更新file_picker依赖到11.0.0-ohos.1版本 2. 清理SecureStorage、Catcher2配置冗余代码 3. 优化鸿蒙系统下HomeWidget调用方式 4. 重构编辑器导航栏图标与页面路由引用 5. 修复边框样式、简化空值判断逻辑 6. 移除冗余系统UI样式配置 7. 新增共享组件导出与自适应返回按钮 8. 批量替换路由引用为app_routes 9. 标记过时通知服务并补充注释 10. 新增引导页扫一扫功能卡片 11. 完善沉浸式状态栏配置逻辑 12. 为大量页面添加统一自适应返回按钮
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
// ============================================================
|
||||
// ============================================================
|
||||
// 闲言APP — 应用布局壳
|
||||
// 创建时间: 2026-04-20
|
||||
// 更新时间: 2026-05-18
|
||||
@@ -9,7 +9,6 @@
|
||||
import 'package:badges/badges.dart' as badges;
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
import 'package:xianyan/core/utils/platform_utils.dart' as pu;
|
||||
import 'package:go_router/go_router.dart';
|
||||
@@ -167,29 +166,15 @@ class AppShell extends ConsumerWidget {
|
||||
);
|
||||
|
||||
return CelebrationOverlay(
|
||||
child: AnnotatedRegion<SystemUiOverlayStyle>(
|
||||
value: SystemUiOverlayStyle(
|
||||
statusBarColor: Colors.transparent,
|
||||
statusBarIconBrightness: ext.isDark
|
||||
? Brightness.light
|
||||
: Brightness.dark,
|
||||
statusBarBrightness: ext.isDark ? Brightness.dark : Brightness.light,
|
||||
systemNavigationBarColor: Colors.transparent,
|
||||
systemNavigationBarIconBrightness: ext.isDark
|
||||
? Brightness.light
|
||||
: Brightness.dark,
|
||||
systemNavigationBarDividerColor: Colors.transparent,
|
||||
),
|
||||
child: PopScope(
|
||||
canPop: false,
|
||||
onPopInvokedWithResult: (didPop, _) {
|
||||
if (didPop) return;
|
||||
},
|
||||
child: Scaffold(
|
||||
extendBody: true,
|
||||
body: Stack(children: [child]),
|
||||
bottomNavigationBar: bottomBar,
|
||||
),
|
||||
child: PopScope(
|
||||
canPop: false,
|
||||
onPopInvokedWithResult: (didPop, _) {
|
||||
if (didPop) return;
|
||||
},
|
||||
child: Scaffold(
|
||||
extendBody: true,
|
||||
body: Stack(children: [child]),
|
||||
bottomNavigationBar: bottomBar,
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
/// ============================================================
|
||||
/// 闲言APP — 鸿蒙端专用布局壳
|
||||
/// 创建时间: 2026-05-18
|
||||
/// 更新时间: 2026-05-18
|
||||
/// 更新时间: 2026-05-22
|
||||
/// 作用: 鸿蒙端使用 Scaffold+GlassBottomBar 替代 GoRouter+StatefulShellRoute
|
||||
/// 上次更新: 恢复液态玻璃效果+TabIconSprite精灵动画,仅阉割路由
|
||||
/// 上次更新: 修复引导页在鸿蒙端不显示的问题,initState检查onboarding状态
|
||||
/// ============================================================
|
||||
///
|
||||
/// 根因: 鸿蒙端 Flutter 引擎中 MaterialApp.router + 额外包导入 = 白屏
|
||||
@@ -12,14 +12,15 @@
|
||||
import 'package:badges/badges.dart' as badges;
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
import 'package:liquid_glass_widgets/liquid_glass_widgets.dart';
|
||||
|
||||
import '../../core/storage/kv_storage.dart';
|
||||
import '../../core/theme/app_theme.dart';
|
||||
import '../../core/utils/interaction_animations.dart';
|
||||
import '../../core/utils/logger.dart';
|
||||
import '../../core/utils/platform_utils.dart' show OhosDeviceCapabilities;
|
||||
import '../../features/onboarding/presentation/onboarding_page.dart';
|
||||
import '../../features/tool_center/inspiration/providers/chat_provider.dart';
|
||||
import '../../features/tool_center/inspiration/presentation/pages/home/inspiration_page.dart';
|
||||
import '../../features/home/presentation/home_page.dart';
|
||||
@@ -57,8 +58,30 @@ class _OhosAppShellState extends ConsumerState<OhosAppShell> {
|
||||
void initState() {
|
||||
super.initState();
|
||||
OhosAppShell._instance = this;
|
||||
WidgetsBinding.instance.addPostFrameCallback((_) {
|
||||
_checkOnboarding();
|
||||
});
|
||||
}
|
||||
|
||||
void _checkOnboarding() {
|
||||
if (!mounted) return;
|
||||
final shouldShow =
|
||||
KvStorage.isFirstLaunch || KvStorage.shouldShowOnboarding;
|
||||
if (shouldShow) {
|
||||
Log.i('🟢 [OHOS] 引导页检查: 首次启动=$isFirstLaunch, 应显示引导=$shouldShow → 推送引导页');
|
||||
Navigator.of(context).push<void>(
|
||||
CupertinoPageRoute<void>(
|
||||
fullscreenDialog: true,
|
||||
builder: (_) => const OnboardingPage(),
|
||||
),
|
||||
);
|
||||
} else {
|
||||
Log.i('🟢 [OHOS] 引导页检查: 已完成引导,直接进入主页');
|
||||
}
|
||||
}
|
||||
|
||||
bool get isFirstLaunch => KvStorage.isFirstLaunch;
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
OhosAppShell._instance = null;
|
||||
@@ -104,29 +127,15 @@ class _OhosAppShellState extends ConsumerState<OhosAppShell> {
|
||||
);
|
||||
|
||||
return CelebrationOverlay(
|
||||
child: AnnotatedRegion<SystemUiOverlayStyle>(
|
||||
value: SystemUiOverlayStyle(
|
||||
statusBarColor: Colors.transparent,
|
||||
statusBarIconBrightness: ext.isDark
|
||||
? Brightness.light
|
||||
: Brightness.dark,
|
||||
statusBarBrightness: ext.isDark ? Brightness.dark : Brightness.light,
|
||||
systemNavigationBarColor: Colors.transparent,
|
||||
systemNavigationBarIconBrightness: ext.isDark
|
||||
? Brightness.light
|
||||
: Brightness.dark,
|
||||
systemNavigationBarDividerColor: Colors.transparent,
|
||||
),
|
||||
child: PopScope(
|
||||
canPop: false,
|
||||
onPopInvokedWithResult: (didPop, _) {
|
||||
if (didPop) return;
|
||||
},
|
||||
child: Scaffold(
|
||||
extendBody: true,
|
||||
body: IndexedStack(index: _currentIndex, children: _tabPages),
|
||||
bottomNavigationBar: bottomBar,
|
||||
),
|
||||
child: PopScope(
|
||||
canPop: false,
|
||||
onPopInvokedWithResult: (didPop, _) {
|
||||
if (didPop) return;
|
||||
},
|
||||
child: Scaffold(
|
||||
extendBody: true,
|
||||
body: IndexedStack(index: _currentIndex, children: _tabPages),
|
||||
bottomNavigationBar: bottomBar,
|
||||
),
|
||||
),
|
||||
);
|
||||
@@ -249,7 +258,10 @@ class _OhosAppShellState extends ConsumerState<OhosAppShell> {
|
||||
label: t.navDiscover,
|
||||
badgeCount: unreadCount,
|
||||
),
|
||||
GlassBottomNavBarItem(spriteType: TabSpriteType.profile, label: t.navProfile),
|
||||
GlassBottomNavBarItem(
|
||||
spriteType: TabSpriteType.profile,
|
||||
label: t.navProfile,
|
||||
),
|
||||
],
|
||||
selectedIndex: _currentIndex,
|
||||
onTabSelected: (index) => setState(() => _currentIndex = index),
|
||||
|
||||
Reference in New Issue
Block a user