NotificationAndroidCrontab class
Constructors
-
NotificationAndroidCrontab({DateTime? initialDateTime, DateTime? expirationDateTime, List<DateTime>? preciseSchedules, String? crontabExpression, String? timeZone, bool allowWhileIdle = false, bool repeats = false, 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)
-
NotificationAndroidCrontab.daily({required DateTime referenceDateTime, bool allowWhileIdle = false})
-
Generates a Cron expression to be played only once at day based on a date reference
-
NotificationAndroidCrontab.fromDate({required DateTime date, int initialSecond = 0, bool allowWhileIdle = false})
-
Initialize a notification crontab schedule based on a date reference
-
NotificationAndroidCrontab.hourly({required DateTime referenceDateTime, bool allowWhileIdle = false})
-
Generates a Cron expression to be played only once at hour based on a date reference
-
NotificationAndroidCrontab.minutely({required DateTime referenceDateTime, bool allowWhileIdle = false})
-
Generates a Cron expression to be played only once at every minute based on a date reference
-
NotificationAndroidCrontab.monthly({required DateTime referenceDateTime, bool allowWhileIdle = false})
-
Generates a Cron expression to be played only once at month based on a date reference
-
NotificationAndroidCrontab.weekendDay({required DateTime referenceDateTime, bool allowWhileIdle = false})
-
Generates a Cron expression to be played only on weekend days based on a date reference
-
NotificationAndroidCrontab.weekly({required DateTime referenceDateTime, bool allowWhileIdle = false})
-
Generates a Cron expression to be played only once at week based on a date reference
-
NotificationAndroidCrontab.workweekDay({required DateTime referenceDateTime, bool allowWhileIdle = false})
-
Generates a Cron expression to be played only on workweek days based on a date reference
-
NotificationAndroidCrontab.yearly({required DateTime referenceDateTime, bool allowWhileIdle = false})
-
Generates a Cron expression to be played only once at year based on a date reference
Properties
-
allowWhileIdle
↔ bool
-
Displays the notification, even when the device is low battery
getter/setter pairinherited
-
createdDate
→ String?
-
Reference
no setterinherited
-
crontabExpression
→ String?
-
Crontab expression as repetition rule (with seconds precision), as described in https://www.baeldung.com/cron-expressions
no setter
-
expirationDateTime
→ DateTime?
-
The final limit date that an schedule is considered valid (YYYY-MM-DD hh:mm:ss)
no setter
-
hashCode
→ int
-
The hash code for this object.
no setterinherited
-
initialDateTime
→ DateTime?
-
The initial limit date that an schedule is considered valid (YYYY-MM-DD hh:mm:ss)
no setter
-
preciseAlarm
↔ bool
-
Displays the notification at precise date, even when the device is low battery. Requires explicity permission in Android 12 and beyond.
getter/setter pairinherited
-
preciseSchedules
→ List<DateTime>?
-
List of precise valid schedule dates
no setter
-
repeats
↔ bool
-
Specify false to deliver the notification one time. Specify true to reschedule the notification request each time the notification is delivered.
getter/setter pairinherited
-
runtimeType
→ Type
-
A representation of the runtime type of the object.
no setterinherited
-
timeZone
↔ String
-
Full time zone identifier to schedule a notification, in english (ex: America/Sao_Paulo, America/New_York, Europe/Helsinki or GMT-07:00)
getter/setter pairinherited