Style constructor
Style({
- String? color,
- String? backgroundColor,
- String? background,
- String? fontSize,
- String? fontWeight,
- String? fontFamily,
- String? display,
- 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,
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;
}