
微信交流群
# WidgetSpan
WidgetSpan在文本中内嵌固定大小Widget。
WidgetSpan({
@required this.child,
ui.PlaceholderAlignment alignment = ui.PlaceholderAlignment.bottom,//对齐方式
TextBaseline baseline,//基准线对齐
TextStyle style,//文本样式
})
1
2
3
4
5
6
2
3
4
5
6
案例:
Text.rich(TextSpan(
children: <InlineSpan>[
TextSpan(text: 'Flutter is'),
WidgetSpan(
child: SizedBox(
width: 120,
height: 50,
child: Card(child: Center(child: Text('Hello World!'))),
)),
TextSpan(text: 'the best!'),
],
))
1
2
3
4
5
6
7
8
9
10
11
12
2
3
4
5
6
7
8
9
10
11
12
本文由Rock提供。
版权所有,禁止私自转发、克隆网站。