Fix all json fields being snake_case
continuous-integration/drone/push Build is failing
Details
continuous-integration/drone/push Build is failing
Details
This commit is contained in:
parent
68d3ffd30d
commit
9973816dde
|
@ -24,25 +24,25 @@ class Task {
|
||||||
: id = json['id'],
|
: id = json['id'],
|
||||||
updated = DateTime.parse(json['updated']),
|
updated = DateTime.parse(json['updated']),
|
||||||
created = DateTime.parse(json['created']),
|
created = DateTime.parse(json['created']),
|
||||||
reminders = (json['reminderDates'] as List<dynamic>)
|
reminders = (json['reminder_dates'] as List<dynamic>)
|
||||||
?.map((r) => DateTime.parse(r))
|
?.map((r) => DateTime.parse(r))
|
||||||
?.toList(),
|
?.toList(),
|
||||||
due = DateTime.parse(json['dueDate']),
|
due = json['due_date'] != null ? DateTime.parse(json['due_date']): null,
|
||||||
description = json['description'],
|
description = json['description'],
|
||||||
title = json['title'],
|
title = json['title'],
|
||||||
done = json['done'],
|
done = json['done'],
|
||||||
owner = User.fromJson(json['createdBy']);
|
owner = User.fromJson(json['created_by']);
|
||||||
|
|
||||||
toJSON() => {
|
toJSON() => {
|
||||||
'id': id,
|
'id': id,
|
||||||
'updated': updated?.toIso8601String(),
|
'updated': updated?.toIso8601String(),
|
||||||
'created': created?.toIso8601String(),
|
'created': created?.toIso8601String(),
|
||||||
'reminderDates':
|
'reminder_dates':
|
||||||
reminders?.map((date) => date.toIso8601String())?.toList(),
|
reminders?.map((date) => date.toIso8601String())?.toList(),
|
||||||
'dueDate': due?.toIso8601String(),
|
'due_date': due?.toIso8601String(),
|
||||||
'description': description,
|
'description': description,
|
||||||
'title': title,
|
'title': title,
|
||||||
'done': done ?? false,
|
'done': done ?? false,
|
||||||
'createdBy': owner?.toJSON()
|
'created_by': owner?.toJSON()
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
Reference in New Issue