This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Let's say we want to set a periodic alarm for each Monday, Wednesday and Friday at 9:41. | |
// Run this function on app launch when Alarm.init is done. | |
// It will make sure your periodic alarms are set for the following week. | |
Future<void> periodicAlarms() async { | |
const nbDays = 7; // Number of following days to potentially set alarm | |
const time = TimeOfDay(hour: 9, minute: 41); // Time of the periodic alarm | |
const days = [ | |
DateTime.monday, | |
DateTime.wednesday, | |
DateTime.friday, |