Update dartdoc version to 0.31.0 (#55335)

diff --git a/dev/bots/docs.sh b/dev/bots/docs.sh
index b6499b2..b180320 100755
--- a/dev/bots/docs.sh
+++ b/dev/bots/docs.sh
@@ -111,7 +111,7 @@
 fi
 
 # Install and activate dartdoc.
-"$PUB" global activate dartdoc 0.30.4
+"$PUB" global activate dartdoc 0.31.0
 
 # This script generates a unified doc set, and creates
 # a custom index.html, placing everything into dev/docs/doc.