Fixed app not working with the newest api change which has multiple reminders #19

Merged
konrad merged 3 commits from fix/latest-api-reminder-dates into master 2018-12-03 21:26:01 +00:00
1 changed files with 5 additions and 2 deletions
Showing only changes of commit a39cd2ca55 - Show all commits

View File

@ -24,7 +24,9 @@ class Task {
: id = json['id'],
updated = DateTime.fromMillisecondsSinceEpoch(json['updated']),
created = DateTime.fromMillisecondsSinceEpoch(json['created']),
reminders = (json['reminderDates'] as List<dynamic>)?.map((milli) => DateTime.fromMillisecondsSinceEpoch(milli))?.toList(),
reminders = (json['reminderDates'] as List<dynamic>)
?.map((milli) => DateTime.fromMillisecondsSinceEpoch(milli))
?.toList(),
due = DateTime.fromMillisecondsSinceEpoch(json['dueDate']),
description = json['description'],
text = json['text'],
@ -35,7 +37,8 @@ class Task {
'id': id,
'updated': updated?.millisecondsSinceEpoch,

The reminders should be transfered into an unix timestamp.

Use something like that:

reminders?.map((date) => date.millisecondsSinceEpoch)?.toList()
The reminders should be transfered into an unix timestamp. Use something like that: ```dart reminders?.map((date) => date.millisecondsSinceEpoch)?.toList() ```

Fixed.

Fixed.
'created': created?.millisecondsSinceEpoch,
'reminderDates': reminders?.map((date) => date.millisecondsSinceEpoch)?.toList(),
'reminderDates':
reminders?.map((date) => date.millisecondsSinceEpoch)?.toList(),
'dueDate': due?.millisecondsSinceEpoch,
'description': description,
'text': text,