Deprecate `BidirectionalIterator`.

There is only one use of it in the SDK, `RuneIterator`,
one use of it outside, `TreeSet` from `package:quiver`,
and one known use in Google internal code.

There are other bi-directional iteration interfaces,
like `CharacterRange` from `package:characters`,
which can move a cursor in two directions,
but which didn't loke the `movePrevious` name and therefore
are not `BidirectionalIterator`s.
(There is also a Google internal class which mentions explicitly
why they're not `BidirectionalIterator`.)

There is no real need for this "shared" interface.
It doesn't carry its own weight.
We have no abstractions which work on the *interface*,
only code that works on one specific concrete implementation.

I'd recommend:
* `quiver` introduce a `TreeSetIterator` for their use-case
  (the actual class has more public members than `BidirectionalIterator`,
  which cannot be accessed through the declared type.)
* the Google internal code introduces its own interface
  (which is just `Iterable` + `movePrevious`.
* The SDK will just make `RuneIterator` not implement
  `BidirectionalIterator` at some (breaking) point.
  Maybe just when we remove the type.


FLUTTER: Needs to land https://github.com/flutter/flutter/pull/106471 before merging this CL into Flutter.

Change-Id: Iaaa6b0c428d30eb3b68898c077d265ac0a622805
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/249486
Reviewed-by: Nate Bosch <nbosch@google.com>
Commit-Queue: Lasse Nielsen <lrn@google.com>
diff --git a/CHANGELOG.md b/CHANGELOG.md
index b8bee49..5139f56 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -24,6 +24,10 @@
 
 - The `Stream.fromIterable` stream can now be listened to more than once.
 
+### `dart:collection`
+
+- Deprecates `BidirectionalIterator`.
+
 ## 2.18.0
 
 ### Language
diff --git a/sdk/lib/core/iterable.dart b/sdk/lib/core/iterable.dart
index 41d7e23..e710e73 100644
--- a/sdk/lib/core/iterable.dart
+++ b/sdk/lib/core/iterable.dart
@@ -823,6 +823,15 @@
 }
 
 /// An [Iterator] that allows moving backwards as well as forwards.
+///
+/// Deprecation note: This interface has turned out to not be
+/// valuable as a general reusable interface. There is still only
+/// one class implementing it, [RuneIterator], and at least one other
+/// bidirectional iterator preferred a different name than `movePrevious`
+/// for the other direction.
+/// As such, this interface does not carry its own weight, and will be
+/// removed in a later release.
+@Deprecated("Use the implementing class directly")
 abstract class BidirectionalIterator<E> implements Iterator<E> {
   /// Move back to the previous element.
   ///