fromDynamic static method
Builds the builder from a Map-like dynamic structure. This expects the JSON format to be of the following structure:
{
"conditional": {
"conditions": "<List<Conditional>>",
"mode": "<EvaluationMode>",
"values": "<Map<String, dynamic>>"
},
"onFalse": "<JsonWidgetData>"
}
The conditional
value is required but the onFalse
is not. If the
onFalse
is null
then the build will return an empty SizedBox when
the conditional
evaluates to false
.
See also:
Conditional.fromDynamic
EvaluationMode.fromCode
- JsonWidgetData.fromDynamic
Implementation
static JsonConditionalBuilder? fromDynamic(
dynamic map, {
JsonWidgetRegistry? registry,
}) {
JsonConditionalBuilder? result;
if (map != null) {
final conditional = Conditional.fromDynamic(map['conditional']);
final keys = <String>{};
_appendKeys(conditional, keys);
result = JsonConditionalBuilder(
conditional: conditional,
keys: keys,
onFalse: JsonWidgetData.fromDynamic(
map['onFalse'],
registry: registry,
),
);
}
return result;
}