今天给大家带来一个Flutter图标库fluentui_system_icons
是 Microsoft 的现代图标的集合,大家可以在自己的下个项目中体验,整体还不错,
作者:坚果
公众号:undefined大前端之旅undefined
华为云享专家,InfoQ签约作者,阿里云专家博主,51CTO博客首席体验官,开源项目GVA成员之一,专注于大前端技术的分享,包括Flutter,小程序,安卓,VUE,JavaScript。
接下来我们看一下如何使用
1.安装
flutter pub add fluentui_system_icons
或者
dependencies
fluentui_system_icons ^1.1.154
flutter pub get
.
2.导入
import 'package:fluentui_system_icons/fluentui_system_icons.dart';
3.使用
import 'package:fluentui_system_icons/fluentui_system_icons.dart';
class MyFlutterWidget extends StatelessWidget {
Widget build(BuildContext context) {
return IconButton(
// Use the FluentIcons + name of the icon you want
icon: Icon(FluentIcons.access_time_24_regular),
onPressed: () { print(undefinedButton pressedundefined); }
);
}
}