Publish an event when icons are changed

This commit is contained in:
vishnukvmd 2023-09-08 18:01:45 +05:30
parent d855559bab
commit 7fb3ab02f9
2 changed files with 8 additions and 2 deletions

View file

@ -0,0 +1,3 @@
import 'package:ente_auth/events/event.dart';
class IconsChangedEvent extends Event {}

View file

@ -1,3 +1,5 @@
import 'package:ente_auth/core/event_bus.dart';
import 'package:ente_auth/events/icons_changed_event.dart';
import 'package:shared_preferences/shared_preferences.dart';
class PreferenceService {
@ -34,7 +36,8 @@ class PreferenceService {
}
}
Future<void> setShowLargeIcons(bool value) {
return _prefs.setBool(kShouldShowLargeIconsKey, value);
Future<void> setShowLargeIcons(bool value) async {
await _prefs.setBool(kShouldShowLargeIconsKey, value);
Bus.instance.fire(IconsChangedEvent());
}
}