PaddingWrapper.only constructor

PaddingWrapper.only({
  1. required Widget child,
  2. double left = 0.0,
  3. double right = 0.0,
  4. double top = 0.0,
  5. double bottom = 0.0,
})

Factory constructor for specific padding on each side.

Allows setting padding individually for the left, right, top, and bottom sides.

Example usage:

PaddingWrapper.only(
  left: 10.0,
  right: 20.0,
  top: 5.0,
  bottom: 15.0,
  child: Text('Custom Side Padded Text'),
);

Implementation

factory PaddingWrapper.only({
  required Widget child,
  double left = 0.0,
  double right = 0.0,
  double top = 0.0,
  double bottom = 0.0,
}) {
  return PaddingWrapper(
    padding: EdgeInsets.only(
      left: left,
      right: right,
      top: top,
      bottom: bottom,
    ),
    child: child,
  );
}