Stack Overflow Asked by Hưng Trịnh on November 24, 2021
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
You need to specify the direction
property of your Wrap
widget.
Wrap(
direction: Axis.vertical,
children: listWidgets,
)
Answered by SCcode on November 24, 2021
Try to use RichText widget:
RichText(
text: TextSpan(
text: '26 Sep 2020nn',
style: TextStyle(
color: Colors.black,
fontSize: 12.0,
),
children: <TextSpan>[
TextSpan(
text: 'blablabla',
style: TextStyle(
fontWeight: FontWeight.bold,
color: Colors.black,
fontSize: 16.0,
),
),
],
),
),
Answered by Jim Chiu on November 24, 2021
Get help from others!
Recent Answers
Recent Questions
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP