Unverified Commit e6a6a473 authored by Justin McCandless's avatar Justin McCandless Committed by GitHub

Mention SelectionArea in SelectableText docs (#143784)

Most users should be using SelectionArea over SelectableText, so this makes that more clear/discoverable in the docs.
parent 3095c116
...@@ -151,6 +151,9 @@ class _SelectableTextSelectionGestureDetectorBuilder extends TextSelectionGestur ...@@ -151,6 +151,9 @@ class _SelectableTextSelectionGestureDetectorBuilder extends TextSelectionGestur
/// A run of selectable text with a single style. /// A run of selectable text with a single style.
/// ///
/// Consider using [SelectionArea] or [SelectableRegion] instead, which enable
/// selection on a widget subtree, including but not limited to [Text] widgets.
///
/// The [SelectableText] widget displays a string of text with a single style. /// The [SelectableText] widget displays a string of text with a single style.
/// The string might break across multiple lines or might all be displayed on /// The string might break across multiple lines or might all be displayed on
/// the same line depending on the layout constraints. /// the same line depending on the layout constraints.
...@@ -214,6 +217,8 @@ class _SelectableTextSelectionGestureDetectorBuilder extends TextSelectionGestur ...@@ -214,6 +217,8 @@ class _SelectableTextSelectionGestureDetectorBuilder extends TextSelectionGestur
/// ///
/// * [Text], which is the non selectable version of this widget. /// * [Text], which is the non selectable version of this widget.
/// * [TextField], which is the editable version of this widget. /// * [TextField], which is the editable version of this widget.
/// * [SelectionArea], which enables the selection of multiple [Text] widgets
/// and of other widgets.
class SelectableText extends StatefulWidget { class SelectableText extends StatefulWidget {
/// Creates a selectable text widget. /// Creates a selectable text widget.
/// ///
......
...@@ -35,6 +35,7 @@ import 'theme.dart'; ...@@ -35,6 +35,7 @@ import 'theme.dart';
/// See also: /// See also:
/// ///
/// * [SelectableRegion], which provides an overview of the selection system. /// * [SelectableRegion], which provides an overview of the selection system.
/// * [SelectableText], which enables selection on a single run of text.
class SelectionArea extends StatefulWidget { class SelectionArea extends StatefulWidget {
/// Creates a [SelectionArea]. /// Creates a [SelectionArea].
/// ///
......
...@@ -195,6 +195,7 @@ const double _kSelectableVerticalComparingThreshold = 3.0; ...@@ -195,6 +195,7 @@ const double _kSelectableVerticalComparingThreshold = 3.0;
/// ///
/// * [SelectionArea], which creates a [SelectableRegion] with /// * [SelectionArea], which creates a [SelectableRegion] with
/// platform-adaptive selection controls. /// platform-adaptive selection controls.
/// * [SelectableText], which enables selection on a single run of text.
/// * [SelectionHandler], which contains APIs to handle selection events from the /// * [SelectionHandler], which contains APIs to handle selection events from the
/// [SelectableRegion]. /// [SelectableRegion].
/// * [Selectable], which provides API to participate in the selection system. /// * [Selectable], which provides API to participate in the selection system.
......
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