NotificationCalendar.fromDate constructor

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

Initializes a NotificationCalendar from a DateTime object.

Implementation

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