MotionTrack constructor

MotionTrack(
  1. List<MotionKey> keys, {
  2. TrackKind? kind,
})

The kind is READ OFF THE KEYS unless it is given: a track of colours is a colour track, and a file that spells MotionTrack([MotionKey(…)]) should not also have to say so. Given explicitly for an empty track, which has nothing to read.

Implementation

MotionTrack(List<MotionKey> keys, {TrackKind? kind})
  : keys = keys,
    kind =
        kind ??
        (keys.isNotEmpty && keys.first.value is SceneColor
            ? TrackKind.color
            : TrackKind.number) {
  _sort();
}