AnalyticsQueueStatusCard constructor
AnalyticsQueueStatusCard({
- Key? key,
- required AnalyticsQueueSnapshot snapshot,
- Future<
void> onFlush()?, - bool consentGranted = true,
- bool busy = false,
- String title = 'Private analytics queue',
- String pendingLabel = 'Pending',
- String uploadedLabel = 'Uploaded',
- String droppedLabel = 'Dropped',
- String droppedByReasonLabel = 'Dropped by reason',
- String consentRequiredLabel = 'Analytics consent not granted',
- String flushLabel = 'Upload pending analytics',
- String flushingLabel = 'Uploading analytics',
- 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');
}
}
}