Skip to main content

Center

Center is a wrapper on Align.

class Center extends Align {
/// Creates a widget that centers its child.
const Center({ super.key, super.widthFactor, super.heightFactor, super.child });
}

class Align extends SingleChildRenderObjectWidget {
/// Creates an alignment widget.
///
/// The alignment defaults to [Alignment.center].
const Align({
super.key,
this.alignment = Alignment.center,
this.widthFactor,
this.heightFactor,
super.child,
})
: assert(widthFactor == null || widthFactor >= 0.0),
assert(heightFactor == null || heightFactor >= 0.0);
}