xxxxxxxxxx
new Container(
child: Row(
children: <Widget>[
Flexible(
child: new Text("A looooooooooooooooooong text"))
],
),
);
xxxxxxxxxx
//80% of screen width
double c_width = MediaQuery.of(context).size.width*0.8;
return new Container (
padding: const EdgeInsets.all(16.0),
width: c_width,
child: new Column (
children: <Widget>[
new Text ("Long text 1 Long text 1 Long text 1 Long text 1 Long text 1 Long text 1 Long text 1 Long text 1 Long text 1 Long text 1 Long text 1 Long text 1 Long text 1 Long text 1 ", textAlign: TextAlign.left),
new Text ("Long Text 2, Long Text 2, Long Text 2, Long Text 2, Long Text 2, Long Text 2, Long Text 2, Long Text 2, Long Text 2, Long Text 2, Long Text 2", textAlign: TextAlign.left),
],
),
);
xxxxxxxxxx
Wrap(
children: [
Container(
width: 200, // Adjust the width according to your requirements
child: Text(
'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce aliquet mauris nec lacinia aliquet.',
style: TextStyle(fontSize: 16),
),
),
],
)
xxxxxxxxxx
Container(
width: 200, // Set the desired width for the container
child: Text(
'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.',
softWrap: true, // Enable text wrapping
),
)