MotionLoader.gaming constructor

MotionLoader.gaming({
  1. Key? key,
  2. required MotionGamingStyle style,
  3. Color? color,
  4. double size = 50.0,
  5. bool glow = true,
})

Gaming Theme Category: RPG runic fires, pixel scanlines, XP arcs.

Implementation

factory MotionLoader.gaming({
  Key? key,
  required MotionGamingStyle style,
  Color? color,
  double size = 50.0,
  bool glow = true,
}) {
  return MotionLoader._internal(
    key: key,
    color: color,
    size: size,
    builder: (context) {
      final activeColor = color ?? Theme.of(context).primaryColor;
      switch (style) {
        case MotionGamingStyle.xpProgress:
          return MotionXpProgressLoader(
            color: activeColor,
            size: size,
            glow: glow,
          );
        case MotionGamingStyle.bossFight:
          return MotionBossFightLoader(
            color: activeColor,
            size: size,
            glow: glow,
          );
        case MotionGamingStyle.pixel:
          return MotionPixelLoader(
            color: activeColor,
            size: size,
          );
      }
    },
  );
}