Skip to content

Commit 9fb1d44

Browse files
authored
Add doc-import for referenced name.
Clarify documentation for the separated function.
1 parent 640a530 commit 9fb1d44

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

pkgs/collection/lib/src/list_extensions.dart

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -343,7 +343,11 @@ extension ListExtensions<E> on List<E> {
343343
///
344344
/// If this iterable is empty, [before] and [after] have no effect.
345345
///
346-
/// Compared to [IterableExtension.separatedList],
346+
/// Compared to [IterableExtension.separatedList], this function
347+
/// doesn't copy the elements into a new list, it creates a view
348+
/// of the existing list with separators between the original elements.
349+
/// To do that efficiently, the source must be a list, not just
350+
/// an iterable.
347351
///
348352
/// Example:
349353
/// ```dart
@@ -368,6 +372,7 @@ extension ListExtensions<E> on List<E> {
368372
/// after: true,
369373
/// )); // []
370374
/// ```
375+
/// @docImport 'iterable_extensions.dart' show IterableExtension;
371376
List<E> separated(E separator, {bool before = false, bool after = false}) =>
372377
_SeparatedList<E>(this, separator, before, after);
373378

0 commit comments

Comments
 (0)