firstRenderObject<T extends RenderObject> method Null safety

T firstRenderObject<T extends RenderObject>(
  1. Finder finder
)

The render object of the first matching widget according to a depth-first pre-order traversal of the widget tree.

Throws a StateError if finder is empty.

  • Use renderObject if you only expect to match one render object.

Implementation

T firstRenderObject<T extends RenderObject>(Finder finder) {
  TestAsyncUtils.guardSync();
  return finder.evaluate().first.renderObject! as T;
}