Map<String, dynamic> toMap() { return { name: { 'git': { 'url': url, if (ref != null) 'ref': ref, if (path != null) 'path': path, }, }, }; }