You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[CQ] stop storing property service instance (#8118)
A bit pedantic but generally good practice and easy to fix. (There's
also no real reason to store the instance.)

Inspection motivation:
> Such services' assignments contribute to global state and make it
impossible to tear down an application and set up another one in tests,
therefore, repeated tests in the same process may fail. The only
exception is an explicit constructor call to store dummy/default
instances.
> The recommended way to avoid storing services is to retrieve a service
locally. Alternatively, one can wrap it in java.util.function.Supplier
(Java, Kotlin) or convert the property to a function (Kotlin).
---
- [x] I’ve reviewed the contributor guide and applied the relevant
portions to this PR.
<details>
<summary>Contribution guidelines:</summary><br>
- See our [contributor
guide]([https://github.com/dart-lang/sdk/blob/main/CONTRIBUTING.md](https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview)
for general expectations for PRs.
- Larger or significant changes should be discussed in an issue before
creating a PR.
- Dart contributions to our repos should follow the [Dart style
guide](https://dart.dev/guides/language/effective-dart) and use `dart
format`.
- Java and Kotlin contributions should strive to follow Java and Kotlin
best practices
([discussion](#8098)).
</details>
0 commit comments