@@ -56,6 +56,7 @@ abstract final class AppSettingsKeys {
5656 static const themeImportPath = 'theme_import_path' ;
5757 static const themeImportName = 'theme_import_name' ;
5858 static const themeImportedColorsJson = 'theme_imported_colors_json' ;
59+ static const themeAnimationEnabled = 'theme_animation_enabled' ;
5960}
6061
6162/// Bumps [listenable] when any preference is persisted so open screens can reload.
@@ -349,10 +350,34 @@ class AppSettings {
349350 AppSettingsRevision .bump ();
350351 }
351352
353+ /// Smooth color transitions when switching theme (off by default).
354+ Future <bool > getThemeAnimationEnabled () async {
355+ final v = await LocalDb .instance.getAppSetting (
356+ AppSettingsKeys .themeAnimationEnabled,
357+ );
358+ if (v == null || v.isEmpty) return false ;
359+ return v == 'true' || v == '1' ;
360+ }
361+
362+ Future <void > setThemeAnimationEnabled (bool enabled) async {
363+ if (! enabled) {
364+ await LocalDb .instance.deleteAppSetting (
365+ AppSettingsKeys .themeAnimationEnabled,
366+ );
367+ } else {
368+ await LocalDb .instance.setAppSetting (
369+ AppSettingsKeys .themeAnimationEnabled,
370+ 'true' ,
371+ );
372+ }
373+ AppSettingsRevision .bump ();
374+ }
375+
352376 Future <void > clearThemeSettings () async {
353377 await LocalDb .instance.deleteAppSetting (AppSettingsKeys .themeMode);
354378 await LocalDb .instance.deleteAppSetting (AppSettingsKeys .themePreset);
355379 await LocalDb .instance.deleteAppSetting (AppSettingsKeys .themeOverridesJson);
380+ await LocalDb .instance.deleteAppSetting (AppSettingsKeys .themeAnimationEnabled);
356381 await deleteThemeImportKeys ();
357382 AppSettingsRevision .bump ();
358383 }
0 commit comments