Closed MoyinShabi closed 1 year ago
Hey @MoyinShabi yes this bit changed in version 0.4.0 and above, it's because Skeletonizer now draws everything like the default painter would, in your case you're using a network image which would take time to be fetched before it's drawn.
You shouldn't have to render a network image while showing a loading indicator, this might even effect performance on phones with slow internet connection.
Since we only need a rectangular to represent the image, it's recommended to remove widgets like Images from the render tree when skeletonizer is enabled, and you can do that by wrapping your image widget with
Skeleton.replace
So skeletonizer will use the replacement when it's enabled
Oh nice, I understand now. Thanks for your response!
@Milad-Akarie I have to ask though, why can't Skeletonizer render a skeleton of a Container
without a child?
@MoyinShabi Does it have a size?
Yes, it has a height
, width
, and color
property (in the second photo). Please check out the results below. It seems like it can only render the skeleton of a Container
or SizedBox
with a child (as seen in the last 3 photos)
@MoyinShabi I suppose that's because you're not giving a color, some users use containers for padding, margins, and alignment meaning they don't want them to render anything on the screen just position the child, so it'd be wrong to render anything then.
Hi @Milad-Akarie, I gave a color in the 2nd and last two videos though and only the child of the container got rendered, but I understand why they don't need to be rendered in some cases.
@MoyinShabi do you need theme to render with a shimmer effect? in that case, try wrapping your container with Skeleton.leaf so it's treated as a leaf widget that has no children
Thanks a lot for your response, it helped!
With the versions 0.4.0 and newer, there's a bit of lag in showing the complete skeleton of the child of the
Skeletonizer
widget, at once.Kindly compare below👇
https://github.com/Milad-Akarie/skeletonizer/assets/21967002/ece41c5e-3939-4e22-934c-f6d2b4efda65
https://github.com/Milad-Akarie/skeletonizer/assets/21967002/36dcca2b-ba36-44d8-83c7-0a4fa1c1bb24
https://github.com/Milad-Akarie/skeletonizer/assets/21967002/7b1007b0-a8d2-49e6-8741-86ef64a8c86b