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

کد منبع Dart که یک کلاس PanTokensIcons شامل ثابت‌های مسیر دارایی را تعریف می‌کند.

نمونه‌ها

دایرکتوری دارایی پیش‌فرض

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