KillSwitchItem constructor
KillSwitchItem({})
Implementation
KillSwitchItem({
required this.id,
required this.label,
required this.killed,
required this.sourceLabel,
this.reasonText,
this.localOverride = false,
}) {
for (final (name, value) in [
('id', id),
('label', label),
('sourceLabel', sourceLabel),
('reasonText', reasonText),
]) {
if (value != null && value.trim().isEmpty) {
throw ArgumentError.value(value, name, 'must not be blank');
}
}
if (id.trim().isEmpty) {
throw ArgumentError.value(id, 'id', 'must not be blank');
}
if (localOverride && !killed) {
throw ArgumentError.value(
localOverride,
'localOverride',
'requires killed state',
);
}
}