fromDynamic static method
Builds the builder from a Map-like dynamic structure. This expects the JSON format to be of the following structure:
{
"alwaysIncludeSemantics": <bool>,
"curve": <Curve>,
"duration": <int; millis>,
"onEnd": <VoidCallback>,
"opacity": <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 JsonAnimatedOpacityBuilder? fromDynamic(
dynamic map, {
JsonWidgetRegistry? registry,
}) {
JsonAnimatedOpacityBuilder? result;
if (map != null) {
result = JsonAnimatedOpacityBuilder(
alwaysIncludeSemantics: JsonClass.parseBool(
map['alwaysIncludeSemantics'],
),
curve: map['curve'] ?? Curves.linear,
duration: JsonClass.parseDurationFromMillis(
map['duration'],
)!,
onEnd: map['onEnd'],
opacity: JsonClass.parseDouble(map['opacity'])!,
);
}
return result;
}