-
Notifications
You must be signed in to change notification settings - Fork 9.8k
[url_launcher]added windowName parameter in url_launcher #2926
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.
Thanks for the PR! I've highlighted the few critical changes that I think are required to launch this:
- Parameter name should be
webOnlyWindowName
or similar to conform with the Flutter style. - Since it's web-only, it can't be
@required
- It shouldn't have a default value in the core plugin. If users don't pass anything, there's "automatic" logic that needs to happen in the web version for certain types of link to work well (
browser.isSafari && _isSafariTargetTopScheme...
) - Its value should not be passed to the MethodChannel implementation.
- The new logic in the web plugin is not being tested correctly.
Please, do let me know if any of my comments don't make sense!
git: | ||
url: https://github.com/balvinderz/plugins | ||
ref: windowname | ||
path: packages/url_launcher/url_launcher_platform_interface |
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.
This makes the plugin unpublishable. Once we figure out all the rest of the changes, you'll have to split this PR in 3: one for each of the packages you've touched (and merge them in the correct order)
packages/url_launcher/url_launcher_platform_interface/lib/method_channel_url_launcher.dart
Outdated
Show resolved
Hide resolved
packages/url_launcher/url_launcher_platform_interface/lib/url_launcher_platform_interface.dart
Outdated
Show resolved
Hide resolved
packages/url_launcher/url_launcher_platform_interface/lib/method_channel_url_launcher.dart
Outdated
Show resolved
Hide resolved
packages/url_launcher/url_launcher_web/lib/url_launcher_web.dart
Outdated
Show resolved
Hide resolved
packages/url_launcher/url_launcher_web/test/url_launcher_web_test.dart
Outdated
Show resolved
Hide resolved
@ditman i did the suggested changes. |
…l. Added 2 tests to verify this feature
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.
This is looking great!
There's only a few minor changes:
- The best name for the new parameter is probably
webOnlyWindowName
, sorry for making you change this twice! - The agreed solution in the original plugin, is a little bit different than the one implemented here (I added a link to the relevant comment on the ticket)
- I think this needs a pass of
dartfmt -w .
to adjust the formatting of some parts of the code
packages/url_launcher/url_launcher_platform_interface/CHANGELOG.md
Outdated
Show resolved
Hide resolved
packages/url_launcher/url_launcher_platform_interface/lib/method_channel_url_launcher.dart
Outdated
Show resolved
Hide resolved
packages/url_launcher/url_launcher_platform_interface/lib/url_launcher_platform_interface.dart
Outdated
Show resolved
Hide resolved
packages/url_launcher/url_launcher_web/lib/url_launcher_web.dart
Outdated
Show resolved
Hide resolved
packages/url_launcher/url_launcher_web/lib/url_launcher_web.dart
Outdated
Show resolved
Hide resolved
packages/url_launcher/url_launcher_web/lib/url_launcher_web.dart
Outdated
Show resolved
Hide resolved
return Future<bool>.value( | ||
openNewWindow(url,webOnlyLinkTarget: webOnlyLinkTarget) != null); |
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.
dartfmt is probably complaining about this too
@ditman Done with the changes |
I think this looks good now, but our tooling doesn't allow us to merge multiple plugins at once when they depend amongst themselves. Can you prepare a PR with only the changes to the url_launcher_platform_interface package? Once we publish that one, we should be able to publish the rest! |
ok |
Tagged and published Next should probably be the |
Both url_launcher and url_launcher_web have been published:
Thanks for the contribution @balvinderz! |
Description
Adds the ability to launch a url in same tab,new tab or launch the url in an iframe.
Related Issues
flutter/flutter#56867
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?