VipPerkProgressRow constructor
VipPerkProgressRow({})
Implementation
VipPerkProgressRow({
super.key,
required this.currentTier,
required this.currentPoints,
this.nextTierPoints,
this.tierLabel,
this.perks = const [],
this.onAction,
this.actionLabel = 'View Perks',
this.semanticLabel,
}) {
if (currentTier < 0) {
throw ArgumentError.value(
currentTier,
'currentTier',
'must be non-negative',
);
}
if (currentPoints < 0) {
throw ArgumentError.value(
currentPoints,
'currentPoints',
'must be non-negative',
);
}
if (nextTierPoints != null && nextTierPoints! <= 0) {
throw ArgumentError.value(
nextTierPoints,
'nextTierPoints',
'must be positive when provided',
);
}
if (tierLabel != null && tierLabel!.trim().isEmpty) {
throw ArgumentError.value(tierLabel, 'tierLabel', 'must not be empty');
}
if (actionLabel.trim().isEmpty) {
throw ArgumentError.value(
actionLabel,
'actionLabel',
'must not be empty',
);
}
}