Skip to content

Commit

Permalink
Fix. typos in _util.dart (#161)
Browse files Browse the repository at this point in the history
  • Loading branch information
droidbg authored Oct 24, 2023
1 parent fb32653 commit c9b788e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions pkgs/leak_tracker/lib/src/shared/_util.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@
T cast<T>(Object? value) {
if (value is T) return value;
throw ArgumentError(
'$value is of type ${value.runtimeType} that is not subtype of $T',
'$value is of type ${value.runtimeType} that is not a subtype of $T',
);
}

extension IterableExtensions<T> on Iterable<T> {
/// Returns the item or null, assuming that the length of the itrable os 0 or 1.
// The name is consistent woth other methods names on iterable like
// `firstOrNull, lastOrNull and singleOrNull`.
/// Returns the item or null, assuming that the length of the iterable is 0 or 1.
// The name is consistent with other method names on iterables like
// `firstOrNull, lastOrNull, and singleOrNull`.
T? get onlyOrNull {
if (length > 1) throw StateError('Length should not be more than one.');
return firstOrNull;
Expand Down

0 comments on commit c9b788e

Please sign in to comment.