Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: image组件演示代码拆分 #237

Merged
merged 3 commits into from
Aug 24, 2024

Conversation

plus7c
Copy link

@plus7c plus7c commented Jul 15, 2024

🤔 这个 PR 的性质是?

  • 演示代码改进
  • 重构
  • 代码风格优化

🔗 相关 Issue

#207

💡 需求背景和解决方案

  1. 要解决的具体问题
    Image的“组件类型”和“组件状态”下面,多个演示组件使用同一份演示代码,演示代码太长,可读性不高
  2. 参考Button“组件类型”的示例代码,拆分成每个组件对应一段演示代码,同时新增多个对应的演示代码文本。
  3. 修改好的组件截图如下
Screenshot 2024-07-15 at 14 16 49 Screenshot 2024-07-15 at 14 19 07 Screenshot 2024-07-15 at 14 18 03 Screenshot 2024-07-15 at 14 21 38

📝 更新日志

  • refactor(image): 将Image组件的演示代码进行拆分,使其查阅起来更直观简单。同时对组件的排列方式进行了调整,将同类组件放在一行,提高文档易读性。

  • 本条 PR 不需要纳入 Changelog

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

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

  • 文档已补充或无须补充
  • 代码演示已提供或无须提供
  • Changelog 已提供或无须提供

@tencent-adm
Copy link
Member

tencent-adm commented Jul 15, 2024

CLA assistant check
All committers have signed the CLA.

margin: const EdgeInsets.all(8),
child: CodeWrapper(
builder: _imageClip,
methodName: '_imageClip', // 裁剪
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个参数可以不用写,打包工具会自动生成

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

好的,已将多余的methodName删去。

Padding(
padding: const EdgeInsets.only(bottom: 16),
child: TDText(
'裁剪',
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个描述如果挪到实例方法外面,此处只生成图片范围的示例代码会更好

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Screenshot 2024-08-04 at 10 01 28

感谢指出,能get到你的点,这里的示例代码只展示了图片范围部分,用户查看的时候不会看到无关的代码。而项目代码中关于Padding的描述和图片组件是一个整体,感觉不太好单独拎出来。

@Luozf12345 Luozf12345 merged commit 8eb3648 into Tencent:rhino-bird Aug 24, 2024
1 check passed
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.

3 participants