Flicker bug fix (#1067)
This commit is contained in:
commit
85e361d667
2 changed files with 29 additions and 24 deletions
|
@ -117,6 +117,7 @@ class _DetailPageState extends State<DetailPage> {
|
|||
key: _appBarKey,
|
||||
),
|
||||
extendBodyBehindAppBar: true,
|
||||
resizeToAvoidBottomInset: false,
|
||||
body: Center(
|
||||
child: Stack(
|
||||
children: [
|
||||
|
|
|
@ -91,27 +91,32 @@ class _DynamicLocationGalleryWidgetState
|
|||
),
|
||||
builder: (context, snapshot) {
|
||||
if (snapshot.hasData) {
|
||||
return SizedBox(
|
||||
height: _galleryHeight(
|
||||
min(
|
||||
(widget.memoriesCountNotifier.value ?? 0),
|
||||
galleryFilesLimit,
|
||||
),
|
||||
),
|
||||
child: Gallery(
|
||||
loadingWidget: const SizedBox.shrink(),
|
||||
disableScroll: true,
|
||||
asyncLoader: (
|
||||
creationStartTime,
|
||||
creationEndTime, {
|
||||
limit,
|
||||
asc,
|
||||
}) async {
|
||||
return snapshot.data as FileLoadResult;
|
||||
},
|
||||
tagPrefix: widget.tagPrefix,
|
||||
shouldCollateFilesByDay: false,
|
||||
),
|
||||
return LayoutBuilder(
|
||||
builder: (context, constrains) {
|
||||
return SizedBox(
|
||||
height: _galleryHeight(
|
||||
min(
|
||||
(widget.memoriesCountNotifier.value ?? 0),
|
||||
galleryFilesLimit,
|
||||
),
|
||||
constrains.maxWidth,
|
||||
),
|
||||
child: Gallery(
|
||||
loadingWidget: const SizedBox.shrink(),
|
||||
disableScroll: true,
|
||||
asyncLoader: (
|
||||
creationStartTime,
|
||||
creationEndTime, {
|
||||
limit,
|
||||
asc,
|
||||
}) async {
|
||||
return snapshot.data as FileLoadResult;
|
||||
},
|
||||
tagPrefix: widget.tagPrefix,
|
||||
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();
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue