@@ -44,6 +44,7 @@ class AlarmModel {
4444 late String label;
4545 late bool isOneTime;
4646 late int snoozeDuration;
47+ late int maxSnoozeCount;
4748 late int gradient;
4849 late String ringtoneName;
4950 late String note;
@@ -95,6 +96,7 @@ class AlarmModel {
9596 required this .label,
9697 required this .isOneTime,
9798 required this .snoozeDuration,
99+ this .maxSnoozeCount = 3 ,
98100 required this .gradient,
99101 required this .ringtoneName,
100102 required this .note,
@@ -134,6 +136,7 @@ class AlarmModel {
134136 minutesSinceMidnight = documentSnapshot['minutesSinceMidnight' ];
135137 }
136138 snoozeDuration = documentSnapshot['snoozeDuration' ];
139+ maxSnoozeCount = documentSnapshot['maxSnoozeCount' ] ?? 3 ;
137140 gradient = documentSnapshot['gradient' ];
138141 label = documentSnapshot['label' ];
139142 isOneTime = documentSnapshot['isOneTime' ];
@@ -216,6 +219,7 @@ class AlarmModel {
216219 label: map['label' ],
217220 isOneTime: map['isOneTime' ] == 1 ,
218221 snoozeDuration: map['snoozeDuration' ],
222+ maxSnoozeCount: map['maxSnoozeCount' ] ?? 3 ,
219223 gradient: map['gradient' ],
220224 ringtoneName: map['ringtoneName' ],
221225 note: map['note' ],
@@ -268,6 +272,7 @@ class AlarmModel {
268272 'label' : label,
269273 'isOneTime' : isOneTime ? 1 : 0 ,
270274 'snoozeDuration' : snoozeDuration,
275+ 'maxSnoozeCount' : maxSnoozeCount,
271276 'gradient' : gradient,
272277 'ringtoneName' : ringtoneName,
273278 'note' : note,
@@ -289,6 +294,7 @@ class AlarmModel {
289294 AlarmModel .fromMap (Map <String , dynamic > alarmData) {
290295 // Making sure the alarms work with the offsets
291296 snoozeDuration = alarmData['snoozeDuration' ];
297+ maxSnoozeCount = alarmData['maxSnoozeCount' ] ?? 3 ;
292298 gradient = alarmData['gradient' ];
293299 isSharedAlarmEnabled = alarmData['isSharedAlarmEnabled' ];
294300 minutesSinceMidnight = alarmData['minutesSinceMidnight' ];
@@ -304,12 +310,11 @@ class AlarmModel {
304310 isEnabled = alarmData['isEnabled' ];
305311 intervalToAlarm = alarmData['intervalToAlarm' ];
306312 isActivityEnabled = alarmData['isActivityEnabled' ];
307- isWeatherEnabled = alarmData['isWeatherEnabled' ];
308- weatherTypes = List <int >.from (alarmData['weatherTypes' ]);
309-
310313 activityInterval = alarmData['activityInterval' ];
314+
311315 isLocationEnabled = alarmData['isLocationEnabled' ];
312- isSharedAlarmEnabled = alarmData['isSharedAlarmEnabled' ];
316+ isWeatherEnabled = alarmData['isWeatherEnabled' ];
317+ weatherTypes = List <int >.from (alarmData['weatherTypes' ]);
313318 location = alarmData['location' ];
314319
315320 isMathsEnabled = alarmData['isMathsEnabled' ];
@@ -330,9 +335,11 @@ class AlarmModel {
330335
331336 volMin = alarmData['volMin' ];
332337 volMax = alarmData['volMax' ];
338+
333339 activityMonitor = alarmData['activityMonitor' ];
334340 alarmDate = alarmData['alarmDate' ];
335341 profile = alarmData['profile' ];
342+
336343 isGuardian = alarmData['isGuardian' ];
337344 guardianTimer = alarmData['guardianTimer' ];
338345 guardian = alarmData['guardian' ];
@@ -381,6 +388,7 @@ class AlarmModel {
381388 'isPedometerEnabled' : alarmRecord.isPedometerEnabled,
382389 'numberOfSteps' : alarmRecord.numberOfSteps,
383390 'snoozeDuration' : alarmRecord.snoozeDuration,
391+ 'maxSnoozeCount' : alarmRecord.maxSnoozeCount,
384392 'gradient' : alarmRecord.gradient,
385393 'ringtoneName' : alarmRecord.ringtoneName,
386394 'note' : alarmRecord.note,
0 commit comments