Last active
February 28, 2024 08:24
-
-
Save Sovann72/a854e5f737d3e815cac9947f75f5d2e7 to your computer and use it in GitHub Desktop.
check-equality-of-two-list
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// https://stackoverflow.com/a/22333042/15149752 | |
import 'package:collection/collection.dart'; | |
List<String> otherList = ['foo', 'bar', 'baz']; | |
List<String> something = ['bar', 'baz', 'foo']; | |
void checkTwoListForEquality(List<String> firstList, List<String> secList) { | |
Function unOrdDeepEq = const DeepCollectionEquality.unordered().equals; | |
final result = unOrdDeepEq.call(firstList, secList); | |
print(result); | |
} | |
void main() { | |
checkTwoListForEquality(something, otherList); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment