isRootWidgetAttached property
Whether the rootElement has been initialized.
This will be false until runApp is called (or WidgetTester.pumpWidget is called in the context of a TestWidgetsFlutterBinding).
Implementation
bool get isRootWidgetAttached => _rootElement != null;