MotionLoader.minimal constructor

MotionLoader.minimal({
  1. Key? key,
  2. required MotionMinimalStyle style,
  3. Color? color,
  4. double size = 50.0,
  5. double strokeWidth = 3.0,
})

Minimal Theme Category: Lemniscate drawing paths, vectors & morphing layers.

Implementation

factory MotionLoader.minimal({
  Key? key,
  required MotionMinimalStyle style,
  Color? color,
  double size = 50.0,
  double strokeWidth = 3.0,
}) {
  return MotionLoader._internal(
    key: key,
    color: color,
    size: size,
    strokeWidth: strokeWidth,
    builder: (context) {
      final activeColor = color ?? Theme.of(context).primaryColor;
      switch (style) {
        case MotionMinimalStyle.lineDraw:
          return MotionLineDrawLoader(
            color: activeColor,
            size: size,
            strokeWidth: strokeWidth,
          );
        case MotionMinimalStyle.morphShape:
          return MotionMorphShapeLoader(
            color: activeColor,
            size: size,
          );
        case MotionMinimalStyle.infiniteRibbon:
          return MotionInfiniteRibbonLoader(
            color: activeColor,
            size: size,
          );
      }
    },
  );
}