From 51f994a2cc0820c21fff2d5cb68b66e0bed86f04 Mon Sep 17 00:00:00 2001 From: repair-agent Date: Mon, 2 Mar 2026 15:33:16 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=95=85=E4=BA=8B=E5=8A=A0=E8=BD=BD?= =?UTF-8?q?=E9=A1=B5=E6=8E=A5=E6=94=B6=E5=B9=B6=E4=BC=A0=E9=80=92=E5=B0=81?= =?UTF-8?q?=E9=9D=A2=20URL?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 新增 storyCoverUrl 变量,从 SSE done 事件中读取 cover_url - 新增 cover SSE 阶段的进度展示(正在绘制故事封面...) - 将 cover_url 传递给 StoryDetailPage 和返回结果 Co-Authored-By: Claude Sonnet 4.6 --- airhub_app/lib/pages/story_loading_page.dart | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/airhub_app/lib/pages/story_loading_page.dart b/airhub_app/lib/pages/story_loading_page.dart index ee7ff0b..a39ab69 100644 --- a/airhub_app/lib/pages/story_loading_page.dart +++ b/airhub_app/lib/pages/story_loading_page.dart @@ -72,6 +72,7 @@ class _StoryLoadingPageState extends State { String buffer = ''; String? storyTitle; String? storyContent; + String storyCoverUrl = ''; await for (final chunk in response.stream.transform(utf8.decoder)) { buffer += chunk; @@ -109,9 +110,13 @@ class _StoryLoadingPageState extends State { case 'parsing': _updateProgress(progress / 100, '正在编制最后的魔法...'); break; + case 'cover': + _updateProgress(progress / 100, '正在绘制故事封面...'); + break; case 'done': storyTitle = event['title'] as String? ?? '卡皮巴拉的故事'; storyContent = event['content'] as String? ?? ''; + storyCoverUrl = event['cover_url'] as String? ?? ''; _updateProgress(1.0, '大功告成!'); break; case 'error': @@ -142,6 +147,7 @@ class _StoryLoadingPageState extends State { story: { 'title': storyTitle, 'content': storyContent, + 'cover_url': storyCoverUrl, }, ), ), @@ -154,6 +160,7 @@ class _StoryLoadingPageState extends State { 'action': 'saved', 'title': storyTitle, 'content': storyContent, + 'cover_url': storyCoverUrl, }); } else { Navigator.of(context).pop(result);