WidgetValueDecoder class

Decodes a DartObject representing a widget tree into an HWWidget.

This uses the analyzer's constant evaluation to read the values of @HomeWidget annotations and their fields.

Constructors

WidgetValueDecoder(DartObject? object, {String? defaultLocale, String? resourcePrefix, String? fontResourcePrefix, String? itemScope})

Properties

defaultLocale → String?
The widget's default locale, from HomeWidgetLocalization.defaultLocale.
final
fontResourcePrefix → String?
Namespace for the icon font resources generated for this widget, as hw_font_<snake_widget_class> — what hwFontResourcePrefix builds.
final
hashCode → int
The hash code for this object.
no setterinherited
itemScope → String?
The list builder whose item is being decoded, spelled the way an error names it (HWRow.builder('days')), or null outside the item of every builder.
final
object → DartObject?
final
resourcePrefix → String?
Namespace for the platform string resources holding constant translations, as home_widget_<snake_widget_class>.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

decode() → HWWidget
decodeItem(DartObject? obj, String builder) → HWWidget
Decodes obj as the item of builder, spelled like itemScope.
decodeRecursive(DartObject? obj) → HWWidget
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited

Static Methods

decodeAndroidFont(DartObject? obj) → HWAndroidFont?
Decodes an HWAndroidFont, or null when obj is absent.
decodeBorderRadius(DartObject? obj) → HWBorderRadius?
Decodes an HWBorderRadius, or null when obj is absent.
decodeBoxBorder(DartObject? obj) → HWBoxBorder?
decodeBoxDecoration(DartObject? obj) → HWBoxDecoration?
decodeColor(DartObject? obj) → HWColor?
decodeCurrency(DartObject? obj, {String? defaultLocale, String? resourcePrefix}) → HWCurrency?
Decodes an HWCurrency, or null when obj is absent.
decodeDataType(DartObject? obj, {String? defaultLocale, String? resourcePrefix}) → HWDataType?
decodeDateFormat(DartObject? obj) → HWDateFormat?
Decodes an HWDateFormat, or null when obj is absent.
decodeEdgeInsets(DartObject? obj) → HWEdgeInsets?
decodeEnum<T>(DartObject? obj, List<T> values) → T?
The constant obj names, matched against values by name.
decodeIconCodePoint(DartObject? obj) → int?
The codepoint of a Flutter IconData constant, or null when obj is not one.
decodeIconData(DartObject obj) → HWIconData
Decodes an HWIconData, reading every icon's name, codepoint and font.
decodeIconFont(DartObject? obj) → HWIconFont?
The font a Flutter IconData constant draws its glyph out of, or null when obj is not one.
decodeIconFontDeclaration(DartObject? obj) → HWIconFont?
The HWIconFont an HWIconFont(...) written in a schema holds, or null when obj is not one.
decodeIconMatchTextDirection(DartObject? obj) → bool
Whether a Flutter IconData constant mirrors in a right-to-left layout, as its matchTextDirection declares.
decodeIconName(DartObject obj, int codePoint) → String
The name the generated enum gives the icon obj, derived from the way the schema names it.
decodeLocalizedValues(DartObject obj) → Map<String, String>?
Reads a defaultTranslations locale map, or null when obj is not a localized string.
decodeNumberFormat(DartObject? obj, {String? defaultLocale, String? resourcePrefix}) → HWNumberFormat?
Decodes an HWNumberFormat, or null when obj is absent.
decodeStringMap(DartObject? obj) → Map<String, String>?
Decodes a Map<String, String> constant, or null when obj is absent or not a map.
decodeTextAlign(DartObject? obj) → HWTextAlign?
decodeTextStyle(DartObject? obj) → HWTextStyle?
Decodes an HWTextStyle, or null when obj is absent.
decodeTimeZone(DartObject? obj, {String? defaultLocale, String? resourcePrefix}) → HWTimeZone?
Decodes an HWTimeZone, or null when obj is absent.
getField(DartObject obj, String name) → DartObject?