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

fgbgSubscription StreamSubscription<FGBGType>
Stream subscription to listen to foreground/background events.
getter/setter pair
prefs ↔ SharedPreferences
Shared preferences instance.
getter/setter pair

Static Methods

dispose() → void
Dispose the fgbg subscription to avoid memory leaks.
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.
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.