Skip to content

pantoken / packages/core/src / flutterIconManifest

関数: flutterIconManifest()

flutterIconManifest(names, assetDir?): string

ベータ

アイコンアセットパスの Flutter/Dart マニフェストを作成します(flutter_svg 用)。生の SVG と組み合わせて使用します assetDir にコピーされています。

パラメーター

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';