diff --git a/packages/flutter/lib/src/semantics/semantics.dart b/packages/flutter/lib/src/semantics/semantics.dart index c078a53243..67fc9aefe1 100644 --- a/packages/flutter/lib/src/semantics/semantics.dart +++ b/packages/flutter/lib/src/semantics/semantics.dart @@ -1495,12 +1495,13 @@ class _TraversalSortNode implements Comparable<_TraversalSortNode> { /// parents. SemanticsSortOrder order; - /// The is the starting corner for the rectangle on this semantics node in - /// global coordinates. When the container has the directionality - /// [TextDirection.ltr], this is the upper left corner. When the container - /// has the directionality [TextDirection.rtl], this is the upper right - /// corner. When the container has no directionality, this is set, but the - /// x coordinate is ignored. + /// The starting corner for the rectangle on this semantics node in + /// global coordinates. + /// + /// When the container has the directionality [TextDirection.ltr], this is the + /// upper left corner. When the container has the directionality + /// [TextDirection.rtl], this is the upper right corner. When the container + /// has no directionality, this is set, but the x coordinate is ignored. Offset globalStartCorner; static Offset _transformPoint(Offset point, Matrix4 matrix) { @@ -2623,7 +2624,7 @@ String _concatStrings({ /// Provides a way to specify the order in which semantic nodes are sorted. /// -/// [TranversalSortOrder] objects contain a list of sort keys in the order in +/// [SemanticsSortOrder] objects contain a list of sort keys in the order in /// which they are applied. They are attached to [Semantics] widgets in the /// widget hierarchy, and are merged with the sort orders of their parent /// [Semantics] widgets. If [SemanticsSortOrder.discardParentOrder] is set to @@ -2659,7 +2660,7 @@ String _concatStrings({ /// child: const Text('Label One'), /// ), /// new Semantics( -/// sortOrder: new SemanticsSortOrder(key: new OrdinalSortKey(2.0)), +/// sortOrder: new SemanticsSortOrder(key: new OrdinalSortKey(1.0)), /// child: const Text('Label Two'), /// ), /// ], @@ -2688,8 +2689,8 @@ class SemanticsSortOrder extends Diagnosticable implements Comparable[key]`. /// /// If [discardParentOrder] is set to true, then the [SemanticsSortOrder.keys] - /// will _replace_ the list of keys from the parents when merged, instead of - /// extending them. + /// will _replace_ the list of keys from the parents when merged. Otherwise, + /// the child's keys are appended at the end of the parent's keys. SemanticsSortOrder({ SemanticsSortKey key, List keys, @@ -2787,9 +2788,9 @@ abstract class SemanticsSortKey extends Diagnosticable implements Comparable double.NEGATIVE_INFINITY), - assert(order < double.INFINITY), + assert(order != double.nan), + assert(order > double.negativeInfinity), + assert(order < double.infinity), super(name: name); - /// A double which describes the order in which this node is traversed by the - /// platform's accessibility services. Lower values will be traversed first. + /// Determines the placement of this key in a sequence of keys that defines + /// the order in which this node is traversed by the platform's accessibility + /// services. + /// + /// Lower values will be traversed first. final double order; @override