Publish an event when icons are changed
This commit is contained in:
parent
d855559bab
commit
7fb3ab02f9
2 changed files with 8 additions and 2 deletions
3
lib/events/icons_changed_event.dart
Normal file
3
lib/events/icons_changed_event.dart
Normal file
|
@ -0,0 +1,3 @@
|
|||
import 'package:ente_auth/events/event.dart';
|
||||
|
||||
class IconsChangedEvent extends Event {}
|
|
@ -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());
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue