center method

Future<void> center({
  1. bool animate = false,
})

Moves window to the center of the screen.

Implementation

Future<void> center({
  bool animate = false,
}) async {
  Size windowSize = await getSize();
  Offset position = await calcWindowPosition(windowSize, Alignment.center);
  await setPosition(position, animate: animate);
}