1
0
mirror of https://github.com/flutter/samples.git synced 2026-06-25 15:49:43 +00:00
Files
samples/compass_app/app/lib
Harsh Yadav 8bfffd4a84 docs: clarify HomeViewModel lifecycle in Compass sample (#2838)
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 https://github.com/flutter/samples/issues/2788

## Pre-launch Checklist

* [x] I read the [[Flutter Style
Guide](https://github.com/flutter/flutter/blob/master/docs/contributing/Style-guide-for-Flutter-repo.md)]
recently, and have followed its advice.
* [x] I signed the [[CLA](https://cla.developers.google.com/)].
* [ ] I have added sample code updates to the
[[changelog](https://chatgpt.com/c/CHANGELOG.md)].
* [x] I updated/added relevant documentation (doc comments with `///`).

<!-- Links -->

[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/master/docs/contributing/Style-guide-for-Flutter-repo.md
[CLA]: https://cla.developers.google.com/
[changelog]: ./CHANGELOG.md

---------

Co-authored-by: Eric Windmill <eric@ericwindmill.com>
2026-06-19 14:16:31 -07:00
..
2025-02-12 18:08:01 -05:00