[new gallery] Reisze gallery images (#147882)

Some cause of jank on both Skia and Impeller are these massive images. We should just resize them so that the noise is reduced and we can see other performance issues.

Fixes https://github.com/flutter/flutter/issues/147797

Tested: this is a test!
This commit is contained in:
Jonah Williams 2024-05-06 12:20:32 -07:00 committed by GitHub
parent af84f6b847
commit 5230ec5ba4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 14 additions and 6 deletions

View File

@ -337,9 +337,13 @@ class _CraneAppBarState extends State<CraneAppBar> {
children: <Widget>[
const ExcludeSemantics(
child: FadeInImagePlaceholder(
image: AssetImage(
'crane/logo/logo.png',
package: 'flutter_gallery_assets',
image: ResizeImage(
AssetImage(
'crane/logo/logo.png',
package: 'flutter_gallery_assets',
),
width: 40,
height: 60,
),
placeholder: SizedBox(
width: 40,

View File

@ -101,9 +101,13 @@ class _DestinationImage extends StatelessWidget {
label: destination.assetSemanticLabel,
child: ExcludeSemantics(
child: FadeInImagePlaceholder(
image: AssetImage(
destination.assetName,
package: 'flutter_gallery_assets',
image: ResizeImage(
AssetImage(
destination.assetName,
package: 'flutter_gallery_assets',
),
width: isDesktop ? null : mobileThumbnailSize.toInt(),
height: isDesktop ? null : mobileThumbnailSize.toInt(),
),
fit: BoxFit.cover,
width: isDesktop ? null : mobileThumbnailSize,