当文本容器大小随字体大小减小时,文本不设置在中心.如何解决这个问题是在集装箱尺寸以下进行的.
Container(
height: height,
width: width,
alignment: Alignment.center,
decoration: _isSelected
? BoxDecoration(
color: Colors.transparent,
border: Border.all(
width: 2,
color: Colors.black,
),
)
: null,
child: Align(
alignment: Alignment.center,
child: Text(
_displayText.isEmpty ? 'Enter Text' : _displayText,
textAlign: TextAlign.center,
overflow: TextOverflow.visible,
maxLines: 1,
style: TextStyle(
color: Colors.black,
fontSize: fontSize,
),
),
),
),