Style constructor

Style({
  1. String? color,
  2. String? backgroundColor,
  3. String? background,
  4. String? fontSize,
  5. String? fontWeight,
  6. String? fontFamily,
  7. String? display,
  8. String? flexDirection,
  9. String? justifyContent,
  10. String? alignItems,
  11. String? margin,
  12. String? padding,
  13. String? width,
  14. String? height,
  15. String? maxWidth,
  16. String? maxHeight,
  17. String? border,
  18. String? borderBottom,
  19. String? borderRadius,
  20. String? position,
  21. String? top,
  22. String? bottom,
  23. String? left,
  24. String? right,
  25. String? zIndex,
  26. String? opacity,
  27. String? transition,
  28. String? cursor,
  29. String? textAlign,
  30. String? lineHeight,
  31. String? letterSpacing,
  32. String? textDecoration,
  33. String? textTransform,
  34. String? gap,
  35. String? gridTemplateColumns,
  36. String? fill,
  37. String? backdropFilter,
  38. String? marginTop,
  39. String? marginBottom,
  40. String? marginLeft,
  41. String? marginRight,
  42. String? paddingTop,
  43. String? paddingBottom,
  44. String? paddingLeft,
  45. String? paddingRight,
  46. String? borderTop,
  47. String? borderLeft,
  48. String? borderRight,
  49. String? flex,
  50. String? flexGrow,
  51. String? flexShrink,
  52. String? flexWrap,
  53. String? alignSelf,
  54. String? overflow,
  55. String? overflowX,
  56. String? overflowY,
  57. String? minHeight,
  58. String? minWidth,
  59. String? boxShadow,
  60. String? transform,
  61. String? borderColor,
  62. Stylesheet? css,
})

Creates a style with raw string values.

For type safety, prefer Style.typed.

Implementation

Style({
  String? color,
  String? backgroundColor,
  String? background,
  String? fontSize,
  String? fontWeight,
  String? fontFamily,
  String? display,
  // ... (other properties are standard CSS)
  String? flexDirection,
  String? justifyContent,
  String? alignItems,
  String? margin,
  String? padding,
  String? width,
  String? height,
  String? maxWidth,
  String? maxHeight,
  String? border,
  String? borderBottom,
  String? borderRadius,
  String? position,
  String? top,
  String? bottom,
  String? left,
  String? right,
  String? zIndex,
  String? opacity,
  String? transition,
  String? cursor,
  String? textAlign,
  String? lineHeight,
  String? letterSpacing,
  String? textDecoration,
  String? textTransform,
  String? gap,
  String? gridTemplateColumns,
  String? fill,
  String? backdropFilter,
  String? marginTop,
  String? marginBottom,
  String? marginLeft,
  String? marginRight,
  String? paddingTop,
  String? paddingBottom,
  String? paddingLeft,
  String? paddingRight,
  String? borderTop,
  String? borderLeft,
  String? borderRight,
  String? flex,
  String? flexGrow,
  String? flexShrink,
  String? flexWrap,
  String? alignSelf,
  String? overflow,
  String? overflowX,
  String? overflowY,
  String? minHeight,
  String? minWidth,
  String? boxShadow,
  String? transform,
  String? borderColor,
  Stylesheet? css,
}) : stylesheet = css {
  if (color != null) _properties['color'] = color;
  if (backgroundColor != null) {
    _properties['background-color'] = backgroundColor;
  }
  if (background != null) _properties['background'] = background;
  if (fontSize != null) _properties['font-size'] = fontSize;
  if (fontWeight != null) _properties['font-weight'] = fontWeight;
  if (fontFamily != null) _properties['font-family'] = fontFamily;
  if (display != null) _properties['display'] = display;
  if (flexDirection != null) _properties['flex-direction'] = flexDirection;
  if (justifyContent != null) _properties['justify-content'] = justifyContent;
  if (alignItems != null) _properties['align-items'] = alignItems;
  if (margin != null) _properties['margin'] = margin;
  if (padding != null) _properties['padding'] = padding;
  if (width != null) _properties['width'] = width;
  if (height != null) _properties['height'] = height;
  if (maxWidth != null) _properties['max-width'] = maxWidth;
  if (maxHeight != null) _properties['max-height'] = maxHeight;
  if (border != null) _properties['border'] = border;
  if (borderBottom != null) _properties['border-bottom'] = borderBottom;
  if (borderRadius != null) _properties['border-radius'] = borderRadius;
  if (position != null) _properties['position'] = position;
  if (top != null) _properties['top'] = top;
  if (bottom != null) _properties['bottom'] = bottom;
  if (left != null) _properties['left'] = left;
  if (right != null) _properties['right'] = right;
  if (zIndex != null) _properties['z-index'] = zIndex;
  if (opacity != null) _properties['opacity'] = opacity;
  if (transition != null) _properties['transition'] = transition;
  if (cursor != null) _properties['cursor'] = cursor;
  if (textAlign != null) _properties['text-align'] = textAlign;
  if (lineHeight != null) _properties['line-height'] = lineHeight;
  if (letterSpacing != null) _properties['letter-spacing'] = letterSpacing;
  if (textDecoration != null) _properties['text-decoration'] = textDecoration;
  if (textTransform != null) _properties['text-transform'] = textTransform;
  if (gap != null) _properties['gap'] = gap;
  if (gridTemplateColumns != null) {
    _properties['grid-template-columns'] = gridTemplateColumns;
  }
  if (fill != null) _properties['fill'] = fill;
  if (backdropFilter != null) _properties['backdrop-filter'] = backdropFilter;
  if (marginTop != null) _properties['margin-top'] = marginTop;
  if (marginBottom != null) _properties['margin-bottom'] = marginBottom;
  if (marginLeft != null) _properties['margin-left'] = marginLeft;
  if (marginRight != null) _properties['margin-right'] = marginRight;
  if (paddingTop != null) _properties['padding-top'] = paddingTop;
  if (paddingBottom != null) _properties['padding-bottom'] = paddingBottom;
  if (paddingLeft != null) _properties['padding-left'] = paddingLeft;
  if (paddingRight != null) _properties['padding-right'] = paddingRight;
  if (borderTop != null) _properties['border-top'] = borderTop;
  if (borderLeft != null) _properties['border-left'] = borderLeft;
  if (borderRight != null) _properties['border-right'] = borderRight;
  if (flex != null) _properties['flex'] = flex;
  if (flexGrow != null) _properties['flex-grow'] = flexGrow;
  if (flexShrink != null) _properties['flex-shrink'] = flexShrink;
  if (flexWrap != null) _properties['flex-wrap'] = flexWrap;
  if (alignSelf != null) _properties['align-self'] = alignSelf;
  if (overflow != null) _properties['overflow'] = overflow;
  if (overflowX != null) _properties['overflow-x'] = overflowX;
  if (overflowY != null) _properties['overflow-y'] = overflowY;
  if (minHeight != null) _properties['min-height'] = minHeight;
  if (minWidth != null) _properties['min-width'] = minWidth;
  if (boxShadow != null) _properties['box-shadow'] = boxShadow;
  if (transform != null) _properties['transform'] = transform;
  if (borderColor != null) _properties['border-color'] = borderColor;
}