AnalyticsQueueStatusCard constructor

AnalyticsQueueStatusCard({
  1. Key? key,
  2. required AnalyticsQueueSnapshot snapshot,
  3. Future<void> onFlush()?,
  4. bool consentGranted = true,
  5. bool busy = false,
  6. String title = 'Private analytics queue',
  7. String pendingLabel = 'Pending',
  8. String uploadedLabel = 'Uploaded',
  9. String droppedLabel = 'Dropped',
  10. String droppedByReasonLabel = 'Dropped by reason',
  11. String consentRequiredLabel = 'Analytics consent not granted',
  12. String flushLabel = 'Upload pending analytics',
  13. String flushingLabel = 'Uploading analytics',
  14. String errorLabel = 'Upload failed. Try again.',
})

Implementation

AnalyticsQueueStatusCard({
  super.key,
  required this.snapshot,
  this.onFlush,
  this.consentGranted = true,
  this.busy = false,
  this.title = 'Private analytics queue',
  this.pendingLabel = 'Pending',
  this.uploadedLabel = 'Uploaded',
  this.droppedLabel = 'Dropped',
  this.droppedByReasonLabel = 'Dropped by reason',
  this.consentRequiredLabel = 'Analytics consent not granted',
  this.flushLabel = 'Upload pending analytics',
  this.flushingLabel = 'Uploading analytics',
  this.errorLabel = 'Upload failed. Try again.',
}) {
  for (final (name, value) in [
    ('title', title),
    ('pendingLabel', pendingLabel),
    ('uploadedLabel', uploadedLabel),
    ('droppedLabel', droppedLabel),
    ('droppedByReasonLabel', droppedByReasonLabel),
    ('consentRequiredLabel', consentRequiredLabel),
    ('flushLabel', flushLabel),
    ('flushingLabel', flushingLabel),
    ('errorLabel', errorLabel),
  ]) {
    if (value.trim().isEmpty) {
      throw ArgumentError.value(value, name, 'must not be blank');
    }
  }
}