getEffectFromIndicatorEffect method

IndicatorEffect getEffectFromIndicatorEffect(
  1. IndicatorEffects? effect,
  2. Color primaryColor,
  3. Color secondaryColor,
  4. double dotSize,
)

Implementation

IndicatorEffect getEffectFromIndicatorEffect(IndicatorEffects? effect,
    Color primaryColor, Color secondaryColor, double dotSize) {
  switch (effect) {
    case IndicatorEffects.worm:
      return WormEffect(
          activeDotColor: primaryColor,
          dotColor: secondaryColor,
          radius: dotSize);
    case IndicatorEffects.colorTransition:
      return ColorTransitionEffect(
          activeDotColor: primaryColor,
          dotColor: secondaryColor,
          radius: dotSize);
    case IndicatorEffects.expanding:
      return ExpandingDotsEffect(
          activeDotColor: primaryColor,
          dotColor: secondaryColor,
          radius: dotSize);

    case IndicatorEffects.jumping:
      return JumpingDotEffect(
          activeDotColor: primaryColor,
          dotColor: secondaryColor,
          radius: dotSize);

    case IndicatorEffects.scale:
      return ScaleEffect(
          activeDotColor: primaryColor,
          dotColor: secondaryColor,
          radius: dotSize);

    case IndicatorEffects.scrolling:
      return ScrollingDotsEffect(
          activeDotColor: primaryColor,
          dotColor: secondaryColor,
          radius: dotSize);

    case IndicatorEffects.slide:
      return SlideEffect(
          activeDotColor: primaryColor,
          dotColor: secondaryColor,
          radius: dotSize);

    case IndicatorEffects.swap:
      return SwapEffect(
          activeDotColor: primaryColor,
          dotColor: secondaryColor,
          radius: dotSize);
    default:
      return ColorTransitionEffect(
          activeDotColor: primaryColor,
          dotColor: secondaryColor,
          radius: dotSize);
  }
}