expressionToTextDecorationLine static method
Implementation
static TextDecoration expressionToTextDecorationLine(List<css.LiteralTerm?> value) {
List<TextDecoration> decorationList = [];
for (css.LiteralTerm? term in value) {
if (term != null) {
switch(term.text) {
case "overline":
decorationList.add(TextDecoration.overline);
break;
case "underline":
decorationList.add(TextDecoration.underline);
break;
case "line-through":
decorationList.add(TextDecoration.lineThrough);
break;
default:
decorationList.add(TextDecoration.none);
break;
}
}
}
if (decorationList.contains(TextDecoration.none)) decorationList = [TextDecoration.none];
return TextDecoration.combine(decorationList);
}