fixed json parsing error
This commit is contained in:
@@ -15,7 +15,7 @@ class RelativeTimeAlarm implements Alarm {
|
||||
factory RelativeTimeAlarm.fromJson(Map<String, dynamic> json) {
|
||||
return RelativeTimeAlarm(
|
||||
id: json['id'] as String,
|
||||
triggerAt: Duration(minutes: int.tryParse(json['triggerAt']) ?? 0),
|
||||
triggerAt: Duration(minutes: json['triggerAt'] as int),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -23,7 +23,7 @@ class RelativeTimeAlarm implements Alarm {
|
||||
Map<String, dynamic> toJson() {
|
||||
return {
|
||||
'id': id,
|
||||
'triggerAtMinutes': triggerAt.inMinutes,
|
||||
'triggerAt': triggerAt.inMinutes,
|
||||
'alarmType': alarmType.toJson(),
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user