完善细类
This commit is contained in:
@@ -60,12 +60,17 @@ class _HomePageState extends State<HomePage>
|
||||
_initDebugInfo();
|
||||
_initOfflineDataManager();
|
||||
_initAudioManager();
|
||||
_initSecondaryButtonsManager();
|
||||
// 延迟加载诗词,确保页面先显示
|
||||
WidgetsBinding.instance.addPostFrameCallback((_) {
|
||||
_loadPoetry();
|
||||
});
|
||||
}
|
||||
|
||||
Future<void> _initSecondaryButtonsManager() async {
|
||||
await SecondaryButtonsManager().init();
|
||||
}
|
||||
|
||||
Future<void> _initAudioManager() async {
|
||||
await AudioManager().init();
|
||||
}
|
||||
@@ -772,63 +777,71 @@ class _HomePageState extends State<HomePage>
|
||||
onRefresh: _refreshPoetry,
|
||||
child: FadeTransition(
|
||||
opacity: _fadeAnimation,
|
||||
child: Stack(
|
||||
children: [
|
||||
SingleChildScrollView(
|
||||
physics: const AlwaysScrollableScrollPhysics(), // 确保可以下拉刷新
|
||||
padding: const EdgeInsets.symmetric(vertical: 16),
|
||||
child: Column(
|
||||
children: [
|
||||
PoetryCard(
|
||||
poetryData: _poetryData!,
|
||||
keywordList: _keywordList,
|
||||
onTap: _loadNextPoetry,
|
||||
sectionLoadingStates: _sectionLoadingStates,
|
||||
repaintKey: _repaintKey,
|
||||
child: ValueListenableBuilder<bool>(
|
||||
valueListenable: SecondaryButtonsManager().hiddenNotifier,
|
||||
builder: (context, hideSecondaryButtons, child) {
|
||||
return Stack(
|
||||
children: [
|
||||
SingleChildScrollView(
|
||||
physics:
|
||||
const AlwaysScrollableScrollPhysics(), // 确保可以下拉刷新
|
||||
padding: const EdgeInsets.symmetric(vertical: 16),
|
||||
child: Column(
|
||||
children: [
|
||||
PoetryCard(
|
||||
poetryData: _poetryData!,
|
||||
keywordList: _keywordList,
|
||||
onTap: _loadNextPoetry,
|
||||
sectionLoadingStates: _sectionLoadingStates,
|
||||
repaintKey: _repaintKey,
|
||||
),
|
||||
const SizedBox(height: 160), // 为悬浮按钮留出更多空间
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 160), // 为悬浮按钮留出更多空间
|
||||
],
|
||||
),
|
||||
),
|
||||
// 调试信息气泡
|
||||
Positioned(
|
||||
bottom: 66,
|
||||
left: 0,
|
||||
right: 0,
|
||||
child: Center(child: _buildDebugInfoBubble()),
|
||||
),
|
||||
// 悬浮上一条按钮 - 左边上方
|
||||
Positioned(
|
||||
left: 16,
|
||||
bottom: 100,
|
||||
child: FloatingPreviousButton(
|
||||
onPrevious: _loadPreviousPoetry,
|
||||
),
|
||||
),
|
||||
// 悬浮下一条按钮 - 左边下方
|
||||
Positioned(
|
||||
left: 16,
|
||||
bottom: 32,
|
||||
child: FloatingNextButton(onNext: _loadNextPoetry),
|
||||
),
|
||||
// 悬浮分享按钮 - 右边上方
|
||||
Positioned(
|
||||
right: 16,
|
||||
bottom: 100,
|
||||
child: FloatingShareButton(onShare: _sharePoetryImage),
|
||||
),
|
||||
// 悬浮点赞按钮 - 右边(仅在线状态显示)
|
||||
if (isOnline)
|
||||
Positioned(
|
||||
right: 16,
|
||||
bottom: 32,
|
||||
child: FloatingLikeButton(
|
||||
isLiked: _isLiked,
|
||||
isLoadingLike: _isLoadingLike,
|
||||
onToggleLike: _toggleLike,
|
||||
),
|
||||
),
|
||||
],
|
||||
// 调试信息气泡
|
||||
Positioned(
|
||||
bottom: 66,
|
||||
left: 0,
|
||||
right: 0,
|
||||
child: Center(child: _buildDebugInfoBubble()),
|
||||
),
|
||||
// 悬浮上一条按钮 - 左边上方(根据设置显示/隐藏)
|
||||
if (!hideSecondaryButtons)
|
||||
Positioned(
|
||||
left: 16,
|
||||
bottom: 100,
|
||||
child: FloatingPreviousButton(
|
||||
onPrevious: _loadPreviousPoetry,
|
||||
),
|
||||
),
|
||||
// 悬浮下一条按钮 - 左边下方
|
||||
Positioned(
|
||||
left: 16,
|
||||
bottom: 32,
|
||||
child: FloatingNextButton(onNext: _loadNextPoetry),
|
||||
),
|
||||
// 悬浮分享按钮 - 右边上方(根据设置显示/隐藏)
|
||||
if (!hideSecondaryButtons)
|
||||
Positioned(
|
||||
right: 16,
|
||||
bottom: 100,
|
||||
child: FloatingShareButton(onShare: _sharePoetryImage),
|
||||
),
|
||||
// 悬浮点赞按钮 - 右边(仅在线状态显示)
|
||||
if (isOnline)
|
||||
Positioned(
|
||||
right: 16,
|
||||
bottom: 32,
|
||||
child: FloatingLikeButton(
|
||||
isLiked: _isLiked,
|
||||
isLoadingLike: _isLoadingLike,
|
||||
onToggleLike: _toggleLike,
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
},
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user