[pigeon] Add usage docs to generated Dart event channel methods (#11894)

The generated event-channel method creates a new `EventChannel` each time it is called, but nothing in the generated code documented that — making it easy to call repeatedly for the same instance, or to assume the returned stream is single-subscription. This implements the "definitely" part of the linked issue:

> Definitely add docs to the generated code, indicated both that it shouldn't be called multiple times for the same instance, and that the returned stream is a broadcast stream.

Each generated event-channel method now gets a usage doc comment:

```dart
/// Returns a broadcast [Stream] of events from the `streamEvents` event channel.
///
/// Each call to this method creates a new [EventChannel], so it should
/// not be called multiple times for the same `instanceName`. To deliver
/// events to multiple listeners, call this method once and listen to the
/// returned broadcast stream multiple times instead.
```

While there, this also emits the user's own documentation comments on event channel methods — previously only the API-level comments were emitted and per-method comments were silently dropped. The two are combined via the existing `generatorComments` mechanism in `addDocumentationComments`, which already handles user-comment/generator-comment separation.

The wrapper-object and renaming ideas from the issue are intentionally not addressed here, per the discussion — those are design decisions; this PR is scoped to the documentation gap.

Checked-in generated files containing event channels (`example/app` and `shared_test_plugin_code`) are regenerated. The new generator test verifies both the user comments and the usage docs are emitted directly above the generated method, and fails without the generator change.

Fixes https://github.com/flutter/flutter/issues/177776

## Pre-Review Checklist

Note: the multi-language auto-formatter step of `tool/generate.dart` could not run fully on this machine (missing clang-format and related binaries); only Dart outputs changed, and those were formatted with `dart format`. If CI's format check flags anything, I'll address it.
8 files changed
tree: 02acb6add50420442d58f9edcdb1c7a92753f09c
  1. .agents/
  2. .ci/
  3. .claude/
  4. .gemini/
  5. .github/
  6. agent-artifacts/
  7. packages/
  8. script/
  9. third_party/
  10. .ci.yaml
  11. .clang-format
  12. .direnv
  13. .gitattributes
  14. .gitignore
  15. .metadata
  16. .repo_tool_config.yaml
  17. AGENTS.md
  18. analysis_options.yaml
  19. AUTHORS
  20. CONTRIBUTING.md
  21. customer_testing.bat
  22. customer_testing.sh
  23. LICENSE
  24. README.md
  25. SUGGESTED_REVIEWERS.md
README.md

Flutter Packages

Release Status Flutter CI Status

This repo is a companion repo to the main flutter repo. It contains the source code for Flutter's first-party packages (i.e., packages developed by the core Flutter team). Check the packages directory to see all packages.

These packages are also available on pub.

Issues

Please file any issues, bugs, or feature requests in the main flutter repo. Issues pertaining to this repository are labeled “package”.

Contributing

If you wish to contribute a new package to the Flutter ecosystem, please see the documentation for developing packages. You can store your package source code in any GitHub repository (the present repo is only intended for packages developed by the core Flutter team). Once your package is ready you can publish to the pub repository.

If you wish to contribute a change to any of the existing packages in this repo, please review our contribution guide, and send a pull request.

Packages

These are the packages hosted in this repository:

PackagePubPointsUsageIssuesPull requests
animationspub packagepub pointsdownloadsGitHub issues by-labelGitHub pull requests by-label
camerapub packagepub pointsdownloadsGitHub issues by-labelGitHub pull requests by-label
cross_filepub packagepub pointsdownloadsGitHub issues by-labelGitHub pull requests by-label
cupertino_iconspub packagepub pointsdownloadsGitHub issues by-labelGitHub pull requests by-label
cupertino_uipub packagepub pointsdownloadsGitHub issues by-labelGitHub pull requests by-label
espressopub packagepub pointsdownloadsGitHub issues by-labelGitHub pull requests by-label
extension_google_sign_in_as_googleapis_authpub packagepub pointsdownloadsGitHub issues by-labelGitHub pull requests by-label
file_selectorpub packagepub pointsdownloadsGitHub issues by-labelGitHub pull requests by-label
flutter_lintspub packagepub pointsdownloadsGitHub issues by-labelGitHub pull requests by-label
flutter_plugin_android_lifecyclepub packagepub pointsdownloadsGitHub issues by-labelGitHub pull requests by-label
flutter_svgpub packagepub pointsdownloadsGitHub issues by-labelGitHub pull requests by-label
flutter_svg_testpub packagepub pointsdownloadsGitHub issues by-labelGitHub pull requests by-label
go_routerpub packagepub pointsdownloadsGitHub issues by-labelGitHub pull requests by-label
go_router_builderpub packagepub pointsdownloadsGitHub issues by-labelGitHub pull requests by-label
google_adsensepub packagepub pointsdownloadsGitHub issues by-labelGitHub pull requests by-label
google_fontspub packagepub pointsdownloadsGitHub issues by-labelGitHub pull requests by-label
google_maps_flutterpub packagepub pointsdownloadsGitHub issues by-labelGitHub pull requests by-label
google_sign_inpub packagepub pointsdownloadsGitHub issues by-labelGitHub pull requests by-label
image_pickerpub packagepub pointsdownloadsGitHub issues by-labelGitHub pull requests by-label
interactive_media_adspub packagepub pointsdownloadsGitHub issues by-labelGitHub pull requests by-label
in_app_purchasepub packagepub pointsdownloadsGitHub issues by-labelGitHub pull requests by-label
local_authpub packagepub pointsdownloadsGitHub issues by-labelGitHub pull requests by-label
material_uipub packagepub pointsdownloadsGitHub issues by-labelGitHub pull requests by-label
metrics_centerpub packagepub pointsdownloadsGitHub issues by-labelGitHub pull requests by-label
path_parsingpub packagepub pointsdownloadsGitHub issues by-labelGitHub pull requests by-label
path_providerpub packagepub pointsdownloadsGitHub issues by-labelGitHub pull requests by-label
pigeonpub packagepub pointsdownloadsGitHub issues by-labelGitHub pull requests by-label
pointer_interceptorpub packagepub pointsdownloadsGitHub issues by-labelGitHub pull requests by-label
plugin_platform_interfacepub packagepub pointsdownloadsGitHub issues by-labelGitHub pull requests by-label
quick_actionspub packagepub pointsdownloadsGitHub issues by-labelGitHub pull requests by-label
google_identity_services_webpub packagepub pointsdownloadsGitHub issues by-labelGitHub pull requests by-label
rfwpub packagepub pointsdownloadsGitHub issues by-labelGitHub pull requests by-label
shared_preferencespub packagepub pointsdownloadsGitHub issues by-labelGitHub pull requests by-label
two_dimensional_scrollablespub packagepub pointsdownloadsGitHub issues by-labelGitHub pull requests by-label
url_launcherpub packagepub pointsdownloadsGitHub issues by-labelGitHub pull requests by-label
vector_graphicspub packagepub pointsdownloadsGitHub issues by-labelGitHub pull requests by-label
vector_graphics_codecpub packagepub pointsdownloadsGitHub issues by-labelGitHub pull requests by-label
vector_graphics_compilerpub packagepub pointsdownloadsGitHub issues by-labelGitHub pull requests by-label
video_playerpub packagepub pointsdownloadsGitHub issues by-labelGitHub pull requests by-label
web_benchmarkspub packagepub pointsdownloadsGitHub issues by-labelGitHub pull requests by-label
webview_flutterpub packagepub pointsdownloadsGitHub issues by-labelGitHub pull requests by-label
xdg_directoriespub packagepub pointsdownloadsGitHub issues by-labelGitHub pull requests by-label