本文已参与「新人创作礼」活动,一起开启掘金创作之路
EdgeInsets
四周的偏移量用于Padding。
EdgeInsets.all
所有的偏移量都固定为同一个值
四周偏移 8 像素
EdgeInsets.all(8.0)
EdgeInsets.symmetric
水平或者垂直方向偏移相同的值
垂直方向偏移 8 像素
EdgeInsets.symmetric(vertical: 8.0)
竖直方向偏移 8 像素
EdgeInsets.symmetric(horizontal: 8.0)
四周偏移 8 像素
EdgeInsets.symmetric(horizontal: 8, vertical: 8)
EdgeInsets.fromLTRB
分别为 Left Top Right Bottom 指定对应的偏移量
Left = 5 Top = 8 Right = 7 Bottom = 3
EdgeInsets.fromLTRB(5,8,7,3)
EdgeInsets.only
可以针对单个或者多个设置偏移
Left = 8
EdgeInsets.only(left:8)
Right = 4 Bottom = 5
EdgeInsets.only(right:4, bottom:5)