VanButton constructor
const
VanButton({
- Key? key,
- required VoidCallback onPressed,
- String text = '',
- VoidCallback? onLongPress,
- ButtonType type = ButtonType.normal,
- ButtonSize size = ButtonSize.normal,
- double height = VanButtonSize.normalHeight,
- double? width,
- MainAxisAlignment mainAxisAlignment = MainAxisAlignment.center,
- double borderRadius = VanBorderSize.borderRadiusSm,
- Color backgroundColor = VanColor.white,
- Gradient? gradient,
- Color? color,
- Color fontColor = VanColor.white,
- double fontSize = VanFontSize.md,
- IconData? icon,
- bool plain = false,
- bool square = false,
- bool round = false,
- bool disabled = false,
- bool loading = false,
- String loadingText = '',
- LoadingType loadingType = LoadingType.circular,
- double loadingSize = 20,
Implementation
const VanButton({
super.key,
required this.onPressed,
this.text = '',
this.onLongPress,
this.type = ButtonType.normal,
this.size = ButtonSize.normal,
this.height = VanButtonSize.normalHeight,
this.width,
this.mainAxisAlignment = MainAxisAlignment.center,
this.borderRadius = VanBorderSize.borderRadiusSm,
this.backgroundColor = VanColor.white,
this.gradient,
this.color,
this.fontColor = VanColor.white,
this.fontSize = VanFontSize.md,
this.icon,
this.plain = false,
this.square = false,
this.round = false,
this.disabled = false,
this.loading = false,
this.loadingText = '',
this.loadingType = LoadingType.circular,
this.loadingSize = 20,
});