OnboardingFlowRow constructor

OnboardingFlowRow({
  1. required String flowId,
  2. required String label,
  3. required int priority,
  4. required int version,
  5. required bool isSeen,
  6. bool isNext = false,
})

Implementation

OnboardingFlowRow({
  required this.flowId,
  required this.label,
  required this.priority,
  required this.version,
  required this.isSeen,
  this.isNext = false,
}) {
  if (flowId.trim().isEmpty) {
    throw ArgumentError.value(flowId, 'flowId', 'must not be blank');
  }
  if (label.trim().isEmpty) {
    throw ArgumentError.value(label, 'label', 'must not be blank');
  }
  if (version <= 0) {
    throw ArgumentError.value(version, 'version', 'must be > 0');
  }
  if (isSeen && isNext) {
    throw ArgumentError.value(isNext, 'isNext', 'a seen flow cannot be next');
  }
}