Skip to content

Instantly share code, notes, and snippets.

@marcinOz
Created June 10, 2020 18:53
Show Gist options
  • Save marcinOz/7f70329739e87c3b363d360b0ab66e24 to your computer and use it in GitHub Desktop.
Save marcinOz/7f70329739e87c3b363d360b0ab66e24 to your computer and use it in GitHub Desktop.
extension IterableExt<T> on Iterable<T> {
bool containsAll(Iterable<T> list) {
for (final item in list) {
if (!contains(item)) return false;
}
return true;
}
T findOrNull(bool Function(T) where) => firstWhere(where, orElse: () => null);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment