Flutter 如何在flatter中的文本末尾添加图标按钮?
我怎样才能像这样在文本末尾添加图标按钮 我使用Row小部件,但iconbutton不在正确的位置,它不在文本的末尾 这是我的代码:Flutter 如何在flatter中的文本末尾添加图标按钮?,flutter,Flutter,我怎样才能像这样在文本末尾添加图标按钮 我使用Row小部件,但iconbutton不在正确的位置,它不在文本的末尾 这是我的代码: Row( children: [ Expanded( child: Text( 'All about marketing, lead generation, content marketing and growth hacks', style: c
Row(
children: [
Expanded(
child: Text(
'All about marketing, lead generation, content marketing and growth hacks',
style: const TextStyle(
fontSize: 12.0, fontWeight: FontWeight.w500),
),
),
IconButton(
icon: Icon(Icons.info),
iconSize: 12.0,
color: Palette.appbar,
onPressed: () {},
),
],
),
与文本span
和一起使用
WidgetSpan
允许添加您自己的小部件作为文本的一部分
像这样:
RichText(
text:TextSpan(
儿童:[
TextSpan(文本:_文本,样式:_样式),
WidgetSpan(
孩子:你的孩子
)
],
),
您可以在行窗口小部件中使用它。我编辑问题请在此处添加您的代码……是的,我在帖子中添加了我的代码