FieldPath constructor

FieldPath(
  1. List<String> segments
)

Implementation

FieldPath(super.segments) {
  if (segments.isEmpty) {
    throw ArgumentError.value(segments, 'segments', 'must not be empty.');
  }

  for (var i = 0; i < segments.length; ++i) {
    if (segments[i].isEmpty) {
      throw ArgumentError.value(
        segments[i],
        'Element at index $i',
        'should not be an empty string.',
      );
    }
  }
}