WindStyle class

The Immutable Style Object

WindStyle represents a resolved set of style properties derived from utility classes. It is the "Output" of the WindParser.

It aggregates properties from all specialized parsers (Typography, Spacing, Layout, etc.) into a single, flattening data structure that can be easily consumed by widgets like WDiv or WText.

Characteristics:

  • Immutable: Once created, it cannot be changed (use copyWith).
  • Comprehensive: Covers all supported CSS-like properties.
  • Null-safe: Properties are null if not specified by a utility class.
Annotations

Constructors

WindStyle({bool isHidden = false, WindDisplayType? displayType = WindDisplayType.block, BoxDecoration? decoration, double? width, double? height, double? widthFactor, double? heightFactor, BoxConstraints? constraints, EdgeInsets? padding, EdgeInsets? margin, bool marginXAuto = false, Axis? flexDirection, MainAxisAlignment? mainAxisAlignment, CrossAxisAlignment? crossAxisAlignment, WrapAlignment? runAlignment, double? gapX, double? gapY, MainAxisSize? mainAxisSize, int? flex, FlexFit? flexFit, double? basisFactor, double? basisSize, Alignment? alignment, TextBaseline? textBaseline, int? gridCols, int? gridColSpan, int? order, bool flexReverse = false, Color? color, double? fontSize, FontWeight? fontWeight, FontStyle? fontStyle, double? letterSpacing, WindLetterSpacingUnit letterSpacingUnit = WindLetterSpacingUnit.px, double? heightLine, double? heightLineFactor, TextDecoration? textDecoration, Color? textDecorationColor, TextDecorationStyle? textDecorationStyle, double? textDecorationThickness, TextAlign? textAlign, TextOverflow? textOverflow, int? maxLines, bool? softWrap, WindTextTransform? textTransform, String? fontFamily, List<BoxShadow>? boxShadow, Color? shadowColor, bool debug = false, double? opacity, int? zIndex, WindOverflow? overflow, WindOverflow? overflowX, WindOverflow? overflowY, Clip? clipBehavior, double? aspectRatio, Duration? transitionDuration, Curve? transitionCurve, List<BoxShadow>? ringShadow, Color? ringColor, double? ringWidth, double? ringOffset, bool? ringInset, Color? fillColor, Color? strokeColor, WindAnimationType? animationType, bool preserveColors = false, MouseCursor? mouseCursor, WindPositionType? positionType, double? positionTop, double? positionRight, double? positionBottom, double? positionLeft})
const

Properties

alignment → Alignment?
Alignment for flex or grid display type e.g., align-self-center, align-self-start
final
animationType → WindAnimationType?
Animation type e.g., animate-spin, animate-pulse, animate-bounce
final
aspectRatio → double?
Aspect ratio e.g., aspect-square, aspect-video, aspect-4/3
final
basisFactor → double?
Fractional flex-basis along the parent's MAIN axis e.g., basis-1/2, basis-full. Resolved by the parent flex (WDiv) into a width factor (row) or height factor (column). This approximates CSS flex-basis: it sets the initial main-axis size and ignores grow/shrink interplay.
final
basisSize → double?
Fixed flex-basis along the parent's MAIN axis e.g., basis-[120px]. Resolved by the parent flex (WDiv) into a fixed width (row) or height (column). Like basisFactor, this approximates CSS flex-basis and ignores grow/shrink interplay.
final
boxShadow → List<BoxShadow>?
Box shadow e.g., shadow-sm, shadow-xl
final
clipBehavior → Clip?
Clip behavior for overflow-hidden
final
color → Color?
Text color e.g., text-red-500
final
constraints → BoxConstraints?
constraints property e.g., min-w-100, max-h-200
final
crossAxisAlignment → CrossAxisAlignment?
Align items for flex display type e.g., items-center, items-start
final
debug → bool
Enable debug mode to log style details
final
decoration → BoxDecoration?
decoration property e.g., bg-red-500, bg-url(...)
final
displayType → WindDisplayType?
display property e.g., block, flex, grid
final
effectiveLineHeight → double?
Calculates the effective line height as a multiplier for TextStyle.height.
no setter
fillColor → Color?
SVG fill color e.g., fill-red-500, fill-current
final
flex → int?
Flex properties for flex display type e.g., flex-1, flex-grow
final
flexDirection → Axis?
Flex direction for flex display type e.g., flex-row, flex-col
final
flexFit → FlexFit?
Flex fit for flex display type e.g., flex-auto, flex-none
final
flexReverse → bool
Whether the flex main axis should be mirrored (flex-row-reverse / flex-col-reverse). Applied by the parent at layout time.
final
fontFamily → String?
Font family e.g., font-sans, font-serif
final
fontSize → double?
Text size e.g., text-sm, text-lg, text-20px
final
fontStyle → FontStyle?
Font style e.g., italic, not-italic
final
fontWeight → FontWeight?
Font weight e.g., font-bold, font-light
final
gapX → double?
Gap between items in flex or grid display type e.g., gap-4, gap-x-2, gap-y-3
final
gapY → double?
Gap between rows in flex or grid display type e.g., gap-4, gap-x-2, gap-y-3
final
gridCols → int?
Number of grid columns for grid display type e.g., grid-cols-3
final
gridColSpan → int?
Columns a grid child spans e.g., col-span-2; gridColSpanFull for col-span-full. Stored unclamped: the grid owns the 1..cols clamp.
final
hashCode → int
The hash code for this object.
no setteroverride
height → double?
height property e.g., h-100, h-lg, h-200px
final
heightFactor → double?
heightFactor property e.g., h-1/2
final
heightLine → double?
Text line height e.g., leading-15px
final
heightLineFactor → double?
Text line height factor e.g., leading-1.5
final
isHidden → bool
hidden property e.g., hidden
final
letterSpacing → double?
Text letter spacing e.g., tracking-wide, tracking-1px, read in letterSpacingUnit. toTextStyle turns it into logical pixels.
final
letterSpacingUnit → WindLetterSpacingUnit
The unit letterSpacing is written in. Named tracking-* and tracking-[Nem] are WindLetterSpacingUnit.em; tracking-[Npx] and a bare number are WindLetterSpacingUnit.px, the default.
final
mainAxisAlignment → MainAxisAlignment?
Justify content for flex display type e.g., justify-center, justify-between
final
mainAxisSize → MainAxisSize?
Main axis size for flex display type e.g., axis-min, axis-max
final
margin → EdgeInsets?
margin property e.g., m-4, mx-2, my-3
final
marginXAuto → bool
Whether horizontal margin is auto (mx-auto) for centering
final
maxLines → int?
Max lines e.g., line-clamp-3
final
mouseCursor → MouseCursor?
Mouse cursor for hover regions e.g., cursor-pointer, cursor-not-allowed. Applied by WDiv through a MouseRegion on web/desktop targets.
final
needsInheritedFontSize → bool
Whether an em letterSpacing has no fontSize of its own to resolve against, so toTextStyle needs the font size the text inherits.
no setter
opacity → double?
Widget opacity e.g., opacity-50, opacity-0.5
final
order → int?
Child order for flex reordering e.g., order-1, order-first, order-5. Children without an order-* class default to 0 during stable sort.
final
overflow → WindOverflow?
Overflow behavior e.g., overflow-hidden
final
overflowX → WindOverflow?
Horizontal overflow behavior e.g., overflow-x-hidden
final
overflowY → WindOverflow?
Vertical overflow behavior e.g., overflow-y-hidden
final
padding → EdgeInsets?
padding property e.g., p-4, px-2, py-3
final
positionBottom → double?
Bottom offset for positioned elements e.g., bottom-4, bottom-10px
final
positionLeft → double?
Left offset for positioned elements e.g., left-4, left-10px
final
positionRight → double?
Right offset for positioned elements e.g., right-4, right-10px
final
positionTop → double?
Top offset for positioned elements e.g., top-4, top-10px
final
positionType → WindPositionType?
Position type e.g., relative, absolute
final
preserveColors → bool
When true, no ColorFilter is applied to the SVG; the widget renders with its own embedded colors unchanged. Use preserve-colors in className. Ideal for QR codes, logos, and multi-colour illustrations.
final
ringColor → Color?
Ring color e.g., ring-blue-500
final
ringInset → bool?
Ring inset e.g., ring-inset
final
ringOffset → double?
Ring offset e.g., ring-offset-2
final
ringOutline → BoxDecoration?
The ring-* outline as a decoration to paint in the FOREGROUND of the element's box, or null when it carries no ring (or ring-0).
no setter
ringShadow → List<BoxShadow>?
Ring shadow e.g., ring, ring-2
final
ringWidth → double?
Ring width e.g., ring-2, ring-4
final
runAlignment → WrapAlignment?
Wrap alignment for flex display type e.g., align-content-start, align-content-center
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
shadowColor → Color?
Shadow color e.g., shadow-red-500
final
softWrap → bool?
White space e.g., whitespace-normal, whitespace-nowrap
final
strokeColor → Color?
SVG stroke color e.g., stroke-blue-500, stroke-current
final
textAlign → TextAlign?
Text align e.g., text-left, text-center, text-right
final
textBaseline → TextBaseline?
Text baseline for baseline alignment (required when using items-baseline)
final
textDecoration → TextDecoration?
Text decoration e.g., underline, line-through
final
textDecorationColor → Color?
Text decoration color e.g., decoration-red-500
final
textDecorationStyle → TextDecorationStyle?
Text decoration style e.g., decoration-dashed, decoration-dotted
final
textDecorationThickness → double?
Text decoration thickness e.g., decoration-2, decoration-4
final
textOverflow → TextOverflow?
Text overflow e.g., truncate, overflow-ellipsis
final
textTransform → WindTextTransform?
Text transform e.g., uppercase, lowercase, capitalize
final
transitionCurve → Curve?
Transition curve e.g., ease-in, ease-out, ease-in-out
final
transitionDuration → Duration?
Transition duration e.g., duration-300, duration-500ms
final
width → double?
width property e.g., w-100, w-lg, w-200px
final
widthFactor → double?
widthFactor property e.g., w-1/2
final
zIndex → int?
Z-index for Stack ordering e.g., z-10, z-100
final

Methods

copyWith({bool? isHidden, WindDisplayType? displayType, BoxDecoration? decoration, double? width, double? height, double? widthFactor, double? heightFactor, BoxConstraints? constraints, EdgeInsets? padding, EdgeInsets? margin, bool? marginXAuto, Axis? flexDirection, MainAxisAlignment? mainAxisAlignment, CrossAxisAlignment? crossAxisAlignment, WrapAlignment? runAlignment, double? gapX, double? gapY, MainAxisSize? mainAxisSize, int? flex, FlexFit? flexFit, double? basisFactor, double? basisSize, Alignment? alignment, TextBaseline? textBaseline, int? gridCols, int? gridColSpan, int? order, bool? flexReverse, Color? color, double? fontSize, FontWeight? fontWeight, FontStyle? fontStyle, double? letterSpacing, WindLetterSpacingUnit? letterSpacingUnit, double? heightLine, double? heightLineFactor, TextDecoration? textDecoration, Color? textDecorationColor, TextDecorationStyle? textDecorationStyle, double? textDecorationThickness, TextAlign? textAlign, TextOverflow? textOverflow, int? maxLines, bool? softWrap, WindTextTransform? textTransform, String? fontFamily, List<BoxShadow>? boxShadow, Color? shadowColor, bool? debug, double? opacity, int? zIndex, WindOverflow? overflow, WindOverflow? overflowX, WindOverflow? overflowY, Clip? clipBehavior, double? aspectRatio, Duration? transitionDuration, Curve? transitionCurve, List<BoxShadow>? ringShadow, Color? ringColor, double? ringWidth, double? ringOffset, bool? ringInset, Color? fillColor, Color? strokeColor, WindAnimationType? animationType, bool? preserveColors, MouseCursor? mouseCursor, WindPositionType? positionType, double? positionTop, double? positionRight, double? positionBottom, double? positionLeft}) → WindStyle
effectiveLetterSpacing({double? inheritedFontSize}) → double?
The letter spacing in logical pixels, the unit Flutter's TextStyle.letterSpacing takes.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
override
toTextStyle({double? inheritedFontSize}) → TextStyle
Converts the typography properties of this WindStyle into a Flutter TextStyle.

Operators

operator ==(Object other) → bool
The equality operator.
override

Constants

gridColSpanFull → const int
Sentinel for col-span-full. Far above any real column count, so the grid's 1..cols clamp turns it into a span of every column.