Skip to content

Dispose Animation Controller in Flutter for Android Devs Examples#13512

Merged
sfshaza2 merged 3 commits into
flutter:mainfrom
djmaster458:patch-1
Jun 17, 2026
Merged

Dispose Animation Controller in Flutter for Android Devs Examples#13512
sfshaza2 merged 3 commits into
flutter:mainfrom
djmaster458:patch-1

Conversation

@djmaster458

@djmaster458 djmaster458 commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

Description of what this PR is changing or adding, and why:

Animation Controller examples in the Android Dev section were missing dispose logic for the controller lifecycle.
This PR adds this logic to the examples.

Issues fixed by this PR (if any):

PRs or commits this PR depends on (if any):

Presubmit checklist

  • If you are unwilling, or unable, to sign the CLA, even for a tiny, one-word PR, please file an issue instead of a PR.
  • If this PR is not meant to land until a future stable release, mark it as draft with an explanation.
  • This PR follows the Google Developer Documentation Style Guidelines—for example, it doesn't use i.e. or e.g., and it avoids I and we (first-person pronouns).
  • This PR uses semantic line breaks
    of 80 characters or fewer.

@djmaster458 djmaster458 requested review from a team and sfshaza2 as code owners June 17, 2026 14:25
@google-cla

google-cla Bot commented Jun 17, 2026

Copy link
Copy Markdown

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request adds proper controller disposal by implementing the dispose() method in two state classes within the Android developers guide. However, these changes were made directly in the markdown file, which uses the code-excerpt tool to inject code from external Dart files. To prevent these updates from being overwritten, they must be applied directly to the source Dart files (animation.dart and events.dart) instead.

Comment thread sites/docs/src/content/flutter-for/android-devs.md
Comment thread sites/docs/src/content/flutter-for/android-devs.md

@sfshaza2 sfshaza2 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm. Thx!

@sfshaza2

Copy link
Copy Markdown
Contributor

/gcbrun

@flutter-website-bot

flutter-website-bot commented Jun 17, 2026

Copy link
Copy Markdown
Collaborator

Staged preview of the updated docs.flutter.dev site (updated for commit d52aeba):

https://flutter-docs-prod--docs-pr13512-patch-1-nk6l87xm.web.app

@flutter-website-bot

flutter-website-bot commented Jun 17, 2026

Copy link
Copy Markdown
Collaborator

Staged preview of the updated flutter.dev site (updated for commit d52aeba):

https://flutter-dev-230821--www-pr13512-patch-1-agame43w.web.app

@djmaster458

djmaster458 commented Jun 17, 2026

Copy link
Copy Markdown
Contributor Author

Updated the code excerpts per the CI suggestion dart run dash_site refresh-excerpts. Not sure what else is needed. Thanks!

@sfshaza2

Copy link
Copy Markdown
Contributor

/gcbrun

@sfshaza2 sfshaza2 merged commit 7a4a97a into flutter:main Jun 17, 2026
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants