Use better way to handle gallery with no images and page with no images

This commit is contained in:
2024-06-02 07:49:03 +00:00
committed by GitHub
parent 9e0aa9ca84
commit f5666a8c46
7 changed files with 54 additions and 14 deletions

View File

@@ -10,7 +10,7 @@ class GalleryBasicInfo extends StatelessWidget {
const GalleryBasicInfo(this.gMeta, this.firstPage,
{super.key, this.fileId, this.gData, this.files});
final GMeta gMeta;
final ExtendedPMeta firstPage;
final ExtendedPMeta? firstPage;
final int? fileId;
final GalleryData? gData;
final EhFiles? files;
@@ -27,7 +27,9 @@ class GalleryBasicInfo extends StatelessWidget {
flex: 2,
child: Container(
margin: const EdgeInsets.only(right: 8),
child: Thumbnail(firstPage, fileId: fileId, gid: gMeta.gid),
child: firstPage != null
? Thumbnail(firstPage!, fileId: fileId, gid: gMeta.gid)
: Container(),
)),
Expanded(
flex: 3,