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/3final - 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 CSSflex-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 CSSflex-basisand 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?
-
constraintsproperty e.g., min-w-100, max-h-200final - 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?
-
decorationproperty e.g., bg-red-500, bg-url(...)final - displayType → WindDisplayType?
-
displayproperty e.g., block, flex, gridfinal - 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-
20pxfinal - 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 the1..colsclamp.final - hashCode → int
-
The hash code for this object.
no setteroverride
- height → double?
-
heightproperty e.g., h-100, h-lg, h-200pxfinal - heightFactor → double?
-
heightFactorproperty e.g., h-1/2final - heightLine → double?
-
Text line height e.g., leading-
15pxfinal - heightLineFactor → double?
-
Text line height factor e.g., leading-1.5
final
- isHidden → bool
-
hiddenproperty e.g., hiddenfinal - 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-*andtracking-[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?
-
marginproperty e.g., m-4, mx-2, my-3final - 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
MouseRegionon 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.5final - order → int?
-
Child order for flex reordering e.g., order-1, order-first, order-
5. Children without anorder-*class default to0during 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?
-
paddingproperty e.g., p-4, px-2, py-3final - positionBottom → double?
-
Bottom offset for positioned elements e.g., bottom-4, bottom-
10pxfinal - positionLeft → double?
-
Left offset for positioned elements e.g., left-4, left-
10pxfinal - positionRight → double?
-
Right offset for positioned elements e.g., right-4, right-
10pxfinal - positionTop → double?
-
Top offset for positioned elements e.g., top-4, top-
10pxfinal - 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-colorsin 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 (orring-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-
500msfinal - width → double?
-
widthproperty e.g., w-100, w-lg, w-200pxfinal - widthFactor → double?
-
widthFactorproperty e.g., w-1/2final - zIndex → int?
-
Z-index for Stack ordering e.g., z-10, z-
100final
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
WindStyleinto a FlutterTextStyle.
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's1..colsclamp turns it into a span of every column.