Fix all json fields being snake_case
continuous-integration/drone/push Build is failing Details

This commit is contained in:
kolaente 2020-06-15 23:46:10 +02:00
parent 68d3ffd30d
commit 9973816dde
Signed by: konrad
GPG Key ID: F40E70337AB24C9B
1 changed files with 6 additions and 6 deletions

View File

@ -24,25 +24,25 @@ class Task {
: id = json['id'],
updated = DateTime.parse(json['updated']),
created = DateTime.parse(json['created']),
reminders = (json['reminderDates'] as List<dynamic>)
reminders = (json['reminder_dates'] as List<dynamic>)
?.map((r) => DateTime.parse(r))
?.toList(),
due = DateTime.parse(json['dueDate']),
due = json['due_date'] != null ? DateTime.parse(json['due_date']): null,
description = json['description'],
title = json['title'],
done = json['done'],
owner = User.fromJson(json['createdBy']);
owner = User.fromJson(json['created_by']);
toJSON() => {
'id': id,
'updated': updated?.toIso8601String(),
'created': created?.toIso8601String(),
'reminderDates':
'reminder_dates':
reminders?.map((date) => date.toIso8601String())?.toList(),
'dueDate': due?.toIso8601String(),
'due_date': due?.toIso8601String(),
'description': description,
'title': title,
'done': done ?? false,
'createdBy': owner?.toJSON()
'created_by': owner?.toJSON()
};
}