Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 9 additions & 6 deletions .idea/workspace.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -578,6 +578,10 @@ the growing community of `dart_extensions.dart`.
<td align="center"><a href="https://github.com/xamantra"><img src="https://avatars0.githubusercontent.com/u/37391380?s=400&v=4" width="64px;" alt=""/><br /><sub><b>Xamantra</b></sub></a><br /><a href="" title="Code">💻</a> <a href="" title="Documentation">📖</a> <a href="" title="Reviewed Pull Requests">👀</a></td>
</a></td>
</tr>
<tr>
<td align="center"><a href="https://github.com/saharvx9"><img src="https://avatars.githubusercontent.com/u/35892162?s=460&v=4" width="64px;" alt=""/><br /><sub><b>saharvx9</b></sub></a><br /><a href="" title="Code">💻</a> <a href="" title="Documentation">📖</a> <a href="" title="Reviewed Pull Requests">👀</a></td>
</a></td>
</tr>
</table>


Expand Down
8 changes: 4 additions & 4 deletions lib/src/iterable.dart
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ extension CollectionsExtensions<T> on Iterable<T> {
List<T> takeOnly(int n) {
if (n == 0) return [];

var list = List<T>.empty();
List<T> list = [];
var thisList = this.toList();
if (this is Iterable) {
final resultSize = this.length - n;
Expand All @@ -109,7 +109,7 @@ extension CollectionsExtensions<T> on Iterable<T> {
List<T> drop(int n) {
if (n == 0) return [];

var list = List<T>.empty();
List<T> list = [];
var originalList = this.toList();
if (this is Iterable) {
final resultSize = this.length - n;
Expand Down Expand Up @@ -250,7 +250,7 @@ extension CollectionsExtensions<T> on Iterable<T> {
/// 36 Ran
List<T> distinctBy(predicate(T selector)) {
final set = HashSet();
final list = List<T>.empty();
final List<T> list = [];
toList().forEach((e) {
final key = predicate(e);
if (set.add(key)) {
Expand Down Expand Up @@ -314,7 +314,7 @@ extension CollectionsExtensions<T> on Iterable<T> {
/// the combination of them two.
zip<T>(Iterable<T> iterable) sync* {
if (iterable.isEmptyOrNull) return;
final iterables = List<Iterable>.empty()..add(this)..add(iterable);
final List<Iterable> iterables = []..add(this)..add(iterable);

final iterators = iterables.map((e) => e.iterator).toList(growable: false);
while (iterators.every((e) => e.moveNext())) {
Expand Down