NeumorphicButtonPainter constructor

NeumorphicButtonPainter({
  1. Gradient? gradient,
  2. List<Shadow> shadows = const <Shadow>[],
  3. ShapeBorder shape = const ContinuousRectangleBorder(),
  4. double blur = 0,
  5. double borderBlur = 0,
  6. Color color = const Color.fromARGB(0, 0, 0, 0),
  7. double strokeWidth = 0,
  8. Gradient? borderGradient,
  9. Color? accentColor,
  10. double accentIntensity = 0,
  11. Alignment? accentAlignment,
  12. required double animationValue,
  13. Key? key,
})

Implementation

NeumorphicButtonPainter(
    {Gradient? gradient,
    List<Shadow> shadows = const <Shadow>[],
    ShapeBorder shape = const ContinuousRectangleBorder(),
    double blur = 0,
    double borderBlur = 0,
    Color color = const Color.fromARGB(0, 0, 0, 0),
    double strokeWidth = 0,
    Gradient? borderGradient,
    Color? accentColor,
    double accentIntensity = 0,
    Alignment? accentAlignment,
    required this.animationValue,
    Key? key}) {
  shadowPainter = NeumorphicShadowPainter(
      shadows: shadows, shape: shape, strokeWidth: strokeWidth);

  if (accentColor != null && accentAlignment != null && accentIntensity > 0) {
    accentPainter = NeumorphicAccentPainter(
        alignment: accentAlignment,
        value: accentIntensity,
        color: accentColor,
        shape: shape,
        strokeWidth: strokeWidth);
  }

  surfacePainter = NeumorphicSurfacePainter(
      shape: shape,
      gradient: gradient,
      color: color,
      borderGradient: borderGradient,
      blur: blur,
      borderBlur: borderBlur,
      strokeWidth: strokeWidth);
}