Skip to content

pantoken / packages/core/src / flutterIconManifest

函式: flutterIconManifest()

flutterIconManifest(names, assetDir?): string

Beta(測試)

flutter_svg 建立 Flutter/Dart 圖示資源路徑的清單。與複製到 assetDir 下的原始 SVG 搭配使用。

參數

names

readonly string[]

圖示名稱。

assetDir?

string = "assets/pantoken/icons"

SVG 被複製到的資源目錄(預設為 assets/pantoken/icons)。

回傳

string

宣告 PanTokensIcons 類別(包含資源路徑常數)的 Dart 原始碼。

範例

預設資源目錄

ts
import { flutterIconManifest } from "@pantoken/core";

flutterIconManifest(["arrow-left", "check-mark"]);
// → class PanTokensIcons {
//     static const String arrowLeft = 'assets/pantoken/icons/arrow-left.svg';
//     static const String checkMark = 'assets/pantoken/icons/check-mark.svg';
//   }

自訂資源目錄

ts
import { flutterIconManifest } from "@pantoken/core";

flutterIconManifest(["arrow-left"], "lib/icons");
// → static const String arrowLeft = 'lib/icons/arrow-left.svg';