parseFontStyle method
Parses a font-style attribute value into a FontStyle.
Implementation
FontStyle? parseFontStyle(String? fontStyle) {
if (fontStyle == null) {
return null;
}
switch (fontStyle) {
case 'normal':
return FontStyle.normal;
case 'italic':
case 'oblique':
return FontStyle.italic;
}
throw UnsupportedError('Attribute value for font-style="$fontStyle"'
' is not supported');
}