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
itemis 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
objas theitemofbuilder, 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
objis absent. -
decodeBorderRadius(
DartObject? obj) → HWBorderRadius? -
Decodes an HWBorderRadius, or null when
objis 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
objis absent. -
decodeDataType(
DartObject? obj, {String? defaultLocale, String? resourcePrefix}) → HWDataType? -
decodeDateFormat(
DartObject? obj) → HWDateFormat? -
Decodes an HWDateFormat, or null when
objis absent. -
decodeEdgeInsets(
DartObject? obj) → HWEdgeInsets? -
decodeEnum<
T> (DartObject? obj, List< T> values) → T? -
The constant
objnames, matched againstvaluesby name. -
decodeIconCodePoint(
DartObject? obj) → int? -
The codepoint of a Flutter
IconDataconstant, or null whenobjis 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
IconDataconstant draws its glyph out of, or null whenobjis not one. -
decodeIconFontDeclaration(
DartObject? obj) → HWIconFont? -
The HWIconFont an
HWIconFont(...)written in a schema holds, or null whenobjis not one. -
decodeIconMatchTextDirection(
DartObject? obj) → bool -
Whether a Flutter
IconDataconstant mirrors in a right-to-left layout, as itsmatchTextDirectiondeclares. -
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
defaultTranslationslocale map, or null whenobjis not a localized string. -
decodeNumberFormat(
DartObject? obj, {String? defaultLocale, String? resourcePrefix}) → HWNumberFormat? -
Decodes an HWNumberFormat, or null when
objis absent. -
decodeStringMap(
DartObject? obj) → Map< String, String> ? -
Decodes a
Map<String, String>constant, or null whenobjis absent or not a map. -
decodeTextAlign(
DartObject? obj) → HWTextAlign? -
decodeTextStyle(
DartObject? obj) → HWTextStyle? -
Decodes an HWTextStyle, or null when
objis absent. -
decodeTimeZone(
DartObject? obj, {String? defaultLocale, String? resourcePrefix}) → HWTimeZone? -
Decodes an HWTimeZone, or null when
objis absent. -
getField(
DartObject obj, String name) → DartObject?