NotificationCalendar.fromDate constructor

NotificationCalendar.fromDate({
  1. required DateTime date,
  2. bool allowWhileIdle = false,
  3. bool repeats = false,
  4. bool preciseAlarm = false,
})

Initialize a notification schedule calendar based on a date object

Implementation

NotificationCalendar.fromDate(
    {required DateTime date,
    bool allowWhileIdle = false,
    bool repeats = false,
    bool preciseAlarm = false})
    : super(
          timeZone: date.isUtc
              ? LocalNotifications.utcTimeZoneIdentifier
              : LocalNotifications.localTimeZoneIdentifier,
          allowWhileIdle: allowWhileIdle,
          repeats: repeats,
          preciseAlarm: preciseAlarm) {
  year = date.year;
  month = date.month;
  day = date.day;
  hour = date.hour;
  minute = date.minute;
  second = date.second;
}