fix: handle null passed to SvgLength (#1903)

SvgLength from method should be able to parse null since it is a correct value, we then use the empty constructor since it provides default values.
This commit is contained in:
Wojciech Lewicki
2022-10-28 14:59:49 +02:00
committed by GitHub
parent 6a5242f00b
commit 8cf4068880
@@ -104,11 +104,11 @@ class SVGLength {
}
static SVGLength from(String string) {
return new SVGLength(string);
return string != null ? new SVGLength(string) : new SVGLength();
}
static SVGLength from(Double value) {
return new SVGLength(value);
return value != null ? new SVGLength(value) : new SVGLength();
}
static String toString(Dynamic dynamic) {