home_widget_generator_cli library

Libraries exported exclusively for use by the home_widget_cli package.

These exports are considered internal implementation details of the home_widget_generator and are not subject to semantic versioning guarantees for general public use.

Classes

WidgetTreeParser
Parses a @HomeWidget annotation into an HWWidget.
WidgetValueDecoder
Decodes a DartObject representing a widget tree into an HWWidget.

Enums

GlanceSizeAxis
An axis a Glance modifier chain can size.

Constants

dartReservedWords → const Set<String>
Dart's reserved words, which no generated identifier may take.

Functions

applySwiftModifier(String childCode, String modifier, int indent) → String
Appends a SwiftUI view modifier (e.g. .frame(...), .background(...)) to childCode.
escapeDartStringLiteral(String s) → String
Escapes s for embedding in a Dart single-quoted string literal.
escapeKotlinStringLiteral(String s) → String
Escapes s for embedding in a Kotlin double-quoted string literal.
escapeSwiftStringLiteral(String s) → String
Escapes s for embedding in a Swift double-quoted string literal.
fnv1a32(String input) → int
32-bit FNV-1a hash.
hwCodePointLiteral(int codePoint) → String
codePoint as the hexadecimal literal a glyph is usually written as, which both platforms read the same way.
hwSizeLiteral(double size) → String
size as a literal both platforms read as a number, without the trailing .0 a whole Dart double stringifies with.
hwValidateCodePoint(int codePoint, String source) → void
Throws a GeneratorError when codePoint is no glyph a widget can be generated for, naming source as what holds it.
injectGlanceModifier(String code, String modifier, {GlanceSizeAxis? weightAxis}) → String
Helper to parse a typical Compose call (e.g. Column { or Text(...)) and inject a modifier string (e.g. fillMaxSize()).
wrapGlanceRootContent(String code, {required String modifier, String contentAlignment = 'Alignment.Center'}) → String
Wraps the widget tree in a full-size Box with contentAlignment.

Exceptions / Errors

GeneratorError
Error thrown when widget generation fails.