fromDynamic static method
Builds the builder from a Map-like dynamic structure. This expects the JSON format to be of the following structure:
{
"color": <Color>,
"icon": <IconData>,
"semanticLabel": <String>,
"shadows": <List<Shadow>>,
"size": <double>,
"textDirection": <TextDirection>
}
See also:
ThemeDecoder.decodeColor
ThemeDecoder.decodeIconData
ThemeDecoder.decodeShadow
ThemeDecoder.decodeTextDirection
Implementation
static JsonIconBuilder? fromDynamic(
dynamic map, {
JsonWidgetRegistry? registry,
}) {
JsonIconBuilder? result;
if (map != null) {
result = JsonIconBuilder(
color: ThemeDecoder.decodeColor(
map['color'],
validate: false,
),
icon: ThemeDecoder.decodeIconData(
map['icon'],
validate: false,
),
semanticLabel: map['semanticLabel'],
shadows: JsonClass.fromDynamicList(
map['shadows'],
(map) => ThemeDecoder.decodeShadow(
map,
validate: false,
)!,
),
size: JsonClass.parseDouble(map['size']),
textDirection: ThemeDecoder.decodeTextDirection(
map['textDirection'],
validate: false,
),
);
}
return result;
}