Text softWrap overflow

2,115 views
Skip to first unread message

Kevin Segaud

unread,
May 23, 2016, 12:56:22 PM5/23/16
to Flutter Dev
Hi all,

I try to create some card with some text and if the text is too long i would like the text auto create new line.

In the documentation i have found that the Text object have a named parameters softWrap but in the source this parameters doesn't exist.
Have you some insight ?

Adam Barth

unread,
May 23, 2016, 1:02:57 PM5/23/16
to Kevin Segaud, Flutter Dev
Looks like that feature was added in this change:

https://github.com/flutter/flutter/commit/36d437d6f281d2a87f09cfcd06efeb29d67752d1

which is newer than the current alpha branch.  If you run "flutter --version", you can see exactly what version of flutter you're using.

I've updated the alpha branch just now.  If you run "flutter upgrade", you should get the new code.

Adam

Kevin Segaud

unread,
May 23, 2016, 1:04:14 PM5/23/16
to Flutter Dev
Oh yeah splendide thanks :)

Kevin Segaud

unread,
May 23, 2016, 1:16:39 PM5/23/16
to Flutter Dev
and Adam when i do this
new Text(quote.text,softWrap: true, overflow: TextOverflow.clip)
my text don't create line break :/

Ian Hickson

unread,
May 23, 2016, 1:19:53 PM5/23/16
to Kevin Segaud, Flutter Dev
softWrap:true is the default. The problem is more likely that you are putting the text in a widget that itself doesn't know how wide it should be, so it's just wrapping the child. For example, maybe the Text is in a Row?

If so, you need to constrain the Text somehow. For example, by putting the Text in a Flexible() widget (which tells the Row to fit the Text in the remaining space after it's laid out all the other children).

--
You received this message because you are subscribed to the Google Groups "Flutter Dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to flutter-dev...@googlegroups.com.
To post to this group, send email to flutt...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/flutter-dev/f469f147-caa2-47c8-a3c1-7c4fbb1a6584%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Kevin Segaud

unread,
May 23, 2016, 1:22:26 PM5/23/16
to Ian Hickson, Flutter Dev
Good point. It was in a Container Thanks
Reply all
Reply to author
Forward
0 new messages