Ensure that on delete a refresh is triggered

This commit is contained in:
Vishnu Mohandas 2020-06-21 23:19:50 +05:30
parent 985fd2f38a
commit 3660aadd3d

View file

@ -22,15 +22,6 @@ class DeviceFolderPage extends StatefulWidget {
class _DeviceFolderPageState extends State<DeviceFolderPage> {
final logger = Logger("DeviceFolderPageState");
Set<File> _selectedFiles = Set<File>();
StreamSubscription<LocalPhotosUpdatedEvent> _subscription;
@override
void initState() {
_subscription = Bus.instance.on<LocalPhotosUpdatedEvent>().listen((event) {
setState(() {});
});
super.initState();
}
@override
Widget build(Object context) {
@ -54,6 +45,7 @@ class _DeviceFolderPageState extends State<DeviceFolderPage> {
_selectedFiles = selectedFiles;
});
},
reloadEvent: Bus.instance.on<LocalPhotosUpdatedEvent>(),
),
);
}
@ -70,10 +62,4 @@ class _DeviceFolderPageState extends State<DeviceFolderPage> {
}
return filteredFiles;
}
@override
void dispose() {
_subscription.cancel();
super.dispose();
}
}