Exclude semantics to improve performance of gallery
This commit is contained in:
parent
a4b6ea66ae
commit
21e836643b
4 changed files with 17 additions and 11 deletions
lib/ui
huge_listview
viewer/gallery/component/grid
test_driver
|
@ -176,7 +176,9 @@ class HugeListViewState<T> extends State<HugeListView<T>> {
|
|||
initialScrollIndex: widget.startIndex,
|
||||
itemCount: max(widget.totalCount, 0),
|
||||
itemBuilder: (context, index) {
|
||||
return widget.itemBuilder(context, index);
|
||||
return ExcludeSemantics(
|
||||
child: widget.itemBuilder(context, index),
|
||||
);
|
||||
},
|
||||
),
|
||||
)
|
||||
|
|
|
@ -31,15 +31,17 @@ class GalleryGridViewWidget extends StatelessWidget {
|
|||
physics: const NeverScrollableScrollPhysics(),
|
||||
// to disable GridView's scrolling
|
||||
itemBuilder: (context, index) {
|
||||
return GalleryFileWidget(
|
||||
file: filesInGroup[index],
|
||||
selectedFiles: selectedFiles,
|
||||
limitSelectionToOne: limitSelectionToOne,
|
||||
tag: tag,
|
||||
photoGridSize: photoGridSize,
|
||||
currentUserID: currentUserID,
|
||||
filesInGroup: filesInGroup,
|
||||
asyncLoader: asyncLoader,
|
||||
return ExcludeSemantics(
|
||||
child: GalleryFileWidget(
|
||||
file: filesInGroup[index],
|
||||
selectedFiles: selectedFiles,
|
||||
limitSelectionToOne: limitSelectionToOne,
|
||||
tag: tag,
|
||||
photoGridSize: photoGridSize,
|
||||
currentUserID: currentUserID,
|
||||
filesInGroup: filesInGroup,
|
||||
asyncLoader: asyncLoader,
|
||||
),
|
||||
);
|
||||
},
|
||||
itemCount: filesInGroup.length,
|
||||
|
|
|
@ -32,7 +32,7 @@ class PlaceHolderGridViewWidget extends StatelessWidget {
|
|||
shrinkWrap: true,
|
||||
physics: const NeverScrollableScrollPhysics(),
|
||||
itemBuilder: (context, index) {
|
||||
return Container(color: faintColor);
|
||||
return ExcludeSemantics(child: Container(color: faintColor));
|
||||
},
|
||||
itemCount: limitCount,
|
||||
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
import 'package:flutter_driver/flutter_driver.dart' as driver;
|
||||
import 'package:integration_test/integration_test_driver.dart';
|
||||
|
||||
///https://api.flutter.dev/flutter/flutter_driver/TimelineSummary/summaryJson.html
|
||||
|
||||
Future<void> main() {
|
||||
return integrationDriver(
|
||||
responseDataCallback: (data) async {
|
||||
|
|
Loading…
Add table
Reference in a new issue