From fb290b3121aa906de7cb8acd6d1fcfe162e205b7 Mon Sep 17 00:00:00 2001 From: Michael Goderbauer Date: Thu, 11 Jul 2024 13:15:05 -0700 Subject: [PATCH] docimports for flutter_goldens, flutter_localizations, flutter_web_plugins, fuchsia_remote_debug_protocol, integration_test (#151271) Part of https://github.com/flutter/flutter/issues/150800 --- packages/flutter/test/rendering/rendering_tester.dart | 6 ++++-- packages/flutter_goldens/lib/flutter_goldens.dart | 4 ++-- packages/flutter_goldens/lib/skia_client.dart | 11 +++++++---- packages/flutter_goldens/test/json_templates.dart | 2 +- .../lib/src/cupertino_localizations.dart | 3 +++ .../lib/src/material_localizations.dart | 3 +++ .../lib/src/widgets_localizations.dart | 7 ++++++- .../flutter_web_plugins/lib/flutter_web_plugins.dart | 2 ++ .../lib/src/dart/dart_vm.dart | 3 +-- packages/integration_test/lib/common.dart | 6 ++++++ packages/integration_test/lib/integration_test.dart | 9 +++++++-- packages/integration_test/test/binding_fail_test.dart | 5 ++++- 12 files changed, 46 insertions(+), 15 deletions(-) diff --git a/packages/flutter/test/rendering/rendering_tester.dart b/packages/flutter/test/rendering/rendering_tester.dart index 14d16e0716..d145d3fd1e 100644 --- a/packages/flutter/test/rendering/rendering_tester.dart +++ b/packages/flutter/test/rendering/rendering_tester.dart @@ -229,7 +229,8 @@ class TestRenderingFlutterBinding extends BindingBase with SchedulerBinding, Ser /// The EnginePhase must not be [EnginePhase.build], since the rendering layer /// has no build phase. /// -/// If `onErrors` is not null, it is set as [TestRenderingFlutterBinding.onError]. +/// If `onErrors` is not null, it is set as +/// [TestRenderingFlutterBinding.onErrors]. void layout( RenderBox box, { // If you want to just repump the last box, call pumpFrame(). BoxConstraints? constraints, @@ -256,7 +257,8 @@ void layout( /// Pumps a single frame. /// -/// If `onErrors` is not null, it is set as [TestRenderingFlutterBinding.onError]. +/// If `onErrors` is not null, it is set as +/// [TestRenderingFlutterBinding.onErrors]. void pumpFrame({ EnginePhase phase = EnginePhase.layout, VoidCallback? onErrors }) { assert(TestRenderingFlutterBinding.instance.renderView.child != null); // call layout() first! diff --git a/packages/flutter_goldens/lib/flutter_goldens.dart b/packages/flutter_goldens/lib/flutter_goldens.dart index b98cf88cba..cbe4de712e 100644 --- a/packages/flutter_goldens/lib/flutter_goldens.dart +++ b/packages/flutter_goldens/lib/flutter_goldens.dart @@ -190,7 +190,7 @@ abstract class FlutterGoldenFileComparator extends GoldenFileComparator { /// /// The optional [suffix] argument is used by the /// [FlutterPostSubmitFileComparator] and the [FlutterPreSubmitFileComparator]. - /// These [FlutterGoldenFileComparators] randomize their base directories to + /// These [FlutterGoldenFileComparator]s randomize their base directories to /// maintain thread safety while using the `goldctl` tool. @protected @visibleForTesting @@ -535,7 +535,7 @@ class FlutterSkippingFileComparator extends FlutterGoldenFileComparator { /// /// This comparator utilizes the [SkiaGoldClient] to request baseline images for /// the given device under test for comparison. This comparator is initialized -/// when conditions for all other [FlutterGoldenFileComparators] have not been +/// when conditions for all other [FlutterGoldenFileComparator]s have not been /// met, see the `isForEnvironment` method for each one listed below. /// /// The [FlutterLocalFileComparator] is intended to run on local machines and diff --git a/packages/flutter_goldens/lib/skia_client.dart b/packages/flutter_goldens/lib/skia_client.dart index 44e446e205..7066f0c5f9 100644 --- a/packages/flutter_goldens/lib/skia_client.dart +++ b/packages/flutter_goldens/lib/skia_client.dart @@ -2,6 +2,9 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +/// @docImport 'flutter_goldens.dart'; +library; + import 'dart:convert'; import 'dart:io' as io; @@ -24,7 +27,7 @@ const String _kImpellerKey = 'FLUTTER_TEST_IMPELLER'; /// Signature of callbacks used to inject [print] replacements. typedef LogCallback = void Function(String); -/// Exception thrown when an error is returned from the [SkiaClient]. +/// Exception thrown when an error is returned from the [SkiaGoldClient]. class SkiaException implements Exception { /// Creates a new `SkiaException` with a required error [message]. const SkiaException(this.message); @@ -75,12 +78,12 @@ class SkiaGoldClient { /// A client for making Http requests to the Flutter Gold dashboard. final io.HttpClient httpClient; - /// The local [Directory] within the [comparisonRoot] for the current test + /// The local [Directory] within the comparison root for the current test /// context. In this directory, the client will create image and JSON files /// for the goldctl tool to use. /// - /// This is informed by the [FlutterGoldenFileComparator] [basedir]. It cannot - /// be null. + /// This is informed by [FlutterGoldenFileComparator.basedir]. It cannot be + /// null. final Directory workDirectory; /// The logging function to use when reporting messages to the console. diff --git a/packages/flutter_goldens/test/json_templates.dart b/packages/flutter_goldens/test/json_templates.dart index d6e7d624e8..bce882b7c9 100644 --- a/packages/flutter_goldens/test/json_templates.dart +++ b/packages/flutter_goldens/test/json_templates.dart @@ -17,7 +17,7 @@ String authTemplate({ } /// Json response template for Skia Gold image request: -/// https://flutter-gold.skia.org/img/images/[imageHash].png +/// https://flutter-gold.skia.org/img/images/{imageHash}.png List> imageResponseTemplate() { return >[ [ diff --git a/packages/flutter_localizations/lib/src/cupertino_localizations.dart b/packages/flutter_localizations/lib/src/cupertino_localizations.dart index 0fe947f81d..227037b266 100644 --- a/packages/flutter_localizations/lib/src/cupertino_localizations.dart +++ b/packages/flutter_localizations/lib/src/cupertino_localizations.dart @@ -2,6 +2,9 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +/// @docImport 'package:intl/intl.dart'; +library; + import 'package:flutter/cupertino.dart'; import 'package:flutter/foundation.dart'; import 'package:intl/intl.dart' as intl; diff --git a/packages/flutter_localizations/lib/src/material_localizations.dart b/packages/flutter_localizations/lib/src/material_localizations.dart index 6d1d139b97..a12282d4fc 100644 --- a/packages/flutter_localizations/lib/src/material_localizations.dart +++ b/packages/flutter_localizations/lib/src/material_localizations.dart @@ -2,6 +2,9 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +/// @docImport 'package:intl/intl.dart'; +library; + import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; import 'package:intl/intl.dart' as intl; diff --git a/packages/flutter_localizations/lib/src/widgets_localizations.dart b/packages/flutter_localizations/lib/src/widgets_localizations.dart index 6231a9037b..796fdd8ade 100644 --- a/packages/flutter_localizations/lib/src/widgets_localizations.dart +++ b/packages/flutter_localizations/lib/src/widgets_localizations.dart @@ -2,6 +2,11 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +/// @docImport 'package:flutter/material.dart'; +/// +/// @docImport 'material_localizations.dart'; +library; + import 'package:flutter/foundation.dart'; import 'package:flutter/widgets.dart'; @@ -17,7 +22,7 @@ import 'l10n/generated_widgets_localizations.dart'; /// /// This list is available programmatically via [kWidgetsSupportedLanguages]. /// -/// Besides localized strings, this class also maps [locale] to [textDirection]. +/// Besides localized strings, this class also maps [Locale] to [textDirection]. /// All locales are [TextDirection.ltr] except for locales with the following /// [Locale.languageCode] values, which are [TextDirection.rtl]: /// diff --git a/packages/flutter_web_plugins/lib/flutter_web_plugins.dart b/packages/flutter_web_plugins/lib/flutter_web_plugins.dart index 3b27fff155..0799371b4c 100644 --- a/packages/flutter_web_plugins/lib/flutter_web_plugins.dart +++ b/packages/flutter_web_plugins/lib/flutter_web_plugins.dart @@ -13,6 +13,8 @@ /// /// * [How to Write a Flutter Web Plugin](https://medium.com/flutter/how-to-write-a-flutter-web-plugin-5e26c689ea1), a Medium article /// describing how the `url_launcher` package was created using [flutter_web_plugins]. +/// +/// @docImport 'src/plugin_registry.dart'; library flutter_web_plugins; export 'src/navigation/url_strategy.dart'; diff --git a/packages/fuchsia_remote_debug_protocol/lib/src/dart/dart_vm.dart b/packages/fuchsia_remote_debug_protocol/lib/src/dart/dart_vm.dart index fe421ad818..001a9addac 100644 --- a/packages/fuchsia_remote_debug_protocol/lib/src/dart/dart_vm.dart +++ b/packages/fuchsia_remote_debug_protocol/lib/src/dart/dart_vm.dart @@ -90,8 +90,7 @@ class RpcFormatError extends Error { /// Handles JSON RPC-2 communication with a Dart VM service. /// -/// Either wraps existing RPC calls to the Dart VM service, or runs raw RPC -/// function calls via [invokeRpc]. +/// Wraps existing RPC calls to the Dart VM service. class DartVm { DartVm._(this._vmService, this.uri); diff --git a/packages/integration_test/lib/common.dart b/packages/integration_test/lib/common.dart index 9f94b4512b..d0b9ef1b5e 100644 --- a/packages/integration_test/lib/common.dart +++ b/packages/integration_test/lib/common.dart @@ -2,6 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +/// @docImport 'package:flutter_driver/flutter_driver.dart'; +/// +/// @docImport 'integration_test.dart'; +/// @docImport 'integration_test_driver_extended.dart'; +library; + import 'dart:async'; import 'dart:convert'; diff --git a/packages/integration_test/lib/integration_test.dart b/packages/integration_test/lib/integration_test.dart index f8646bbf90..b747edfd89 100644 --- a/packages/integration_test/lib/integration_test.dart +++ b/packages/integration_test/lib/integration_test.dart @@ -2,6 +2,11 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +/// @docImport 'package:flutter_driver/flutter_driver.dart'; +/// +/// @docImport 'integration_test_driver_extended.dart'; +library; + import 'dart:async'; import 'dart:developer' as developer; import 'dart:io' show HttpClient, SocketException, WebSocket; @@ -312,8 +317,8 @@ https://docs.flutter.dev/testing/integration-tests /// [reportData] with `reportKey`. The [reportData] contains extra information /// from the test other than test success/fail. It will be passed back to the /// host and be processed by the [ResponseDataCallback] defined in - /// [integration_test_driver.integrationDriver]. By default it will be written - /// to `build/integration_response_data.json` with the key `timeline`. + /// [integrationDriver]. By default it will be written to + /// `build/integration_response_data.json` with the key `timeline`. /// /// For tests with multiple calls of this method, `reportKey` needs to be a /// unique key, otherwise the later result will override earlier one. Tests diff --git a/packages/integration_test/test/binding_fail_test.dart b/packages/integration_test/test/binding_fail_test.dart index f28d1f9dd9..9b7ca120ba 100644 --- a/packages/integration_test/test/binding_fail_test.dart +++ b/packages/integration_test/test/binding_fail_test.dart @@ -2,6 +2,9 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +/// @docImport 'package:integration_test/integration_test.dart'; +library; + import 'dart:convert'; import 'dart:io'; @@ -52,7 +55,7 @@ Future main() async { }); } -/// Runs a test script and returns the [IntegrationTestWidgetsFlutterBinding.result]. +/// Runs a test script and returns the [IntegrationTestWidgetsFlutterBinding.results]. /// /// [scriptPath] is relative to the package root. Future?> _runTest(String scriptPath) async {