OnboardingFlowQueueCard constructor
OnboardingFlowQueueCard({
- Key? key,
- required List<
OnboardingFlowRow> rows, - Future<
void> onMarkSeen(- String flowId
- bool busy = false,
- int maxVisibleRows = 20,
- String title = 'Onboarding flows',
- String emptyLabel = 'No onboarding flows registered.',
- String nextLabel = 'Next',
- String seenLabel = 'Seen',
- String pendingLabel = 'Not seen yet',
- String priorityLabel = 'Priority',
- String versionLabel = 'Version',
- String markSeenLabel = 'Mark seen',
- String actionErrorLabel = 'Action failed. Try again.',
Implementation
OnboardingFlowQueueCard({
super.key,
required List<OnboardingFlowRow> rows,
this.onMarkSeen,
this.busy = false,
this.maxVisibleRows = 20,
this.title = 'Onboarding flows',
this.emptyLabel = 'No onboarding flows registered.',
this.hiddenRowsLabel = 'More flows hidden',
this.nextLabel = 'Next',
this.seenLabel = 'Seen',
this.pendingLabel = 'Not seen yet',
this.priorityLabel = 'Priority',
this.versionLabel = 'Version',
this.markSeenLabel = 'Mark seen',
this.actionErrorLabel = 'Action failed. Try again.',
}) : rows = List.unmodifiable(rows) {
if (maxVisibleRows <= 0) {
throw ArgumentError.value(
maxVisibleRows,
'maxVisibleRows',
'must be > 0',
);
}
if (this.rows.where((r) => r.isNext).length > 1) {
throw ArgumentError.value(rows, 'rows', 'at most one row can be next');
}
if (this.rows.map((r) => r.flowId).toSet().length != this.rows.length) {
throw ArgumentError.value(rows, 'rows', 'flowId values must be unique');
}
for (final (name, value) in [
('title', title),
('emptyLabel', emptyLabel),
('hiddenRowsLabel', hiddenRowsLabel),
('nextLabel', nextLabel),
('seenLabel', seenLabel),
('pendingLabel', pendingLabel),
('priorityLabel', priorityLabel),
('versionLabel', versionLabel),
('markSeenLabel', markSeenLabel),
('actionErrorLabel', actionErrorLabel),
]) {
if (value.trim().isEmpty) {
throw ArgumentError.value(value, name, 'must not be blank');
}
}
}