Style class
A typed representation of CSS styles.
Use Style.typed for a type-safe experience with CssLength, CssColor, etc. Or use the default constructor for loose, string-based styles.
Example
Style.typed(
display: CssDisplay.flex,
backgroundColor: CssColor.hex('333'),
padding: CssSpacing.all(CssLength.rem(1)),
)
- Implemented types
Constructors
- 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.
- Style.typed({CssColor? color, CssColor? backgroundColor, CssColor? borderColor, CssColor? fill, CssDisplay? display, CssPosition? position, CssLength? width, CssLength? height, CssLength? minWidth, CssLength? minHeight, CssLength? maxWidth, CssLength? maxHeight, CssSpacing? margin, CssLength? marginTop, CssLength? marginRight, CssLength? marginBottom, CssLength? marginLeft, CssSpacing? padding, CssLength? paddingTop, CssLength? paddingRight, CssLength? paddingBottom, CssLength? paddingLeft, CssLength? top, CssLength? right, CssLength? bottom, CssLength? left, CssFlexDirection? flexDirection, CssFlexWrap? flexWrap, CssJustifyContent? justifyContent, CssAlignItems? alignItems, CssAlignSelf? alignSelf, CssAlignContent? alignContent, CssNumber? flexGrow, CssNumber? flexShrink, CssLength? gap, CssLength? fontSize, CssFontWeight? fontWeight, CssFontFamily? fontFamily, CssFontStyle? fontStyle, CssTextAlign? textAlign, CssTextDecoration? textDecoration, CssTextTransform? textTransform, CssWhiteSpace? whiteSpace, CssWordBreak? wordBreak, CssNumber? lineHeight, CssLength? letterSpacing, CssBorder? border, CssBorder? borderTop, CssBorder? borderRight, CssBorder? borderBottom, CssBorder? borderLeft, CssLength? borderRadius, CssNumber? opacity, CssOverflow? overflow, CssOverflow? overflowX, CssOverflow? overflowY, CssZIndex? zIndex, CssCursor? cursor, CssTransition? transition, String? transform, String? boxShadow, String? backdropFilter, String? background, String? flex, String? gridTemplateColumns, Stylesheet? css})
- Type-safe constructor with CSS value types.
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- stylesheet → Stylesheet?
-
final
Methods
-
add(
String property, String value) → void - Adds a custom property not covered by the named arguments.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toCss(
) → String -
Converts the style to a CSS string.
override
-
toString(
) → String -
A string representation of this object.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited