From 455be19d928fa8e0e5bb26904f2d0f57312794c6 Mon Sep 17 00:00:00 2001 From: Michael Goderbauer Date: Tue, 2 Jul 2024 09:19:14 -0700 Subject: [PATCH] Docimports for foundation (#151119) Part of https://github.com/flutter/flutter/issues/150800 Things I couldn't get to work: --- packages/flutter/lib/src/foundation/_bitfield_io.dart | 2 +- packages/flutter/lib/src/foundation/_bitfield_web.dart | 4 ++-- packages/flutter/lib/src/foundation/_isolates_io.dart | 2 +- packages/flutter/lib/src/foundation/_isolates_web.dart | 2 +- packages/flutter/lib/src/foundation/assertions.dart | 3 +++ packages/flutter/lib/src/foundation/basic_types.dart | 3 +++ packages/flutter/lib/src/foundation/binding.dart | 9 +++++++++ packages/flutter/lib/src/foundation/change_notifier.dart | 6 +++++- packages/flutter/lib/src/foundation/collections.dart | 3 +++ packages/flutter/lib/src/foundation/constants.dart | 3 +++ packages/flutter/lib/src/foundation/debug.dart | 7 +++++++ packages/flutter/lib/src/foundation/diagnostics.dart | 3 +++ packages/flutter/lib/src/foundation/isolates.dart | 3 +++ packages/flutter/lib/src/foundation/key.dart | 4 ++++ packages/flutter/lib/src/foundation/licenses.dart | 5 +++++ .../flutter/lib/src/foundation/persistent_hash_map.dart | 3 ++- packages/flutter/lib/src/foundation/platform.dart | 3 +++ packages/flutter/lib/src/foundation/print.dart | 3 +++ 18 files changed, 61 insertions(+), 7 deletions(-) diff --git a/packages/flutter/lib/src/foundation/_bitfield_io.dart b/packages/flutter/lib/src/foundation/_bitfield_io.dart index 680d56f2622..be4a29e656c 100644 --- a/packages/flutter/lib/src/foundation/_bitfield_io.dart +++ b/packages/flutter/lib/src/foundation/_bitfield_io.dart @@ -7,7 +7,7 @@ import 'bitfield.dart' as bitfield; /// The dart:io implementation of [bitfield.kMaxUnsignedSMI]. const int kMaxUnsignedSMI = 0x3FFFFFFFFFFFFFFF; // ignore: avoid_js_rounded_ints, (VM-only code) -/// The dart:io implementation of [bitfield.Bitfield]. +/// The dart:io implementation of [bitfield.BitField]. class BitField implements bitfield.BitField { /// The dart:io implementation of [bitfield.Bitfield()]. BitField(this._length) diff --git a/packages/flutter/lib/src/foundation/_bitfield_web.dart b/packages/flutter/lib/src/foundation/_bitfield_web.dart index 91ad7744a4a..e45452ab187 100644 --- a/packages/flutter/lib/src/foundation/_bitfield_web.dart +++ b/packages/flutter/lib/src/foundation/_bitfield_web.dart @@ -13,9 +13,9 @@ import 'bitfield.dart' as bitfield; /// does not have to guarantee efficiency. const int kMaxUnsignedSMI = -1; -/// The web implementation of [bitfield.Bitfield]. +/// The web implementation of [bitfield.BitField]. class BitField implements bitfield.BitField { - /// The web implementation of [bitfield.Bitfield]. + /// The web implementation of [bitfield.BitField]. // Can remove when we have metaclasses. // ignore: avoid_unused_constructor_parameters BitField(int length); diff --git a/packages/flutter/lib/src/foundation/_isolates_io.dart b/packages/flutter/lib/src/foundation/_isolates_io.dart index 08bd8ca0c73..da18ecacfd3 100644 --- a/packages/flutter/lib/src/foundation/_isolates_io.dart +++ b/packages/flutter/lib/src/foundation/_isolates_io.dart @@ -10,7 +10,7 @@ import 'isolates.dart' as isolates; export 'isolates.dart' show ComputeCallback; -/// The dart:io implementation of [isolate.compute]. +/// The dart:io implementation of [isolates.compute]. @pragma('vm:prefer-inline') Future compute(isolates.ComputeCallback callback, M message, {String? debugLabel}) async { debugLabel ??= kReleaseMode ? 'compute' : callback.toString(); diff --git a/packages/flutter/lib/src/foundation/_isolates_web.dart b/packages/flutter/lib/src/foundation/_isolates_web.dart index 7410a5271c8..82d2d8aba06 100644 --- a/packages/flutter/lib/src/foundation/_isolates_web.dart +++ b/packages/flutter/lib/src/foundation/_isolates_web.dart @@ -6,7 +6,7 @@ import 'isolates.dart' as isolates; export 'isolates.dart' show ComputeCallback; -/// The web implementation of [isolate.compute]. +/// The web implementation of [isolates.compute]. @pragma('dart2js:tryInline') Future compute(isolates.ComputeCallback callback, M message, { String? debugLabel }) async { // To avoid blocking the UI immediately for an expensive function call, we diff --git a/packages/flutter/lib/src/foundation/assertions.dart b/packages/flutter/lib/src/foundation/assertions.dart index 4be191a9098..aa433f13bbf 100644 --- a/packages/flutter/lib/src/foundation/assertions.dart +++ b/packages/flutter/lib/src/foundation/assertions.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:flutter/widgets.dart'; +library; + import 'package:meta/meta.dart'; import 'basic_types.dart'; diff --git a/packages/flutter/lib/src/foundation/basic_types.dart b/packages/flutter/lib/src/foundation/basic_types.dart index 27c9bc92229..e1506541b86 100644 --- a/packages/flutter/lib/src/foundation/basic_types.dart +++ b/packages/flutter/lib/src/foundation/basic_types.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 'dart:ui'; +library; + import 'dart:collection'; // COMMON SIGNATURES diff --git a/packages/flutter/lib/src/foundation/binding.dart b/packages/flutter/lib/src/foundation/binding.dart index fb4d95fcad5..43304b95536 100644 --- a/packages/flutter/lib/src/foundation/binding.dart +++ b/packages/flutter/lib/src/foundation/binding.dart @@ -2,6 +2,15 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +/// @docImport 'dart:convert'; +/// @docImport 'dart:ui'; +/// +/// @docImport 'package:flutter/rendering.dart'; +/// @docImport 'package:flutter/scheduler.dart'; +/// @docImport 'package:flutter/services.dart'; +/// @docImport 'package:flutter/widgets.dart'; +library; + import 'dart:async'; import 'dart:convert' show json; import 'dart:developer' as developer; diff --git a/packages/flutter/lib/src/foundation/change_notifier.dart b/packages/flutter/lib/src/foundation/change_notifier.dart index 7cf4c00d3ca..0297902f006 100644 --- a/packages/flutter/lib/src/foundation/change_notifier.dart +++ b/packages/flutter/lib/src/foundation/change_notifier.dart @@ -2,6 +2,10 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +/// @docImport 'package:flutter/animation.dart'; +/// @docImport 'package:flutter/widgets.dart'; +library; + import 'dart:ui' show VoidCallback; import 'package:meta/meta.dart'; @@ -150,7 +154,7 @@ mixin class ChangeNotifier implements Listenable { /// If true, the event [ObjectCreated] for this instance was dispatched to /// [FlutterMemoryAllocations]. /// - /// As [ChangedNotifier] is used as mixin, it does not have constructor, + /// As [ChangeNotifier] is used as mixin, it does not have constructor, /// so we use [addListener] to dispatch the event. bool _creationDispatched = false; diff --git a/packages/flutter/lib/src/foundation/collections.dart b/packages/flutter/lib/src/foundation/collections.dart index e1e1499d856..3f79788fd96 100644 --- a/packages/flutter/lib/src/foundation/collections.dart +++ b/packages/flutter/lib/src/foundation/collections.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:collection/collection.dart'; +library; + // TODO(ianh): These should be on the Set and List classes themselves. /// Compares two sets for element-by-element equality. diff --git a/packages/flutter/lib/src/foundation/constants.dart b/packages/flutter/lib/src/foundation/constants.dart index 678408ca272..6979a3ee78e 100644 --- a/packages/flutter/lib/src/foundation/constants.dart +++ b/packages/flutter/lib/src/foundation/constants.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 'platform.dart'; +library; + /// A constant that is true if the application was compiled in release mode. /// /// More specifically, this is a constant that is true if the application was diff --git a/packages/flutter/lib/src/foundation/debug.dart b/packages/flutter/lib/src/foundation/debug.dart index ab9ff30c38f..d811ab2d91d 100644 --- a/packages/flutter/lib/src/foundation/debug.dart +++ b/packages/flutter/lib/src/foundation/debug.dart @@ -2,6 +2,13 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +/// @docImport 'dart:developer'; +/// +/// @docImport 'package:flutter/foundation.dart'; +/// @docImport 'package:flutter/rendering.dart'; +/// @docImport 'package:flutter/widgets.dart'; +library; + import 'dart:ui' as ui show Brightness; import 'assertions.dart'; diff --git a/packages/flutter/lib/src/foundation/diagnostics.dart b/packages/flutter/lib/src/foundation/diagnostics.dart index 08b775e81e3..d48a90a0503 100644 --- a/packages/flutter/lib/src/foundation/diagnostics.dart +++ b/packages/flutter/lib/src/foundation/diagnostics.dart @@ -3,6 +3,9 @@ // found in the LICENSE file. /// @docImport 'dart:developer'; +/// +/// @docImport 'package:flutter/rendering.dart'; +/// @docImport 'package:flutter/widgets.dart'; library; import 'dart:math' as math; diff --git a/packages/flutter/lib/src/foundation/isolates.dart b/packages/flutter/lib/src/foundation/isolates.dart index 8a4cc266a37..ba53d23c041 100644 --- a/packages/flutter/lib/src/foundation/isolates.dart +++ b/packages/flutter/lib/src/foundation/isolates.dart @@ -2,7 +2,10 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +/// @docImport 'dart:developer'; /// @docImport 'dart:isolate'; +/// +/// @docImport 'package:flutter/scheduler.dart'; library; import 'dart:async'; diff --git a/packages/flutter/lib/src/foundation/key.dart b/packages/flutter/lib/src/foundation/key.dart index 0940e80ac2a..c36f41fac8c 100644 --- a/packages/flutter/lib/src/foundation/key.dart +++ b/packages/flutter/lib/src/foundation/key.dart @@ -2,6 +2,10 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +/// @docImport 'package:flutter/semantics.dart'; +/// @docImport 'package:flutter/widgets.dart'; +library; + import 'package:meta/meta.dart'; import 'diagnostics.dart'; diff --git a/packages/flutter/lib/src/foundation/licenses.dart b/packages/flutter/lib/src/foundation/licenses.dart index f68622bc282..92f6e6e3d0d 100644 --- a/packages/flutter/lib/src/foundation/licenses.dart +++ b/packages/flutter/lib/src/foundation/licenses.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/foundation.dart'; +/// @docImport 'package:flutter/material.dart'; +/// @docImport 'package:flutter/scheduler.dart'; +library; + import 'dart:async'; import 'package:meta/meta.dart' show visibleForTesting; diff --git a/packages/flutter/lib/src/foundation/persistent_hash_map.dart b/packages/flutter/lib/src/foundation/persistent_hash_map.dart index 086a6889115..934fcae1a5e 100644 --- a/packages/flutter/lib/src/foundation/persistent_hash_map.dart +++ b/packages/flutter/lib/src/foundation/persistent_hash_map.dart @@ -116,7 +116,8 @@ class _FullNode extends _TrieNode { /// Instead of storing the full array of outgoing edges this node uses a /// compressed representation: /// -/// * [_CompressedNode.occupied] has a bit set for indices which are occupied. +/// * [_CompressedNode.occupiedIndices] has a bit set for indices which are +/// occupied. /// * furthermore, each occupied index can either be a `(key, value)` pair /// representing an actual key/value mapping or a `(null, trieNode)` pair /// representing a descendant node. diff --git a/packages/flutter/lib/src/foundation/platform.dart b/packages/flutter/lib/src/foundation/platform.dart index b1905aea1a9..48ce4b085c3 100644 --- a/packages/flutter/lib/src/foundation/platform.dart +++ b/packages/flutter/lib/src/foundation/platform.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:flutter/material.dart'; +library; + import '_platform_io.dart' if (dart.library.js_util) '_platform_web.dart' as platform; import 'assertions.dart'; diff --git a/packages/flutter/lib/src/foundation/print.dart b/packages/flutter/lib/src/foundation/print.dart index 6b7d86da583..a5fcf520856 100644 --- a/packages/flutter/lib/src/foundation/print.dart +++ b/packages/flutter/lib/src/foundation/print.dart @@ -6,6 +6,9 @@ // calling "print" is sort of a non-starter here... // ignore_for_file: avoid_print +/// @docImport 'package:flutter/widgets.dart'; +library; + import 'dart:async'; import 'dart:collection';