ModulaLoadingButton constructor

const ModulaLoadingButton({
  1. Key? key,
  2. VoidCallback? onPressed,
  3. Future<void> onPressedAsync()?,
  4. String? label,
  5. Widget? icon,
  6. IconPlacement iconPlacement = IconPlacement.left,
  7. TextStyle? labelStyle,
  8. ModulaButtonSize size = ModulaButtonSize.medium,
  9. bool isDisabled = false,
  10. double? borderRadius,
  11. Color? backgroundColor,
  12. Color? foregroundColor,
  13. Color? loadingColor,
  14. TextAlign textAlign = TextAlign.center,
  15. EdgeInsetsGeometry? padding,
  16. double? elevation,
  17. String? loadingText,
  18. Widget? loadingIndicator,
  19. bool showIconWhileLoading = false,
})

Implementation

const ModulaLoadingButton({
  super.key,
  this.onPressed,
  this.onPressedAsync,
  this.label,
  this.icon,
  this.iconPlacement = IconPlacement.left,
  this.labelStyle,
  this.size = ModulaButtonSize.medium,
  this.isDisabled = false,
  this.borderRadius,
  this.backgroundColor,
  this.foregroundColor,
  this.loadingColor,
  this.textAlign = TextAlign.center,
  this.padding,
  this.elevation,
  this.loadingText,
  this.loadingIndicator,
  this.showIconWhileLoading = false,
}) : assert(
        onPressed != null || onPressedAsync != null,
        'Either onPressed or onPressedAsync must be provided',
      );