i use margin for text to go a little bit up but container its taking a lot of space on screen,why container is taking a lot os spaces on screen

╄→尐↘猪︶ㄣ 提交于 2020-01-22 02:14:29

问题


Column( mainAxisAlignment: MainAxisAlignment.center, children: [ Container( margin: EdgeInsets.only(bottom: 200.0), child: Center( child: Padding( padding: EdgeInsets.symmetric(horizontal: 10.0), child: Text( _text, style: TextStyle(color: Colors.white), ), ), ), ),


回答1:


reduce margin, margin takes much of space

    Column( mainAxisAlignment: MainAxisAlignment.center, 
    children: [ Container( margin: EdgeInsets.only(bottom: 15.0), 
child: Center( 
child: Padding( padding: EdgeInsets.symmetric(horizontal: 10.0), 
child: Text( _text, style: TextStyle(color: Colors.white), ), ), ), ),


来源:https://stackoverflow.com/questions/59784517/i-use-margin-for-text-to-go-a-little-bit-up-but-container-its-taking-a-lot-of-sp

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!