NotificationInterval constructor

NotificationInterval({
  1. required int? interval,
  2. String? timeZone,
  3. bool allowWhileIdle = false,
  4. bool repeats = false,
  5. bool preciseAlarm = true,
})

Constructs a NotificationInterval object with various scheduling options.

interval specifies the time interval between each notification (minimum of 60 seconds if repeating). timeZone specifies the time zone identifier as a reference for the schedule date. allowWhileIdle allows the notification to be displayed even when the device is in low battery mode. repeats determines whether the notification should play only once or keep repeating. preciseAlarm enables maximum precision for scheduling notifications at exact times, which may consume more battery. Requires explicit user consent on Android 12 and beyond.

Implementation

NotificationInterval(
    {required this.interval,
    String? timeZone,
    super.allowWhileIdle,
    super.repeats,
    super.preciseAlarm = true})
    : super(
          timeZone: timeZone ?? AwesomeNotifications.localTimeZoneIdentifier);