execute method Null safety

List execute(
  1. List results,
  2. Map<String, dynamic> passed
)
override

Implementation

List execute(List results, Map<String, dynamic> passed) {
  final executedValue = value.execute(results.toList(), passed);
  return executedValue.length != 1 || executedValue.first is! int
      ? throw FhirPathEvaluationException(
          'The argument passed to the .skip() function was not valid.',
          operation: '.skip()',
          arguments: value)
      : executedValue.first == null
          ? throw FhirPathEvaluationException(
              'The value for .skip() was not a number: ${executedValue.first}',
              operation: '.skip()',
              arguments: executedValue.first)
          : executedValue.first <= 0
              ? results
              : results.isEmpty || executedValue.first >= results.length
                  ? []
                  : results.sublist(executedValue.first);
}