paddingOnly method

T paddingOnly({
  1. double? horizontal,
  2. double? vertical,
  3. double? start,
  4. double? end,
  5. double? left,
  6. double? right,
  7. double? top,
  8. double? bottom,
})

Sets custom padding for each side with priority resolution.

Implementation

T paddingOnly({
  double? horizontal,
  double? vertical,
  double? start,
  double? end,
  double? left,
  double? right,
  double? top,
  double? bottom,
}) {
  // Priority resolution (most specific wins)
  final resolvedLeft = left ?? horizontal;
  final resolvedRight = right ?? horizontal;
  final resolvedTop = top ?? vertical;
  final resolvedBottom = bottom ?? vertical;

  // Use directional if start/end provided
  if (start != null || end != null) {
    return padding(
      EdgeInsetsGeometryMix.directional(
        start: start ?? resolvedLeft,
        end: end ?? resolvedRight,
        top: resolvedTop,
        bottom: resolvedBottom,
      ),
    );
  }

  // Otherwise use regular EdgeInsets
  return padding(
    EdgeInsetsGeometryMix.only(
      left: resolvedLeft,
      right: resolvedRight,
      top: resolvedTop,
      bottom: resolvedBottom,
    ),
  );
}