我想设置一个定期警报,当用户第一次启动该应用程序时。现在的问题是,如何检查警报是否已设置。
final int dailyAlarmID = 0;
await AndroidAlarmManager.initialize();
runApp(...);
DateTime currentDate = new DateTime.now();
if(alarm.exists){
await AndroidAlarmManager.periodic(
Duration(days: 1), dailyAlarmID, checkForReminders,
rescheduleOnReboot: true,
exact: true,
startAt: DateTime(
currentDate.year, currentDate.month, currentDate.day, 11, 30, 10));
}