RPOrderedTask constructor Null safety

RPOrderedTask(
  1. {required String identifier,
  2. required List<RPStep> steps,
  3. bool closeAfterFinished = true}
)

Implementation

RPOrderedTask(
    {required String identifier,
    required this.steps,
    bool closeAfterFinished = true})
    : super(identifier: identifier, closeAfterFinished: closeAfterFinished) {
  this._numberOfQuestionSteps = 0;
  this._isConsentTask = false;

  steps.forEach((step) {
    // Counting the Question or FormStep items
    if (step is RPQuestionStep) this._numberOfQuestionSteps++;
    // If there's a Consent Review Step among the steps it means the task is
    // a Consent Task
    if (step.runtimeType == RPConsentReviewStep) {
      _isConsentTask = true;
    }
  });
}