Skip to content

Document multiple Flutter plugin instances#13591

Open
awnoa wants to merge 2 commits into
flutter:mainfrom
awnoa:docs/multiple-plugin-instances
Open

Document multiple Flutter plugin instances#13591
awnoa wants to merge 2 commits into
flutter:mainfrom
awnoa:docs/multiple-plugin-instances

Conversation

@awnoa

@awnoa awnoa commented Jul 18, 2026

Copy link
Copy Markdown

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

  • 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.

@awnoa
awnoa requested review from a team and sfshaza2 as code owners July 18, 2026 13:21
@google-cla

google-cla Bot commented Jul 18, 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 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.

Comment thread sites/docs/src/content/packages-and-plugins/developing-packages.md
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.

Document multiple engines and plugin instances in plugin development docs

1 participant