AlarmStorage class

Class that handles the local storage of the alarm info.

Constructors

AlarmStorage()

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

prefs ↔ SharedPreferences
Shared preferences instance.
getter/setter pair

Static Methods

getNotificationOnAppKillBody() String
Returns notification on app kill notificationOnAppKillBody.
getNotificationOnAppKillTitle() String
Returns notification on app kill notificationOnAppKillTitle.
getSavedAlarms() List<AlarmSettings>
Returns all alarms info from local storage in the case app is terminated and we need to restore previously scheduled alarms.
hasAlarm() bool
Whether at least one alarm is set.
init() Future<void>
Initializes shared preferences instance.
saveAlarm(AlarmSettings alarmSettings) Future<void>
Saves alarm info in local storage so we can restore it later in the case app is terminated.
setNotificationContentOnAppKill(String title, String body) Future<void>
Saves on app kill notification custom title and body.
unsaveAlarm(int id) Future<void>
Removes alarm from local storage.

Constants

notificationOnAppKill → const String
Key to be used in local storage to identify notification on app kill title.
notificationOnAppKillBody → const String
Key to be used in local storage to identify notification on app kill body.
notificationOnAppKillTitle → const String
Key to be used in local storage to identify notification on app kill body.
prefix → const String
Prefix to be used in local storage to identify alarm info.