QuestProgressPill constructor
QuestProgressPill({})
Implementation
QuestProgressPill({
super.key,
required this.completed,
required this.total,
required this.onTap,
this.claimableCount = 0,
this.label = 'Quests',
this.semanticLabel,
}) {
if (total <= 0) {
throw ArgumentError.value(total, 'total', 'must be > 0');
}
if (completed < 0 || completed > total) {
throw ArgumentError.value(completed, 'completed', 'must be in 0..total');
}
if (claimableCount < 0 || claimableCount > completed) {
throw ArgumentError.value(
claimableCount,
'claimableCount',
'must be in 0..completed',
);
}
if (label.trim().isEmpty) {
throw ArgumentError.value(label, 'label', 'must not be blank');
}
if (semanticLabel != null && semanticLabel!.trim().isEmpty) {
throw ArgumentError.value(
semanticLabel,
'semanticLabel',
'must not be blank',
);
}
}