NZButton constructor

const NZButton({
  1. Key? key,
  2. required VoidCallback? onPressed,
  3. Widget? child,
  4. String? label,
  5. NZButtonStyle style = NZButtonStyle.primary,
  6. double? width,
  7. double height = 48.0,
  8. EdgeInsetsGeometry? padding,
  9. double borderRadius = 12.0,
  10. Widget? icon,
  11. double iconGap = 8.0,
  12. bool isLoading = false,
  13. bool block = false,
  14. double? progress,
  15. Color? progressColor,
  16. Color? color,
  17. Color? foregroundColor,
})

Implementation

const NZButton({
  super.key,
  required this.onPressed,
  this.child,
  this.label,
  this.style = NZButtonStyle.primary,
  this.width,
  this.height = 48.0,
  this.padding,
  this.borderRadius = 12.0,
  this.icon,
  this.iconGap = 8.0,
  this.isLoading = false,
  this.block = false,
  this.progress,
  this.progressColor,
  this.color,
  this.foregroundColor,
}) : assert(child != null || label != null, '必须提供 child 或 label');