Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Remove FirstWhereOrNull as it causes conflicts with dart:collection #62

Merged
merged 1 commit into from
May 7, 2024
Merged
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
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
Loading