NotificationAndroidCrontab constructor

NotificationAndroidCrontab({
  1. DateTime? initialDateTime,
  2. DateTime? expirationDateTime,
  3. List<DateTime>? preciseSchedules,
  4. String? crontabExpression,
  5. String? timeZone,
  6. bool allowWhileIdle = false,
  7. bool repeats = false,
  8. bool preciseAlarm = false,
})

Notification Schedule based on crontab rules or a list of valid dates. initialDate: The initial limit date that an schedule is considered valid (YYYY-MM-DD hh:mm:ss) expirationDate: The final limit date that an schedule is considered valid (YYYY-MM-DD hh:mm:ss) crontabExpression: Crontab expression as repetition rule (with seconds precision), as described in https://www.baeldung.com/cron-expressions preciseSchedules: List of precise valid schedule dates allowWhileIdle: Determines if notification will send, even when the device is in critical situation, such as low battery. repeats: Determines if notification will send, even when the device is in critical situation, such as low battery. preciseAlarm Requires maximum precision to schedule notifications at exact time, but may use more battery. Requires the explicit user consent for Android 12 and beyond. timeZone time zone identifier as reference of this schedule date. (https://en.wikipedia.org/wiki/List_of_tz_database_time_zones)

Implementation

NotificationAndroidCrontab(
    {DateTime? initialDateTime,
    DateTime? expirationDateTime,
    List<DateTime>? preciseSchedules,
    String? crontabExpression,
    String? timeZone,
    bool allowWhileIdle = false,
    bool repeats = false,
    bool preciseAlarm = false})
    : _initialDateTime = initialDateTime,
      _expirationDateTime = expirationDateTime,
      _preciseSchedules = preciseSchedules,
      _crontabExpression = crontabExpression,
      super(
          timeZone: timeZone ?? LocalNotifications.localTimeZoneIdentifier,
          allowWhileIdle: allowWhileIdle,
          repeats: repeats,
          preciseAlarm: preciseAlarm);