基本属性

  1. const IconButton({
  2. Key key,
  3. this.iconSize = 24.0,
  4. this.visualDensity,
  5. this.padding = const EdgeInsets.all(8.0),
  6. this.alignment = Alignment.center,
  7. @required this.icon,
  8. this.color,
  9. this.focusColor,
  10. this.hoverColor,
  11. this.highlightColor,
  12. this.splashColor,
  13. this.disabledColor,
  14. @required this.onPressed,
  15. this.focusNode,
  16. this.autofocus = false,
  17. this.tooltip,
  18. this.enableFeedback = true,
  19. this.constraints,
  20. })

这里就不一一介绍了,上面的组件都有讲解。

使用Flutter自带图标

image.png

使用iconfont字体图标

在iconfont吧字体图标下载下来,然后将 .ttf 字体文件添加到工作目录文件夹中,然后在 pubspec.yaml 文件中配置信息。

  1. fonts:
  2. - family: wz
  3. fonts:
  4. - asset: lib/iconfont/iconfont.ttf

使用
image.png
**

flutter 自带图标都有

1194837-2a83a70540ea0cf7.webp1194837-3a4de1ffc8f187de.webp1194837-7b8272a502d10dc8.webp1194837-8a96babba7dc36f9.png1194837-8b811fc15f15c11a.webp1194837-9f46c5b6c6711ed9.webp1194837-18d3d18492208d13.webp1194837-24ac60b94c513b6d.webp1194837-532cc877e7d6fb45.webp1194837-577e2f884d9c7416.webp1194837-63151e47338bc56e.webp1194837-2179905dd22052ea.webp1194837-4223337a494cc3d8.webp1194837-ab39e03e6ed9a492.webp1194837-c4d98cb188ba2f71.webp