Tencent / Tencent/tdesign-flutter
fix: 完善 Flutter Web 版本判断逻辑
Open
Nobody has claimed this yet.
- Dominant language
- Dart
- Stars
- 1.2k
- Forks
- 182
- Avg merge
- 2d 2h
- Merged PRs (30d)
- 88
Description
背景
tdesign-component/lib/src/util/version_util.dart 的 VersionUtil.isAfterThen 在 Web 环境直接返回 kIsFlutterWebAfter320。该变量默认为 false,当前没有发现实际赋值逻辑,因此 Web 环境无法根据真实 Dart/Flutter 版本完成判断。
期望
- 为 Flutter Web 实现可靠的版本判断逻辑;
- 覆盖 Web 与非 Web 环境的版本比较测试;
- 明确不支持或无法解析版本时的兜底行为。
相关代码
tdesign-component/lib/src/util/version_util.dart
备注
该问题原先由 TODO 标记,属于功能缺口,不应仅删除注释。
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with tdesign-component/lib/src/util/version_util.dart and trace VersionUtil.isAfterThen, kIsFlutterWebAfter320, and the existing TODO. Add coverage for version comparisons on Web and non-Web platforms, including unsupported or unparseable versions, and confirm the fallback behavior is explicit and reliable.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- dart, flutter
- Domain
- frontend, web-dev
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 58/100