import 'ObjectiveDraft.dart'; /// Creates a shared goal in a group, objectives and all. class GroupGoalRequest { String groupId; String? id; String title; String description; String targetDate; String colourHex; List objectives; GroupGoalRequest({ this.groupId = "", this.id, this.title = "", this.description = "", this.targetDate = "", this.colourHex = "", List? objectives, }) : objectives = objectives ?? []; Map toJson() { final Map data = {}; data['groupId'] = groupId; data['id'] = id; data['title'] = title; data['description'] = description; data['targetDate'] = targetDate; data['colourHex'] = colourHex; data['objectives'] = objectives.map((item) => item.toJson()).toList(); return data; } }