create static method

LiPlasmaCompute create({
  1. required PlasmaType type,
  2. required double circleSize,
  3. required double offset,
  4. required Size canvasSize,
  5. required double value,
  6. required double blur,
  7. required int particles,
  8. required double variation1,
  9. required double variation2,
  10. required double variation3,
})

Implementation

static LiPlasmaCompute create({
  required PlasmaType type,
  required double circleSize,
  required double offset,
  required Size canvasSize,
  required double value,
  required double blur,
  required int particles,
  required double variation1,
  required double variation2,
  required double variation3,
}) {
  if (type == PlasmaType.bubbles) {
    return LiBubblesPlasmaCompute(
      value: value,
      offset: offset,
      canvasSize: canvasSize,
      circleSize: circleSize,
      variation1: variation1,
      variation2: variation2,
      variation3: variation3,
    );
  }

  if (type == PlasmaType.circle) {
    return LiCirclePlasmaCompute(
      particles: particles,
      value: value,
      offset: offset,
      canvasSize: canvasSize,
      circleSize: circleSize,
      variation1: variation1,
      variation2: variation2,
      variation3: variation3,
    );
  }

  if (type == PlasmaType.infinity) {
    // return default
  }

  return LiInfinityPlasmaCompute(
    value: value,
    offset: offset,
    canvasSize: canvasSize,
    circleSize: circleSize,
    variation1: variation1,
    variation2: variation2,
    variation3: variation3,
  );
}