convertBoundingBox static method

Rect convertBoundingBox(
  1. Map boxMap
)

Converts a bounding box map to a Rect object.

This method centralizes the bounding box conversion logic that was duplicated across multiple files in result processing.

boxMap The map containing bounding box coordinates Returns a Rect object with the bounding box coordinates

Implementation

static Rect convertBoundingBox(Map<dynamic, dynamic> boxMap) {
  return Rect.fromLTRB(
    safeGetDouble(boxMap, 'left'),
    safeGetDouble(boxMap, 'top'),
    safeGetDouble(boxMap, 'right'),
    safeGetDouble(boxMap, 'bottom'),
  );
}