Skip to content
This repository was archived by the owner on Oct 12, 2024. It is now read-only.

Commit db4608a

Browse files
committed
Update
1 parent 96397cc commit db4608a

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

lib/src/collections/src/etc.dart

+7
Original file line numberDiff line numberDiff line change
@@ -60,3 +60,10 @@ String combinedOrderedStringId(List<String> ids) {
6060
final combined = sorted.join('_');
6161
return combined;
6262
}
63+
64+
extension TakeLastOnIterableExtension on Iterable<String> {
65+
/// Takes the last [count] elements from the iterable.
66+
Iterable<String> takeLast(int count) {
67+
return this.toList().reversed.take(count).toList().reversed;
68+
}
69+
}

0 commit comments

Comments
 (0)