Add url_launcher_windows #3015
Add url_launcher_windows #3015
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
## Backward compatible 1.0.0 version is coming | ||
The plugin has reached a stable API, we guarantee that version `1.0.0` will be backward compatible with `0.0.y+z`. If you use | ||
url_launcher_windows directly, rather than as an implementation detail | ||
of `url_launcher`, please use `url_launcher_windows: '>=0.0.y+x <2.0.0'` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can I ask why we're recommending this instead of putting the right version of the plugin as a dependency of url_launcher?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
answering my own question, I assume we're doing this as a temporary message until Windows hits alpha.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To endorse a federated plugin (i.e., make it a dependency of the main plugin), the plugin already has to be published. So our flow for a new federated implementation is:
- Make a PR for the federated implementation (e.g., foo_windows).
- Land foo_windows.
- Publish foo_windows.
- Make a PR (against foo) to endorse the new federated implementation.
- Land foo.
- Publish foo.
This README covers steps 3 through 5, where this plugin exists in the wild as a published plugin but isn't endorsed. In step 6, the foo_windows readme gets updated to say that it's included automatically by foo. (Then that gets published as a minor, README-only change to foo_windows).
It's cumbersome, but the alternative (putting everything in one PR) wouldn't pass CI because the build of the main plugin would fail due to the federated implementation not having been published.
packages/url_launcher/url_launcher_windows/windows/url_launcher_plugin.cpp
Outdated
Show resolved
Hide resolved
Future<void> _launched; | ||
|
||
Future<void> _launchInBrowser(String url) async { | ||
if (await UrlLauncherPlatform.instance.canLaunch(url)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not for this PR but still -
This saddens me, I really want us to come up with a way to share relevant pieces of the example app and e2e tests (and not have an example app thats using the platform interface).
I'm planning to be focusing on these issues in the coming weeks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Per my recent comments is Discord, I think using the platform interface rather than the app-facing plugin is a better way to write the driver tests; maybe we can continue the discussion there.
The role of the example app in a federated implementation is questionable though; it's only going to be an example in the (rare?) cases where there is extra API in the platform implementation. Having it replicate things that are in the main example—which is what people should look at in almost every case—isn't really useful as an example. But it is useful to have a self-contained build when working on the implementation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Adds a federated Windows implementation of url_launcher (not yet endorsed). Since this is the first C++ plugin, this also adds a .clang-format file to the repo root for formatting C++ plugins. Part of flutter/flutter#41721 (will need follow-up to endorse it in url_launcher)
Adds a federated Windows implementation of url_launcher (not yet endorsed). Since this is the first C++ plugin, this also adds a .clang-format file to the repo root for formatting C++ plugins. Part of flutter/flutter#41721 (will need follow-up to endorse it in url_launcher)
Adds a federated Windows implementation of url_launcher (not yet endorsed). Since this is the first C++ plugin, this also adds a .clang-format file to the repo root for formatting C++ plugins. Part of flutter/flutter#41721 (will need follow-up to endorse it in url_launcher)
Description
Adds a federated Windows implementation of url_launcher (not yet endorsed).
Since this is the first C++ plugin, this also adds a .clang-format file to the repo root for formatting C++ plugins.
Related Issues
Part of flutter/flutter#41721 (will need follow-up to endorse it in url_launcher)
Checklist
Before you create this PR confirm that it meets all requirements listed below by checking the relevant checkboxes (
[x]
). This will ensure a smooth and quick review process.///
).flutter analyze
) does not report any problems on my PR.Breaking Change
Does your PR require plugin users to manually update their apps to accommodate your change?