mirror of
https://github.com/dart-lang/sdk
synced 2024-10-06 15:39:54 +00:00
[collection] Update example code in dartdoc
Added 'final' to the example class `EntryItem` that extends `LinkedListEntry` from 'dart:collection'. The code as written now produces the error: ``` The type 'EntryItem' must be 'base', 'final' or 'sealed' because the supertype 'LinkedListEntry' is 'base'. ``` Also applied dartfmt to get new line break locations. Change-Id: I78e76c7d9d4e6cd29c2e229ab1054efad21c6248 CoreLibraryReviewExempt: Comments only Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/343688 Reviewed-by: Nate Bosch <nbosch@google.com> Commit-Queue: Nicholas Shahan <nshahan@google.com>
This commit is contained in:
parent
c944fc1db1
commit
0c4147675f
|
@ -31,7 +31,7 @@ part of dart.collection;
|
|||
///
|
||||
/// Example:
|
||||
/// ```dart
|
||||
/// class EntryItem extends LinkedListEntry<EntryItem> {
|
||||
/// final class EntryItem extends LinkedListEntry<EntryItem> {
|
||||
/// final int id;
|
||||
/// final String text;
|
||||
/// EntryItem(this.id, this.text);
|
||||
|
@ -44,8 +44,8 @@ part of dart.collection;
|
|||
///
|
||||
/// void main() {
|
||||
/// final linkedList = LinkedList<EntryItem>();
|
||||
/// linkedList.addAll(
|
||||
/// [EntryItem(1, 'A'), EntryItem(2, 'B'), EntryItem(3, 'C')]);
|
||||
/// linkedList
|
||||
/// .addAll([EntryItem(1, 'A'), EntryItem(2, 'B'), EntryItem(3, 'C')]);
|
||||
/// print(linkedList.first); // 1 : A
|
||||
/// print(linkedList.last); // 3 : C
|
||||
///
|
||||
|
|
Loading…
Reference in a new issue