AnimatedNeumorphicContainer constructor

const AnimatedNeumorphicContainer({
  1. Key? key,
  2. required double depth,
  3. Color color = const Color(0xFFF2F2F2),
  4. double? width,
  5. double? height,
  6. Widget? child,
  7. double radius = 8,
  8. Duration duration = const Duration(milliseconds: 250),
  9. Curve curve = Curves.easeInOut,
})

Creates a widget styled as Neumorphism that animates implicitly.

The color, radius, duration, curve arguments must not be null.

As default, color is defined Color(0xFFF2F2F2) that is little-grayish white. Because the Neumorphism is composed of base color, light color and dark color (for dropshadow), and this widget will calculate these automatically from the base color.

Implementation

const AnimatedNeumorphicContainer({
  Key? key,
  required this.depth,
  this.color = const Color(0xFFF2F2F2),
  this.width,
  this.height,
  this.child,
  this.radius = 8,
  this.duration = const Duration(milliseconds: 250),
  this.curve = Curves.easeInOut,
})  : assert(depth >= 0.0 && depth <= 1.0),
      super(key: key);