fromDynamic static method
Builds the builder from a Map-like dynamic structure. This expects the JSON format to be of the following structure:
{
"bottom": <bool>,
"left": <bool>,
"maintainBottomViewPadding": <bool>,
"minimum": <EdgeInsetsGeometry>,
"right": <bool>,
"top": <bool>
}
See also:
ThemeDecoder.decodeEdgeInsetsGeometry
Implementation
static JsonSafeAreaBuilder? fromDynamic(
dynamic map, {
JsonWidgetRegistry? registry,
}) {
JsonSafeAreaBuilder? result;
if (map != null) {
result = JsonSafeAreaBuilder(
bottom: map['bottom'] == null
? true
: JsonClass.parseBool(
map['bottom'],
),
left: map['left'] == null ? true : JsonClass.parseBool(map['left']),
maintainBottomViewPadding: JsonClass.parseBool(
map['maintainBottomViewPadding'],
),
minimum: ThemeDecoder.decodeEdgeInsetsGeometry(
map['minimum'],
validate: false,
) as EdgeInsets? ??
EdgeInsets.zero,
right: map['right'] == null ? true : JsonClass.parseBool(map['right']),
top: map['top'] == null ? true : JsonClass.parseBool(map['top']),
);
}
return result;
}