Container class
DSL node for a Container widget.
Usage
Container(
key: Key('hero_box'),
height: 200,
width: double.infinity,
color: 'Colors.red', // Flutter color name
// or: color: '#FF6B6B', // hex string
padding: 16, // uniform padding
// or: padding: {'horizontal': 24, 'vertical': 12},
margin: {'top': 8, 'bottom': 8},
borderRadius: 12, // uniform radius
// or: borderRadius: {'tl': 16, 'tr': 16, 'bl': 0, 'br': 0},
borderColor: 'Colors.grey.shade300',
borderWidth: 1.5,
alignment: 'center',
gradient: {
'type': 'linear',
'colors': ['#FF6B6B', '#4ECDC4'],
'begin': 'topLeft',
'end': 'bottomRight',
},
child: Text('Hello'),
)
Constructors
Properties
- alignment → String?
-
Alignment:
'center','topLeft','bottomRight', etc.final - borderColor → String?
-
Border color string:
'Colors.grey'or'#CCCCCC'.final - borderRadius → dynamic
-
Border radius: a number (uniform) or a map with
tl/tr/bl/br.final - borderWidth → double?
-
final
- child → SduiNode?
-
final
- color → String?
-
Color string:
'Colors.red'or'#FF0000'.final -
gradient
→ Map<
String, dynamic> ? -
Gradient map:
{'type': 'linear', 'colors': [...], 'begin': ..., 'end': ...}.final - hashCode → int
-
The hash code for this object.
no setterinherited
- height → double?
-
final
- margin → dynamic
-
Margin: same format as padding.
final
- padding → dynamic
-
Padding: a number (all sides) or a map with
all/horizontal/vertical/left/top/right/bottom.final - runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- width → double?
-
final
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toJson(
) → Map< String, dynamic> -
Serialises this node and all its children into the SDUI JSON format.
override
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited