OutboxQueueStatusCard constructor
OutboxQueueStatusCard({
- Key? key,
- required int pendingCount,
- required int manualReviewCount,
- required OutboxQueueStatus status,
- bool busy = false,
- Future<
void> onDrain()?, - String title = 'Offline delivery queue',
- String idleLabel = 'Waiting to sync',
- String drainingLabel = 'Syncing queued changes',
- String offlineLabel = 'Offline · changes stay on this device',
- String errorLabel = 'Sync could not finish. Try again later.',
- String pendingLabel = 'Pending',
- String reviewLabel = 'Needs review',
- String drainLabel = 'Sync now',
Implementation
OutboxQueueStatusCard({
super.key,
required this.pendingCount,
required this.manualReviewCount,
required this.status,
this.busy = false,
this.onDrain,
this.title = 'Offline delivery queue',
this.idleLabel = 'Waiting to sync',
this.drainingLabel = 'Syncing queued changes',
this.offlineLabel = 'Offline · changes stay on this device',
this.errorLabel = 'Sync could not finish. Try again later.',
this.pendingLabel = 'Pending',
this.reviewLabel = 'Needs review',
this.drainLabel = 'Sync now',
}) {
if (pendingCount < 0) {
throw ArgumentError.value(pendingCount, 'pendingCount', 'must be >= 0');
}
if (manualReviewCount < 0) {
throw ArgumentError.value(
manualReviewCount,
'manualReviewCount',
'must be >= 0',
);
}
for (final (name, value) in [
('title', title),
('idleLabel', idleLabel),
('drainingLabel', drainingLabel),
('offlineLabel', offlineLabel),
('errorLabel', errorLabel),
('pendingLabel', pendingLabel),
('reviewLabel', reviewLabel),
('drainLabel', drainLabel),
]) {
if (value.trim().isEmpty) {
throw ArgumentError.value(value, name, 'must not be blank');
}
}
}