Skip to content

refactor(picker): 将 picker 组件只保留选择功能#921

Draft
RSS1102 wants to merge 14 commits intodevelopfrom
rss1102/refactor/picker-unified
Draft

refactor(picker): 将 picker 组件只保留选择功能#921
RSS1102 wants to merge 14 commits intodevelopfrom
rss1102/refactor/picker-unified

Conversation

@RSS1102
Copy link
Copy Markdown
Collaborator

@RSS1102 RSS1102 commented Apr 26, 2026

API 设计:

  • items: 数据源 (List 或 Map)
  • initialValue: 初始选中值
  • onChange: 选中回调 (TPickerValue)
  • onLoad: 按需加载回调 (TPickerLoadEvent)
  • height/itemCount/preloadThreshold: 尺寸与加载控制

🤔 这个 PR 的性质是?

勾选规则:
1.只要有新增参数,就勾选”新特性提交“
2.只修改内部bug,未新增参数,才勾选”日常 bug 修复“
3.其他选项视具体改动判断

  • 日常 bug 修复
  • 新特性提交
  • 文档改进
  • 演示代码改进
  • 组件样式/交互改进
  • CI/CD 改进
  • 重构
  • 代码风格优化
  • 测试用例
  • 分支合并
  • 其他

🔗 相关 Issue

💡 需求背景和解决方案

📝 更新日志

  • refactor(picker): 将 picker 组件只保留选择功能

  • 本条 PR 不需要纳入 Changelog

☑️ 请求合并前的自查清单

⚠️ 请自检并全部勾选全部选项⚠️

  • pr目标分支为develop分支,请勿直接往main分支合并
  • 标题格式为:组件类名: 修改描述(示例:TBottomTabBar: 修复iconText模式,底部溢出2.5像素)
  • ”相关issue“处带上修复的issue链接
  • 相关文档已补充或无须补充

…TPicker

核心变更:
- 新增 TPickerOption(label, value, disabled) 数据类,label/value 分离
- 新增 TPickerValue + TPickerLoadEvent 回调类型
- 重写 TPicker: 支持 List<List<TPickerOption>> 多列独立 + Map 联动模式
- 删除 t_date_picker.dart / t_multi_picker.dart (合并入 t_picker.dart)
- 删除 t_date_picker_page.dart (由 TPickerPage 替代)
- onChange 命名统一 (原 onChanged)
- 移除 onSelectedItemChanged 回调
- 移除 Header/弹窗逻辑 (解耦展示层)
- 保留 TItemWidget / no_wave_behavior 内部组件

API 设计:
- items: 数据源 (List 或 Map)
- initialValue: 初始选中值
- onChange: 选中回调 (TPickerValue)
- onLoad: 按需加载回调 (TPickerLoadEvent)
- height/itemCount/preloadThreshold: 尺寸与加载控制

文件结构:
picker/
  t_picker.dart           # 主组件 (307行)
  t_picker_option.dart    # 选项数据类
  t_picker_value.dart     # 回调类型
  t_item_widget.dart      # 项渲染组件 (复用)
  API_REFERENCE.md        # API 文档
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 26, 2026

完成

📱 APK 下载

tdesign-flutter-0.2.7-481.apk

@tencent-adm
Copy link
Copy Markdown
Member

CLA assistant check
Thank you for your submission, we really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
1 out of 2 committers have signed the CLA.

✅ RSS1102
❌ autofix-ci[bot]
You have signed the CLA already but the status is still pending? Let us recheck it.

@RSS1102 RSS1102 marked this pull request as ready for review May 7, 2026 09:00
@RSS1102 RSS1102 marked this pull request as draft May 8, 2026 10:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants