Repository: flutter/flutter
File: packages/flutter/test/widgets/widgets_app_tester.dart (Dart)

Code before:
  /// Creates a minimal [WidgetsApp] for testing.
  const TestWidgetsApp({
    super.key,
    this.navigatorKey,
    this.home,
    this.routes = const <String, WidgetBuilder>{},
    this.color = const Color(0xFFFFFFFF),
    this.pageRouteBuilder = _defaultPageRouteBuilder,
  });

  /// {@macro flutter.widgets.widgetsApp.navigatorKey}
  ///
  /// In tests, this allows direct access to the [NavigatorState] for
  /// programmatic navigation without needing to find the [Navigator] widget:
  ///
  /// ```dart
  /// final navigatorKey = GlobalKey<NavigatorState>();
  /// await tester.pumpWidget(TestWidgetsApp(
  ///   navigatorKey: navigatorKey,
  ///   home: const Text('Home'),
  /// ));
  /// navigatorKey.currentState!.pushNamed('/details');
  /// ```
  final GlobalKey<NavigatorState>? navigatorKey;

  /// {@macro flutter.widgets.widgetsApp.home}
  ///
  /// In tests, this is where you place the widget under test. The widget
  /// will have access to [Navigator], [Overlay], and other app-level
  /// services provided by [WidgetsApp].
  final Widget? home;

  /// The application's top-level routing table.
  ///
  /// {@macro flutter.widgets.widgetsApp.routes}
  ///
  /// In tests, routes are built using [pageRouteBuilder], which defaults to
  /// zero-duration transitions for instant navigation without waiting for
  /// animations.
  ///
  /// Defaults to an empty map.
  final Map<String, WidgetBuilder> routes;

  /// {@macro flutter.widgets.widgetsApp.color}
  ///
  /// In tests, this is typically not relevant as OS-level features are not
  /// exercised. Defaults to white.
  final Color color;

  /// {@macro flutter.widgets.widgetsApp.pageRouteBuilder}
  ///

Review comment (suggestion):
I don't know if we want to use macros here. Macros will copy over the exact documentation from the WidgetsApp equivalent property, including WidgetsApp properties that are either not implemented here yet or are irrelevant to testing needs.

Instead, we want a description of the property's use in WidgetsApp, but from a testing perspective. Plus a "See also" section to link the WidgetsApp equivalent property.

Code after:
  /// Creates a minimal [WidgetsApp] for testing.
  const TestWidgetsApp({
    super.key,
    this.navigatorKey,
    this.home,
    this.routes = const <String, WidgetBuilder>{},
    this.color = const Color(0xFFFFFFFF),
    this.pageRouteBuilder = _defaultPageRouteBuilder,
  });

  /// A key to use when building the [Navigator].
  ///
  /// In tests, this allows direct access to the [NavigatorState] for
  /// programmatic navigation without needing to find the [Navigator] widget:
  ///
  /// ```dart
  /// final navigatorKey = GlobalKey<NavigatorState>();
  /// await tester.pumpWidget(TestWidgetsApp(
  ///   navigatorKey: navigatorKey,
  ///   home: const Text('Home'),
  /// ));
  /// navigatorKey.currentState!.pushNamed('/details');
  /// ```
  ///
  /// See also:
  ///
  ///  * [WidgetsApp.navigatorKey], the equivalent property in [WidgetsApp].
  final GlobalKey<NavigatorState>? navigatorKey;

  /// The widget displayed when the app launches.
  ///
  /// In tests, this is where you place the widget under test. The widget
  /// will have access to [Navigator], [Overlay], and other app-level
  /// services provided by [WidgetsApp].
  ///
  /// See also:
  ///
  ///  * [WidgetsApp.home], the equivalent property in [WidgetsApp].
  final Widget? home;

  /// The application's top-level routing table.
  ///
  /// Maps route names to widget builders. When navigating to a named route,
  /// the corresponding builder is called to create the route's content.
  ///
  /// In tests, routes are built using [pageRouteBuilder], which defaults to
  /// zero-duration transitions for instant navigation without waiting for
  /// animations.
  ///
  /// Defaults to an empty map.
  ///