FieldPath.fromString constructor

FieldPath.fromString(
  1. String path
)

Creates a new FieldPath from a string path.

The FieldPath will created by splitting the given path by the '.' character. If you are trying to match a Firestore field whose field contains a '.', construct a new FieldPath instance and provide the field as a List element.

Implementation

FieldPath.fromString(String path)
    : components = path.split('.'),
      assert(path.isNotEmpty),
      assert(!path.startsWith('.')),
      assert(!path.endsWith('.')),
      assert(!path.contains('..')),
      assert(!path.contains('~'), _reserved),
      assert(!path.contains('*'), _reserved),
      assert(!path.contains('/'), _reserved),
      assert(!path.contains('['), _reserved),
      assert(!path.contains(']'), _reserved);