fix(TNoticeBar): 修复水平滚动距离误用屏幕宽度并补全文档与测试 - #1032
Open
RSS1102 wants to merge 2 commits into
Open
Conversation
Contributor
Web DemoAPK 下载 |
Open
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.

🤔 这个 PR 的性质是?
🔗 相关 Issue
💡 需求背景和解决方案
TNoticeBar水平跑马灯在_scroll()中计算滚动总距离时误用屏幕宽度MediaQuery.of(context).size.width,而非公告栏自身的可视区宽度,导致文本滚到尽头后要空转一大段才回绕,窄屏/宽屏表现不一致。_contentKey测量(_getEmptyWidth());_getFontSize()文本布局maxWidth同步改为可视区宽度,避免窄容器内文本按屏宽换行。同时移除冗余 getter_effectiveMarquee、_effectiveInterval,统一使用widget.marquee/widget.interval。TNoticeBarStyle/TNoticeBarTheme/TNoticeBarType/onTap/interval:int/height/theme/style,补齐onPressed/items/interval:Duration/TNoticeBarTapTarget/TNoticeBarThemeData/TNoticeBarVariant等);将官方垂直滚动与自定义内容场景移入公开示例入口,并删除无小程序平台依据的「卡片顶部」Demo。设计文档见
specs/005-notice-bar-review/。📝 更新日志
fix(TNoticeBar): 修复水平跑马灯滚动距离计算误用屏幕宽度的问题,改为基于公告栏可视区宽度
本条 PR 不需要纳入 Changelog
☑️ 请求合并前的自查清单
type(<scope>?): 修改描述。示例:
fix(TBottomTabBar): 修复 iconText 模式底部溢出