Container(
margin: EdgeInsets.only(top: 4),
padding: EdgeInsets.fromLTRB(12, 3, 7, 3),
child: Row(
children: [
Text("營業中",
style: TextStyle(
height: 1.4,
fontSize: 12,
textBaseline: TextBaseline.alphabetic,
color: Color(0XFFFA6C17),
fontWeight: FontWeight.bold),
textAlign: TextAlign.center,
maxLines: 1,
textDirection: TextDirection.ltr),
Image.asset(
"assets/images/public/icon_system_arrow_mini_right.png",
width: 16,
height: 16,
)
],
),
decoration: BoxDecoration(
color: Color(0xfffef0e8),
borderRadius: BorderRadius.all(Radius.circular(8)),
),
),
假如不加height属性 文字始终不能垂直居中,设置height就好了,这个属性的意思是行高,不要设置太大,他会乘以fontSize得出的结果才是行高,目前暂时知道这种方法可以垂直居中。