【发布时间】:2021-11-25 01:52:44
【问题描述】:
我想使用GridView 组织此代码(我认为在这种情况下这是最好的选择),但我遇到了麻烦。我有 16 个 results 命名为 result1、result2 ... result16,我想像 4x4 一样组织它,如下图所示:
下面是一小部分代码:
child: RichText(
text: TextSpan(
children: [
TextSpan(
text: widget.result1 + ' ',
style: TextStyle(
fontSize: 20.0,
fontWeight: FontWeight.bold,
color: checkdominantA(widget.predominant, widget.result1),
height: 2.5,
letterSpacing: 0.7,
),
// ...
TextSpan(
text: widget.result16 + ' ',
style: TextStyle(
fontSize: 20.0,
fontWeight: FontWeight.bold,
color: checkdominantA(widget.predominant, widget.result16),
height: 2.5,
letterSpacing: 0.7,
),
),
),
],
),
),
【问题讨论】:
标签: android flutter dart mobile