Skip to content

Commit

Permalink
feat: loadingbuilder as not original image, change grid spacing for 3…
Browse files Browse the repository at this point in the history
… col
  • Loading branch information
jerichoi224 committed Oct 25, 2023
1 parent a16be9d commit 24322b4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
4 changes: 2 additions & 2 deletions lib/pages/albums_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -237,8 +237,8 @@ class _AlbumsState extends LifecycleListenerState<AlbumsWidget>
SliverPadding(
padding: const EdgeInsets.all(10),
sliver: SliverGrid.count(
crossAxisSpacing: 15,
mainAxisSpacing: 15,
crossAxisSpacing: albumsCol == 2 ? 15 : 10,
mainAxisSpacing: albumsCol == 2 ? 15 : 10,
crossAxisCount: albumsCol,
childAspectRatio: 0.85,
children: albums
Expand Down
9 changes: 5 additions & 4 deletions lib/pages/image_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -107,10 +107,11 @@ class _ImagePageWidgetState extends State<ImagePageWidget>
return PhotoViewGalleryPageOptions(
minScale: min(MediaQuery.of(context).size.width / orientatedSize.width,
MediaQuery.of(context).size.height / orientatedSize.height),
imageProvider: AssetEntityImage(
images[index],
isOriginal: true,
).image);
imageProvider: AssetEntityImage(images[index], isOriginal: true,
loadingBuilder: (context, child, loadingProgress) {
if (loadingProgress == null) return child;
return AssetEntityImage(images[index], isOriginal: false);
}).image);
}

Widget imagePageWrapper(Widget child) {
Expand Down

0 comments on commit 24322b4

Please # to comment.