fromLine static method
Implementation
static Rect fromLine(Offset a, Offset b, double width) {
final angle = (b - a).direction;
final topLeft = a.translate(-width / 2 * math.cos(angle), -width / 2 * math.sin(angle));
final bottomRight = b.translate(width / 2 * math.cos(angle), width / 2 * math.sin(angle));
return Rect.fromPoints(topLeft, bottomRight);
}