flutter margins 1

flutter margins

Container (
	// Even Margin On All Sides
    margin: EdgeInsets.all(10.0),
    // Symetric Margin
    margin: EdgeInsets.symmetric(vertical: 10.0, horizontal: 5.0),
    // Different Margin For All Sides
    margin: EdgeInsets.fromLTRB(1.0, 2.0, 3.0, 4.0);
    
    child: Child
    (
    	...
    ),
)

Here is what the above code is Doing:
1. We are creating a Container widget.
2. We are giving it a margin of 10.0 on all sides.
3. We are giving it a margin of 10.0 on the top and bottom and 5.0 on the left and right.
4. We are giving it a margin of 1.0 on the left, 2.0 on the top, 3.0 on the right and 4.0 on the bottom.

Similar Posts