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.


Iterable<Layer> layerListOf(Finder finder) {
  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);