setStyle method

  1. @ControllerProps(NodeProps.kStyle)
void setStyle(
  1. TextRenderViewModel renderViewModel,
  2. VoltronMap style
)

Implementation

@ControllerProps(NodeProps.kStyle)
void setStyle(TextRenderViewModel renderViewModel, VoltronMap style) {
  var flexDirection = style.get<String>('flexDirection') ?? '';
  if (flexDirection.isNotEmpty) {
    renderViewModel.flexDirection =
        flexCssDirectionFromValue(flexDirection) ?? FlexCSSDirection.row;
  }

  var alignItems = style.get<String>('alignItems') ?? '';
  if (alignItems.isNotEmpty) {
    renderViewModel.alignItems = flexAlignFromValue(alignItems) ?? FlexAlign.flexStart;
  }
  var justifyContent = style.get<String>('justifyContent') ?? '';
  if (justifyContent.isNotEmpty) {
    renderViewModel.justifyContent = flexAlignFromValue(justifyContent) ?? FlexAlign.flexStart;
  }
}