Files
stream-chat-flutter/packages/stream_chat/lib/src/extensions/iterable_extension.dart
T
Sahil Kumar 4e9f4baf23 fix example
Signed-off-by: Sahil Kumar <[email protected]>
2021-04-20 21:17:43 +05:30

10 lines
288 B
Dart

/// Useful extension functions for [Iterable]
extension IterableX<T> on Iterable<T?> {
/// Removes all the null values
/// and converts `Iterable<T?>` into `Iterable<T>`
Iterable<T> get withNullifyer => [
for (final item in this)
if (item != null) item
];
}