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
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.
The text was updated successfully, but these errors were encountered:
You use
SvgCacheKey
that haskeyData
which isSvgNetworkLoader
.operator==
andhashCode
for ColorMapper (actually there is onlyTestColorMapper
yet).hashCode
and comparing theSvgNetworkLoader.headers
which isMap<String, String>
.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:
const MapEquality().equals(headers, other.headers)
in theoperator==
andObject.hashAll([ ...headers.keys, headers.values, ... ])
in thehashCode
getter.hashCode
andoperator==
sinceheaders
don't define the the source of svg data likeurl
does.The text was updated successfully, but these errors were encountered: