Analyzer, require 10.1.0, fix deprecations in dependency_graph.dart (#182507)

<!--
Thanks for filing a pull request!
Reviewers are typically assigned within a week of filing a request.
To learn more about code review, see our documentation on Tree Hygiene:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
-->

In analyzer 10.x.y we deprecated `returnType` and want clients to switch
to `typeName`, to support primary constructors language feature.

## Pre-launch Checklist

- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [ ] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [ ] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [ ] I listed at least one issue that this PR fixes in the description
above.
- [ ] I updated/added relevant documentation (doc comments with `///`).
- [ ] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [ ] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [ ] All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel
on [Discord].

**Note**: The Flutter team is currently trialing the use of [Gemini Code
Assist for
GitHub](https://developers.google.com/gemini-code-assist/docs/review-github-code).
Comments from the `gemini-code-assist` bot should not be taken as
authoritative feedback from the Flutter team. If you find its comments
useful you can update your code accordingly, but if you are unsure or
disagree with the feedback, please feel free to wait for a Flutter team
member's review for guidance on which automated comments should be
addressed.

<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md
diff --git a/dev/integration_tests/widget_preview_scaffold/pubspec.yaml b/dev/integration_tests/widget_preview_scaffold/pubspec.yaml
index a505408..28a2ddc 100644
--- a/dev/integration_tests/widget_preview_scaffold/pubspec.yaml
+++ b/dev/integration_tests/widget_preview_scaffold/pubspec.yaml
@@ -47,7 +47,7 @@
   typed_data: 1.4.0
   unified_analytics: 8.0.11
   url_launcher_android: 6.3.28
-  url_launcher_ios: 6.4.0
+  url_launcher_ios: 6.4.1
   url_launcher_linux: 3.2.2
   url_launcher_macos: 3.2.5
   url_launcher_platform_interface: 2.3.2
@@ -68,4 +68,4 @@
 
 flutter:
   uses-material-design: true
-# PUBSPEC CHECKSUM: fv45lk
+# PUBSPEC CHECKSUM: 96nev4
diff --git a/packages/flutter_tools/lib/src/widget_preview/dependency_graph.dart b/packages/flutter_tools/lib/src/widget_preview/dependency_graph.dart
index 8a41686..fa12f53 100644
--- a/packages/flutter_tools/lib/src/widget_preview/dependency_graph.dart
+++ b/packages/flutter_tools/lib/src/widget_preview/dependency_graph.dart
@@ -124,7 +124,7 @@
         }
       }
     } else if (_currentConstructor != null && !hasRequiredParams(_currentConstructor!.parameters)) {
-      final returnType = _currentConstructor!.returnType as SimpleIdentifier;
+      final SimpleIdentifier returnType = _currentConstructor!.typeName!;
       final Token? name = _currentConstructor!.name;
       previewEntries.add(
         PreviewDetails(
@@ -143,14 +143,14 @@
       if (returnTypeAnnotation is NamedType) {
         final Token returnType = returnTypeAnnotation.name;
         if (returnType.isWidget || returnType.isWidgetBuilder) {
-          final parentClass = _currentMethod!.parent! as ClassDeclaration;
+          final parentClass = _currentMethod!.parent!.parent! as ClassDeclaration;
           previewEntries.add(
             PreviewDetails(
               scriptUri: _currentScriptUri,
               line: line,
               column: column,
               packageName: packageName,
-              functionName: '${parentClass.name}.${_currentMethod!.name}',
+              functionName: '${parentClass.namePart.typeName}.${_currentMethod!.name}',
               isBuilder: returnType.isWidgetBuilder,
               previewAnnotation: preview,
               isMultiPreview: isMultiPreview,
diff --git a/packages/flutter_tools/pubspec.yaml b/packages/flutter_tools/pubspec.yaml
index ea4c117..62f2ea2 100644
--- a/packages/flutter_tools/pubspec.yaml
+++ b/packages/flutter_tools/pubspec.yaml
@@ -10,7 +10,7 @@
   #
   # For detailed instructions, refer to:
   # https://github.com/flutter/flutter/blob/main/docs/infra/Updating-dependencies-in-Flutter.md
-  analyzer: 9.0.0
+  analyzer: 10.1.0
   archive: 3.6.1
   args: 2.7.0
   dds: 5.1.0
@@ -73,10 +73,10 @@
 
   standard_message_codec: 0.0.1+4
 
-  dart_style: 3.1.3
+  dart_style: 3.1.5
 
   # The below dependencies are transitive and are here to pin them to a specific version.
-  _fe_analyzer_shared: 92.0.0
+  _fe_analyzer_shared: 95.0.0
   boolean_selector: 2.1.2
   browser_launcher: 1.1.3
   built_collection: 5.1.1
@@ -96,7 +96,7 @@
   io: 1.0.5
   json_rpc_2: 4.0.0
   matcher: 0.12.18
-  petitparser: 7.0.1
+  petitparser: 7.0.2
   platform: 3.1.6
   shelf_packages_handler: 3.0.2
   shelf_proxy: 1.0.4
@@ -129,4 +129,4 @@
   # Exclude this package from the hosted API docs.
   nodoc: true
 
-# PUBSPEC CHECKSUM: j77gl7
+# PUBSPEC CHECKSUM: d3f462
diff --git a/pubspec.lock b/pubspec.lock
index 3a4bd69..3c7e3f8 100644
--- a/pubspec.lock
+++ b/pubspec.lock
@@ -13,10 +13,10 @@
     dependency: "direct main"
     description:
       name: _fe_analyzer_shared
-      sha256: "5b7468c326d2f8a4f630056404ca0d291ade42918f4a3c6233618e724f39da8e"
+      sha256: "0e4db51a88671b676adc09e923ffebd765a1f0c2b04dc19b08b35a335de2972c"
       url: "https://pub.dev"
     source: hosted
-    version: "92.0.0"
+    version: "95.0.0"
   adaptive_breakpoints:
     dependency: "direct main"
     description:
@@ -29,10 +29,10 @@
     dependency: "direct main"
     description:
       name: analyzer
-      sha256: "70e4b1ef8003c64793a9e268a551a82869a8a96f39deb73dea28084b0e8bf75e"
+      sha256: "3d577a36cde804a46bd1d89e673c3d87c3538c49a39c35d4d336f7760b48c319"
       url: "https://pub.dev"
     source: hosted
-    version: "9.0.0"
+    version: "10.1.0"
   animations:
     dependency: "direct main"
     description:
@@ -182,10 +182,10 @@
     dependency: "direct main"
     description:
       name: dart_style
-      sha256: a9c30492da18ff84efe2422ba2d319a89942d93e58eb0b73d32abe822ef54b7b
+      sha256: "15a7db352c8fc6a4d2bc475ba901c25b39fe7157541da4c16eacce6f8be83e49"
       url: "https://pub.dev"
     source: hosted
-    version: "3.1.3"
+    version: "3.1.5"
   device_info:
     dependency: "direct main"
     description:
@@ -614,10 +614,10 @@
     dependency: "direct main"
     description:
       name: petitparser
-      sha256: "1a97266a94f7350d30ae522c0af07890c70b8e62c71e8e3920d1db4d23c057d1"
+      sha256: "91bd59303e9f769f108f8df05e371341b15d59e995e6806aefab827b58336675"
       url: "https://pub.dev"
     source: hosted
-    version: "7.0.1"
+    version: "7.0.2"
   platform:
     dependency: "direct main"
     description:
@@ -883,10 +883,10 @@
     dependency: "direct main"
     description:
       name: url_launcher_ios
-      sha256: b1aca26728b7cc7a3af971bb6f601554a8ae9df2e0a006de8450ba06a17ad36a
+      sha256: "580fe5dfb51671ae38191d316e027f6b76272b026370708c2d898799750a02b0"
       url: "https://pub.dev"
     source: hosted
-    version: "6.4.0"
+    version: "6.4.1"
   url_launcher_linux:
     dependency: "direct main"
     description:
diff --git a/pubspec.yaml b/pubspec.yaml
index 58a23b9..806b253 100644
--- a/pubspec.yaml
+++ b/pubspec.yaml
@@ -79,9 +79,9 @@
 
 dependencies:
   _discoveryapis_commons: 1.0.7
-  _fe_analyzer_shared: 92.0.0
+  _fe_analyzer_shared: 95.0.0
   adaptive_breakpoints: 0.1.7
-  analyzer: 9.0.0
+  analyzer: 10.1.0
   animations: 2.1.1
   archive: 3.6.1
   args: 2.7.0
@@ -145,7 +145,7 @@
   path_provider_linux: 2.2.1
   path_provider_platform_interface: 2.1.2
   path_provider_windows: 2.3.0
-  petitparser: 7.0.1
+  petitparser: 7.0.2
   platform: 3.1.6
   plugin_platform_interface: 2.1.8
   pool: 1.5.2
@@ -177,7 +177,7 @@
   typed_data: 1.4.0
   url_launcher: 6.3.2
   url_launcher_android: 6.3.28
-  url_launcher_ios: 6.4.0
+  url_launcher_ios: 6.4.1
   url_launcher_linux: 3.2.2
   url_launcher_macos: 3.2.5
   url_launcher_platform_interface: 2.3.2
@@ -205,7 +205,7 @@
   xml: 6.6.1
   yaml: 3.1.3
   cli_util: 0.4.2
-  dart_style: 3.1.3
+  dart_style: 3.1.5
   file_testing: 3.0.2
   flutter_lints: 6.0.0
   lints: 6.1.0
@@ -216,4 +216,4 @@
 dev_dependencies:
   ffigen: 20.1.1
 
-# PUBSPEC CHECKSUM: r03o20
+# PUBSPEC CHECKSUM: j24h6m