Skip to content

Conversation

@stuartmorgan-g
Copy link
Contributor

Currently a plugin with a Linux, macOS, and/or Windows Dart
implementation that is inline, rather than federated, will not get Dart
autoregistration, which isn't the intended behavior.

Fixing that directly would be a breaking change for already-published
plugins with inline Dart implementations, because it would require a
registerWith() method at build time that wasn't previously required.
In order to allow the intended behavior going forward without breaking
existing plugins, this enables auto-registation for inline Dart-only
desktop implementations only if the plugin's min Flutter SDK requirement
is 2.11 or higher.

Fixes #87862

Pre-launch Checklist

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • I read the Tree Hygiene wiki page, which explains my responsibilities.
  • I read and followed the Flutter Style Guide, including Features we expect every widget to implement.
  • I signed the CLA.
  • I listed at least one issue that this PR fixes in the description above.
  • I updated/added relevant documentation (doc comments with ///).
  • I added new tests to check the change I am making, or this PR is test-exempt.
  • All existing and new tests are passing.

Currently a plugin with a Linux, macOS, and/or Windows Dart
implementation that is inline, rather than federated, will not get Dart
autoregistration, which isn't the intended behavior.

Fixing that directly would be a breaking change for already-published
plugins with inline Dart implementations, because it would require a
`registerWith()` method at build time that wasn't previously required.
In order to allow the intended behavior going forward without breaking
existing plugins, this enables auto-registation for inline Dart-only
desktop implementations only if the plugin's min Flutter SDK requirement
is 2.11 or higher.

Fixes flutter#87862
@flutter-dashboard flutter-dashboard bot added the tool Affects the "flutter" command-line tool. See also t: labels. label Jan 13, 2022
final semver.Version? minFlutterVersion = flutterConstraint != null &&
flutterConstraint is semver.VersionRange ? flutterConstraint.min : null;
final bool hasMinVersionForImplementsRequirement = minFlutterVersion != null &&
minFlutterVersion.compareTo(semver.Version(2, 11, 0)) >= 0;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice

Copy link

@blasten blasten left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Copy link

@jambestwick jambestwick left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

vi

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

tool Affects the "flutter" command-line tool. See also t: labels.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Desktop Dart plugin registration doesn't work for inline implementations

4 participants