Repository navigation
Conversation
Member
Contributor
Web DemoAPK 下载 |
TCellGroup 卡片形态的圆角一直画在组容器上,但容器没有绘制背景色, 可见的白色来自内部 TCell;cardPadding 默认左右 16 使单元格内缩, 圆角弧线所在的这圈区域没有任何可填充内容,表现为改了 cardBorderRadius 却看不到圆角,只有把 cardPadding 设为 EdgeInsets.zero 时才可见。 新增可选字段 TCellThemeData.cardBackgroundColor,未配置时回退 bgColorContainer Token;通栏形态不绘制背景,行为不变。
lnuxe
force-pushed
the
fix/cell-card-background-1240
branch
from
November 27, 2026 02:32
f2ac0f0 to
bec8e75
Compare
This branch has not been deployed
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
Fixes #1240
💡 需求背景和解决方案
问题:
TCellGroup(variant: TCellGroupVariant.card)设置cardBorderRadius后看不到圆角,只有同时把cardPadding设为EdgeInsets.zero才生效。真机截图(iPhone 17 Pro 模拟器,iOS 26.1,同一份代码):
根因:圆角一直画在组容器的
BoxDecoration上,但容器没有color;可见的白色来自内部TCell的bgColorContainer。cardPadding默认左右 16 逻辑像素让单元格内缩,圆角弧线所在的这圈区域没有任何可填充内容,所以cardBorderRadius计算正确却没有可见效果。实机截图判读(
cardRadius: 12、默认cardPadding,取卡片左上角首行白色像素的横坐标):改动:
TCellThemeData新增可选cardBackgroundColor,未配置时回退bgColorContainerToken;cardPadding的语义收敛为卡片内边距,不再隐含决定圆角是否可见。验证:
flutter test test/components/cellflutter analyze lib/src/components/cell test/components/cellSpec 与验收记录见
specs/components/084-DataDisplay-Cell/spec.md、acceptance.md。📝 更新日志
fix(TCell): 修复卡片形态下设置 cardBorderRadius 看不到圆角的问题feat(TCell): 新增 TCellThemeData.cardBackgroundColor,用于配置卡片组背景色本条 PR 不需要纳入 Changelog
☑️ 请求合并前的自查清单
type(<scope>?): 修改描述。示例:
fix(TBottomTabBar): 修复 iconText 模式底部溢出