搜尋套件、儲存庫與 APP 分類

套件詳情v7.0.7296

material_design_icons_flutter

由社群為 Flutter 設計的 Material Design 圖標

AndroidiOSWebmacOSWindowsLinux
近 30 天下載
6.5萬
喜歡數
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

所屬分類

原始碼儲存庫

使用此套件的專案