get method

double get(
  1. FlexStyleEdge spacingType
)

Implementation

double get(FlexStyleEdge spacingType) {
  var defaultValue = (spacingType == FlexStyleEdge.start.index ||
          spacingType == FlexStyleEdge.end.index
      ? undefined
      : _defaultValue);

  if (_valueFlags == 0) {
    return defaultValue;
  }

  if ((_valueFlags & kFlags[spacingType.index]) != 0) {
    return _spacing[spacingType.index];
  }

  if (_hasAliasesSet) {
    var secondType = spacingType == FlexStyleEdge.top ||
            spacingType == FlexStyleEdge.bottom
        ? FlexStyleEdge.vertical
        : FlexStyleEdge.horizontal;
    if ((_valueFlags & kFlags[secondType.index]) != 0) {
      return _spacing[secondType.index];
    } else if ((_valueFlags & kFlags[FlexStyleEdge.all.index]) != 0) {
      return _spacing[FlexStyleEdge.all.index];
    }
  }

  return defaultValue;
}