Try this: Extended text package
There is an overflow widget you can use.
Check their example:
ExtendedText(...
overFlowWidget:
TextOverflowWidget(
//maxHeight: double.infinity,
//align: TextOverflowAlign.right,
//fixedOffset: Offset.zero,
child: Row(
mainAxisSize: MainAxisSize.min,
children: <Widget>[
const Text('u2026 '),
RaisedButton(
child: const Text('more'),
onPressed: () {
launch(
'https://github.com/fluttercandies/extended_text');
},
)
],
),
),
...
)
Ok turned out that you need to specify maxLines for overflow to work properly. I think you are instead going for a widget that follows the text. You can try Text.rich() widget
Text.rich(
TextSpan(
text: 'This is an example text!',
children: [
WidgetSpan(
// Set the alignment
alignment: PlaceholderAlignment.middle,
// You can put any widget inline with text using WidgetSpan
child: Container(
margin: const EdgeInsets.only(left: 8.0),
child: ElevatedButton(
child: Text("Read more..."),
onPressed: () {},
),
),
),
],
),
);
You don't need the extended text package in this case.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…