Map<String, dynamic>? rectSingleTojson(Rect? rect) { if (rect == null) return null; return { 'left': rect.left, 'top': rect.top, 'right': rect.right, 'bottom': rect.bottom, }; }