Skip to content

pantoken / packages/core/src / flutterIconManifest

Funksjon: flutterIconManifest()

flutterIconManifest(names, assetDir?): string

Beta

Lag ein Flutter/Dart-manifest som listar stiar til ikonressursar (for flutter_svg). Kombiner med dei rå SVG-ane kopierte under assetDir.

Parametrar

names

readonly string[]

Ikonnamn.

assetDir?

string = "assets/pantoken/icons"

Mappa for ressursane der SVG-ane vert kopierte til (standard assets/pantoken/icons).

Returnerer

string

Dart-kilde som deklarerer ei PanTokensIcons-klasse med konstante asset-stiar.

Døme

Standard ressursmappe

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

Ein tilpassa ressursmappe

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

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