Document multiple Flutter plugin instances#13591
Conversation
|
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. |
There was a problem hiding this comment.
Code Review
This pull request adds a new section to the package development documentation detailing how to support multiple Flutter instances. It advises developers to avoid global or static variables for engine-specific state and to coordinate access to shared native singletons. The reviewer suggested adding a concrete example of coordination, such as reference counting, to make the guidance more actionable.
Description of what this PR is changing or adding, and why:
Documents that an app can run multiple Flutter engines, that each engine creates its own plugin instance, and that those instances can have independent lifetimes. It also adds guidance for scoping engine-specific state and coordinating shared native resources.
Issues fixed by this PR (if any):
Fixes flutter/flutter#150855.
PRs or commits this PR depends on (if any):
None.
Presubmit checklist