在最近flutter页面改造过程中,发现通过Contail包裹Text控件设置上下padding时,在华为魅族和vivo等手机上并没有居中展示,所以通过查看控件属性,得以解决此类问题
可以看到上面的在华为手机上明显偏下了
使用:
Container(
padding: EdgeInsets.only(left: 4,top: 2,bottom: 2,right: 4),
color: Colors.blue,
child: Text('测试标题111'),
),
Container(