feat: Remove list helpers

Use the collection package instead.
This commit is contained in:
PapaTutuWawa 2023-06-17 21:06:29 +02:00
parent 2a469e10e8
commit 7e55015948
2 changed files with 0 additions and 17 deletions

View File

@ -1,16 +0,0 @@
/// A wrapper around List<T>.firstWhere that does not throw but instead just
/// returns true if [test] returns true for an element or false if [test] never
/// returned true.
bool listContains<T>(List<T> list, bool Function(T element) test) {
return firstWhereOrNull<T>(list, test) != null;
}
/// A wrapper around [List<T>.firstWhere] that does not throw but instead just
/// return null if [test] never returned true
T? firstWhereOrNull<T>(List<T> list, bool Function(T element) test) {
try {
return list.firstWhere(test);
} catch(e) {
return null;
}
}

View File

@ -1,5 +1,4 @@
library moxlib;
export 'awaitabledatasender.dart';
export 'lists.dart';
export 'math.dart';