Material Symbols

fonts.google.com 图片来源: material.io

pub package donate

这个 Flutter 包旨在添加 Google 引入的 Material Symbols 中的所有图标,以及 Material 3。

在此处阅读 Google 的官方公告:https://material.io/blog/introducing-symbols

安装

要使用此包,请将 flutter_material_symbols 添加为 pubspec.yaml 文件中的依赖项

使用命令行

flutter pub add flutter_material_symbols

或者,如果您更喜欢直接添加到 pubspec.yaml 文件

dependencies:
  flutter_material_symbols: ^0.0.1

用法

导入包

import 'package:flutter_material_symbols/flutter_material_symbols.dart';

使用 MaterialSymbols 类访问图标

Icon(MaterialSymbols.favorite),

IconButton(
  icon: Icon(MaterialSymbols.add),
  onPressed: () {},
)

此包还支持 filled、outlined 和 sharp 图标,可以通过在图标名称后添加 filledoutlinedsharp 后缀来使用它们

Icon Styles 图片来源: material.io

Icon(MaterialSymbols.favorite_filled),
Icon(MaterialSymbols.favorite_outlined),
Icon(MaterialSymbols.favorite_sharp),

贡献者

报告问题 / Bug

如果您发现任何 bug 或图标错位,请在此处提交 issue:https://github.com/rehmatsg/flutter_material_symbols/issues

许可证

此包根据 MIT License 获得许可

GitHub

查看 Github