myBoxDec function

Decoration myBoxDec(
  1. dynamic animation,
  2. {dynamic isCircle = false,
  3. dynamic isDark = false}
)

myBoxDesc to reuse with PKSkeleton

Implementation

Decoration myBoxDec(animation, {isCircle = false, isDark = false}) {
  return BoxDecoration(
    shape: isCircle ? BoxShape.circle : BoxShape.rectangle,
    gradient: LinearGradient(
      begin: Alignment.centerLeft,
      end: Alignment.centerRight,
      colors: isDark
          ? [
              Colors.grey[700],
              Colors.grey[600],
              Colors.grey[700],
              // Color(0xfff6f7f9),
            ]
          : [
              const Color(0xfff6f7f9),
              const Color(0xffe9ebee),
              const Color(0xfff6f7f9),
            ],
      stops: [
        animation.value - 1,
        animation.value,
        animation.value + 1,
      ],
    ),
  );
}