If you don't care about checking for duplicates, you can achieve this by converting the first List
into a Set
and then calling containsAll
against the second List
:
bool listContainsAll<T>(List<T> a, List<T> b) {
final setA = Set.of(a);
return setA.containsAll(b);
}
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…