viewOf method

TestFlutterView viewOf(
  1. Finder finder
)

Finds the TestFlutterView that is the closest ancestor of the widget found by finder.

TestFlutterView can be used to modify view specific properties for testing.

See also:

Implementation

TestFlutterView viewOf(Finder finder) {
  final View view = firstWidget<View>(
    find.ancestor(
      of: finder,
      matching: find.byType(View),
    )
  );

  return view.view as TestFlutterView;
}