listHash<T> function
A deep hash of a nullable list — consistent with listsEqual. Two lists that compare equal under listsEqual produce the same hash. Null hashes to 0.
Implementation
int listHash<T>(List<T>? list) {
if (list == null) return 0;
return const DeepCollectionEquality().hash(list);
}