getBody method
Implementation
Map<String, String> getBody(Todo todo) {
Map<String, String> body = {
"title": todo.title,
"body": todo.body,
};
if (todo.labels.isNotEmpty) {
body.putIfAbsent("labels", () => jsonEncode(todo.labels));
}
return body;
}