getBounds method

Future<Rect> getBounds(
  1. String id
)

Get current bounds.

Implementation

Future<Rect> getBounds(String id) async {
  final result = await sendForMap('getBounds', windowId: id);
  if (result == null) {
    debugPrint('[FrameClient] getBounds($id) returned null — using fallback');
    return Rect.zero;
  }
  return Rect.fromLTWH(
    (result['x'] as num).toDouble(),
    (result['y'] as num).toDouble(),
    (result['width'] as num).toDouble(),
    (result['height'] as num).toDouble(),
  );
}