答案 0 :(得分:2)
Center(
child: Row(
children: '51-47-24'
.split('-')
.map((s) => CircleAvatar(
child: Text(s),
))
.toList(),
),
),
答案 1 :(得分:2)
您可以尝试使用Row小部件。
String someString = "51-47-24";
List<String> someNumbers = someString.split("-");
...
Row(
children: someNumbers.map((someNum) =>
Container(
padding: EdgeInsets.all(5.0),
child: Center(
child: Text("$someNum")
),
decoration: BoxDecoration(
color: Colors.yellow,
shape: BoxShape.circle
)
)
).toList()
)