hitTestLine function
Returns true if point is within thickness of the segment start-end.
Implementation
bool hitTestLine(Offset point, Offset start, Offset end, double thickness) {
final distance = distancePointToSegment(point, start, end);
return distance <= thickness / 2;
}