Skip to content

Commit 89be087

Browse files
committed
Improve CssLength.toString output when unit is percentage
1 parent 678aefe commit 89be087

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

packages/core/lib/src/data/css.dart

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,10 @@ class CssLength {
269269

270270
@override
271271
String toString() =>
272-
number.toString() + unit.toString().replaceAll('CssLengthUnit.', '');
272+
number.toString() +
273+
(unit == CssLengthUnit.percentage
274+
? '%'
275+
: unit.toString().replaceAll('CssLengthUnit.', ''));
273276
}
274277

275278
/// A set of length measurements.

0 commit comments

Comments
 (0)