Single text widgets having more width than single text widget
SimonVillage opened this issue · comments
Simon commented
I wonder if there is a solution for this?
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text("123,123,123", style: TextStyle(fontSize: 24)),
Row(
children: [
Text("1", style: TextStyle(fontSize: 24)),
Text("2", style: TextStyle(fontSize: 24)),
Text("3", style: TextStyle(fontSize: 24)),
Text(",", style: TextStyle(fontSize: 24)),
Text("1", style: TextStyle(fontSize: 24)),
Text("2", style: TextStyle(fontSize: 24)),
Text("3", style: TextStyle(fontSize: 24)),
Text(",", style: TextStyle(fontSize: 24)),
Text("1", style: TextStyle(fontSize: 24)),
Text("2", style: TextStyle(fontSize: 24)),
Text("3", style: TextStyle(fontSize: 24)),
],
),
],
);
Bradley Wang commented
This is intentional. This package ensures all digits occupy the same width, so that when their values change, there won't be any horizontal shifting.
For example, typically number 1
is "skinnier" than number 2
. This package makes sure 1
is padded to be the same width as 2
, such that when 1
is animated into 2
, its width doesn't need to change, and other digits around it aren't affected.
For your case, you can consider using a monospaced font.