fromDynamic static method
Builds the builder from a Map-like dynamic structure. This expects the JSON format to be of the following structure:
{
"alignment": "<AlignmentGeometry>",
"heightFactor": "<double>",
"widthFactor": "<double>"
}
See also:
ThemeDecoder.decodeAlignment
Implementation
static JsonFractionallySizedBoxBuilder? fromDynamic(
dynamic map, {
JsonWidgetRegistry? registry,
}) {
JsonFractionallySizedBoxBuilder? result;
if (map != null) {
result = JsonFractionallySizedBoxBuilder(
alignment: ThemeDecoder.decodeAlignment(
map['alignment'],
validate: false,
) ??
Alignment.center,
heightFactor: JsonClass.maybeParseDouble(
map['heightFactor'],
),
widthFactor: JsonClass.maybeParseDouble(
map['widthFactor'],
),
);
}
return result;
}