decodeFontStyle static method
Decodes the value
to a FontStyle. Supported values are:
italic
normal
Implementation
static FontStyle? decodeFontStyle(
dynamic value, {
bool validate = true,
}) {
FontStyle? result;
if (value is FontStyle) {
result = value;
} else {
_checkSupported(
'FontStyle',
[
'italic',
'normal',
],
value,
);
if (value != null) {
assert(SchemaValidator.validate(
schemaId: '$_baseSchemaUrl/font_style',
value: value,
validate: validate,
));
switch (value) {
case 'italic':
result = FontStyle.italic;
break;
case 'normal':
result = FontStyle.normal;
break;
}
}
}
return result;
}