AsyncCommonButton constructor
const
AsyncCommonButton({
- Key? key,
- String? label,
- IconData? icon,
- CommonButtonVariant variant = CommonButtonVariant.primary,
- required Future<
void> onPressed()?, - Color? color,
- double? width,
- String? semanticLabel,
- Duration? timeout,
- IconData successIcon = Icons.check_circle,
- IconData errorIcon = Icons.error,
- Duration successDuration = const Duration(seconds: 1),
- Duration errorDuration = const Duration(seconds: 2),
- String loadingAnnouncement = 'Loading',
- String? successAnnouncement,
- 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',
});