ContentPackStatusCard constructor
ContentPackStatusCard({
- Key? key,
- required ContentPackStatus status,
- required int contentVersion,
- String? updatedAtText,
- bool busy = false,
- Future<
void> onRefresh()?, - String title = 'Content pack',
- String loadingLabel = 'Loading content',
- String readyLabel = 'Content ready',
- String refreshingLabel = 'Updating content',
- String errorLabel = 'Content update failed. Try again.',
- String versionLabel = 'Version',
- String updatedLabel = 'Updated',
- String refreshLabel = 'Refresh content',
- String retryLabel = 'Retry update',
- String actionErrorLabel = 'Action failed. Try again.',
Implementation
ContentPackStatusCard({
super.key,
required this.status,
required this.contentVersion,
this.updatedAtText,
this.busy = false,
this.onRefresh,
this.title = 'Content pack',
this.loadingLabel = 'Loading content',
this.readyLabel = 'Content ready',
this.refreshingLabel = 'Updating content',
this.errorLabel = 'Content update failed. Try again.',
this.versionLabel = 'Version',
this.updatedLabel = 'Updated',
this.refreshLabel = 'Refresh content',
this.retryLabel = 'Retry update',
this.actionErrorLabel = 'Action failed. Try again.',
}) {
if (contentVersion < 0) {
throw ArgumentError.value(
contentVersion,
'contentVersion',
'must be >= 0',
);
}
for (final (name, value) in [
('title', title),
('loadingLabel', loadingLabel),
('readyLabel', readyLabel),
('refreshingLabel', refreshingLabel),
('errorLabel', errorLabel),
('versionLabel', versionLabel),
('updatedLabel', updatedLabel),
('refreshLabel', refreshLabel),
('retryLabel', retryLabel),
('actionErrorLabel', actionErrorLabel),
('updatedAtText', updatedAtText),
]) {
if (value != null && value.trim().isEmpty) {
throw ArgumentError.value(value, name, 'must not be blank');
}
}
}