Map<String, dynamic> toJson() { return { 'text': text, 'recognizedRect': recognizedRect?.toJson(), }; }