Card constructor

const Card({
  1. Widget? child,
  2. List<Widget>? children,
  3. CardVariant variant = CardVariant.elevated,
  4. String? padding,
  5. String? borderRadius,
  6. void onTap()?,
  7. void onClick()?,
  8. String? backgroundColor,
  9. bool fillWidth = false,
  10. Key? key,
})

Implementation

const Card({
  Widget? child,
  List<Widget>? children,
  this.variant = CardVariant.elevated,
  this.padding,
  this.borderRadius,
  void Function()? onTap,
  void Function()? onClick,
  this.backgroundColor,
  this.fillWidth = false,
  super.key,
})  : _child = child,
      _children = children,
      _onTap = onTap ?? onClick,
      assert(child != null || children != null,
          'Either child or children must be provided');