center method

Widget center({
  1. Key? key,
})

Centers this widget horizontally and vertically.

Parameters:

  • key (Key?, optional): Widget key.

Returns: Widget — centered widget.

Implementation

Widget center({Key? key}) {
  return Center(
    key: key,
    child: this,
  );
}