setShorthandGap static method

void setShorthandGap(
  1. Map<String, String?> properties,
  2. String shorthandValue
)

Implementation

static void setShorthandGap(Map<String, String?> properties, String shorthandValue) {
  List<String> values = _splitBySpace(shorthandValue);
  if (values.length == 1) {
    // gap: 20px -> row-gap: 20px, column-gap: 20px
    properties[ROW_GAP] = values[0];
    properties[COLUMN_GAP] = values[0];
  } else if (values.length == 2) {
    // gap: 20px 10px -> row-gap: 20px, column-gap: 10px
    properties[ROW_GAP] = values[0];
    properties[COLUMN_GAP] = values[1];
  }
}