background method
Stack
background({
- required Widget backgroundWidget,
- AlignmentGeometry alignment = Alignment.center,
- StackFit fit = StackFit.loose,
- Clip clipBehavior = Clip.none,
Adds a background to the widget.
backgroundWidget The widget that will be placed in the background.
alignment Optional parameter to specify the alignment of the background widget within the stack.
fit Optional parameter to specify how the background widget should fit inside the stack.
clipBehavior Optional parameter to specify how the stack clips its children.
Implementation
Stack background({
required Widget backgroundWidget,
AlignmentGeometry alignment = Alignment.center,
StackFit fit = StackFit.loose,
Clip clipBehavior = Clip.none,
}) {
return Stack(
alignment: alignment,
fit: fit,
clipBehavior: clipBehavior,
children: [
backgroundWidget,
this,
],
);
}