Fixed app not working with the newest api change which has multiple reminders (#19)
All checks were successful
the build was successful
All checks were successful
the build was successful
This commit is contained in:
parent
62d7261a63
commit
563fe1fc4d
|
@ -3,7 +3,8 @@ import 'package:meta/meta.dart';
|
||||||
|
|
||||||
class Task {
|
class Task {
|
||||||
final int id;
|
final int id;
|
||||||
final DateTime created, updated, reminder, due;
|
final DateTime created, updated, due;
|
||||||
|
final List<DateTime> reminders;
|
||||||
final String text, description;
|
final String text, description;
|
||||||
final bool done;
|
final bool done;
|
||||||
final User owner;
|
final User owner;
|
||||||
|
@ -12,7 +13,7 @@ class Task {
|
||||||
{@required this.id,
|
{@required this.id,
|
||||||
this.created,
|
this.created,
|
||||||
this.updated,
|
this.updated,
|
||||||
this.reminder,
|
this.reminders,
|
||||||
this.due,
|
this.due,
|
||||||
@required this.text,
|
@required this.text,
|
||||||
this.description,
|
this.description,
|
||||||
|
@ -23,7 +24,9 @@ class Task {
|
||||||
: id = json['id'],
|
: id = json['id'],
|
||||||
updated = DateTime.fromMillisecondsSinceEpoch(json['updated']),
|
updated = DateTime.fromMillisecondsSinceEpoch(json['updated']),
|
||||||
created = DateTime.fromMillisecondsSinceEpoch(json['created']),
|
created = DateTime.fromMillisecondsSinceEpoch(json['created']),
|
||||||
reminder = DateTime.fromMillisecondsSinceEpoch(json['reminderDate']),
|
reminders = (json['reminderDates'] as List<dynamic>)
|
||||||
|
?.map((milli) => DateTime.fromMillisecondsSinceEpoch(milli))
|
||||||
|
?.toList(),
|
||||||
due = DateTime.fromMillisecondsSinceEpoch(json['dueDate']),
|
due = DateTime.fromMillisecondsSinceEpoch(json['dueDate']),
|
||||||
description = json['description'],
|
description = json['description'],
|
||||||
text = json['text'],
|
text = json['text'],
|
||||||
|
@ -34,7 +37,8 @@ class Task {
|
||||||
'id': id,
|
'id': id,
|
||||||
'updated': updated?.millisecondsSinceEpoch,
|
'updated': updated?.millisecondsSinceEpoch,
|
||||||
'created': created?.millisecondsSinceEpoch,
|
'created': created?.millisecondsSinceEpoch,
|
||||||
'reminderDate': reminder?.millisecondsSinceEpoch,
|
'reminderDates':
|
||||||
|
reminders?.map((date) => date.millisecondsSinceEpoch)?.toList(),
|
||||||
'dueDate': due?.millisecondsSinceEpoch,
|
'dueDate': due?.millisecondsSinceEpoch,
|
||||||
'description': description,
|
'description': description,
|
||||||
'text': text,
|
'text': text,
|
||||||
|
|
|
@ -14,6 +14,7 @@ dependencies:
|
||||||
# Use with the CupertinoIcons class for iOS style icons.
|
# Use with the CupertinoIcons class for iOS style icons.
|
||||||
cupertino_icons: ^0.1.2
|
cupertino_icons: ^0.1.2
|
||||||
flutter_secure_storage: 3.1.1
|
flutter_secure_storage: 3.1.1
|
||||||
|
http: 0.12.0
|
||||||
|
|
||||||
dev_dependencies:
|
dev_dependencies:
|
||||||
flutter_test:
|
flutter_test:
|
||||||
|
|
Reference in New Issue
Block a user