Skip to content

feat(badge): 添加图标支持到徽章组件#3

Open
L-X-J wants to merge 2 commits into
point-source:mainfrom
L-X-J:main
Open

feat(badge): 添加图标支持到徽章组件#3
L-X-J wants to merge 2 commits into
point-source:mainfrom
L-X-J:main

Conversation

@L-X-J

@L-X-J L-X-J commented Jun 25, 2026

Copy link
Copy Markdown

Summary

  • 为徽章(badge)组件添加图标支持

Changes

  • 新增图标渲染能力到 badge 组件

This PR is submitted from a fork.

- 在徽章组件中新增 iconData 属性以支持图标显示
- 根据 iconData 是否为空决定徽章内容的布局
Copilot AI review requested due to automatic review settings June 25, 2026 03:18

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR adds optional icon rendering support to the AurisBadge widget so badges can display a leading icon alongside the existing uppercased label, while preserving the existing color/variant behavior.

Changes:

  • Added an optional iconData parameter/field to AurisBadge.
  • Updated AurisBadge.build to render either text-only or an icon+label Row.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 35 to 39
/// Creates a status badge labelled [label], colored by [variant].
const AurisBadge(
this.label, {
super.key,
this.variant = AurisBadgeVariant.amber,
? text
: Row(
mainAxisSize: MainAxisSize.min,
children: [
Comment on lines +89 to +98
child: iconData == null
? text
: Row(
mainAxisSize: MainAxisSize.min,
children: [
Icon(iconData, size: 11, color: color),
const SizedBox(width: 2),
text,
],
),
@L-X-J

L-X-J commented Jun 25, 2026

Copy link
Copy Markdown
Author

这是效果样例
image

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