AnimatedBorderSegments.spacedEvenly constructor

AnimatedBorderSegments.spacedEvenly(
  1. List<EvenlySpacedBorderSegment> segments
)

Implementation

factory AnimatedBorderSegments.spacedEvenly(List<EvenlySpacedBorderSegment> segments) {
  List<BorderSegment> modifiedSegments = segments;
  int count = modifiedSegments.length;
  for (var i = 0; i < count; i++) {
    modifiedSegments[i].position = (400 / count) * i;
  }
  return AnimatedBorderSegments._(
    segmentationType: SegmentationType.spacedEvenly,
    segments: modifiedSegments,
  );
}