基本属性
const IconButton({
Key key,
this.iconSize = 24.0,
this.visualDensity,
this.padding = const EdgeInsets.all(8.0),
this.alignment = Alignment.center,
@required this.icon,
this.color,
this.focusColor,
this.hoverColor,
this.highlightColor,
this.splashColor,
this.disabledColor,
@required this.onPressed,
this.focusNode,
this.autofocus = false,
this.tooltip,
this.enableFeedback = true,
this.constraints,
})
这里就不一一介绍了,上面的组件都有讲解。
使用Flutter自带图标
使用iconfont字体图标
在iconfont吧字体图标下载下来,然后将 .ttf 字体文件添加到工作目录文件夹中,然后在 pubspec.yaml 文件中配置信息。
fonts:
- family: wz
fonts:
- asset: lib/iconfont/iconfont.ttf