图片生成
This commit is contained in:
@@ -39,6 +39,8 @@ class _HomePageState extends State<HomePage>
|
||||
late Animation<double> _fadeAnimation;
|
||||
late Animation<Offset> _slideAnimation;
|
||||
|
||||
final GlobalKey _repaintKey = GlobalKey();
|
||||
|
||||
// 动态加载状态
|
||||
bool _isLoadingNext = false;
|
||||
Map<String, bool> _sectionLoadingStates = {
|
||||
@@ -724,6 +726,15 @@ class _HomePageState extends State<HomePage>
|
||||
}
|
||||
}
|
||||
|
||||
Future<void> _sharePoetryImage() async {
|
||||
if (_poetryData == null) return;
|
||||
await ShareImageUtils.captureAndShare(
|
||||
context,
|
||||
_repaintKey,
|
||||
subject: _poetryData!.name,
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
@@ -773,6 +784,7 @@ class _HomePageState extends State<HomePage>
|
||||
keywordList: _keywordList,
|
||||
onTap: _loadNextPoetry,
|
||||
sectionLoadingStates: _sectionLoadingStates,
|
||||
repaintKey: _repaintKey,
|
||||
),
|
||||
const SizedBox(height: 160), // 为悬浮按钮留出更多空间
|
||||
],
|
||||
@@ -799,6 +811,12 @@ class _HomePageState extends State<HomePage>
|
||||
bottom: 32,
|
||||
child: FloatingNextButton(onNext: _loadNextPoetry),
|
||||
),
|
||||
// 悬浮分享按钮 - 右边上方
|
||||
Positioned(
|
||||
right: 16,
|
||||
bottom: 100,
|
||||
child: FloatingShareButton(onShare: _sharePoetryImage),
|
||||
),
|
||||
// 悬浮点赞按钮 - 右边(仅在线状态显示)
|
||||
if (isOnline)
|
||||
Positioned(
|
||||
|
||||
Reference in New Issue
Block a user