Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Support for Skeleton Effect on SVG Icons #43

Open
wm-jenildgohel opened this issue Sep 20, 2024 · 6 comments
Open

Add Support for Skeleton Effect on SVG Icons #43

wm-jenildgohel opened this issue Sep 20, 2024 · 6 comments

Comments

@wm-jenildgohel
Copy link

I frequently use this package in my projects and have encountered an issue when applying a shimmer effect to SVG icons. Currently, there is no direct support for rendering SVG with shimmer, causing difficulties in achieving the desired visual effect.

Please consider adding native support for applying shimmer effects to SVG icons or guide how to implement this feature.

Thank you!

@mattalbr
Copy link

Adding on here from a different project, when I use Skeletonizer on a mobile device, it properly handles my VectorGraphic(AssetBytesLoader("...svg"))
image

But the exact same code run on web does not properly skeltonize the svg
image

@muhammadkamel
Copy link

muhammadkamel commented Oct 15, 2024

@Milad-Akarie
I am also encouraging the same issue with SVG assets

@Milad-Akarie
Copy link
Owner

Custom painted widgets must be wrapped with Skeleton.shade

@mattalbr
Copy link

@Milad-Akarie Thanks for the response! Is there no way from within skeletonizer to understand that VectorGraphic needs shading?

@wm-jenildgohel
Copy link
Author

@Milad-Akarie Thank you for your assistance; everything is now functioning properly. I suppose you have to incorporate this straight into future versions or mention it somewhere in the documentation. I had this problem in several apps, and it has already been addressed.

@dattd38
Copy link

dattd38 commented Oct 18, 2024

I frequently use this package in my projects and have encountered an issue when applying a shimmer effect to SVG icons. Currently, there is no direct support for rendering SVG with shimmer, causing difficulties in achieving the desired visual effect.

Please consider adding native support for applying shimmer effects to SVG icons or guide how to implement this feature.

Thank you!
Solution: use Skeleton.replace

return Skeleton.replace(
replacement: _placeholder,
replace: true,
child: SvgPicture.asset(
widget.image ?? '',
width: widget.width ?? widget.size,
height: widget.height ?? widget.size,
fit: widget.fit,
colorFilter: widget.color != null
? ColorFilter.mode(widget.color!, BlendMode.srcIn)
: null,
placeholderBuilder: (context) => _placeholder,
),
);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants