build method
Implementation
@override
Widget build(Context context) {
var current = child;
if (child == null && (constraints == null || !constraints!.isTight)) {
current = LimitedBox(
maxWidth: 0,
maxHeight: 0,
child: ConstrainedBox(constraints: const BoxConstraints.expand()));
}
if (alignment != null) {
current = Align(alignment: alignment!, child: current);
}
if (padding != null) {
current = Padding(padding: padding!, child: current);
}
if (decoration != null) {
current = DecoratedBox(decoration: decoration!, child: current);
}
if (foregroundDecoration != null) {
current = DecoratedBox(
decoration: foregroundDecoration!,
position: DecorationPosition.foreground,
child: current);
}
if (constraints != null) {
current = ConstrainedBox(constraints: constraints!, child: current);
}
if (margin != null) {
current = Padding(padding: margin!, child: current);
}
if (transform != null) {
current = Transform(transform: transform!, child: current);
}
return current!;
}