setBounds method
Resizes and moves the window to the supplied bounds.
Implementation
Future<void> setBounds(
Rect? bounds, {
Offset? position,
Size? size,
bool animate = false,
}) async {
final window = _target;
if (window == null) return;
if (bounds == null && position == null && size == null) return;
final current = window.bounds.toRect();
final target =
bounds ??
Rect.fromLTWH(
position?.dx ?? current.left,
position?.dy ?? current.top,
size?.width ?? current.width,
size?.height ?? current.height,
);
if (!animate || !window.animateBounds(target.toNative())) {
window.bounds = target.toNative();
}
}