GuardrailStatusPanel constructor

GuardrailStatusPanel({
  1. Key? key,
  2. required List<GuardrailStatusRow> rows,
  3. String title = 'Rollout guardrails',
  4. String emptyLabel = 'No guardrails registered.',
  5. String noDataLabel = 'No data yet',
  6. String okLabel = 'Within limits',
  7. String violatedLabel = 'Rolled back on this device',
  8. String boundsLabel = 'Limits',
  9. String currentLabel = 'Current',
})

Implementation

GuardrailStatusPanel({
  super.key,
  required List<GuardrailStatusRow> rows,
  this.title = 'Rollout guardrails',
  this.emptyLabel = 'No guardrails registered.',
  this.noDataLabel = 'No data yet',
  this.okLabel = 'Within limits',
  this.violatedLabel = 'Rolled back on this device',
  this.boundsLabel = 'Limits',
  this.currentLabel = 'Current',
}) : rows = List.unmodifiable(rows) {
  for (final (name, value) in [
    ('title', title),
    ('emptyLabel', emptyLabel),
    ('noDataLabel', noDataLabel),
    ('okLabel', okLabel),
    ('violatedLabel', violatedLabel),
    ('boundsLabel', boundsLabel),
    ('currentLabel', currentLabel),
  ]) {
    if (value.trim().isEmpty) {
      throw ArgumentError.value(value, name, 'must not be blank');
    }
  }
}