updateMorphSequence static method

List<Morph> updateMorphSequence({
  1. List<Morph>? morphSequence,
  2. required List<RoundedPolygon> polygons,
  3. required bool circularSequence,
  4. LoadingIndicatorForEachPolygon forEachPolygon = defaultForEachPolygon,
})

Implementation

static List<Morph> updateMorphSequence({
  List<Morph>? morphSequence,
  required List<RoundedPolygon> polygons,
  required bool circularSequence,
  LoadingIndicatorForEachPolygon forEachPolygon = defaultForEachPolygon,
}) {
  if (polygons.isEmpty) {
    morphSequence?.clear();
    return morphSequence ?? [];
  }
  final iterable = generateMorphSequence(
    polygons: polygons,
    circularSequence: circularSequence,
    forEachPolygon: forEachPolygon,
  );
  morphSequence
    ?..clear()
    ..addAll(iterable);
  return morphSequence ?? [...iterable];
}