left method

double? left({
  1. required double childSize,
  2. required ZeroBadgeType type,
  3. required double childPadding,
})

Calculation of the left position on the badge

If the position is topLeft or bottomLeft, return the childSize if the type is standard, otherwise return 0

If ZeroBadgePosition is not left, return null

Args: childSize (double): The size of the child widget. type (ZeroBadgeType): The type of badge. childPadding (double): The padding of the child widget.

Returns: A double value.

Implementation

double? left({
  required double childSize,
  required ZeroBadgeType type,
  required double childPadding,
}) {
  if (this == topLeft || this == bottomLeft) {
    // Check if type is standard return [childSize]
    return type != ZeroBadgeType.dot ? childSize - (childPadding / 2) : 0;
  }

  return null;
}