Padding class
Represents padding (internal spacing) for styled content.
Padding adds space between the content and its border.
// Uniform padding
final p1 = Padding.all(2);
// Vertical and horizontal
final p2 = Padding.symmetric(vertical: 1, horizontal: 2);
// Per-side
final p3 = Padding.only(top: 1, left: 2);
Constructors
- Padding({int top = 0, int right = 0, int bottom = 0, int left = 0})
-
Creates padding with explicit values for each side.
const
- Padding.all(int value)
-
Creates uniform padding on all sides.
const
- Padding.only({int top = 0, int right = 0, int bottom = 0, int left = 0})
-
Creates padding with only the specified sides.
const
- Padding.symmetric({int vertical = 0, int horizontal = 0})
-
Creates symmetric padding.
const
Properties
- bottom → int
-
Padding on the bottom side.
final
- hashCode → int
-
The hash code for this object.
no setteroverride
- horizontal → int
-
Total horizontal padding (left + right).
no setter
- isZero → bool
-
Whether all padding values are zero.
no setter
- left → int
-
Padding on the left side.
final
- right → int
-
Padding on the right side.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- top → int
-
Padding on the top side.
final
- vertical → int
-
Total vertical padding (top + bottom).
no setter
Methods
-
copyWith(
{int? top, int? right, int? bottom, int? left}) → Padding - Creates a copy with the specified values replaced.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
override