Skip to content

Commit

Permalink
fix: Remove FirstWhereOrNull as it causes conflicts with dart:collection
Browse files Browse the repository at this point in the history
  • Loading branch information
thelukewalton committed May 7, 2024
1 parent 2acf36f commit 237e9fa
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 11 deletions.
1 change: 1 addition & 0 deletions lib/src/components/phone_input/phone_input.dart
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import 'package:collection/collection.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
Expand Down
1 change: 1 addition & 0 deletions lib/src/components/select_input/select_input.dart
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import 'package:collection/collection.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:flutter/rendering.dart';
Expand Down
11 changes: 0 additions & 11 deletions lib/src/utils/extensions.dart
Original file line number Diff line number Diff line change
Expand Up @@ -101,14 +101,3 @@ extension StringExtensions on String? {
return '${this![0].toUpperCase()}${this!.substring(1).toLowerCase()}';
}
}

/// Extension [FirstWhereOrNull] on [Iterable].
extension FirstWhereOrNull<T> on Iterable<T> {
/// Returns the first element satisfying test, or null if there are none.
T? firstWhereOrNull(bool Function(T element) test) {
for (final element in this) {
if (test(element)) return element;
}
return null;
}
}
1 change: 1 addition & 0 deletions pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ environment:
flutter: ">=3.16.0"

dependencies:
collection: ^1.18.0
flutter:
sdk: flutter
flutter_slidable: ^3.1.0
Expand Down

0 comments on commit 237e9fa

Please sign in to comment.