搜索分类、插件与代码仓

插件详情v7.0.7296

material_design_icons_flutter

由社区为 Flutter 设计的 Material Design 图标

AndroidiOSWebmacOSWindowsLinux
近 30 天下载
6.2万
喜欢数
693
Pub 分数
50

安装插件

flutter pub add material_design_icons_flutter

插件介绍

基于插件公开信息、社区数据与项目使用情况整理的选型参考。

一个 Flutter 包,提供由社区打造的 Material Design 图标,适用于 Flutter 应用程序。它提供了一套全面的图标,符合 Google 的 Material Design 指南,确保在各个平台上的一致性和视觉吸引力。这些图标经过性能优化,支持所有主要的 Flutter 平台,包括 Android、iOS、Web、macOS、Windows 和 Linux。开发者可以使用简单的 widget 语法轻松地将图标集成并自定义到他们的 UI 中。

适合场景

  • 将符合 Material Design 规范的图标集成到移动和网页应用中
  • 通过一致且可扩展的矢量图标增强用户界面
  • 使用统一的图标体系构建跨平台应用程序
  • 自定义 Flutter 小部件中的图标颜色和大小
  • 在按钮、导航栏和应用工具栏中使用图标

主要特点

  • 丰富的 Material Design 图标库
  • 支持所有主要的Flutter平台
  • 通过 pub.dev 实现轻松集成
  • 可缩放的矢量图标,具有高分辨率
  • 内置图标主题和自定义选项

适合对象

  • 基于 Material Design 构建应用的 Flutter 开发人员
  • 需要在跨平台环境中保持图标集一致性的团队
  • 需要轻量级、高性能图标解决方案的项目
  • 专注于UI/UX一致性的开发者
  • 面向多个操作系统的应用

使用建议

  • 需要手动更新以添加新图标
  • 仅限社区维护的图标集
  • 可能需要额外配置才能使用自定义图标主题
  • 非谷歌官方维护
  • 依赖外部 GitHub 仓库以获取更新

原始 README

以下为关联源码仓库的 README 原文快照,最新内容请访问源码仓库。

material_design_icons_flutter

The Material Design Icons Icon pack available as set of Flutter Icons.

Based on Material Design Icons 7.4.47. See a web demo build with this package.

👍 Like us on pub.dev!

Installation

In the dependencies: section of your pubspec.yaml, add the following line:

  material_design_icons_flutter: 7.0.7447

WARNING: MDI's version is based on their icons quantity, which does not strictly respect semver guide. They do try their best to keep icons in same name between minor releases but name changing may still appear. To not break your application, using a fix version in your pubspec.yaml is highly recommended.

Usage

import 'package:material_design_icons_flutter/material_design_icons_flutter.dart';

class MyWidget extends StatelessWidget {
  Widget build(BuildContext context) {
    return new IconButton(
      // Use the MdiIcons class for the IconData
      icon: new Icon(MdiIcons.sword),
      onPressed: () { print('Using the sword'); }
     );
  }
}

Or, if you want to access the icon by a string name, you can use fromString method to create one.

import 'package:material_design_icons_flutter/material_design_icons_flutter.dart';

class MyWidget extends StatelessWidget {
  Widget build(BuildContext context) {
    return new IconButton(
      // Use the string name to access icons.
      icon: new Icon(MdiIcons.fromString('sword')),
      onPressed: () { print('Using the sword'); }
     );
  }
}

Note: This is not recomended because to make fromString work we need a map for all icon names. Using this method will not get the benefits of tree-shaking.

On flutter 1.22 and above, using fromString method will also cause a compile error This application cannot tree shake icons fonts, which can be bypass by building with --no-tree-shake-icons.

Name Conversion

Some icons' names are reserved keywords in Dart (and most other languages), so they have been changed.

  • null -> nullIcon
  • switch -> switchIcon
  • sync -> syncIcon
  • factory -> factoryIcon

所属分类

源码仓库

使用此插件的项目