Remove unnecessary GlobalKey

This commit is contained in:
ashilkn 2023-07-07 19:03:45 +05:30
parent db9148b7ac
commit 76eb0d52b3
2 changed files with 0 additions and 7 deletions

View file

@ -22,7 +22,6 @@ If a group has more than 400 files, LazyGroupGallery internally divides the
group into multiple grid views during rendering.
*/
class MultipleGroupsGalleryView extends StatelessWidget {
final GlobalKey<HugeListViewState<dynamic>> hugeListViewKey;
final ItemScrollController itemScroller;
final List<List<File>> groupedFiles;
final bool disableScroll;
@ -43,7 +42,6 @@ class MultipleGroupsGalleryView extends StatelessWidget {
final bool isScrollablePositionedList;
const MultipleGroupsGalleryView({
required this.hugeListViewKey,
required this.itemScroller,
required this.groupedFiles,
required this.disableScroll,
@ -68,7 +66,6 @@ class MultipleGroupsGalleryView extends StatelessWidget {
@override
Widget build(BuildContext context) {
return HugeListView<List<File>>(
key: hugeListViewKey,
controller: itemScroller,
startIndex: 0,
totalCount: groupedFiles.length,

View file

@ -12,7 +12,6 @@ import 'package:photos/models/file.dart';
import 'package:photos/models/file_load_result.dart';
import 'package:photos/models/selected_files.dart';
import 'package:photos/ui/common/loading_widget.dart';
import 'package:photos/ui/huge_listview/huge_listview.dart';
import "package:photos/ui/viewer/gallery/component/multiple_groups_gallery_view.dart";
import 'package:photos/ui/viewer/gallery/empty_state.dart';
import "package:photos/ui/viewer/gallery/state/gallery_sort_order.dart";
@ -83,8 +82,6 @@ class Gallery extends StatefulWidget {
class _GalleryState extends State<Gallery> {
static const int kInitialLoadLimit = 100;
final _hugeListViewKey = GlobalKey<HugeListViewState>();
late Logger _logger;
List<List<File>> _currentGroupedFiles = [];
bool _hasLoadedFiles = false;
@ -226,7 +223,6 @@ class _GalleryState extends State<Gallery> {
return GallerySortOrder(
sortOrderAsc: _sortOrderAsc,
child: MultipleGroupsGalleryView(
hugeListViewKey: _hugeListViewKey,
itemScroller: _itemScroller,
groupedFiles: _currentGroupedFiles,
disableScroll: widget.disableScroll,