rect static method

Map<String, dynamic>? rect(
  1. Rect? rect
)

Returns a Rect from the specified map.

If the map is absent, returns null.

Otherwise, returns a Rect.fromLTWH whose x, y, width, and height components are determined from the x, y, w, and h properties of the map, with missing (or non-double) values replaced by zeros.

Implementation

static Map<String, dynamic>? rect(Rect? rect) {
  if (rect == null) return null;
  return {'x': rect.left, 'y': rect.top, 'w': rect.width, 'h': rect.height};
}