Skip to content
New issue

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

TextOverflowWidget的align:TextOverflowAlign.left属性没有效果 #108

Open
miduobao opened this issue May 17, 2021 · 5 comments
Open
Labels
enhancement New feature or request

Comments

@miduobao
Copy link

如题:期望能显示在最后的文字旁边,即333的旁边
left
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),
),
],
),
),
),
],
)),
),
);
}
}

@zmtzawqlp
Copy link
Member

as design

@miduobao
Copy link
Author

有办法让TextOverflowWidget紧挨着文字显示么?

@zmtzawqlp
Copy link
Member

你看看官方的...怎么显示的

@zmtzawqlp
Copy link
Member

overflowRect = Rect.fromLTRB(_overflowRect!.left, overflowRect.top,

@Oklahomawhore
Copy link

https://medium.com/@VasyaFromRussia/expanding-text-in-flutter-92736226ace5
应该可以通过RenderParapgraph.getBoxesForSelection实现跟踪最后一行文字末尾的效果。

@zmtzawqlp zmtzawqlp added the enhancement New feature or request label Jul 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants