MotionLoader.threeD constructor

MotionLoader.threeD({
  1. Key? key,
  2. required MotionThreeDStyle style,
  3. Color? color,
  4. double size = 50.0,
})

3D Theme Category: floating parallax cubes, stacked isometrics, holographic wireframe spheres.

Implementation

factory MotionLoader.threeD({
  Key? key,
  required MotionThreeDStyle style,
  Color? color,
  double size = 50.0,
}) {
  return MotionLoader._internal(
    key: key,
    color: color,
    size: size,
    builder: (context) {
      final activeColor = color ?? Theme.of(context).primaryColor;
      switch (style) {
        case MotionThreeDStyle.floatingCube:
          return MotionFloatingCubeLoader(
            color: activeColor,
            size: size,
          );
        case MotionThreeDStyle.isometric:
          return MotionIsometricLoader(
            color: activeColor,
            size: size,
          );
        case MotionThreeDStyle.holographicSphere:
          return MotionHolographicSphereLoader(
            color: activeColor,
            size: size,
          );
      }
    },
  );
}