From 64424a6ae46b6890c3fe40d323b611e1f06fcee3 Mon Sep 17 00:00:00 2001 From: Justin McCandless Date: Thu, 5 Sep 2019 09:54:56 -0700 Subject: [PATCH] Null TextWidthBasis docs (#39761) Docs improvement after seeing "null" showing up for TextWidthBasis. --- packages/flutter/lib/src/material/selectable_text.dart | 2 +- packages/flutter/lib/src/painting/text_painter.dart | 8 +++++--- packages/flutter/lib/src/widgets/text.dart | 3 ++- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/packages/flutter/lib/src/material/selectable_text.dart b/packages/flutter/lib/src/material/selectable_text.dart index d16e7ec39f..bc4849ef16 100644 --- a/packages/flutter/lib/src/material/selectable_text.dart +++ b/packages/flutter/lib/src/material/selectable_text.dart @@ -374,7 +374,7 @@ class SelectableText extends StatefulWidget { /// {@macro flutter.widgets.edtiableText.scrollPhysics} final ScrollPhysics scrollPhysics; - /// {@macro flutter.dart:ui.text.TextWidthBasis} + /// {@macro flutter.painting.textPainter.textWidthBasis} final TextWidthBasis textWidthBasis; @override diff --git a/packages/flutter/lib/src/painting/text_painter.dart b/packages/flutter/lib/src/painting/text_painter.dart index 8b31be3bed..2af5a6b9b6 100644 --- a/packages/flutter/lib/src/painting/text_painter.dart +++ b/packages/flutter/lib/src/painting/text_painter.dart @@ -79,9 +79,9 @@ class PlaceholderDimensions { } } -/// The different ways of considering the width of one or more lines of text. +/// The different ways of measuring the width of one or more lines of text. /// -/// See [Text.widthType]. +/// See [Text.textWidthBasis], for example. enum TextWidthBasis { /// Multiline text will take up the full width given by the parent. For single /// line text, only the minimum amount of width needed to contain the text @@ -323,7 +323,9 @@ class TextPainter { _needsLayout = true; } - /// {@macro flutter.dart:ui.text.TextWidthBasis} + /// {@template flutter.painting.textPainter.textWidthBasis} + /// Defines how to measure the width of the rendered text. + /// {@endtemplate} TextWidthBasis get textWidthBasis => _textWidthBasis; TextWidthBasis _textWidthBasis; set textWidthBasis(TextWidthBasis value) { diff --git a/packages/flutter/lib/src/widgets/text.dart b/packages/flutter/lib/src/widgets/text.dart index 0108ffe9e3..894f15da99 100644 --- a/packages/flutter/lib/src/widgets/text.dart +++ b/packages/flutter/lib/src/widgets/text.dart @@ -135,6 +135,7 @@ class DefaultTextStyle extends InheritedTheme { final int maxLines; /// The strategy to use when calculating the width of the Text. + /// /// See [TextWidthBasis] for possible values and their implications. final TextWidthBasis textWidthBasis; @@ -410,7 +411,7 @@ class Text extends StatelessWidget { /// ``` final String semanticsLabel; - /// {@macro flutter.dart:ui.text.TextWidthBasis} + /// {@macro flutter.painting.textPainter.textWidthBasis} final TextWidthBasis textWidthBasis; @override