Flutter EdgeInsets Class EdgeInsets.all, EdgeInsets.only, EdgeInsets.fromLTRB, EdgeInsets.symmetric

Опубликовано: 25 Август 2024
на канале: Click 2 Start
65
1

Flutter EdgeInsets Class EdgeInsets.all, EdgeInsets.only, EdgeInsets.fromLTRB, EdgeInsets.symmetric

EdgeInsets.fromLTRB(double left, double top, double right, double bottom)
This constructor creates insets with specific values for each of the four sides left, top, right, and bottom.
Usage:: When you want to provide different padding or margins for each side.

EdgeInsets.all(double value)
This constructor creates insets where the padding or margin is the same on all four sides (left, top, right, bottom).
Usage:: When you want to apply uniform padding or margins.

EdgeInsets.only({double left = 0.0, double top = 0.0, double right = 0.0, double bottom = 0.0})
This constructor allows you to specify padding or margins for only certain sides while leaving the others at a default value (usually 0.0).
Usage:: When you only want to apply padding or margins to specific sides.

EdgeInsets.symmetric({double vertical = 0.0, double horizontal = 0.0})
This constructor creates insets with symmetric padding or margins, where the same value is applied horizontally (left and right) and/or vertically (top and bottom)
Usage:: When you want to apply equal padding or margins on both the horizontal or vertical sides.