AsyncCommonButton constructor

const AsyncCommonButton({
  1. Key? key,
  2. String? label,
  3. IconData? icon,
  4. CommonButtonVariant variant = CommonButtonVariant.primary,
  5. required Future<void> onPressed()?,
  6. Color? color,
  7. double? width,
  8. String? semanticLabel,
  9. Duration? timeout,
  10. IconData successIcon = Icons.check_circle,
  11. IconData errorIcon = Icons.error,
  12. Duration successDuration = const Duration(seconds: 1),
  13. Duration errorDuration = const Duration(seconds: 2),
  14. String loadingAnnouncement = 'Loading',
  15. String? successAnnouncement,
  16. String errorAnnouncement = 'Action failed',
})

Implementation

const AsyncCommonButton({
  super.key,
  this.label,
  this.icon,
  this.variant = CommonButtonVariant.primary,
  required this.onPressed,
  this.color,
  this.width,
  this.semanticLabel,
  this.timeout,
  this.successIcon = Icons.check_circle,
  this.errorIcon = Icons.error,
  this.successDuration = const Duration(seconds: 1),
  this.errorDuration = const Duration(seconds: 2),
  this.loadingAnnouncement = 'Loading',
  this.successAnnouncement,
  this.errorAnnouncement = 'Action failed',
});