We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
如题:期望能显示在最后的文字旁边,即333的旁边 class BackgroundTextDemo extends StatelessWidget { @OverRide Widget build(BuildContext context) { return Scaffold( appBar: AppBar( title: const Text('nick background for text'), ), body: SingleChildScrollView( child: Container( color: Colors.green, width: 400, padding: const EdgeInsets.all(20.0), child: Column( mainAxisAlignment: MainAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start, children: [ ExtendedText.rich( TextSpan( text: '11111111111111111111111111111111\n', ), TextSpan( text: '222222212222222222222222222222222222222\n', ), TextSpan( text: '3333\n', ), TextSpan( text: '444444\n', ), ]), maxLines: 3, overflow: TextOverflow.visible, overflowWidget: TextOverflowWidget( align:TextOverflowAlign.left, position: TextOverflowPosition.end, debugOverflowRectColor: Colors.red.withOpacity(0.1), child: Row( mainAxisSize: MainAxisSize.min, mainAxisAlignment:MainAxisAlignment.end, children: const [ Text( '...', ), Text( '全文', style: TextStyle( height: 1, fontSize: 16, color: Colors.amber), ), ], ), ), ), ], )), ), ); } }
The text was updated successfully, but these errors were encountered:
as design
Sorry, something went wrong.
有办法让TextOverflowWidget紧挨着文字显示么?
你看看官方的...怎么显示的
extended_text/lib/src/text_overflow_render_mixin.dart
Line 395 in 51399f6
https://medium.com/@VasyaFromRussia/expanding-text-in-flutter-92736226ace5 应该可以通过RenderParapgraph.getBoxesForSelection实现跟踪最后一行文字末尾的效果。
RenderParapgraph.getBoxesForSelection
No branches or pull requests
如题:期望能显示在最后的文字旁边,即333的旁边
class BackgroundTextDemo extends StatelessWidget {
@OverRide
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: const Text('nick background for text'),
),
body: SingleChildScrollView(
child: Container(
color: Colors.green,
width: 400,
padding: const EdgeInsets.all(20.0),
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
ExtendedText.rich(
TextSpan(
text:
'11111111111111111111111111111111\n',
),
TextSpan(
text:
'222222212222222222222222222222222222222\n',
),
TextSpan(
text:
'3333\n',
),
TextSpan(
text:
'444444\n',
),
]),
maxLines: 3,
overflow: TextOverflow.visible,
overflowWidget: TextOverflowWidget(
align:TextOverflowAlign.left,
position: TextOverflowPosition.end,
debugOverflowRectColor: Colors.red.withOpacity(0.1),
child: Row(
mainAxisSize: MainAxisSize.min,
mainAxisAlignment:MainAxisAlignment.end,
children: const [
Text(
'...',
),
Text(
'全文',
style: TextStyle(
height: 1,
fontSize: 16,
color: Colors.amber),
),
],
),
),
),
],
)),
),
);
}
}
The text was updated successfully, but these errors were encountered: