Acrylic constructor

const Acrylic({
  1. Key? key,
  2. Color? color,
  3. BoxDecoration? decoration,
  4. ImageFilter? filter,
  5. Widget? child,
  6. double opacity = kDefaultAcrylicOpacity,
  7. double? width,
  8. double? height,
  9. EdgeInsetsGeometry? padding,
  10. EdgeInsetsGeometry? margin,
  11. Color? shadowColor,
  12. double elevation = 0.0,
  13. bool? enabled,
})

The color and decoration arguments can not be both supplied.

Implementation

const Acrylic({
  Key? key,
  this.color,
  this.decoration,
  this.filter,
  this.child,
  this.opacity = kDefaultAcrylicOpacity,
  this.width,
  this.height,
  this.padding,
  this.margin,
  this.shadowColor,
  this.elevation = 0.0,
  this.enabled,
})  : assert(elevation >= 0, 'The elevation can NOT be negative'),
      assert(opacity >= 0, 'The opacity can NOT be negative'),
      assert(
        elevation == 0.0 || opacity == 1.0,
        'You can NOT provide both opacity and elevation',
      ),
      super(key: key);