NotificationCalendar class
Represents a notification scheduling configuration based on calendar components.
Constructors
- NotificationCalendar({int? era, int? year, int? month, int? day, int? hour, int? minute, int? second, int? millisecond, int? weekday, int? weekOfMonth, int? weekOfYear, String? timeZone, bool allowWhileIdle = false, bool preciseAlarm = true, bool repeats = false})
-
Notification Schedule based on calendar components. At least one date parameter is required.
eraSchedule era conditionyearSchedule year conditionmonthSchedule month conditiondaySchedule day conditionhourSchedule hour conditionminuteSchedule minute conditionsecondSchedule second conditionweekdaySchedule weekday conditionweekOfMonthSchedule weekOfMonth conditionweekOfMonthSchedule weekOfMonth conditionweekOfYearSchedule weekOfYear conditionallowWhileIdleDisplays the notification, even when the device is low batteryrepeatsDefines if the notification should play only once or keeps repeatingpreciseAlarmRequires maximum precision to schedule notifications at exact time, but may use more battery. Requires the explicit user consent for Android 12 and beyond.timeZonetime zone identifier as reference of this schedule date. (https://en.wikipedia.org/wiki/List_of_tz_database_time_zones) - NotificationCalendar.fromDate({required DateTime date, bool allowWhileIdle = false, bool repeats = false, bool preciseAlarm = false})
- Initializes a NotificationCalendar from a DateTime object.
Properties
- allowWhileIdle ↔ bool
-
Allows the notification to be displayed even when the device is in low battery mode.
getter/setter pairinherited
- day ↔ int?
-
The day of the month (1-31) for scheduling the notification.
getter/setter pair
- delayTolerance ↔ int
-
Delay tolerance in milliseconds for scheduling the notification. Minimum tolerance is typically 600,000 ms (10 minutes).
getter/setter pairinherited
- era ↔ int?
-
The era for scheduling, e.g., AD or BC in the Julian calendar.
getter/setter pair
- hashCode → int
-
The hash code for this object.
no setterinherited
- hour ↔ int?
-
The hour of the day (0-23) for scheduling the notification.
getter/setter pair
- millisecond ↔ int?
-
Millisecond precision is deprecated due to device limitations. This field will be ignored.
getter/setter pair
- minute ↔ int?
-
The minute within the hour (0-59) for scheduling the notification.
getter/setter pair
- month ↔ int?
-
The month of the year (1-12) for scheduling the notification.
getter/setter pair
- preciseAlarm ↔ bool
-
Requires precise timing for the notification schedule, especially important on devices with strict power-saving features.
getter/setter pairinherited
- 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
- second ↔ int?
-
The second within the minute (0-59) for scheduling the notification.
getter/setter pair
- timeZone ↔ String
-
Full time zone identifier for scheduling the notification. Example: 'America/Sao_Paulo', 'America/New_York', 'Europe/Helsinki'.
getter/setter pairinherited
- weekday ↔ int?
-
The day of the week (1 = Monday) for scheduling the notification.
getter/setter pair
- weekOfMonth ↔ int?
-
The count of weeks of the month for scheduling. This parameter is now deprecated and will be no longer supported.
getter/setter pair
- weekOfYear ↔ int?
-
The week of the year for scheduling the notification.
getter/setter pair
- year ↔ int?
-
The year for scheduling the notification.
getter/setter pair
Methods
-
fromMap(
Map< String, dynamic> mapData) → NotificationCalendar? - Creates a NotificationCalendar instance from a map of data.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toMap(
) → Map< String, dynamic> - Converts the NotificationCalendar instance to a map.
-
toString(
) → String - Returns a string representation of the NotificationCalendar instance.
-
validate(
) → void - Validates the calendar schedule settings.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited