@override Object toJson() { return { 'parent': parent, 'viewId': viewId, if (view != null) 'view': view!.toJson(), }; }