想要在 Flutter 的 ListView 中显示所有图标

伊尔凡·加纳特拉

我想制作一个显示所有可用颤振图标的屏幕

谁能建议我进行循环编码以在 ListView 图标和图标名称中显示所有颤振默认图标列表

巴比伦

没有flutter API来获取所有flutter Icons。开发人员可以一一访问所有这些默认图标。您可以自己制作图标列表。例如:

  static const _iconList = <IconData>[
    Icons.cake,
    Icons.add_location_sharp,
    Icons.zoom_in_outlined,
    Icons.auto_awesome_motion,
    Icons.call_end_sharp,
    Icons.equalizer_rounded,
    Icons.wifi_lock,
    Icons.mail,
    etc................,
  ];

像使用 listView 中的列表一样

 ...
     Container(
      child: ListView(
        children: _iconList .map((icon) => Icon(icon)).toList(),
      ),
    )
    ...

您可以浏览来自 bleow 链接的所有颤振图标。

默认材质图标: https ://api.flutter.dev/flutter/material/Icons-class.html

Flutter 自定义图标生成器: https ://www.fluttericon.com/

FontAwesomeIcons: https ://pub.dev/packages/font_awesome_flutter

其他链接: https ://www.fluttericon.com/

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章