NotificationAndroidCrontab.fromDate constructor

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

Initialize a notification crontab schedule based on a date reference

Implementation

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