getFontWeight static method Null safety
- FontWeight? fontWeight
Converts FontWeight to string format
Implementation
static String getFontWeight(FontWeight? fontWeight) {
if (fontWeight == null) fontWeight = FontWeight.NORMAL;
switch (fontWeight) {
case FontWeight.BOLD:
return "bold";
case FontWeight.ITALIC:
return "italic";
case FontWeight.BOLD_ITALIC:
return "bold_italic";
case FontWeight.NORMAL:
default:
return "normal";
}
}