right method
double?
right({
- required double childSize,
- required ZeroBadgeType type,
- required double childPadding,
Calculation of the right position on the badge
If the position is topRight or bottomRight, return the childSize if the type is standard, otherwise return 0
If ZeroBadgePosition is not right, 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: The return value is a double? (nullable double)
Implementation
double? right({
required double childSize,
required ZeroBadgeType type,
required double childPadding,
}) {
if (this == topRight || this == bottomRight) {
// Check if type is standard return [childSize]
return type != ZeroBadgeType.dot ? childSize - (childPadding / 2) : 0;
}
return null;
}