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

icofont_flutter 封面
套件詳情v1.5.0

icofont_flutter

IcoFont 圖標套件現已作為 Flutter 圖標套件提供。我們致力於透過數千個免費圖標與智慧技術,提升您的設計體驗,讓使用更順暢。

AndroidiOSWebmacOSWindowsLinux
近 30 天下載
368
喜歡數
34
Pub 分數
160

安裝套件

flutter pub add icofont_flutter

套件介紹

根據套件公開資料產生的選型評估,僅供參考。

IcoFont Flutter 是一個將數千個免費高品質圖示帶入 Flutter 應用程式的套件。專為無縫整合而設計,它利用智慧技術確保跨平台的順暢呈現。該套件支援 Android、iOS、Web、macOS、Windows 和 Linux,具有高度的多功能性。圖示可透過簡單的 API 輕鬆存取,提升 UI 設計效率。非常適合尋求豐富圖示庫卻不增加額外負擔的開發者。

適用情境

  • 透過可縮放圖示增強應用程式介面
  • 在使用者介面中加入視覺提示
  • 在各個平台建立一致的圖示美學
  • 設計儀表板和導航菜單
  • 建構響應式網頁與行動應用程式

主要特色

  • 數以萬計的免費圖示
  • 跨平台支援
  • 與 Flutter 的輕鬆整合
  • 針對效能進行優化
  • 可縮放向量圖示

適合對象

  • 使用 Flutter 的 UI/UX 設計師
  • 行動與Web應用開發者
  • 需要大量圖示庫的專案
  • 專注於設計一致性的團隊
  • 希望快速實現圖標功能的開發者

使用建議

  • 初始設定需要互聯網連接(如果未快取)
  • 超出標準樣式的自定義選項有限
  • 依賴外部來源進行圖示更新
  • 對於圖標較少的極簡專案來說並不理想
  • 大型專案中未使用的圖標可能導致潛在的膨脹

原始 README

以下為關聯原始碼儲存庫的 README 原文快照,最新內容請造訪原始碼儲存庫。

icofont_flutter

pub package CI license: MIT

The IcoFont icon pack as a Flutter icon pack — 2,105 icons exposed as IconData constants, usable anywhere Flutter takes an icon.

No dependencies beyond Flutter itself. The font ships with the package, so there is nothing to declare in your own pubspec.yaml beyond the package.

Installation

flutter pub add icofont_flutter

Or add it to the dependencies: section of your pubspec.yaml:

dependencies:
  icofont_flutter: ^1.5.0

Usage

Every icon is a static const IconData on IcoFontIcons, so it works with any widget that accepts an IconData:

import 'package:flutter/material.dart';
import 'package:icofont_flutter/icofont_flutter.dart';

class MyWidget extends StatelessWidget {
  const MyWidget({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return IconButton(
      icon: const Icon(IcoFontIcons.brandIcofont),
      onPressed: () => debugPrint('Pressed'),
    );
  }
}

Size and color come from the usual Icon properties:

const Icon(IcoFontIcons.rocket, size: 48, color: Colors.indigo)
Finding an icon

Browse the pack at icofont.com/icons. An icon's name there maps to a constant by camel casing it:

IcoFont name Constant
angry-monster IcoFontIcons.angryMonster
brand-icofont IcoFontIcons.brandIcofont
ui-calculator IcoFontIcons.uiCalculator
500px IcoFontIcons.fiveHundredpx

Names that would start with a digit are spelled out, since Dart identifiers cannot. lib/icofont_flutter.dart lists every constant with its IcoFont name in a comment above it.

The 324 duotone icons are not currently available — they are drawn as pairs of stacked glyphs, which the single-IconData API here cannot express.

Requirements

Dart >=2.12.0 <4.0.0, Flutter >=1.17.0. Works on Dart 2 and Dart 3.

Example

See example/ for a small app that renders icons from the pack:

cd example
flutter run

Updating the icons

lib/icofont_flutter.dart is generated from lib/fonts/icofont.ttf — do not edit it by hand. After replacing the font, regenerate:

dart run tool/generate_icons.dart

The generator reads glyph names from the font's post table and code points from its cmap table. It refuses to guess a name it cannot derive, so if it reports a problem, add the icon to nameOverrides in the script rather than editing the output. CI runs dart run tool/generate_icons.dart --check to verify the committed file still matches the font.

Credits

Icons by the IcoFont team, who made this wonderful pack free for everyone. This package only wraps their work for Flutter.

License

MIT — see LICENSE.

所屬分類

原始碼儲存庫

使用此套件的專案