MountPreconditionRow constructor
MountPreconditionRow({
- required MountPrecondition precondition,
- required MountOutcome outcome,
- required String detail,
- String remedy = '',
- List<
String> evidence = const <String>[], - String retrievedBy = '',
Creates one answered precondition.
evidence is the trimmable material — ids, keys, per-path counts — that
backs detail. retrievedBy is the exact scoped read that returns it in
full, and is required whenever there is evidence to lose.
Implementation
MountPreconditionRow({
required this.precondition,
required this.outcome,
required this.detail,
this.remedy = '',
this.evidence = const <String>[],
this.retrievedBy = '',
}) {
if (detail.trim().isEmpty) {
throw ArgumentError.value(
detail,
'detail',
'every ${precondition.wire} row states its evidence; a blank detail is '
'a row that says nothing',
);
}
if (outcome != MountOutcome.pass && remedy.trim().isEmpty) {
throw ArgumentError.value(
remedy,
'remedy',
'a ${outcome.wire} ${precondition.wire} row without a remedy leaves '
"the dance in the operator's head",
);
}
if (outcome == MountOutcome.pass && remedy.trim().isNotEmpty) {
throw ArgumentError.value(
remedy,
'remedy',
'a PASS ${precondition.wire} row has nothing to remedy',
);
}
if (evidence.isNotEmpty && retrievedBy.trim().isEmpty) {
throw ArgumentError.value(
retrievedBy,
'retrievedBy',
'evidence that can be withheld names the read that retrieves it',
);
}
}