getBounds method

  1. @override
Rect getBounds()
override

Implementation

@override
Rect getBounds() {
  if (startPoint == null) return Rect.zero;
  if (endPoint == null)
    return Rect.fromCenter(center: startPoint!, width: 1, height: 1);

  return Rect.fromPoints(startPoint!, endPoint!);
}