valueAsString property
String
get
valueAsString
Returns css.Identifier
's name or unquoted String value.
Implementation
String get valueAsString {
final v = value;
if (v is css.Identifier) {
return v.name;
}
if (v is String) {
final first = v.codeUnitAt(0);
final last = v.codeUnitAt(v.length - 1);
if (first == last) {
final escaped = v.substring(1, v.length - 1);
switch (first) {
case 34: // double quote
return escaped.replaceAll(r'\"', '"');
case 39: // single quote
return escaped.replaceAll(r"\'", "'");
}
}
}
return '';
}