CoderShakingIcon constructor

const CoderShakingIcon({
  1. Key? key,
  2. String? svgAssetPath,
  3. String? imageAssetPath,
  4. IconData? iconData,
  5. Color? color,
  6. double size = 24,
  7. Duration duration = const Duration(milliseconds: 600),
  8. double shakeOffset = 4.0,
  9. Axis shakeDirection = Axis.horizontal,
  10. BlendMode blendMode = BlendMode.srcIn,
})

Creates a CoderShakingIcon widget.

You must provide at least one of svgAssetPath, imageAssetPath, or iconData, otherwise an AssertionError will be thrown.

Implementation

const CoderShakingIcon({
  super.key,
  this.svgAssetPath, // ✅ Optional: SVG asset path (requires flutter_svg)
  this.imageAssetPath, // ✅ Optional: Image asset path (e.g., PNG/JPG)
  this.iconData, // ✅ Optional: Flutter built-in IconData
  this.color, // Optional: Color to apply to the icon/image/SVG
  this.size = 24, // Optional: Size of the icon/image in logical pixels
  this.duration = const Duration(
    milliseconds: 600,
  ), // Optional: One full shake cycle duration
  this.shakeOffset = 4.0, // Optional: Max distance to move during shake
  this.shakeDirection =
      Axis.horizontal, // Optional: Shake along horizontal or vertical axis
  this.blendMode =
      BlendMode.srcIn, // Optional: Blend mode for SVG or image color filter
}) : assert(
       svgAssetPath != null || imageAssetPath != null || iconData != null,
       'Provide either svgAssetPath, imageAssetPath, or iconData.',
     );