Fix State-loss of 'Select all' button for a group when scrolling it out and in of view

This commit is contained in:
ashilkn 2023-07-13 11:37:42 +05:30
parent a03f92cf5a
commit 48f45961b6

View file

@ -63,9 +63,12 @@ class _LazyGroupGalleryState extends State<LazyGroupGallery> {
@override
void initState() {
//this is for removing the 'select all from day' icon on unselecting all files with 'cancel'
super.initState();
if (widget.selectedFiles != null &&
widget.selectedFiles!.files.isNotEmpty) {
_areAllFromGroupSelected.value =
widget.selectedFiles!.files.containsAll(widget.files);
}
widget.selectedFiles?.addListener(_selectedFilesListener);
_showSelectAllButton = ValueNotifier(widget.showSelectAllByDefault);
_init();