@@ -45,15 +45,19 @@ Style declarationsToStyle(Map<String?, List<css.Expression>> declarations) {
45
45
case 'text-decoration' :
46
46
List <css.LiteralTerm ?>? textDecorationList = value.whereType< css.LiteralTerm > ().toList ();
47
47
/// List<css.LiteralTerm> might include other values than the ones we want for [textDecorationList] , so make sure to remove those before passing it to [ExpressionMapping]
48
- textDecorationList.removeWhere ((element) => element != null && element.text != "none" && element.text != "overline" && element.text != "underline" && element.text != "line-through" );
49
- css.Expression textDecorationColor = value.firstWhere ((css.Expression ? element) => element is css.HexColorTerm || element is css.FunctionTerm ,
50
- orElse: () => css.HexColorTerm (null , style.textDecorationColor! .value.toRadixString (16 ), null ));
48
+ textDecorationList.removeWhere ((element) => element != null && element.text != "none"
49
+ && element.text != "overline" && element.text != "underline" && element.text != "line-through" );
50
+ List <css.Expression ?>? nullableList = value;
51
+ css.Expression ? textDecorationColor = nullableList.firstWhere (
52
+ (css.Expression ? element) => element is css.HexColorTerm || element is css.FunctionTerm , orElse: () => null );
51
53
List <css.LiteralTerm ?>? potentialStyles = value.whereType< css.LiteralTerm > ().toList ();
52
54
/// List<css.LiteralTerm> might include other values than the ones we want for [textDecorationStyle] , so make sure to remove those before passing it to [ExpressionMapping]
53
- potentialStyles.removeWhere ((element) => element != null && element.text != "solid" && element.text != "double" && element.text != "dashed" && element.text != "dotted" && element.text != "wavy" );
55
+ potentialStyles.removeWhere ((element) => element != null && element.text != "solid"
56
+ && element.text != "double" && element.text != "dashed" && element.text != "dotted" && element.text != "wavy" );
54
57
css.LiteralTerm ? textDecorationStyle = potentialStyles.isNotEmpty ? potentialStyles.last : null ;
55
58
style.textDecoration = ExpressionMapping .expressionToTextDecorationLine (textDecorationList);
56
- style.textDecorationColor = ExpressionMapping .expressionToColor (textDecorationColor) ?? style.textDecorationColor;
59
+ if (textDecorationColor != null ) style.textDecorationColor = ExpressionMapping .expressionToColor (textDecorationColor)
60
+ ?? style.textDecorationColor;
57
61
if (textDecorationStyle != null ) style.textDecorationStyle = ExpressionMapping .expressionToTextDecorationStyle (textDecorationStyle);
58
62
break ;
59
63
case 'text-decoration-color' :
0 commit comments