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>",
"fallbackHeight": "<double>",
"fallbackWidth": "<double>",
"strokeWidth": "<double>"
}
See also:
ThemeDecoder.decodeColor
Implementation
static JsonPlaceholderBuilder? fromDynamic(
dynamic map, {
JsonWidgetRegistry? registry,
}) {
JsonPlaceholderBuilder? result;
if (map != null) {
result = JsonPlaceholderBuilder(
color: ThemeDecoder.decodeColor(
map['color'],
validate: false,
) ??
const Color(0xFF455A64),
fallbackHeight: JsonClass.maybeParseDouble(
map['fallbackHeight'],
400.0,
)!,
fallbackWidth: JsonClass.maybeParseDouble(
map['fallbackWidth'],
400.0,
)!,
strokeWidth: JsonClass.maybeParseDouble(
map['strokeWidth'],
2.0,
)!,
);
}
return result;
}