refactored alarm models
This commit is contained in:
@@ -12,12 +12,15 @@ class LocationAlarm implements Alarm {
|
||||
|
||||
final int radiusMeters;
|
||||
|
||||
@override
|
||||
final AlarmType alarmType;
|
||||
|
||||
const LocationAlarm({
|
||||
required this.id,
|
||||
required this.taskId,
|
||||
required this.location,
|
||||
required this.radiusMeters,
|
||||
});
|
||||
}) : alarmType = AlarmType.location;
|
||||
|
||||
factory LocationAlarm.fromJson(Map<String, dynamic> json) {
|
||||
return LocationAlarm(
|
||||
@@ -35,6 +38,7 @@ class LocationAlarm implements Alarm {
|
||||
'taskId': taskId,
|
||||
'location': location.toJson(),
|
||||
'radiusMeters': radiusMeters,
|
||||
'alarmType': alarmType,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user