NZButton constructor
const
NZButton({
- Key? key,
- required VoidCallback? onPressed,
- Widget? child,
- String? label,
- NZButtonStyle style = NZButtonStyle.primary,
- double? width,
- double height = 48.0,
- EdgeInsetsGeometry? padding,
- double borderRadius = 12.0,
- Widget? icon,
- double iconGap = 8.0,
- bool isLoading = false,
- bool block = false,
- double? progress,
- Color? progressColor,
- Color? color,
- 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');