AnalyticsQueueSnapshot constructor
AnalyticsQueueSnapshot({})
Implementation
AnalyticsQueueSnapshot({
required this.pendingCount,
required this.uploadedCount,
required Map<String, int> droppedCounts,
}) : droppedCounts = Map.unmodifiable(droppedCounts) {
for (final (name, value) in [
('pendingCount', pendingCount),
('uploadedCount', uploadedCount),
]) {
if (value < 0) throw ArgumentError.value(value, name, 'must be >= 0');
}
for (final entry in droppedCounts.entries) {
if (entry.key.trim().isEmpty || entry.value < 0) {
throw ArgumentError.value(entry, 'droppedCounts', 'invalid entry');
}
}
}