Cherry pick for update to dartdoc 6.2.2 (#125661)

This is a cherry pick for #125650.
diff --git a/dev/bots/docs.sh b/dev/bots/docs.sh
index 435bad4..978d607 100755
--- a/dev/bots/docs.sh
+++ b/dev/bots/docs.sh
@@ -20,7 +20,7 @@
     # 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.1
+    "$DART" pub global activate dartdoc 6.2.2
 
     # Install and activate the snippets tool, which resides in the
     # assets-for-api-docs repo: