removePx method

double removePx (String cssAttr)

Returns the rounded integer value assuming cssAttr is given in pixels, "10", or "10.5px",

Implementation

static double removePx(String cssAttr) {
  if (cssAttr == null || cssAttr.isEmpty) return 28.0;
  return double.parse(cssAttr.replaceFirst("px", ""));
}