Flicker bug fix (#1067)

This commit is contained in:
Ashil 2023-05-04 19:59:55 +05:30 committed by GitHub
commit 85e361d667
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 29 additions and 24 deletions

View file

@ -117,6 +117,7 @@ class _DetailPageState extends State<DetailPage> {
key: _appBarKey,
),
extendBodyBehindAppBar: true,
resizeToAvoidBottomInset: false,
body: Center(
child: Stack(
children: [

View file

@ -91,12 +91,15 @@ class _DynamicLocationGalleryWidgetState
),
builder: (context, snapshot) {
if (snapshot.hasData) {
return LayoutBuilder(
builder: (context, constrains) {
return SizedBox(
height: _galleryHeight(
min(
(widget.memoriesCountNotifier.value ?? 0),
galleryFilesLimit,
),
constrains.maxWidth,
),
child: Gallery(
loadingWidget: const SizedBox.shrink(),
@ -113,6 +116,8 @@ class _DynamicLocationGalleryWidgetState
shouldCollateFilesByDay: false,
),
);
},
);
} else {
return const SizedBox.shrink();
}
@ -121,14 +126,13 @@ class _DynamicLocationGalleryWidgetState
);
}
double _galleryHeight(int fileCount) {
double _galleryHeight(int fileCount, double widthOfGrid) {
final photoGridSize = LocalSettings.instance.getPhotoGridSize();
final totalWhiteSpaceBetweenPhotos =
galleryGridSpacing * (photoGridSize - 1);
final thumbnailHeight =
((MediaQuery.of(context).size.width - totalWhiteSpaceBetweenPhotos) /
photoGridSize);
((widthOfGrid - totalWhiteSpaceBetweenPhotos) / photoGridSize);
final numberOfRows = (fileCount / photoGridSize).ceil();