fromDynamic static method
JsonAnimatedPositionedDirectionalBuilder?
fromDynamic(
- dynamic map, {
- JsonWidgetRegistry? registry,
Builds the builder from a Map-like dynamic structure. This expects the JSON format to be of the following structure:
{
"bottom": "<double>",
"curve": "<Curve>",
"duration": "<int; millis>",
"end": "<double>",
"height": "<double>",
"onEnd": "<VoidCallback>",
"start": "<double>",
"top": "<double>",
"width": "<double>"
}
As a note, the Curve and VoidCallback cannot be decoded via JSON. Instead, the only way to bind those values to the builder is to use a function or a variable reference via the JsonWidgetRegistry.
Implementation
static JsonAnimatedPositionedDirectionalBuilder? fromDynamic(
dynamic map, {
JsonWidgetRegistry? registry,
}) {
JsonAnimatedPositionedDirectionalBuilder? result;
if (map != null) {
result = JsonAnimatedPositionedDirectionalBuilder(
bottom: JsonClass.maybeParseDouble(map['bottom']),
curve: map['curve'] ?? Curves.linear,
duration: JsonClass.maybeParseDurationFromMillis(
map['duration'],
)!,
end: JsonClass.maybeParseDouble(map['end']),
height: JsonClass.maybeParseDouble(map['height']),
onEnd: map['onEnd'],
start: JsonClass.maybeParseDouble(map['start']),
top: JsonClass.maybeParseDouble(map['top']),
width: JsonClass.maybeParseDouble(map['width']),
);
}
return result;
}