diff --git a/lib/src/components/phone_input/phone_input.dart b/lib/src/components/phone_input/phone_input.dart index ac347360..f0123ae4 100644 --- a/lib/src/components/phone_input/phone_input.dart +++ b/lib/src/components/phone_input/phone_input.dart @@ -1,3 +1,4 @@ +import 'package:collection/collection.dart'; import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; diff --git a/lib/src/components/select_input/select_input.dart b/lib/src/components/select_input/select_input.dart index 1b409290..b371d920 100644 --- a/lib/src/components/select_input/select_input.dart +++ b/lib/src/components/select_input/select_input.dart @@ -1,3 +1,4 @@ +import 'package:collection/collection.dart'; import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; import 'package:flutter/rendering.dart'; diff --git a/lib/src/utils/extensions.dart b/lib/src/utils/extensions.dart index 3b4d5a45..77dc6bcc 100644 --- a/lib/src/utils/extensions.dart +++ b/lib/src/utils/extensions.dart @@ -101,14 +101,3 @@ extension StringExtensions on String? { return '${this![0].toUpperCase()}${this!.substring(1).toLowerCase()}'; } } - -/// Extension [FirstWhereOrNull] on [Iterable]. -extension FirstWhereOrNull on Iterable { - /// 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; - } -} diff --git a/pubspec.yaml b/pubspec.yaml index 1026f59f..93adce35 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -21,6 +21,7 @@ environment: flutter: ">=3.16.0" dependencies: + collection: ^1.18.0 flutter: sdk: flutter flutter_slidable: ^3.1.0