From 29c858adc73980e4a88cb9f71f3fce655eee995e Mon Sep 17 00:00:00 2001 From: Janice Collins Date: Thu, 8 Jun 2023 13:14:23 -0700 Subject: [PATCH] Update flutter to dartdoc 6.3.0 and hide Icons implementation from doc pages (#128442) This updates dartdoc to 6.3.0. Release notes are available, here: https://github.com/dart-lang/dartdoc/releases/tag/v6.3.0 Most important for Flutter are the reduction in the size of generated HTML files (dart-lang/dartdoc#3384) and a new dartdoc directive to hide constant implementations from indicated classes (dart-lang/dartdoc#3398), which fixes the longstanding issue (dart-lang/dartdoc#2657). I've also added the api documentation zip to `.gitignore` and the `{@hideConstantImplementations}` dartdoc directive to the motivating example. A screenshot: ![Screenshot 2023-06-07 at 9 54 58 AM](https://github.com/flutter/flutter/assets/14116827/1ad9c1f0-b224-462f-a8e3-706d9858f0d8) I assert that this change to icons.dart should be test-exempt as existing tests cover whether or not dartdoc directives are recognized or are leaking into HTML, and the impact of adding the directive was tested in dart-lang/dartdoc#3398. --- .gitignore | 1 + dev/bots/docs.sh | 2 +- packages/flutter/lib/src/cupertino/icons.dart | 1 + packages/flutter/lib/src/material/icons.dart | 1 + 4 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 9a78642e8c..a317f26436 100644 --- a/.gitignore +++ b/.gitignore @@ -32,6 +32,7 @@ /dev/bots/android_tools/ /dev/devicelab/ABresults*.json /dev/docs/doc/ +/dev/docs/api_docs.zip /dev/docs/flutter.docs.zip /dev/docs/lib/ /dev/docs/pubspec.yaml diff --git a/dev/bots/docs.sh b/dev/bots/docs.sh index e0fb024ec1..6a0cec83c9 100755 --- a/dev/bots/docs.sh +++ b/dev/bots/docs.sh @@ -20,7 +20,7 @@ function generate_docs() { # Install and activate dartdoc. # When updating to a new dartdoc version, please also update # `dartdoc_options.yaml` to include newly introduced error and warning types. - "$DART" pub global activate dartdoc 6.2.2 + "$DART" pub global activate dartdoc 6.3.0 # Install and activate the snippets tool, which resides in the # assets-for-api-docs repo: diff --git a/packages/flutter/lib/src/cupertino/icons.dart b/packages/flutter/lib/src/cupertino/icons.dart index 9d9eda6210..b91746efab 100644 --- a/packages/flutter/lib/src/cupertino/icons.dart +++ b/packages/flutter/lib/src/cupertino/icons.dart @@ -59,6 +59,7 @@ import 'package:flutter/widgets.dart'; /// See also: /// /// * [Icon], used to show these icons. +/// {@hideConstantImplementations} @staticIconProvider abstract final class CupertinoIcons { /// The icon font used for Cupertino icons. diff --git a/packages/flutter/lib/src/material/icons.dart b/packages/flutter/lib/src/material/icons.dart index 68631a5afa..59f3b08849 100644 --- a/packages/flutter/lib/src/material/icons.dart +++ b/packages/flutter/lib/src/material/icons.dart @@ -149,6 +149,7 @@ final class PlatformAdaptiveIcons implements Icons { /// * [IconButton] /// * /// * [AnimatedIcons], for the list of available animated Material Icons. +/// {@hideConstantImplementations} @staticIconProvider abstract final class Icons { /// A set of platform-adaptive Material Design icons.