删除行颤动中的小部件之间的 space
Remove space between widgets in row flutter
我需要删除一行中两个或多个文本小部件之间的 space。
这是使用行的代码
Row(
mainAxisAlignment: MainAxisAlignment.start,
// textBaseline: TextBaseline.alphabetic,
// crossAxisAlignment: CrossAxisAlignment.baseline,
children: [
Text(
r'$ ' + formatNumber(valueText),
style: TextStyle(
color: Color(0xff210049),
fontSize: smallTextSize,
fontFamily: 'RedHat',
),
),
Text(
',00',
style: TextStyle(
color: Color(0xff210049),
fontSize: smallTextSize,
fontFamily: 'RedHat',
),
),
],
),
我也试过使用富文本,但结果是一样的:
RichText(
text: TextSpan(
text: r'$ ' + formatNumber(valueText),
style: TextStyle(
color: Color(0xff210049),
fontSize: smallTextSize,
fontFamily: 'RedHat',
),
children: <TextSpan>[
TextSpan(
text: ',00',
style: TextStyle(
color: Color(0xff210049),
fontSize: smallTextSize,
fontFamily: 'RedHat',
),
),
],
),
),
图中的最后一行是我需要得到的示例
enter image description here
Text(
r'$' + '333 '.trim(),
style: TextStyle(
color: Color(0xff210049),
//fontSize: smallTextSize,
fontFamily: 'RedHat',
),
),
我需要删除一行中两个或多个文本小部件之间的 space。
这是使用行的代码
Row(
mainAxisAlignment: MainAxisAlignment.start,
// textBaseline: TextBaseline.alphabetic,
// crossAxisAlignment: CrossAxisAlignment.baseline,
children: [
Text(
r'$ ' + formatNumber(valueText),
style: TextStyle(
color: Color(0xff210049),
fontSize: smallTextSize,
fontFamily: 'RedHat',
),
),
Text(
',00',
style: TextStyle(
color: Color(0xff210049),
fontSize: smallTextSize,
fontFamily: 'RedHat',
),
),
],
),
我也试过使用富文本,但结果是一样的:
RichText(
text: TextSpan(
text: r'$ ' + formatNumber(valueText),
style: TextStyle(
color: Color(0xff210049),
fontSize: smallTextSize,
fontFamily: 'RedHat',
),
children: <TextSpan>[
TextSpan(
text: ',00',
style: TextStyle(
color: Color(0xff210049),
fontSize: smallTextSize,
fontFamily: 'RedHat',
),
),
],
),
),
图中的最后一行是我需要得到的示例
enter image description here
Text(
r'$' + '333 '.trim(),
style: TextStyle(
color: Color(0xff210049),
//fontSize: smallTextSize,
fontFamily: 'RedHat',
),
),