SettingsController class

A class that many Widgets can interact with to read user settings, update user settings, or listen to user settings changes.

Controllers glue Data Services to Flutter Widgets. The SettingsController uses the SettingsService to store and retrieve user settings.

Mixed-in types

Constructors

SettingsController(SettingsService _settingsService, ThemeMode _themeMode, SharedPreferences _sharedPreferences, NotificationService _notificationService, ClientContext _clientContext)

Properties

cardinalitySelection CardinalitySelection
no setter
clientContext ClientContext
no setter
hashCode int
The hash code for this object.
no setterinherited
hasListeners bool
Whether any listeners are currently registered.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
streakEngine StreakEngine
no setter
themeMode ThemeMode
no setter

Methods

addListener(VoidCallback listener) → void
Register a closure to be called when the object changes.
inherited
cancelNotifications() Future<void>
dispose() → void
Discards any resources used by the object. After this is called, the object is not in a usable state and should be discarded (calls to addListener will throw after the object is disposed).
inherited
isNotificationEnabled() bool
loadSettings() Future<void>
Load the user's settings from the SettingsService. It may load from a local database or the internet. The controller only knows it can load the settings from the service.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
notificationTime() TimeOfDay
notifyListeners() → void
Call all the registered listeners.
inherited
removeListener(VoidCallback listener) → void
Remove a previously registered closure from the list of closures that are notified when the object changes.
inherited
scheduleNotification({required int hour, required int minute, required String title, required String body, required String payload}) Future<void>
showLocalNotificationAfterSeconds({required int seconds, required int id, required String title, required String body, required String payload}) Future<void>
toString() String
A string representation of this object.
inherited
updateCardinalitySelection() Future<void>
Update and persist the cardinality settings based on the user's selection.
updateNotificationEnabled(bool value) Future<void>
updateStreakEngine() Future<void>
Update and persist the StreakEngine based on the user's actions.
updateThemeMode(ThemeMode? newThemeMode) Future<void>
Update and persist the ThemeMode based on the user's selection.

Operators

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