getBody method

Map<String, String> getBody(
  1. Todo todo
)

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;
}