Alarm class

Class that handles the alarm.

Constructors

Alarm()

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

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

Static Properties

android bool
Whether it's Android device.
no setter
iOS bool
Whether it's iOS device.
no setter
ringing → ValueStream<AlarmSet>
Stream of the ringing alarms.
no setter
ringStream StreamController<AlarmSettings>
Stream of the ringing status.
final
scheduled → ValueStream<AlarmSet>
Stream of the scheduled alarms.
no setter
updateStream StreamController<int>
Stream of the alarm updates.
final

Static Methods

alarmRang(AlarmSettings alarm) → void
PRIVATE: Called by the native platform when the alarm rings.
alarmSettingsValidation(AlarmSettings alarmSettings) → void
Validates alarmSettings fields.
checkAlarm() Future<void>
Checks if some alarms were set on previous session. If it's the case then reschedules them.
getAlarm(int id) Future<AlarmSettings?>
Returns alarm by given id. Returns null if not found.
getAlarms() Future<List<AlarmSettings>>
Returns all the alarms.
hasAlarm() Future<bool>
Whether an alarm is set.
init() Future<void>
Initializes Alarm services.
isRinging([int? id]) Future<bool>
Whether the alarm is ringing.
set({required AlarmSettings alarmSettings}) Future<bool>
Schedules an alarm with given alarmSettings with its notification.
setWarningNotificationOnKill(String title, String body) Future<void>
When the app is killed, all the processes are terminated so the alarm may never ring. By default, to warn the user, a notification is shown at the moment he kills the app. This methods allows you to customize this notification content.
stop(int id) Future<bool>
Stops alarm.
stopAll() Future<void>
Stops all the alarms.