Skip to content
This repository has been archived by the owner on Feb 22, 2023. It is now read-only.

[connectivity_macos] Implements connectivity_platform_interface #3830

Closed
wants to merge 2 commits into from

Conversation

blasten
Copy link

@blasten blasten commented Apr 27, 2021

Related issue flutter/flutter#52267

@blasten blasten changed the title [connectivity_macos] Implements connectivity [connectivity_macos] Implements connectivity_platform_interface Apr 27, 2021
@blasten
Copy link
Author

blasten commented Apr 27, 2021

This actually doesn't appear to make sense

@blasten blasten closed this Apr 27, 2021
@blasten blasten deleted the connectivity_macos_drt branch April 27, 2021 21:31
@stuartmorgan
Copy link
Contributor

What was wrong with the first version of the PR? Isn't that the right way to annotate a package as being an implementation?

@blasten
Copy link
Author

blasten commented Apr 28, 2021

connectivity_macos doesn't import or implement the interface package. It's a bit strange that the meaning of implements can vary depending on the plugin. For connectivity_macos, it seems to mean that pub.dev should understand the relation-ship for search purposes.

@stuartmorgan
Copy link
Contributor

connectivity_macos doesn't import or implement the interface package.

The implements' key was never about the platform interface though, or the Dart keyword with the same name. connectivity_macosimplements theconnectivity` package by providing an implementation of the method channel.

It's a bit strange that the meaning of implements can vary depending on the plugin.

I don't think it does. The design doc defined it this way:

The ‘implements’ key (flutter/plugin/implements)
Signifies that this package provides platform implementation for some plugin frontend

Not the implementation of the interface package, but of the front-end (i.e., app-facing) package.

For connectivity_macos, it seems to mean that pub.dev should understand the relation-ship for search purposes.

That is one of the implications of the implements key, and applies to all kinds of implementations. The part that is different between connectivity_macos and the Dart-only implementations you've been looking at isn't related to implements, it's related to the other keys (pluginClass vs dartPluginClass). But as described in the document, all the conflict resolution around multiple implementations should apply just as much to an entirely-native implementation as to an entirely-Dart, or Dart/native hybrid. We just haven't implemented that in the tool yet.

@blasten
Copy link
Author

blasten commented Apr 28, 2021

My question then would be how are we versioning the method channel itself: https://github.com/blasten/plugins/blob/ab8f120624ecdc90fbd758e8c29d6a64227d6a71/packages/connectivity/connectivity_macos/macos/Classes/ConnectivityPlugin.swift#L37

I would expect that some native interface is imported and implemented in swift.

@stuartmorgan
Copy link
Contributor

Capturing from discussion elsewhere, it would make sense to add an explicit dependency on the platform interface in pubspec.yaml here, to make it clear (and enforced) what major version of the method channel is being implemented here.

@blasten
Copy link
Author

blasten commented Apr 29, 2021

PTAL #3833

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants