NotificationAndroidCrontab.fromDate constructor

NotificationAndroidCrontab.fromDate({
  1. required DateTime date,
  2. int initialSecond = 0,
  3. bool allowWhileIdle = false,
})

Initializes a notification schedule based on a single date reference.

Implementation

NotificationAndroidCrontab.fromDate(
    {required DateTime date, int initialSecond = 0, super.allowWhileIdle})
    : super(
          timeZone: date.isUtc
              ? AwesomeNotifications.utcTimeZoneIdentifier
              : AwesomeNotifications.localTimeZoneIdentifier,
          repeats: false) {
  _initialDateTime = date;
  _crontabExpression = CronHelper().atDate(referenceDateTime: date);
}