|
@@ -27,6 +27,7 @@ class LazyGroupGallery extends StatefulWidget {
|
|
final int photoGridSize;
|
|
final int photoGridSize;
|
|
final bool enableFileGrouping;
|
|
final bool enableFileGrouping;
|
|
final bool limitSelectionToOne;
|
|
final bool limitSelectionToOne;
|
|
|
|
+ final bool showSelectAllByDefault;
|
|
LazyGroupGallery(
|
|
LazyGroupGallery(
|
|
this.files,
|
|
this.files,
|
|
this.index,
|
|
this.index,
|
|
@@ -36,7 +37,8 @@ class LazyGroupGallery extends StatefulWidget {
|
|
this.selectedFiles,
|
|
this.selectedFiles,
|
|
this.tag,
|
|
this.tag,
|
|
this.currentIndexStream,
|
|
this.currentIndexStream,
|
|
- this.enableFileGrouping, {
|
|
|
|
|
|
+ this.enableFileGrouping,
|
|
|
|
+ this.showSelectAllByDefault, {
|
|
this.logTag = "",
|
|
this.logTag = "",
|
|
this.photoGridSize = photoGridSizeDefault,
|
|
this.photoGridSize = photoGridSizeDefault,
|
|
this.limitSelectionToOne = false,
|
|
this.limitSelectionToOne = false,
|
|
@@ -57,14 +59,15 @@ class _LazyGroupGalleryState extends State<LazyGroupGallery> {
|
|
late StreamSubscription<int> _currentIndexSubscription;
|
|
late StreamSubscription<int> _currentIndexSubscription;
|
|
bool? _shouldRender;
|
|
bool? _shouldRender;
|
|
final ValueNotifier<bool> _toggleSelectAllFromDay = ValueNotifier(false);
|
|
final ValueNotifier<bool> _toggleSelectAllFromDay = ValueNotifier(false);
|
|
- final ValueNotifier<bool> _showSelectAllButton = ValueNotifier(false);
|
|
|
|
|
|
+ late final ValueNotifier<bool> _showSelectAllButton;
|
|
final ValueNotifier<bool> _areAllFromDaySelected = ValueNotifier(false);
|
|
final ValueNotifier<bool> _areAllFromDaySelected = ValueNotifier(false);
|
|
|
|
|
|
@override
|
|
@override
|
|
void initState() {
|
|
void initState() {
|
|
//this is for removing the 'select all from day' icon on unselecting all files with 'cancel'
|
|
//this is for removing the 'select all from day' icon on unselecting all files with 'cancel'
|
|
- widget.selectedFiles?.addListener(_selectedFilesListener);
|
|
|
|
super.initState();
|
|
super.initState();
|
|
|
|
+ widget.selectedFiles?.addListener(_selectedFilesListener);
|
|
|
|
+ _showSelectAllButton = ValueNotifier(widget.showSelectAllByDefault);
|
|
_init();
|
|
_init();
|
|
}
|
|
}
|
|
|
|
|
|
@@ -223,7 +226,7 @@ class _LazyGroupGalleryState extends State<LazyGroupGallery> {
|
|
}
|
|
}
|
|
|
|
|
|
void _selectedFilesListener() {
|
|
void _selectedFilesListener() {
|
|
- if (widget.selectedFiles!.files.isEmpty) {
|
|
|
|
|
|
+ if (widget.selectedFiles!.files.isEmpty && !widget.showSelectAllByDefault) {
|
|
_showSelectAllButton.value = false;
|
|
_showSelectAllButton.value = false;
|
|
} else {
|
|
} else {
|
|
_showSelectAllButton.value = true;
|
|
_showSelectAllButton.value = true;
|