Show placeholders for images while loading, and then fade in images#3
Show placeholders for images while loading, and then fade in images#3clocksmith merged 10 commits intoflutter:masterfrom
Conversation
|
Is it possible to get around the size shift going from the placeholder to the image? Other than that, looks great! |
The shifting comes from the fact that the height of the placeholders are different compared to the images. We will only know the height of the images when they have been loaded. So I think it will be hard to get around the size shift going on. The only way to get around it would be to hard code the aspect ratios into the code for every image. |
|
Looks much better! Can you do the same for the Shrine logo? |
|
I updated the PR now with aspect ratios for the images to make sure that the placeholders have the exact same size as the images.
Sure. I added it to the logos now. |
|
Can you put in the aspect ratio for the shrine logo? |
|
Is this necessary on mobile? |
Good idea.
No. It should only be needed for the web. Let me update my |
…using it instead of FadeInImage
| /// to specify a widget as a [placeholder], instead of just an [ImageProvider]. | ||
| /// It also lets you override the [child] argument, in case you want to wrap | ||
| /// the image with another widget, for example an [Ink.image]. | ||
| class FadeInImagePlaceholder extends StatelessWidget { |
There was a problem hiding this comment.
What about calling this FadeInImage, since its not really a placeholder, but rather the placeholder is inside of it
There was a problem hiding this comment.
That is already a widget inside the Flutter framework, and this one works a bit different.
What do you think about:
WebFadeInImageFadeInImageWithWidgetsPlaceholderFadeInLoadingImage
…lutter#3) * Fade in images when loading * Fix imports * Add imageAspectRatio for fortnightly * Add image aspect ratio to Crane * Add image aspect ratio to Shrine * Fade in Rally and Fortnightly logos * Ensure full height on mobile for shrine images * Only fade images on the web, by modifying FadeInImagePlaceholder and using it instead of FadeInImage * Add height and width for the Rally logo placeholder Co-authored-by: Anthony <[email protected]> Former-commit-id: 0a9bdde
c.f. issue flutter#3 Thanks pravindodia@ for implementing and publishing the iOS app !
estimateion make offer ui done and Api integration is in process
Add placeholders for when images are loading. To make sure that the placeholders are the same size as the images, I added the image aspect ratio to the data of the demos. I assume in a real application such information would be saved in a database.
I am still waiting on the final designs for the placeholders. I'll update them in case there are any updates.
Closes material-components/material-components-flutter-gallery#552