mirror of
https://github.com/Dr-Blank/Vaani.git
synced 2025-12-07 03:29:29 +00:00
ui: better sleep timer ui in player and fix auto turn on settings (#43)
* refactor: enhance sleep timer functionality and improve duration formatting * refactor: update sleep timer settings handling * refactor: update cancel icon for sleep timer button * refactor: implement isBetween method for TimeOfDay and simplify sleep timer logic * refactor: update alwaysAutoTurnOnTimer default value and improve icon usage in settings * refactor: remove unused IconButton and update sleep timer preset durations
This commit is contained in:
parent
933bfc5750
commit
12100ffbcd
18 changed files with 755 additions and 383 deletions
|
|
@ -60,3 +60,19 @@ class AppSettings extends _$AppSettings {
|
|||
state = const model.AppSettings();
|
||||
}
|
||||
}
|
||||
|
||||
// SleepTimerSettings provider but only rebuilds when the sleep timer settings change
|
||||
@Riverpod(keepAlive: true)
|
||||
class SleepTimerSettings extends _$SleepTimerSettings {
|
||||
@override
|
||||
model.SleepTimerSettings build() {
|
||||
final settings = ref.read(appSettingsProvider).sleepTimerSettings;
|
||||
state = settings;
|
||||
ref.listen(appSettingsProvider, (a, b) {
|
||||
if (a?.sleepTimerSettings != b.sleepTimerSettings) {
|
||||
state = b.sleepTimerSettings;
|
||||
}
|
||||
});
|
||||
return state;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue