setPropString method

void setPropString(
  1. String name,
  2. String? value
)

Implementation

void setPropString(String name, String? value) {
  switch (name) {
    case NodeProps.kFlexDirection:
      styleCssDirection = value == null
          ? FlexCSSDirection.column
          : flexCssDirectionFromValue(value) ?? FlexCSSDirection.column;
      break;
    case NodeProps.kFlexWrap:
      wrap = value == null
          ? FlexWrap.noWrap
          : flexWrapFromValue(value) ?? FlexWrap.noWrap;
      break;
    case NodeProps.kAlignSelf:
      alignSelf = value == null
          ? FlexAlign.auto
          : flexAlignFromValue(value) ?? FlexAlign.auto;
      break;
    case NodeProps.kAlignItems:
      alignItems = value == null
          ? FlexAlign.stretch
          : flexAlignFromValue(value) ?? FlexAlign.stretch;
      break;
    case NodeProps.kJustifyContent:
      justifyContent = value == null
          ? FlexJustify.flexStart
          : flexJustifyFromValue(value) ?? FlexJustify.flexStart;
      break;
    case NodeProps.kOverflow:
      overflow = value == null
          ? FlexOverflow.visible
          : flexOverflowFromValue(value) ?? FlexOverflow.visible;
      break;
    case NodeProps.kDisplay:
      if (value == "none") {
        display = FlexDisplay.displayNode;
      } else {
        display = FlexDisplay.displayFlex;
      }
      break;
    case NodeProps.kPosition:
      var positionType = value == null
          ? FlexPositionType.relative
          : flexPositionTypeFromValue(value) ?? FlexPositionType.relative;
      this.positionType = positionType;
      break;
    default:
      break;
  }
}