centered method

Widget centered()

A modifier that aligns its widget within itself and optionally sizes itself based on the widget's size.

Example:

Text('Item 1')
    .centered()

Implementation

Widget centered() {
  return Center(
    child: this,
  );
}