NotificationAndroidCrontab.monthly constructor

NotificationAndroidCrontab.monthly({
  1. required DateTime referenceDateTime,
  2. bool allowWhileIdle = false,
})

Initializes a notification crontab schedule to be triggered monthly at a specific date and time. referenceDateTime: The date and time at which the notification should be scheduled each month. allowWhileIdle: Allows the notification to display even when the device is in low battery mode.

Implementation

NotificationAndroidCrontab.monthly(
    {required DateTime referenceDateTime, super.allowWhileIdle})
    : super(
          timeZone: referenceDateTime.isUtc
              ? AwesomeNotifications.utcTimeZoneIdentifier
              : AwesomeNotifications.localTimeZoneIdentifier,
          repeats: false) {
  _crontabExpression =
      CronHelper().monthly(referenceDateTime: referenceDateTime);
}