parseSpacing method

void parseSpacing(
  1. String style
)

Implementation

void parseSpacing(String style) {
  try {
    final size = style.split("-")[1];
    if (style.startsWith("px")) {
      applyHPadding(size);
    } else if (style.startsWith("py")) {
      applyVPadding(size);
    } else if (style.startsWith("mx")) {
      applyHMargin(size);
    } else if (style.startsWith("my")) {
      applyVMargin(size);
    } else if (style.startsWith("pl")) {
      pl = spacingMetrics.fromString(size);
    } else if (style.startsWith("pr")) {
      pr = spacingMetrics.fromString(size);
    } else if (style.startsWith("pt")) {
      pt = spacingMetrics.fromString(size);
    } else if (style.startsWith("pb")) {
      pb = spacingMetrics.fromString(size);
    } else if (style.startsWith("ml")) {
      ml = spacingMetrics.fromString(size);
    } else if (style.startsWith("mr")) {
      mr = spacingMetrics.fromString(size);
    } else if (style.startsWith("mt")) {
      mt = spacingMetrics.fromString(size);
    } else if (style.startsWith("mb")) {
      mb = spacingMetrics.fromString(size);
    }
  } on RangeError catch (_) {
    return;
  }
}