Box
This is equivalent to the Container widget in Flutter.
Box(
style: BoxStyler()
.width(100)
.height(100)
.color(Colors.blue)
.borderRounded(8),
child: Text('Styled Box'),
);
Constructor
Prop | Type | Required / Default Value |
---|---|---|
child | Widget? | Optional |
style | Style<BoxSpec> | Optional, defaults to BoxStyler.create() |
key | Key? | Optional |
Style API Reference
Method | Description |
---|---|
animate | Sets animation configuration |
modifier | Adds widget modifiers |
alignment | Sets box alignment |
transformAlignment | Sets transform alignment |
clipBehavior | Sets clip behavior |
padding | Sets padding |
margin | Sets margin |
transform | Sets transform matrix |
decoration | Sets decoration |
foregroundDecoration | Sets foreground decoration |
constraints | Sets box constraints |
width | Sets fixed width |
height | Sets fixed height |
minWidth | Sets minimum width |
maxWidth | Sets maximum width |
minHeight | Sets minimum height |
maxHeight | Sets maximum height |
size | Sets both width and height |
constraintsOnly | Sets specific constraints |
paddingTop | Sets top padding |
paddingBottom | Sets bottom padding |
paddingLeft | Sets left padding |
paddingRight | Sets right padding |
paddingX | Sets horizontal padding |
paddingY | Sets vertical padding |
paddingAll | Sets padding on all sides |
paddingStart | Sets start padding (RTL-aware) |
paddingEnd | Sets end padding (RTL-aware) |
paddingOnly | Sets specific padding values |
marginTop | Sets top margin |
marginBottom | Sets bottom margin |
marginLeft | Sets left margin |
marginRight | Sets right margin |
marginX | Sets horizontal margin |
marginY | Sets vertical margin |
marginAll | Sets margin on all sides |
marginStart | Sets start margin (RTL-aware) |
marginEnd | Sets end margin (RTL-aware) |
marginOnly | Sets specific margin values |
color | Sets background color |
gradient | Sets gradient background |
shadow | Sets single shadow |
shadows | Sets multiple shadows |
elevation | Sets Material elevation |
image | Sets background image |
shape | Sets shape |
border | Sets border |
borderRadius | Sets border radius |
borderTop | Sets top border |
borderBottom | Sets bottom border |
borderLeft | Sets left border |
borderRight | Sets right border |
borderStart | Sets start border (RTL-aware) |
borderEnd | Sets end border (RTL-aware) |
borderVertical | Sets top and bottom borders |
borderHorizontal | Sets left and right borders |
borderAll | Sets all borders |
borderRadiusAll | Sets radius on all corners |
borderRadiusTop | Sets radius on top corners |
borderRadiusBottom | Sets radius on bottom corners |
borderRadiusLeft | Sets radius on left corners |
borderRadiusRight | Sets radius on right corners |
borderRadiusTopLeft | Sets top-left radius |
borderRadiusTopRight | Sets top-right radius |
borderRadiusBottomLeft | Sets bottom-left radius |
borderRadiusBottomRight | Sets bottom-right radius |
borderRadiusTopStart | Sets top-start radius (RTL-aware) |
borderRadiusTopEnd | Sets top-end radius (RTL-aware) |
borderRadiusBottomStart | Sets bottom-start radius (RTL-aware) |
borderRadiusBottomEnd | Sets bottom-end radius (RTL-aware) |
borderRounded | Sets circular radius on all corners |
borderRoundedTop | Sets circular radius on top corners |
borderRoundedBottom | Sets circular radius on bottom corners |
borderRoundedLeft | Sets circular radius on left corners |
borderRoundedRight | Sets circular radius on right corners |
borderRoundedTopLeft | Sets circular top-left radius |
borderRoundedTopRight | Sets circular top-right radius |
borderRoundedBottomLeft | Sets circular bottom-left radius |
borderRoundedBottomRight | Sets circular bottom-right radius |
borderRoundedTopStart | Sets circular top-start radius (RTL-aware) |
borderRoundedTopEnd | Sets circular top-end radius (RTL-aware) |
borderRoundedBottomStart | Sets circular bottom-start radius (RTL-aware) |
borderRoundedBottomEnd | Sets circular bottom-end radius (RTL-aware) |
shadowOnly | Creates single shadow with parameters |
boxShadows | Sets multiple box shadows |
boxElevation | Sets Material elevation shadow |
rotate | Sets rotation transform |
scale | Sets scale transform |
translate | Sets translation transform |
skew | Sets skew transform |
transformReset | Resets transform to identity |