Flutter - Container & Padding


Flutter - Container & Padding 

Container örneği : Burada tüm body kısmını container kullanıp gri'ye boyadık asitce gösterimi.

Pading kullanarak köşelerden alan ayırabiliriz Örnek kod ;


fromLTRB(0,0,0,0) ile sağ sol alt üst olarak padding verebiliriz,

Aynı şekilde margin kullanabiliriz. Margin dıştan uzaklık Padding içten uzaklıktır kısacası.


A container first surrounds the child with padding (inflated by any borders present in the decoration) and then applies additional constraints to the padded extent (incorporating the width and height as constraints, if either is non-null). The container is then surrounded by additional empty space described from the margin.

During painting, the container first applies the given transform, then paints the decoration to fill the padded extent, then it paints the child, and finally paints the foregroundDecoration, also filling the padded extent.

Containers with no children try to be as big as possible unless the incoming constraints are unbounded, in which case they try to be as small as possible. Containers with children size themselves to their children. The width, height, and constraints arguments to the constructor override this.

By default, containers return false for all hit tests. If the color property is specified, the hit testing is handled by ColoredBox, which always returns true. If the decoration or foregroundDecoration properties are specified, hit testing is handled by Decoration.hitTest.


Yorum Gönderme

1 Yorumlar