Reputation: 1047
I use the Wrap Widget to display chat messages, I'm having trouble getting show new line '\n' in Wrap Widgets
show text message:
a *bold*
`highlight`
```pre```
```pre1```
a ```pre2```
a *bold*
and then wrap listWidget in Wrap Widget
Wrap(
children: listWidgets,
)
but the Text widget ('\ n') doesn't go as expected
Does anyone have solution new line in Wrap Widget please help
Upvotes: 0
Views: 666
Reputation: 341
You need to specify the direction
property of your Wrap
widget.
Wrap(
direction: Axis.vertical,
children: listWidgets,
)
Upvotes: 0
Reputation: 7601
Try to use RichText widget:
RichText(
text: TextSpan(
text: '26 Sep 2020\n\n',
style: TextStyle(
color: Colors.black,
fontSize: 12.0,
),
children: <TextSpan>[
TextSpan(
text: 'blablabla',
style: TextStyle(
fontWeight: FontWeight.bold,
color: Colors.black,
fontSize: 16.0,
),
),
],
),
),
Upvotes: 1