Map<String, dynamic> toMap() { return <String, dynamic>{ 'id': id, 'type': type, 'x': x, 'y': y, 'width': width, 'height': height, }; }