Skip to content

Commit 342855a

Browse files
committed
refactor(icon): add the size attribute
1 parent f27fee7 commit 342855a

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

lib/weui_icon.dart

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,12 @@ enum WeuiIconType {
1515
}
1616

1717
class WeuiIcon extends StatelessWidget {
18-
WeuiIcon({Key key, this.type, this.msg, this.color = const Color(0xFF09BB07)}) : super(key: key);
18+
WeuiIcon({Key key, this.type, this.msg, this.color = const Color(0xFF09BB07), this.size}) : super(key: key);
1919

2020
final WeuiIconType type;
2121
final bool msg;
2222
final Color color;
23+
final double size;
2324
final Map<WeuiIconType, String> iconMap = const {
2425
WeuiIconType.success: "\u{EA06}",
2526
WeuiIconType.warn: "\u{EA0B}",
@@ -38,7 +39,7 @@ class WeuiIcon extends StatelessWidget {
3839
return Text(
3940
iconMap[type],
4041
style: TextStyle(
41-
fontSize: msg ? 93 : 23,
42+
fontSize: size ?? (msg ? 93 : 23),
4243
package: "flutter_weui",
4344
fontFamily: "WeuiIcon",
4445
color: color,

0 commit comments

Comments
 (0)