insertMiddlePoint method
Adds a new point to link on point
location.
index
is an index of link's segment where you want to insert the point.
Indexed from 1.
When the link is a straight line you want to add a point to index 1.
Implementation
void insertMiddlePoint(Offset position, int index) {
assert(index > 0);
assert(index < linkPoints.length);
linkPoints.insert(index, position);
notifyListeners();
}