Null TextWidthBasis docs (#39761)

Docs improvement after seeing "null" showing up for TextWidthBasis.
This commit is contained in:
Justin McCandless 2019-09-05 09:54:56 -07:00 committed by GitHub
parent 2640bfeb10
commit 64424a6ae4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 8 additions and 5 deletions

View file

@ -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

View file

@ -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) {

View file

@ -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