NotificationAndroidCrontab class

(Only for Android devices) Represents a notification scheduling configuration based on crontab rules or a list of valid dates.

Inheritance

Constructors

NotificationAndroidCrontab({DateTime? initialDateTime, DateTime? expirationDateTime, List<DateTime>? preciseSchedules, String? crontabExpression, String? timeZone, bool allowWhileIdle = false, bool repeats = false, bool preciseAlarm = true})
Constructs a NotificationAndroidCrontab with various crontab-based scheduling options.
NotificationAndroidCrontab.daily({required DateTime referenceDateTime, bool allowWhileIdle = false})
Initializes a notification crontab schedule to be triggered daily at a specific time. referenceDateTime: The time at which the notification should be scheduled each day. allowWhileIdle: Allows the notification to display even when the device is in low battery mode.
NotificationAndroidCrontab.fromDate({required DateTime date, int initialSecond = 0, bool allowWhileIdle = false})
Initializes a notification schedule based on a single date reference.
NotificationAndroidCrontab.hourly({required DateTime referenceDateTime, bool allowWhileIdle = false})
Initializes a notification crontab schedule to be triggered hourly at a specific minute and second. referenceDateTime: The minute and second at which the notification should be scheduled each hour. allowWhileIdle: Allows the notification to display even when the device is in low battery mode.
NotificationAndroidCrontab.minutely({required DateTime referenceDateTime, bool allowWhileIdle = false})
Initializes a notification crontab schedule to be triggered every minute at a specific second. referenceDateTime: The second at which the notification should be scheduled each minute. allowWhileIdle: Allows the notification to display even when the device is in low battery mode.
NotificationAndroidCrontab.monthly({required DateTime referenceDateTime, 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.
NotificationAndroidCrontab.weekendDay({required DateTime referenceDateTime, bool allowWhileIdle = false})
Initializes a notification crontab schedule to be triggered on weekend days (Saturday and Sunday) at a specific time. referenceDateTime: The time at which the notification should be scheduled on weekend days. allowWhileIdle: Allows the notification to display even when the device is in low battery mode.
NotificationAndroidCrontab.weekly({required DateTime referenceDateTime, bool allowWhileIdle = false})
Initializes a notification crontab schedule to be triggered weekly at a specific date and time. referenceDateTime: The date and time at which the notification should be scheduled each week. allowWhileIdle: Allows the notification to display even when the device is in low battery mode.
NotificationAndroidCrontab.workweekDay({required DateTime referenceDateTime, bool allowWhileIdle = false})
Initializes a notification crontab schedule to be triggered on workweek days (Monday to Friday) at a specific time. referenceDateTime: The time at which the notification should be scheduled on workweek days. allowWhileIdle: Allows the notification to display even when the device is in low battery mode.
NotificationAndroidCrontab.yearly({required DateTime referenceDateTime, bool allowWhileIdle = false})
Initializes a notification crontab schedule to be triggered yearly at a specific date and time. referenceDateTime: The date and time at which the notification should be scheduled each year. allowWhileIdle: Allows the notification to display even when the device is in low battery mode.

Properties

allowWhileIdle bool
Allows the notification to be displayed even when the device is in low battery mode.
getter/setter pairinherited
crontabExpression String?
Gets the crontab expression as a repetition rule with seconds precision (if set to *, considers all possible values for the respective component as valid). For more information, please take a look at https://www.baeldung.com/cron-expressions
no setter
delayTolerance int
Delay tolerance in milliseconds for scheduling the notification. Minimum tolerance is typically 600,000 ms (10 minutes).
getter/setter pairinherited
expirationDateTime DateTime?
Gets the final limit date that a schedule is considered valid.
no setter
hashCode int
The hash code for this object.
no setterinherited
initialDateTime DateTime?
Gets the initial limit date that a schedule is considered valid.
no setter
preciseAlarm bool
Requires precise timing for the notification schedule, especially important on devices with strict power-saving features.
getter/setter pairinherited
preciseSchedules List<DateTime>?
Gets a list of precise valid schedule dates.
no setter
repeats bool
Indicates whether the notification should be delivered once (false) or rescheduled each time it's delivered (true).
getter/setter pairinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
timeZone String
Full time zone identifier for scheduling the notification. Example: 'America/Sao_Paulo', 'America/New_York', 'Europe/Helsinki'.
getter/setter pairinherited

Methods

fromMap(Map<String, dynamic> mapData) NotificationAndroidCrontab?
Creates a NotificationAndroidCrontab instance from a map of data.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toMap() Map<String, dynamic>
Converts the NotificationAndroidCrontab instance to a map.
override
toString() String
Returns a string representation of the NotificationAndroidCrontab instance.
validate() → void
Validates the crontab schedule settings.

Operators

operator ==(Object other) bool
The equality operator.
inherited