void removeSegment(int start, int end) { segments.removeWhere( (element) => element.start == start && element.endIndex == end); }