Button constructor

const Button({
  1. Key? key,
  2. Widget? icon,
  3. String? text,
  4. Widget? child,
  5. String? tooltip,
  6. TextStyle? textStyle,
  7. Color? foregroundColor,
  8. Color? backgroundColor,
  9. Color? disabledBackgroundColor,
  10. EdgeInsets? padding,
  11. BorderRadius? borderRadius,
  12. required VoidCallback? onPressed,
  13. VoidCallback? onLongPress,
})

One of icon or text must be non-null

Implementation

const Button({
  super.key,
  this.icon,
  this.text,
  this.child,
  this.tooltip,
  this.textStyle,
  this.foregroundColor,
  this.backgroundColor,
  this.disabledBackgroundColor,
  this.padding,
  this.borderRadius,
  required this.onPressed,
  this.onLongPress,
}) : assert(icon != null || text != null || child != null);