VanButton constructor

const VanButton({
  1. Key? key,
  2. required VoidCallback onPressed,
  3. String text = '',
  4. VoidCallback? onLongPress,
  5. ButtonType type = ButtonType.normal,
  6. ButtonSize size = ButtonSize.normal,
  7. double height = VanButtonSize.normalHeight,
  8. double? width,
  9. MainAxisAlignment mainAxisAlignment = MainAxisAlignment.center,
  10. double borderRadius = VanBorderSize.borderRadiusSm,
  11. Color backgroundColor = VanColor.white,
  12. Gradient? gradient,
  13. Color? color,
  14. Color fontColor = VanColor.white,
  15. double fontSize = VanFontSize.md,
  16. IconData? icon,
  17. bool plain = false,
  18. bool square = false,
  19. bool round = false,
  20. bool disabled = false,
  21. bool loading = false,
  22. String loadingText = '',
  23. LoadingType loadingType = LoadingType.circular,
  24. 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,
});