child method

DatabaseReference child(
  1. String path
)

The reference at path below this one. path may have several segments; empty segments are dropped, so child('a//b') is child('a/b') and child('/') is this location. Throws an ArgumentError for an empty path or an invalid key; .info is accepted on the root only. It checks no depth or length; see the class documentation for the writes that do.

Implementation

DatabaseReference child(String path) {
  if (spec.path.isEmpty) {
    validateRootPathString('child', 'path', path);
  } else {
    validatePathString('child', 'path', path);
  }
  return DatabaseReference.internal(
    database,
    QuerySpec.defaultAt(spec.path.childPath(Path(path))),
  );
}