Tencent / Tencent/tdesign-flutter

refactor: 优化 TabBar 指标器颜色自动调整

Open
#992 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Dart
Stars
1.2k
Forks
182
Avg merge
2d 2h
Merged PRs (30d)
88

Description

背景

THorizontalTabBar 当前沿用 Flutter Material TabBar 的自动指标器颜色调整逻辑:当指标器颜色与 Material 背景色相同时,自动改为白色。该逻辑是兼容性方案,可能导致主题切换时指标器颜色突然变化,也可能与 TDesign 的主题色预期不一致。

期望

  • 评估并移除对自动改为白色的依赖,或提供稳定的长期替代方案;
  • 保证显式 indicatorColor、组件主题和 TDesign token 的优先级不被破坏;
  • 覆盖深色、浅色、透明背景和主题动态切换场景的测试或视觉验证。

相关代码

备注

该问题原先由 TODO 标记,属于需要保留技术背景的兼容性债务,不应无上下文地删除。

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Read tdesign-component/lib/src/components/tabs/t_horizontal_tab_bar.dart and compare its indicator-color behavior with the Flutter discussion in PR 68171. Determine how explicit indicatorColor, component themes, and TDesign tokens should be prioritized, then validate the result across light, dark, transparent, and dynamically changing themes with tests or visual checks.

Written by the indexing model from the issue text.

Assessment

Tech stack
dart, flutter
Domain
frontend
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.