radiusBoxDecoration function

Decoration radiusBoxDecoration(
  1. {@required Animation animation,
  2. bool isDarkMode = false,
  3. bool isPurplishMode = false,
  4. bool hasCustomColors = false,
  5. AlignmentGeometry beginAlign = Alignment.topLeft,
  6. AlignmentGeometry endAlign = Alignment.bottomRight,
  7. List<Color> colors = defaultColors,
  8. double radius = 10.0}
)

Implementation

Decoration radiusBoxDecoration(
    {@required Animation animation,
    bool isDarkMode = false,
    bool isPurplishMode = false,
    bool hasCustomColors = false,
    AlignmentGeometry beginAlign = Alignment.topLeft,
    AlignmentGeometry endAlign = Alignment.bottomRight,
    List<Color> colors = defaultColors,
    double radius = 10.0}) {
  return BoxDecoration(
      borderRadius: BorderRadius.circular(radius),
      shape: BoxShape.rectangle,
      gradient: LinearGradient(
          begin: beginAlign,
          end: endAlign,
          colors: hasCustomColors
              ? colors.map((color) {
                  return color;
                }).toList()
              : [
                  isPurplishMode
                      ? Color(0xFF8D71A9)
                      : isDarkMode
                          ? Color(0xFF1D1D1D)
                          : Color.fromRGBO(0, 0, 0, 0.1),
                  isPurplishMode
                      ? Color(0xFF36265A)
                      : isDarkMode ? Color(0XFF3C4042) : Color(0x44CCCCCC),
                  isPurplishMode
                      ? Color(0xFF8D71A9)
                      : isDarkMode
                          ? Color(0xFF1D1D1D)
                          : Color.fromRGBO(0, 0, 0, 0.1),
                ],
          stops: [animation.value - 2, animation.value, animation.value + 1]));
}