center method

Widget center({
  1. double? heightFactor,
  2. double? widthFactor,
})

Centers the widget within a Center widget.

Text("Centered").center();

Implementation

Widget center({double? heightFactor, double? widthFactor}) {
  return Center(
    heightFactor: heightFactor,
    widthFactor: widthFactor,
    child: this,
  );
}