feat: 重构分享保存图片逻辑,支持长图模式,新增动态、专栏、视频分享保存图片 - #2521
Open
WindDrift wants to merge 2 commits into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
背景
现有的"保存动态"功能存在多项体验问题:
bilibili://协议链接,大部分软件(如 QQ 、微信)无法扫码识别更改内容
1. 菜单项重命名
2. 二维码改用 https 网页链接
将
parseDyn中各动态类型的bilibili://协议改为对应的https://网页链接:https://www.bilibili.com/video/{bvid}https://www.bilibili.com/opus/{idStr}https://live.bilibili.com/{roomId}https://www.bilibili.com/video/{bvid}https://www.bilibili.com/bangumi/play/ep{epid}https://www.bilibili.com/medialist/detail/ml{mediaId}https://t.bilibili.com/{idStr}同时将评论的
bilibili://comment/detail/链接改为所在内容的 https 网页链接。3. 抽取可复用的分享列表
AuthorPanel.shareSheetItems:返回"保存为图片""分享链接""分享至消息"三项 ListTile,供 morePanel 复用AuthorPanel.showShareSheet:弹出 BottomSheet 分享列表,供动态详情页调用4. 动态详情页底部"分享"按钮改为弹出列表
5. SavePanel 新增"长图切换"按钮
isLongImageMode状态(默认网格模式)6. 长图排版模式
7. 视频分享图片生成
8. 专栏分享图片生成
涉及文件
lib/pages/dynamics/widgets/author_panel.dartshareSheetItems/showShareSheet可复用方法lib/pages/save_panel/view.dartlib/pages/dynamics_detail/view.dartlib/pages/dynamics/widgets/content_panel.dartlib/pages/dynamics/widgets/dyn_content.dartlib/pages/dynamics/widgets/dynamic_panel.dartlib/pages/video/introduction/ugc/controller.dartlib/pages/article/view.dart实现说明
content_panel.dart用LayoutBuilder + Column实现垂直堆叠,未修改image_grid_builder.dart(其_calcGridInfo返回单一 Size 不支持每图独立高度),更简单且满足需求ArticleShareData容器类封装封面/标题/正文/作者/链接,避免 SavePanel 依赖 ArticleController/musicDetail保留原bilibili://协议(music 无网页版);/Scaffold改用 enterUri 作为 uri测试构建
代码由 GLM 5.2 撰写,本人已测试功能正常运行。