set method

bool set(
  1. int spacingType,
  2. double value
)

Implementation

bool set(int spacingType, double value) {
  if (!floatsEqual(_spacing[spacingType], value)) {
    _spacing[spacingType] = value;

    if (isDoubleNan(value)) {
      _valueFlags &= ~kFlags[spacingType];
    } else {
      _valueFlags |= kFlags[spacingType];
    }

    _hasAliasesSet = (_valueFlags & kFlags[FlexStyleEdge.all.index]) != 0 ||
        (_valueFlags & kFlags[FlexStyleEdge.vertical.index]) != 0 ||
        (_valueFlags & kFlags[FlexStyleEdge.horizontal.index]) != 0;

    return true;
  }

  return false;
}