Bump analyzer from 4.7.0 to 5.1.0 (#3582)

Bumps [analyzer](https://github.com/dart-lang/sdk/tree/main/pkg) from 4.7.0 to 5.1.0.
- [Release notes](https://github.com/dart-lang/sdk/releases)
- [Changelog](https://github.com/dart-lang/sdk/blob/main/CHANGELOG.md)
- [Commits](https://github.com/dart-lang/sdk/commits/HEAD/pkg)

---
updated-dependencies:
- dependency-name: analyzer
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
diff --git a/pubspec.yaml b/pubspec.yaml
index 4f52414..eb2983f 100644
--- a/pubspec.yaml
+++ b/pubspec.yaml
@@ -6,7 +6,7 @@
 dependencies:
   # Note: Pub's test infrastructure assumes that any dependencies used in tests
   # will be hosted dependencies.
-  analyzer: ^4.0.0
+  analyzer: ^5.1.0
   args: ^2.1.0
   async: ^2.6.1
   cli_util: ^0.3.5