decodeShadow static method
Decodes the given value
to a Shadow. This expects the value
to have
the following structure:
{
"blurRadius": <double>,
"color": <Color>,
"offset": <Offset>
}
See also:
Implementation
static Shadow? decodeShadow(
dynamic value, {
bool validate = true,
}) {
Shadow? result;
if (value is Shadow) {
result = value;
} else if (value != null) {
assert(SchemaValidator.validate(
schemaId: '$_baseSchemaUrl/shadow',
value: value,
validate: validate,
));
result = Shadow(
blurRadius: JsonClass.parseDouble(value['blurRadius'], 0.0)!,
color: decodeColor(
value['color'],
validate: false,
)!,
offset: decodeOffset(
value['offset'],
validate: false,
)!,
);
}
return result;
}