From f1a2357463297a6630b9389ccd12693aded665ad Mon Sep 17 00:00:00 2001 From: Broccolism <45515332+broccolism@users.noreply.github.com> Date: Sat, 29 Aug 2020 08:08:06 +0900 Subject: [PATCH] feat: Text constructor, overflow, and softWrap docs (#64175) --- packages/flutter/lib/src/widgets/text.dart | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/packages/flutter/lib/src/widgets/text.dart b/packages/flutter/lib/src/widgets/text.dart index 15ba8be8bf..446ca53ca8 100644 --- a/packages/flutter/lib/src/widgets/text.dart +++ b/packages/flutter/lib/src/widgets/text.dart @@ -126,9 +126,15 @@ class DefaultTextStyle extends InheritedTheme { /// Whether the text should break at soft line breaks. /// /// If false, the glyphs in the text will be positioned as if there was unlimited horizontal space. + /// + /// This also decides the [overflow] property's behavior. If this is true or null, + /// the glyph causing overflow, and those that follow, will not be rendered. final bool softWrap; /// How visual overflow should be handled. + /// + /// If [softWrap] is true or null, the glyph causing overflow, and those that follow, + /// will not be rendered. Otherwise, it will be shown with the given overflow option. final TextOverflow overflow; /// An optional maximum number of lines for the text to span, wrapping if necessary. @@ -341,6 +347,10 @@ class Text extends StatelessWidget { /// closest enclosing [DefaultTextStyle]. /// /// The [data] parameter must not be null. + /// + /// The [overflow] property's behavior is affected by the [softWrap] argument. + /// If the [softWrap] is true or null, the glyph causing overflow, and those that follow, + /// will not be rendered. Otherwise, it will be shown with the given overflow option. const Text( this.data, { Key key,