You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[flutter_svg] [BUG] Caching is not working correctly. #158818
P3Issues that are less important to the Flutter projectp: flutter_svgThe Flutter SVG drawing packagespackageflutter/packages repository. See also p: labels.waiting for responseThe Flutter team cannot make further progress on this issue until the original reporter responds
You use SvgCacheKey that has keyData which is SvgNetworkLoader.
Implement operator== and hashCode for ColorMapper (actually there is only TestColorMapper yet).
Fix calculating hashCode and comparing the SvgNetworkLoader.headers which is Map<String, String>.
@overrideintget hashCode =>Object.hash(url, headers /* HERE */, theme, colorMapper);
@overridebooloperator==(Object other) {
return other isSvgNetworkLoader&&
other.url == url &&
other.headers == headers &&// You NEVER get here true until these are identical maps.
other.theme == theme &&
other.colorMapper == colorMapper;
}
It's hardly ever to be happend when user writes the same Map of headers on different pages, usually these are different maps with the same entries.
You have two options:
Use const MapEquality().equals(headers, other.headers) in the operator== and Object.hashAll([ ...headers.keys, headers.values, ... ]) in the hashCode getter.
Remove headers from hashCode and operator== since headers don't define the the source of svg data like url does.
@darkstarx
Please provide us complete minimal but reproducible code sample along with svg. Also provide the current vs expected behavior upon running the code.
Without additional information, we are unfortunately not sure how to resolve this issue. We are therefore reluctantly going to close this bug for now.
If you find this problem please file a new issue with the same description, what happens, logs and the output of 'flutter doctor -v'. All system setups can be slightly different so it's always better to open new issues and reference the related ones.
Thanks for your contribution.
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.
P3Issues that are less important to the Flutter projectp: flutter_svgThe Flutter SVG drawing packagespackageflutter/packages repository. See also p: labels.waiting for responseThe Flutter team cannot make further progress on this issue until the original reporter responds
Activity
darshankawar commentedon Jul 18, 2025
@darkstarx
Please provide us complete minimal but reproducible code sample along with svg. Also provide the current vs expected behavior upon running the code.
github-actions commentedon Aug 8, 2025
Without additional information, we are unfortunately not sure how to resolve this issue. We are therefore reluctantly going to close this bug for now.
If you find this problem please file a new issue with the same description, what happens, logs and the output of 'flutter doctor -v'. All system setups can be slightly different so it's always better to open new issues and reference the related ones.
Thanks for your contribution.
github-actions commentedon Aug 22, 2025
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of
flutter doctor -vand a minimal reproduction of the issue.