Unverified Commit 80082ac4 authored by Greg Spencer's avatar Greg Spencer Committed by GitHub

Remove references to obsolete SemanticsSortOrder (#29012)

This removes references to SemanticsSortOrder, which was removed a long time ago.
parent 89512e46
...@@ -5,46 +5,33 @@ ...@@ -5,46 +5,33 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/semantics.dart'; import 'package:flutter/semantics.dart';
/// This example shows a set of widgets for changing data fields arranged in a column /// This example shows a set of widgets for changing data fields arranged in a
/// of rows but, in accessibility mode, are traversed in a custom order. /// column of rows but, in accessibility mode, are traversed in a custom order.
/// ///
/// This demonstrates how Flutter's accessibility system describes custom traversal /// This demonstrates how Flutter's accessibility system describes custom
/// orders using sort keys. /// traversal orders using sort keys.
/// ///
/// The example app here has three fields that have a title and up/down spinner buttons /// The example app here has three fields that have a title and up/down spinner
/// above and below. The traversal order should allow the user to focus on each /// buttons above and below. The traversal order should allow the user to focus
/// title, the input field next, the up spinner next, and the down spinner last before /// on each title, the input field next, the up spinner next, and the down
/// moving to the next input title. /// spinner last before moving to the next input title.
/// ///
/// Users that do not use a screen reader (e.g. TalkBack on Android and VoiceOver on iOS) /// Users that do not use a screen reader (e.g. TalkBack on Android and
/// will just see a regular app with controls. /// VoiceOver on iOS) will just see a regular app with controls.
/// ///
/// The example's [RowColumnTraversal] widget sets up two [Semantics] objects that wrap the /// The example's [RowColumnTraversal] widget sets up two [Semantics] objects
/// given [Widget] child, providing the traversal order they should have in the "row" /// that wrap the given [Widget] child, providing the traversal order they
/// direction, and then the traversal order they should have in the "column" direction. /// should have in the "row" direction, and then the traversal order they should
/// /// have in the "column" direction.
/// Sort keys, by default, are appended to the sort orders for their parents, but
/// they can also override those of their parents (by setting
/// [SemanticsSortOrder.discardParentOrder] to true), and an entire sort order can be
/// defined with multiple keys, to provide for virtually any ordering.
///
/// Keys at the same position in the sort order are compared with each other, and
/// keys which are of different types, or which have different [SemanticSortKey.name]
/// values compare as "equal" so that two different types of keys can co-exist at the
/// same level and not interfere with each other, allowing for sorting in groups.
/// Keys that evaluate as equal, or when compared with Widgets that don't have
/// [Semantics], are given the default upper-start-to-lower-end geometric
/// ordering.
/// ///
/// Since widgets are globally sorted by their sort key, the order does not have /// Since widgets are globally sorted by their sort key, the order does not have
/// to conform to the widget hierarchy. Indeed, in this example, we traverse vertically /// to conform to the widget hierarchy. Indeed, in this example, we traverse
/// first, but the widget hierarchy is a column of rows. /// vertically first, but the widget hierarchy is a column of rows.
/// ///
/// See also: /// See also:
/// ///
/// * [Semantics] for an object that annotates widgets with accessibility semantics /// * [Semantics] for an object that annotates widgets with accessibility semantics
/// (including traversal order). /// (including traversal order).
/// * [SemanticSortOrder] for the class that manages the sort order of a semantic node.
/// * [SemanticSortKey] for the base class of all semantic sort keys. /// * [SemanticSortKey] for the base class of all semantic sort keys.
/// * [OrdinalSortKey] for a concrete sort key that sorts based on the given ordinal. /// * [OrdinalSortKey] for a concrete sort key that sorts based on the given ordinal.
class RowColumnTraversal extends StatelessWidget { class RowColumnTraversal extends StatelessWidget {
...@@ -56,24 +43,7 @@ class RowColumnTraversal extends StatelessWidget { ...@@ -56,24 +43,7 @@ class RowColumnTraversal extends StatelessWidget {
/// Builds a widget hierarchy that wraps [child]. /// Builds a widget hierarchy that wraps [child].
/// ///
/// This function expresses the sort keys as a hierarchy, but it could just as /// This function expresses the sort keys as a hierarchy.
/// easily have been a flat list:
///
/// ```dart
/// Widget build(BuildContext context) {
/// return new Semantics(
/// sortOrder: new SemanticsSortOrder(
/// keys: <SemanticsSortKey>[
/// new OrdinalSortKey(columnOrder.toDouble()),
/// new OrdinalSortKey(rowOrder.toDouble())
/// ],
/// ),
/// child: child,
/// );
/// }
/// ```
///
/// The resulting order is the same.
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Semantics( return Semantics(
......
...@@ -3745,7 +3745,6 @@ String _concatStrings({ ...@@ -3745,7 +3745,6 @@ String _concatStrings({
/// ///
/// See Also: /// See Also:
/// ///
/// * [SemanticsSortOrder] which manages a list of sort keys.
/// * [OrdinalSortKey] for a sort key that sorts using an ordinal. /// * [OrdinalSortKey] for a sort key that sorts using an ordinal.
abstract class SemanticsSortKey extends Diagnosticable implements Comparable<SemanticsSortKey> { abstract class SemanticsSortKey extends Diagnosticable implements Comparable<SemanticsSortKey> {
/// Abstract const constructor. This constructor enables subclasses to provide /// Abstract const constructor. This constructor enables subclasses to provide
...@@ -3794,10 +3793,6 @@ abstract class SemanticsSortKey extends Diagnosticable implements Comparable<Sem ...@@ -3794,10 +3793,6 @@ abstract class SemanticsSortKey extends Diagnosticable implements Comparable<Sem
/// fractional, e.g. in order to fit between two other consecutive whole /// fractional, e.g. in order to fit between two other consecutive whole
/// numbers. The value must be finite (it cannot be [double.nan], /// numbers. The value must be finite (it cannot be [double.nan],
/// [double.infinity], or [double.negativeInfinity]). /// [double.infinity], or [double.negativeInfinity]).
///
/// See also:
///
/// * [SemanticsSortOrder] which manages a list of sort keys.
class OrdinalSortKey extends SemanticsSortKey { class OrdinalSortKey extends SemanticsSortKey {
/// Creates a semantics sort key that uses a [double] as its key value. /// Creates a semantics sort key that uses a [double] as its key value.
/// ///
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment