如何在 Richtext 中获取一些 space 之间的值?
How to get some space between in Richtext?
我正在尝试在 Richttext 中获取一些 space。首先是我的代码
title: RichText(
text: TextSpan(
text: _snapshot.data['username'], // _snapshot.data['username']
style: TextStyle(fontWeight: FontWeight.bold, color: Colors.black),
children: <TextSpan>[
TextSpan(
//"${comment.data()['comment']}"
text: "${comment.data()['comment']}",
style: TextStyle(
fontWeight: FontWeight.normal,
),
)
],
),
)
而我想要的是在这个
之间的一些space
text: TextSpan(
text: _snapshot.data['username'], // _snapshot.data['username']
style: TextStyle(
fontWeight: FontWeight.bold,
color: Colors.black,
)
还有这个
children: <TextSpan>[
TextSpan(
//"${comment.data()['comment']}"
text: "${comment.data()['comment']}",
style: TextStyle(
fontWeight: FontWeight.normal,
),
],
),
希望有人能提供帮助。如果你需要一张它现在是什么样子的照片,请发表评论
您可以使用如下所示的 SizedBox:
RichText(
text: TextSpan(
text: "Test:",
style: TextStyle(fontWeight: FontWeight.bold, color: Colors.black),
children: <InlineSpan>[
WidgetSpan(
alignment: PlaceholderAlignment.baseline,
baseline: TextBaseline.alphabetic,
child: SizedBox(width: 10)),
TextSpan(
text: "Data",
style: TextStyle(
fontWeight: FontWeight.normal,
),
)
],
),
)
我正在尝试在 Richttext 中获取一些 space。首先是我的代码
title: RichText(
text: TextSpan(
text: _snapshot.data['username'], // _snapshot.data['username']
style: TextStyle(fontWeight: FontWeight.bold, color: Colors.black),
children: <TextSpan>[
TextSpan(
//"${comment.data()['comment']}"
text: "${comment.data()['comment']}",
style: TextStyle(
fontWeight: FontWeight.normal,
),
)
],
),
)
而我想要的是在这个
之间的一些space text: TextSpan(
text: _snapshot.data['username'], // _snapshot.data['username']
style: TextStyle(
fontWeight: FontWeight.bold,
color: Colors.black,
)
还有这个
children: <TextSpan>[
TextSpan(
//"${comment.data()['comment']}"
text: "${comment.data()['comment']}",
style: TextStyle(
fontWeight: FontWeight.normal,
),
],
),
希望有人能提供帮助。如果你需要一张它现在是什么样子的照片,请发表评论
您可以使用如下所示的 SizedBox:
RichText(
text: TextSpan(
text: "Test:",
style: TextStyle(fontWeight: FontWeight.bold, color: Colors.black),
children: <InlineSpan>[
WidgetSpan(
alignment: PlaceholderAlignment.baseline,
baseline: TextBaseline.alphabetic,
child: SizedBox(width: 10)),
TextSpan(
text: "Data",
style: TextStyle(
fontWeight: FontWeight.normal,
),
)
],
),
)