generate library

JSON → Dart generator. Not part of the runtime barrel.

For Flutter tests/apps (includes STTheme conversion):

import 'package:flutter_scale_theme_kit/generate.dart';

The CLI uses generate_core.dart so dart run does not need dart:ui.

Classes

STColorIr
STColorsIr
STComponentIr
STComponentsIr
STDartTokens
Names + kinds scanned from hand-written Dart (STTheme / STExtra).
STDesignIr
Parsed JSON design. No Flutter types — safe for dart run.
STExtraIr
STParsedTheme
Parsed design plus a runtime STTheme. Flutter-only (not used by the CLI).
STRadiusIr
STTextTokenIr
STTypographyIr

Enums

STIrKind
Kind of extra token. Dart-only copy of runtime STKind so the CLI has no Flutter.

Constants

stDartReserved → const Set<String>
stResolvedMemberNames → const Set<String>
Getters / methods already on STResolved — generated extras must not collide.

Functions

emitStResolvedExtension(StringBuffer buf, {required String extensionName, List<STExtraIr> extras = const [], List<String> extraColors = const [], List<String> extraComponents = const []}) → void
emitStThemeDart(STDesignIr ir, {String? variableName, String? extensionName, String? partOf}) → String
generateDartFromJson(Map<String, dynamic> json, {String? variableName, String? extensionName, String? partOf}) → String
Turns JSON into a Dart library (or part of) that looks hand-written.
generateExtensionFromDart(String source, {String? extensionName, String? partOf}) → String
Extension-only Dart from a hand-written STTheme file. Does not emit appST.
parseCssColorInt(String raw, String path) → int
parseStColorIr(Object? raw, String path) → STColorIr
parseStComponentIr(Object? raw, String path) → STComponentIr
parseStDartSource(String source) → STDartTokens
Reads extras, extra colors, and untyped extra components from Dart source. Does not parse the full STTheme constructor.
parseStDesignJson(Map<String, dynamic> json) → STDesignIr
Reads a JSON object (from jsonDecode) into a Dart-only design IR.
parseStExtraIr(String name, Object? raw, String path) → STExtraIr
parseStFontStyleName(Object? raw, String path) → String?
parseStFontWeightValue(Object? raw, String path) → int?
parseStIrKind(Object? raw, String path) → STIrKind
parseStTextTokenIr(Object? raw, String path) → STTextTokenIr
parseStThemeJson(Map<String, dynamic> json) → STParsedTheme
stColorGetterName(String name) → String
Extra color getter: brand → brand. Collision with text → textColor.
stDartIdentifier(String name) → String
Lower-camel identifier from a token name (product-card → productCard).
stDefaultExtensionName(String variableName) → String
appST → STAppExtras.
stExtraGetterName(String name, STIrKind kind) → String
Getter name for an extra: ghost + button → ghostButton.
stPascal(String identifier) → String
stStripDartComments(String source) → String
stThemeFromIr(STDesignIr ir) → STTheme