centered method
Centers the widget. If a size factor is non-null then the corresponding dimension of this widget will be the product of the child's dimension and the size factor. For example if widthFactor is 2.0 then the width of this widget will always be twice the width of the widget is is called on.
Implementation
Widget centered({
double? widthFactor,
double? heightFactor,
Key? key,
}) {
return Center(
key: key,
widthFactor: widthFactor,
heightFactor: heightFactor,
child: this,
);
}