我想制作一個顯示所有可用顫振圖示的螢屏
誰能建議我進行回圈編碼以在 ListView 圖示和圖示名稱中顯示所有顫振默認圖示串列
uj5u.com熱心網友回復:
沒有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/
uj5u.com熱心網友回復:
使用此鏈接https://github.com/Ahmadre/FlutterIconPicker/blob/master/lib/IconPicker/Packs/Material.dart并獲取所有可用的顫振圖示,并使用串列視圖列出。
上面的鏈接包含具有各自名稱的所有圖示變數。
Map<String, IconData> icons_data = {
'ac_unit': Icons.ac_unit,
'ac_unit_sharp': Icons.ac_unit_sharp,
'ac_unit_rounded': Icons.ac_unit_rounded,
'ac_unit_outlined': Icons.ac_unit_outlined,
ect...
}
ListView.builder(
shrinkWrap: true,
itemCount: icons_data.length,
itemBuilder: (context, index) {
var item = icons_data.entries.elementAt(index);
return Row(
childern:[
Text(item.key " - "),
Icon(item.value)
]
);
},
)
轉載請註明出處,本文鏈接:https://www.uj5u.com/qukuanlian/484254.html
