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

[url_launcher]added windowName parameter in url_launcher #2926

Closed
wants to merge 6 commits into from

Conversation

balvinderz
Copy link
Contributor

@balvinderz balvinderz commented Aug 12, 2020

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.

  • I read the [Contributor Guide] and followed the process outlined there for submitting PRs.
  • My PR includes unit or integration tests for all changed/updated/fixed behaviors (See [Contributor Guide]).
  • All existing and new tests are passing.
  • I updated/added relevant documentation (doc comments with ///).
  • The analyzer (flutter analyze) does not report any problems on my PR.
  • I read and followed the [Flutter Style Guide].
  • The title of the PR starts with the name of the plugin surrounded by square brackets, e.g. [shared_preferences]
  • I updated pubspec.yaml with an appropriate new version according to the [pub versioning philosophy].
  • I updated CHANGELOG.md to add a description of the change.
  • I signed the [CLA].
  • I am willing to follow-up on review comments in a timely manner.

Breaking Change

Does your PR require plugin users to manually update their apps to accommodate your change?

  • No, this is not a breaking change.

@balvinderz
Copy link
Contributor Author

balvinderz commented Aug 25, 2020

Can you please review this. @mklim @ditman

@ditman ditman self-requested a review August 25, 2020 16:56
Copy link
Member

@ditman ditman left a 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!

Comment on lines +26 to +29
git:
url: https://github.com/balvinderz/plugins
ref: windowname
path: packages/url_launcher/url_launcher_platform_interface
Copy link
Member

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)

@balvinderz
Copy link
Contributor Author

@ditman i did the suggested changes.

@balvinderz balvinderz requested a review from ditman August 27, 2020 06:06
Copy link
Member

@ditman ditman left a 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

Comment on lines 74 to 75
return Future<bool>.value(
openNewWindow(url,webOnlyLinkTarget: webOnlyLinkTarget) != null);
Copy link
Member

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

@balvinderz balvinderz requested a review from ditman August 27, 2020 19:38
@balvinderz
Copy link
Contributor Author

balvinderz commented Aug 27, 2020

@ditman Done with the changes

@ditman
Copy link
Member

ditman commented Aug 27, 2020

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!

@balvinderz
Copy link
Contributor Author

ok

@balvinderz
Copy link
Contributor Author

#2974

@ditman
Copy link
Member

ditman commented Aug 28, 2020

Tagged and published url_launcher_platform_interface: ^1.0.8

Next should probably be the _web package.

@ditman
Copy link
Member

ditman commented Aug 28, 2020

Both url_launcher and url_launcher_web have been published:

Thanks for the contribution @balvinderz!

@ditman ditman closed this Aug 28, 2020
@balvinderz balvinderz deleted the windowname branch August 29, 2020 04:46
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants