createSequenceItems method

List<TweenSequenceItem<T?>> createSequenceItems()

Implementation

List<TweenSequenceItem<T?>> createSequenceItems() {
  final items = <TweenSequenceItem<T?>>[];
  T current = initial;

  for (final segment in segments) {
    final end = segment.value;
    final tween = tweenBuilder(begin: current, end: end);

    items.add(
      TweenSequenceItem(
        tween: tween.chain(CurveTween(curve: segment.curve)),
        weight: segment.duration.inMilliseconds.toDouble(),
      ),
    );
    current = end;
  }

  return items;
}