Skip to content

docs: clarify HomeViewModel lifecycle in Compass sample#2838

Open
harshyadavDeveloper wants to merge 1 commit intoflutter:mainfrom
harshyadavDeveloper:clarify-viewmodel-lifecycle
Open

docs: clarify HomeViewModel lifecycle in Compass sample#2838
harshyadavDeveloper wants to merge 1 commit intoflutter:mainfrom
harshyadavDeveloper:clarify-viewmodel-lifecycle

Conversation

@harshyadavDeveloper
Copy link
Copy Markdown

Adds a comment explaining why HomeViewModel is not disposed in the Compass sample.

This clarifies that the current implementation is safe because the ViewModel does not manage disposable resources. It also highlights that in real applications, proper lifecycle management is required when working with streams, controllers, or subscriptions.

Fixes #2788

Pre-launch Checklist

  • I read the [Flutter Style Guide] recently, and have followed its advice.
  • I signed the [CLA].
  • I have added sample code updates to the [changelog].
  • I updated/added relevant documentation (doc comments with ///).

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.

Clarify ViewModel lifecycle & disposal in Compass sample

1 participant