layerListOf method Null safety

Iterable<Layer> layerListOf(
  1. Finder finder
)

Find all layers that are children of the provided finder.

The finder must match exactly one element.

Implementation

Iterable<Layer> layerListOf(Finder finder) {
  TestAsyncUtils.guardSync();
  final Element element = finder.evaluate().single;
  final RenderObject object = element.renderObject!;
  RenderObject current = object;
  while (current.debugLayer == null) {
    current = current.parent! as RenderObject;
  }
  final ContainerLayer layer = current.debugLayer!;
  return _walkLayers(layer);
}