removed taskId
This commit is contained in:
@@ -4,24 +4,17 @@ class FixedTimeAlarm implements Alarm {
|
|||||||
@override
|
@override
|
||||||
final String id;
|
final String id;
|
||||||
|
|
||||||
@override
|
|
||||||
final String taskId;
|
|
||||||
|
|
||||||
final DateTime triggerAt;
|
final DateTime triggerAt;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
final AlarmType alarmType;
|
final AlarmType alarmType;
|
||||||
|
|
||||||
const FixedTimeAlarm({
|
const FixedTimeAlarm({required this.id, required this.triggerAt})
|
||||||
required this.id,
|
: alarmType = AlarmType.timeFixed;
|
||||||
required this.taskId,
|
|
||||||
required this.triggerAt,
|
|
||||||
}) : alarmType = AlarmType.timeFixed;
|
|
||||||
|
|
||||||
factory FixedTimeAlarm.fromJson(Map<String, dynamic> json) {
|
factory FixedTimeAlarm.fromJson(Map<String, dynamic> json) {
|
||||||
return FixedTimeAlarm(
|
return FixedTimeAlarm(
|
||||||
id: json['id'] as String,
|
id: json['id'] as String,
|
||||||
taskId: json['taskId'] as String,
|
|
||||||
triggerAt: DateTime.parse(json['triggerAt'] as String),
|
triggerAt: DateTime.parse(json['triggerAt'] as String),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -30,7 +23,6 @@ class FixedTimeAlarm implements Alarm {
|
|||||||
Map<String, dynamic> toJson() {
|
Map<String, dynamic> toJson() {
|
||||||
return {
|
return {
|
||||||
'id': id,
|
'id': id,
|
||||||
'taskId': taskId,
|
|
||||||
'triggerAt': triggerAt.toIso8601String(),
|
'triggerAt': triggerAt.toIso8601String(),
|
||||||
'alarmType': alarmType,
|
'alarmType': alarmType,
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -5,9 +5,6 @@ class LocationAlarm implements Alarm {
|
|||||||
@override
|
@override
|
||||||
final String id;
|
final String id;
|
||||||
|
|
||||||
@override
|
|
||||||
final String taskId;
|
|
||||||
|
|
||||||
final Location location;
|
final Location location;
|
||||||
|
|
||||||
final int radiusMeters;
|
final int radiusMeters;
|
||||||
@@ -17,7 +14,6 @@ class LocationAlarm implements Alarm {
|
|||||||
|
|
||||||
const LocationAlarm({
|
const LocationAlarm({
|
||||||
required this.id,
|
required this.id,
|
||||||
required this.taskId,
|
|
||||||
required this.location,
|
required this.location,
|
||||||
required this.radiusMeters,
|
required this.radiusMeters,
|
||||||
}) : alarmType = AlarmType.location;
|
}) : alarmType = AlarmType.location;
|
||||||
@@ -25,7 +21,6 @@ class LocationAlarm implements Alarm {
|
|||||||
factory LocationAlarm.fromJson(Map<String, dynamic> json) {
|
factory LocationAlarm.fromJson(Map<String, dynamic> json) {
|
||||||
return LocationAlarm(
|
return LocationAlarm(
|
||||||
id: json['id'] as String,
|
id: json['id'] as String,
|
||||||
taskId: json['taskId'] as String,
|
|
||||||
location: Location.fromJson(json['location'] as Map<String, dynamic>),
|
location: Location.fromJson(json['location'] as Map<String, dynamic>),
|
||||||
radiusMeters: json['radiusMeters'] as int,
|
radiusMeters: json['radiusMeters'] as int,
|
||||||
);
|
);
|
||||||
@@ -35,7 +30,6 @@ class LocationAlarm implements Alarm {
|
|||||||
Map<String, dynamic> toJson() {
|
Map<String, dynamic> toJson() {
|
||||||
return {
|
return {
|
||||||
'id': id,
|
'id': id,
|
||||||
'taskId': taskId,
|
|
||||||
'location': location.toJson(),
|
'location': location.toJson(),
|
||||||
'radiusMeters': radiusMeters,
|
'radiusMeters': radiusMeters,
|
||||||
'alarmType': alarmType,
|
'alarmType': alarmType,
|
||||||
|
|||||||
@@ -4,24 +4,17 @@ class RelativeTimeAlarm implements Alarm {
|
|||||||
@override
|
@override
|
||||||
final String id;
|
final String id;
|
||||||
|
|
||||||
@override
|
|
||||||
final String taskId;
|
|
||||||
|
|
||||||
final DateTime triggerAt;
|
final DateTime triggerAt;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
final AlarmType alarmType;
|
final AlarmType alarmType;
|
||||||
|
|
||||||
const RelativeTimeAlarm({
|
const RelativeTimeAlarm({required this.id, required this.triggerAt})
|
||||||
required this.id,
|
: alarmType = AlarmType.timeRelative;
|
||||||
required this.taskId,
|
|
||||||
required this.triggerAt,
|
|
||||||
}) : alarmType = AlarmType.timeRelative;
|
|
||||||
|
|
||||||
factory RelativeTimeAlarm.fromJson(Map<String, dynamic> json) {
|
factory RelativeTimeAlarm.fromJson(Map<String, dynamic> json) {
|
||||||
return RelativeTimeAlarm(
|
return RelativeTimeAlarm(
|
||||||
id: json['id'] as String,
|
id: json['id'] as String,
|
||||||
taskId: json['taskId'] as String,
|
|
||||||
triggerAt: DateTime.parse(json['triggerAt'] as String),
|
triggerAt: DateTime.parse(json['triggerAt'] as String),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -30,7 +23,6 @@ class RelativeTimeAlarm implements Alarm {
|
|||||||
Map<String, dynamic> toJson() {
|
Map<String, dynamic> toJson() {
|
||||||
return {
|
return {
|
||||||
'id': id,
|
'id': id,
|
||||||
'taskId': taskId,
|
|
||||||
'triggerAt': triggerAt.toIso8601String(),
|
'triggerAt': triggerAt.toIso8601String(),
|
||||||
'alarmType': alarmType,
|
'alarmType': alarmType,
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user