CooldownActionButton constructor

CooldownActionButton({
  1. Key? key,
  2. required String label,
  3. required Duration remaining,
  4. required VoidCallback onTap,
  5. VoidCallback? onReady,
  6. bool busy = false,
  7. String? waitingSemanticLabel,
})

Implementation

CooldownActionButton({
  super.key,
  required this.label,
  required this.remaining,
  required this.onTap,
  this.onReady,
  this.busy = false,
  this.waitingSemanticLabel,
}) {
  if (label.trim().isEmpty) {
    throw ArgumentError.value(label, 'label', 'must not be blank');
  }
  if (remaining < Duration.zero) {
    throw ArgumentError.value(remaining, 'remaining', 'must be >= 0');
  }
}